thread-specific breakpoints not saved properly by save-breakpoint

Initially, I noticed that the save command was often missing
new lines in the file that it generated.  For instance, consider:

        % gdb save-bp
        (gdb) b break_me
        (gdb) b save-bp.c:27
        (gdb) save breakpoints bps

The contents of the bps file would be:

        % cat bps
        break break_mebreak save-bp.c:27

Looking further into the problem, I realized that the missing newlines
are just a consequence of a missing call to print_recreate_thread.
After having generated the breakpoint location in the break command,
we cannot put a new line until we have looked at whether we need to
add a 'thread NUM' argument.

gdb/ChangeLog:

        * breakpoint.c (bkpt_print_recreate): Add call to
        print_recreate_thread.

gdb/testsuite/ChangeLog:

        * gdb.base/save-bp.exp, gdb.base/save-bp.c: New files.
This commit is contained in:
Joel Brobecker
2011-10-02 02:13:13 +00:00
parent 2fed52b14d
commit dd11a36cfe
5 changed files with 115 additions and 0 deletions

View File

@@ -11047,6 +11047,7 @@ bkpt_print_recreate (struct breakpoint *tp, struct ui_file *fp)
_("unhandled breakpoint type %d"), (int) tp->type);
fprintf_unfiltered (fp, " %s", tp->addr_string);
print_recreate_thread (tp, fp);
}
/* Virtual table for internal breakpoints. */