Move declaration of breakpoint_chain to the header.
Commit Message
TUI was using it.
gdb/ChangeLog:
2019-10-07 Christian Biesinger <cbiesinger@google.com>
* breakpoint.c (breakpoint_chain): Move comment to header.
* breakpoint.h (breakpoint_chain): Declare.
* tui/tui-winsource.c (tui_source_window_base::update_breakpoint_info):
Remove declaration of breakpoint_chain.
---
gdb/breakpoint.c | 2 +-
gdb/breakpoint.h | 4 ++++
gdb/tui/tui-winsource.c | 1 -
3 files changed, 5 insertions(+), 2 deletions(-)
Comments
>>>>> "Christian" == Christian Biesinger via gdb-patches <gdb-patches@sourceware.org> writes:
Christian> TUI was using it.
Christian> gdb/ChangeLog:
Christian> 2019-10-07 Christian Biesinger <cbiesinger@google.com>
Christian> * breakpoint.c (breakpoint_chain): Move comment to header.
Christian> * breakpoint.h (breakpoint_chain): Declare.
Christian> * tui/tui-winsource.c (tui_source_window_base::update_breakpoint_info):
Christian> Remove declaration of breakpoint_chain.
I think it would be preferable to change the TUI to use
iterate_over_bp_locations or iterate_over_breakpoints instead;
then make breakpoint_chain static.
Tom
On Wed, Oct 9, 2019 at 12:43 PM Tom Tromey <tom@tromey.com> wrote:
>
> >>>>> "Christian" == Christian Biesinger via gdb-patches <gdb-patches@sourceware.org> writes:
>
> Christian> TUI was using it.
> Christian> gdb/ChangeLog:
>
> Christian> 2019-10-07 Christian Biesinger <cbiesinger@google.com>
>
> Christian> * breakpoint.c (breakpoint_chain): Move comment to header.
> Christian> * breakpoint.h (breakpoint_chain): Declare.
> Christian> * tui/tui-winsource.c (tui_source_window_base::update_breakpoint_info):
> Christian> Remove declaration of breakpoint_chain.
>
> I think it would be preferable to change the TUI to use
> iterate_over_bp_locations or iterate_over_breakpoints instead;
> then make breakpoint_chain static.
Thanks, I will send an updated version in a moment. It will be a patch
set because I'm also changing iterate_over_breakpoints to take a
function_view.
Christian
@@ -519,7 +519,7 @@ bool target_exact_watchpoints = false;
for (B = breakpoint_chain; B; B = B->next) \
if (is_tracepoint (B))
-/* Chains of all breakpoints defined. */
+/* See breakpoint.h. */
struct breakpoint *breakpoint_chain;
@@ -849,6 +849,10 @@ struct watchpoint : public breakpoint
CORE_ADDR hw_wp_mask;
};
+/* Chains of all breakpoints defined. */
+
+extern struct breakpoint *breakpoint_chain;
+
/* Given a function FUNC (struct breakpoint *B, void *DATA) and
USER_DATA, call FUNC for every known breakpoint passing USER_DATA
as argument.
@@ -402,7 +402,6 @@ tui_source_window_base::update_breakpoint_info
for (i = 0; i < content.size (); i++)
{
struct breakpoint *bp;
- extern struct breakpoint *breakpoint_chain;
struct tui_source_element *line;
line = &content[i];