diff options
author | Tom Tromey <tromey@adacore.com> | 2019-07-23 12:41:02 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2019-08-06 08:01:21 -0600 |
commit | c0e8dcd87101119806c5bbca4c7b649c1b8c0996 (patch) | |
tree | 5a48dc95bc727191690c782a470d1b184f87a1f0 /gdb/breakpoint.c | |
parent | 128bf1fe608badb59d27f9c5c8ffb1a6a6d9d811 (diff) | |
download | fsf-binutils-gdb-c0e8dcd87101119806c5bbca4c7b649c1b8c0996.zip fsf-binutils-gdb-c0e8dcd87101119806c5bbca4c7b649c1b8c0996.tar.gz fsf-binutils-gdb-c0e8dcd87101119806c5bbca4c7b649c1b8c0996.tar.bz2 |
Change breakpoint::filter to be a unique_xmalloc_ptr
This changes breakpoint::filter to be a unique_xmalloc_ptr, removing
an explicit xfree, as well as a use of a "release" method.
gdb/ChangeLog
2019-08-06 Tom Tromey <tromey@adacore.com>
* breakpoint.c (init_breakpoint_sal): Update.
(breakpoint): Update.
* breakpoint.h (struct breakpoint) <filter>: Now a
unique_xmalloc_ptr.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index e0c9aa4..7a1e782 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -8850,7 +8850,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch, b->location = std::move (location); else b->location = new_address_location (b->loc->address, NULL, 0); - b->filter = filter.release (); + b->filter = std::move (filter); } static void @@ -12124,7 +12124,6 @@ breakpoint::~breakpoint () { xfree (this->cond_string); xfree (this->extra_string); - xfree (this->filter); } static struct bp_location * @@ -13701,7 +13700,7 @@ decode_location_default (struct breakpoint *b, decode_line_full (location, DECODE_LINE_FUNFIRSTLINE, search_pspace, NULL, 0, &canonical, multiple_symbols_all, - b->filter); + b->filter.get ()); /* We should get 0 or 1 resulting SALs. */ gdb_assert (canonical.lsals.size () < 2); |