aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-11-01 09:00:09 -0600
committerTom Tromey <tom@tromey.com>2017-11-04 10:27:17 -0600
commitc80049d3b615691dc902762d5d97551aa9664442 (patch)
treea538ad25dabca7d727f48d80d3b205792f5f6624 /gdb/breakpoint.c
parent167b0be1b5ef36a5605fcdfba0c84db2ed475e1e (diff)
downloadgdb-c80049d3b615691dc902762d5d97551aa9664442.zip
gdb-c80049d3b615691dc902762d5d97551aa9664442.tar.gz
gdb-c80049d3b615691dc902762d5d97551aa9664442.tar.bz2
Replace start_rbreak_breakpoints and end_rbreak_breakpoints
This replaces start_rbreak_breakpoints and end_rbreak_breakpoints with a new scoped class. This allows the removal of a cleanup. This also fixes an earlier memory leak regression, by changing "string" to be a std::string. gdb/ChangeLog 2017-11-04 Tom Tromey <tom@tromey.com> * breakpoint.c (scoped_rbreak_breakpoints::scoped_rbreak_breakpoints): Rename from start_rbreak_breakpoints. (scoped_rbreak_breakpoints): Rename from end_rbreak_breakpoints. * breakpoint.h (class scoped_rbreak_breakpoints): New. (start_rbreak_breakpoints, end_rbreak_breakpoints): Remove. * symtab.c (do_end_rbreak_breakpoints): Remove. (rbreak_command): Use scoped_rbreak_breakpoints, std::string.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 0bf47d5..61e4128 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -644,8 +644,7 @@ static int rbreak_start_breakpoint_count;
/* Called at the start an "rbreak" command to record the first
breakpoint made. */
-void
-start_rbreak_breakpoints (void)
+scoped_rbreak_breakpoints::scoped_rbreak_breakpoints ()
{
rbreak_start_breakpoint_count = breakpoint_count;
}
@@ -653,8 +652,7 @@ start_rbreak_breakpoints (void)
/* Called at the end of an "rbreak" command to record the last
breakpoint made. */
-void
-end_rbreak_breakpoints (void)
+scoped_rbreak_breakpoints::~scoped_rbreak_breakpoints ()
{
prev_breakpoint_count = rbreak_start_breakpoint_count;
}