aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1992-02-27 16:28:59 +0000
committerJohn Gilmore <gnu@cygnus>1992-02-27 16:28:59 +0000
commitcba0d141fb4c565ae5e04b339a95d57123aa46fb (patch)
tree5b387cd1cf67276bb4c4399124d0901537f5927c /gdb/breakpoint.c
parent5c83e859b98d1d38e0f8744d3feab1b906526bfa (diff)
downloadgdb-cba0d141fb4c565ae5e04b339a95d57123aa46fb.zip
gdb-cba0d141fb4c565ae5e04b339a95d57123aa46fb.tar.gz
gdb-cba0d141fb4c565ae5e04b339a95d57123aa46fb.tar.bz2
* breakpoint.h (ALL_BREAKPOINTS_SAFE): Add.
* breakpoint.c (breakpoint_re_set): Use ALL_BREAKPOINTS_SAFE. * symtab.c (find_pc_symtab): Handle having no objfiles. * infcmd.c: Fix comment. * objfiles.c (free_all_objfiles): Add. * symfile.h (ALL_OBJFILES, ALL_OBJFILES_SAFE): Add. * symfile.c (symbol_file_command): free all objfiles when specifying a new symbol file. (reread_symbols): Stat the file name, don't fstat the descriptor.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 61a7a9f..e24105c 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -113,7 +113,7 @@ static void
breakpoints_info PARAMS ((char *, int));
static void
-breakpoint_1 PARAMS ((int, int));
+breakpoint_1 PARAMS ((int, enum bptype));
static bpstat
bpstat_alloc PARAMS ((struct breakpoint *, bpstat));
@@ -143,8 +143,17 @@ extern int demangle; /* Print de-mangled symbol names? */
/* Are we executing breakpoint commands? */
static int executing_breakpoint_commands;
+/* Walk the following statement or block through all breakpoints.
+ ALL_BREAKPOINTS_SAFE does so even if the statment deletes the current
+ breakpoint. */
+
#define ALL_BREAKPOINTS(b) for (b = breakpoint_chain; b; b = b->next)
+#define ALL_BREAKPOINTS_SAFE(b,tmp) \
+ for (b = breakpoint_chain; \
+ b? (tmp=b->next, 1): 0; \
+ b = tmp)
+
/* Chain of all breakpoints defined. */
struct breakpoint *breakpoint_chain;
@@ -810,7 +819,7 @@ bpstat_stop_status (pc, frame_address)
int real_breakpoint = 0;
#endif
/* Root of the chain of bpstat's */
- struct bpstat__struct root_bs[1];
+ struct bpstat root_bs[1];
/* Pointer to the last thing in the chain currently. */
bpstat bs = root_bs;
@@ -2229,11 +2238,11 @@ breakpoint_re_set_one (bint)
void
breakpoint_re_set ()
{
- struct breakpoint *b;
+ struct breakpoint *b, *temp;
static char message1[] = "Error in re-setting breakpoint %d:\n";
char message[sizeof (message1) + 30 /* slop */];
- ALL_BREAKPOINTS (b)
+ ALL_BREAKPOINTS_SAFE (b, temp)
{
b->symtab = 0; /* Be sure we don't point to old dead symtab */
sprintf (message, message1, b->number); /* Format possible error msg */