From dbaa3bf64062798c3e3009ab18af432dc5e7f4f5 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 8 May 2023 15:54:52 -0400 Subject: gdb: make some breakpoint methods use `this` Some implementations of breakpoint::check_status and breakpoint::print_it do this: struct breakpoint *b = bs->breakpoint_at; bs->breakpoint_at is always the same as `this` (we can get convinced by looking at the call sites of check_status and print_it), so it would just be clearer to access fields through `this` instead. Change-Id: Ic542a64fcd88e31ae2aad6feff1da278c7086891 Reviewed-By: Alexandra Petlanova Hajkova Reviewed-By: Andrew Burgess --- gdb/break-catch-load.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'gdb/break-catch-load.c') diff --git a/gdb/break-catch-load.c b/gdb/break-catch-load.c index d8dab0b..e01f645 100644 --- a/gdb/break-catch-load.c +++ b/gdb/break-catch-load.c @@ -141,19 +141,18 @@ solib_catchpoint::check_status (struct bpstat *bs) enum print_stop_action solib_catchpoint::print_it (const bpstat *bs) const { - struct breakpoint *b = bs->breakpoint_at; struct ui_out *uiout = current_uiout; - annotate_catchpoint (b->number); + annotate_catchpoint (this->number); maybe_print_thread_hit_breakpoint (uiout); - if (b->disposition == disp_del) + if (this->disposition == disp_del) uiout->text ("Temporary catchpoint "); else uiout->text ("Catchpoint "); - uiout->field_signed ("bkptno", b->number); + uiout->field_signed ("bkptno", this->number); uiout->text ("\n"); if (uiout->is_mi_like_p ()) - uiout->field_string ("disp", bpdisp_text (b->disposition)); + uiout->field_string ("disp", bpdisp_text (this->disposition)); print_solib_event (true); return PRINT_SRC_AND_LOC; } -- cgit v1.1