diff options
author | Antoine Tremblay <antoine.tremblay@ericsson.com> | 2015-06-12 07:58:47 -0400 |
---|---|---|
committer | Antoine Tremblay <antoine.tremblay@ericsson.com> | 2015-06-12 08:43:17 -0400 |
commit | 98aa42ee02c56378cecb737d01c27adca36bf48f (patch) | |
tree | 20394df6558afc1babf8611f64b79939e935a017 /gdb/breakpoint.c | |
parent | 0054dcd7b6a815ce178c464f7a1b7e7fce7df3e4 (diff) | |
download | gdb-98aa42ee02c56378cecb737d01c27adca36bf48f.zip gdb-98aa42ee02c56378cecb737d01c27adca36bf48f.tar.gz gdb-98aa42ee02c56378cecb737d01c27adca36bf48f.tar.bz2 |
Fix MI dprintf-insert not printing on a resolved pending location.
This patch fixes the "Format string required" error when trying to print
a dprintf on a now resolved, pending location when set via the MI interface
even if the format string is entered correctly.
This patch also adds a test case to check that issue called
mi-dprintf-pending.exp.
gdb/ChangeLog:
PR breakpoints/16465
* breakpoint.c (create_breakpoint): Save extra_string for
pending breakpoints.
gdb/testsuite/ChangeLog:
PR breakpoints/16465
* gdb.mi/mi-dprintf-pending.c: New file.
* gdb.mi/mi-dprintf-pending.exp: New test.
* gdb.mi/mi-dprintf-pendshr.c: New file.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 657c58e..0a960f8 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -9773,7 +9773,10 @@ create_breakpoint (struct gdbarch *gdbarch, b->addr_string = copy_arg; if (parse_arg) - b->cond_string = NULL; + { + b->cond_string = NULL; + b->extra_string = NULL; + } else { /* Create a private copy of condition string. */ @@ -9782,10 +9785,16 @@ create_breakpoint (struct gdbarch *gdbarch, cond_string = xstrdup (cond_string); make_cleanup (xfree, cond_string); } + /* Create a private copy of any extra string. */ + if (extra_string != NULL) + { + extra_string = xstrdup (extra_string); + make_cleanup (xfree, extra_string); + } b->cond_string = cond_string; + b->extra_string = extra_string; b->thread = thread; } - b->extra_string = NULL; b->ignore_count = ignore_count; b->disposition = tempflag ? disp_del : disp_donttouch; b->condition_not_parsed = 1; |