From: Stan Shebs Date: Fri, 26 Mar 2010 23:49:31 +0000 (+0000) Subject: 2010-03-26 Tom Tromey X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9766ced4152120e0300ddbfe40118bc9f8f15226;p=binutils-gdb.git 2010-03-26 Tom Tromey * breakpoint.c (commands_command_1): Duplicate 'arg'. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b9d6b48c287..d539e8f9e2a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2010-03-26 Tom Tromey + + * breakpoint.c (commands_command_1): Duplicate 'arg'. + 2010-03-26 Ulrich Weigand * breakpoint.c (expand_line_sal_maybe): Always call skip_prologue_sal. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index a6bde43f37f..e9fb71ebc8f 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -959,8 +959,12 @@ commands_command_1 (char *arg, int from_tty, struct command_line *control) arg = xstrprintf ("%d-%d", multi_start, multi_end); else if (breakpoint_count > 0) arg = xstrprintf ("%d", breakpoint_count); - make_cleanup (xfree, arg); } + else + /* The command loop has some static state, so we need to preserve + our argument. */ + arg = xstrdup (arg); + make_cleanup (xfree, arg); map_breakpoint_numbers (arg, do_map_commands_command, &info);