aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2012-11-10 20:25:56 +0000
committerKeith Seitz <keiths@redhat.com>2012-11-10 20:25:56 +0000
commitcf4ded82d012113df559b446bf8532cfb700d11e (patch)
tree4e81767300ba8c66adac9be7ef7c646af6397003 /gdb
parent0d63ecdad04d410698c905283d095505680ba907 (diff)
downloadgdb-cf4ded82d012113df559b446bf8532cfb700d11e.zip
gdb-cf4ded82d012113df559b446bf8532cfb700d11e.tar.gz
gdb-cf4ded82d012113df559b446bf8532cfb700d11e.tar.bz2
* breakpoint.c (clear_command): Add cleanup for
sals.sals if an argument is given. * linespec.c (parse_linespec): Do cleanups after parsing a convenience variable.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/breakpoint.c1
-rw-r--r--gdb/linespec.c5
3 files changed, 10 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4175f2f..91558cd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
2012-11-10 Keith Seitz <keiths@redhat.com>
+ * breakpoint.c (clear_command): Add cleanup for
+ sals.sals if an argument is given.
+
+ * linespec.c (parse_linespec): Do cleanups after
+ parsing a convenience variable.
+
+2012-11-10 Keith Seitz <keiths@redhat.com>
+
PR gdb/14288
* c-valprint.c (c_val_print): For character arrays
with "print null" option on, print ellipses if
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index d47544b..ccf7ee1 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -11792,6 +11792,7 @@ clear_command (char *arg, int from_tty)
sals = decode_line_with_current_source (arg,
(DECODE_LINE_FUNFIRSTLINE
| DECODE_LINE_LIST_MODE));
+ make_cleanup (xfree, sals.sals);
default_match = 0;
}
else
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 06634d2..e9918b1 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -2095,20 +2095,17 @@ parse_linespec (linespec_parser *parser, char **argptr)
cleanup = make_cleanup (xfree, var);
PARSER_RESULT (parser)->line_offset
= linespec_parse_variable (PARSER_STATE (parser), var);
+ do_cleanups (cleanup);
/* If a line_offset wasn't found (VAR is the name of a user
variable/function), then skip to normal symbol processing. */
if (PARSER_RESULT (parser)->line_offset.sign != LINE_OFFSET_UNKNOWN)
{
- discard_cleanups (cleanup);
-
/* Consume this token. */
linespec_lexer_consume_token (parser);
goto convert_to_sals;
}
-
- do_cleanups (cleanup);
}
else if (token.type != LSTOKEN_STRING && token.type != LSTOKEN_NUMBER)
unexpected_linespec_error (parser);