diff options
author | Pedro Alves <palves@redhat.com> | 2007-03-27 23:01:00 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2007-03-27 23:01:00 +0000 |
commit | 8671a17bde87f6c694c718771d3ef17f3287a41b (patch) | |
tree | d360739d7a1ad716ecbe1f5de6f921f4e8159a90 /gdb/breakpoint.c | |
parent | bce7165daae97585d93ac28361576feebcc80721 (diff) | |
download | fsf-binutils-gdb-8671a17bde87f6c694c718771d3ef17f3287a41b.zip fsf-binutils-gdb-8671a17bde87f6c694c718771d3ef17f3287a41b.tar.gz fsf-binutils-gdb-8671a17bde87f6c694c718771d3ef17f3287a41b.tar.bz2 |
* breakpoint.c (bpstat_num): Add int *num parameter.
* breakpoint.h (bpstat_num): Likewise.
* infcmd.c (continue_command): Adjust to new bpstat_num
interface.
(program_info): Likewise.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index abefcdc..fc8e389 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -2054,28 +2054,30 @@ bpstat_find_step_resume_breakpoint (bpstat bsp) } -/* Return the breakpoint number of the first breakpoint we are stopped +/* Put in *NUM the breakpoint number of the first breakpoint we are stopped at. *BSP upon return is a bpstat which points to the remaining breakpoints stopped at (but which is not guaranteed to be good for anything but further calls to bpstat_num). - Return 0 if passed a bpstat which does not indicate any breakpoints. */ + Return 0 if passed a bpstat which does not indicate any breakpoints. + Return -1 if stopped at a breakpoint that has been deleted since + we set it. + Return 1 otherwise. */ int -bpstat_num (bpstat *bsp) +bpstat_num (bpstat *bsp, int *num) { struct breakpoint *b; if ((*bsp) == NULL) return 0; /* No more breakpoint values */ - else - { - b = (*bsp)->breakpoint_at; - *bsp = (*bsp)->next; - if (b == NULL) - return -1; /* breakpoint that's been deleted since */ - else - return b->number; /* We have its number */ - } + + b = (*bsp)->breakpoint_at; + *bsp = (*bsp)->next; + if (b == NULL) + return -1; /* breakpoint that's been deleted since */ + + *num = b->number; /* We have its number */ + return 1; } /* Modify BS so that the actions will not be performed. */ |