dd11a36cfe
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.
36 lines
1 KiB
C
36 lines
1 KiB
C
/* Copyright 2011 Free Software Foundation, Inc.
|
|
|
|
This file is part of GDB.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
void
|
|
break_me (void)
|
|
{
|
|
}
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
int i;
|
|
break_me (); /* BREAK HERE. */
|
|
break_me (); /* Try a thread-specific breakpoint. */
|
|
|
|
for (i = 0; i < 5; i++)
|
|
break_me (); /* Try a condition-specific breakpoint. */
|
|
|
|
break_me (); /* Finally, try a breakpoint with commands. */
|
|
return 0;
|
|
}
|
|
|