diff options
author | Tom Tromey <tromey@redhat.com> | 2011-01-31 15:07:49 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2011-01-31 15:07:49 +0000 |
commit | 09d682a4f353e0e692e602baf229b3b5b93c0142 (patch) | |
tree | 176e10e1fd7cb76b032ea429088c3797fb508d6a | |
parent | 65b4571a45f1e672f3679d8149cea621e1d7ef1d (diff) | |
download | gdb-09d682a4f353e0e692e602baf229b3b5b93c0142.zip gdb-09d682a4f353e0e692e602baf229b3b5b93c0142.tar.gz gdb-09d682a4f353e0e692e602baf229b3b5b93c0142.tar.bz2 |
* breakpoint.h (user_breakpoint_p): Declare.
* breakpoint.c (user_breakpoint_p): New function.
(breakpoint_1): Use it.
(save_breakpoints): Likewise.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/breakpoint.c | 19 | ||||
-rw-r--r-- | gdb/breakpoint.h | 2 |
3 files changed, 22 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3cbfba5..9d7f6ba 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2011-01-31 Tom Tromey <tromey@redhat.com> + + * breakpoint.h (user_breakpoint_p): Declare. + * breakpoint.c (user_breakpoint_p): New function. + (breakpoint_1): Use it. + (save_breakpoints): Likewise. + 2011-01-31 Joel Brobecker <brobecker@adacore.com> * configure.ac: Add handling of Python distribution on Windows. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 8d0692b..ff0ea18 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -5064,6 +5064,15 @@ user_settable_breakpoint (const struct breakpoint *b) || is_watchpoint (b)); } +/* Return true if this breakpoint was set by the user, false if it is + internal or momentary. */ + +int +user_breakpoint_p (struct breakpoint *b) +{ + return user_settable_breakpoint (b) && b->number > 0; +} + /* Print information on user settable breakpoint (watchpoint, etc) number BNUM. If BNUM is -1 print all user-settable breakpoints. If ALLFLAG is non-zero, include non-user-settable breakpoints. If @@ -5096,8 +5105,7 @@ breakpoint_1 (int bnum, int allflag, if (filter && !filter (b)) continue; - if (allflag || (user_settable_breakpoint (b) - && b->number > 0)) + if (allflag || user_breakpoint_p (b)) { int addr_bit, type_len; @@ -5169,8 +5177,7 @@ breakpoint_1 (int bnum, int allflag, /* We only print out user settable breakpoints unless the allflag is set. */ - if (allflag || (user_settable_breakpoint (b) - && b->number > 0)) + if (allflag || user_breakpoint_p (b)) print_one_breakpoint (b, &last_loc, print_address_bits, allflag); } } @@ -11727,7 +11734,7 @@ save_breakpoints (char *filename, int from_tty, ALL_BREAKPOINTS (tp) { /* Skip internal and momentary breakpoints. */ - if (!user_settable_breakpoint (tp) || tp->number < 0) + if (!user_breakpoint_p (tp)) continue; /* If we have a filter, only save the breakpoints it accepts. */ @@ -11765,7 +11772,7 @@ save_breakpoints (char *filename, int from_tty, ALL_BREAKPOINTS (tp) { /* Skip internal and momentary breakpoints. */ - if (!user_settable_breakpoint (tp) || tp->number < 0) + if (!user_breakpoint_p (tp)) continue; /* If we have a filter, only save the breakpoints it accepts. */ diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 69598a7..6eed2cd 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -1184,4 +1184,6 @@ extern void end_rbreak_breakpoints (void); extern struct breakpoint *iterate_over_breakpoints (int (*) (struct breakpoint *, void *), void *); +extern int user_breakpoint_p (struct breakpoint *); + #endif /* !defined (BREAKPOINT_H) */ |