From 313f3b21cbcd3475c2fc6030abb26e6c8346d03b Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 5 Nov 2021 15:29:20 -0400 Subject: gdb: remove bpstat typedef, rename bpstats to bpstat I don't find that the bpstat typedef, which hides a pointer, is particularly useful. In fact, it confused me many times, and I just see it as something to remember that adds cognitive load. Also, with C++, we might want to be able to pass bpstats objects by const-reference, not necessarily by pointer. So, remove the bpstat typedef and rename struct bpstats to bpstat (since it represents one bpstat, it makes sense that it is singular). Change-Id: I52e763b6e54ee666a9e045785f686d37b4f5f849 --- gdb/python/py-finishbreakpoint.c | 2 +- gdb/python/py-inferior.c | 2 +- gdb/python/py-stopevent.c | 4 ++-- gdb/python/py-stopevent.h | 2 +- gdb/python/python-internal.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'gdb/python') diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c index 1d8373d..fe5089c 100644 --- a/gdb/python/py-finishbreakpoint.c +++ b/gdb/python/py-finishbreakpoint.c @@ -378,7 +378,7 @@ bpfinishpy_detect_out_scope_cb (struct breakpoint *b, out of the scope of any FinishBreakpoint before it has been hit. */ static void -bpfinishpy_handle_stop (struct bpstats *bs, int print_frame) +bpfinishpy_handle_stop (struct bpstat *bs, int print_frame) { gdbpy_enter enter_py (get_current_arch (), current_language); diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c index 3938dd8..222e4d9 100644 --- a/gdb/python/py-inferior.c +++ b/gdb/python/py-inferior.c @@ -74,7 +74,7 @@ static const struct inferior_data *infpy_inf_data_key; } while (0) static void -python_on_normal_stop (struct bpstats *bs, int print_frame) +python_on_normal_stop (struct bpstat *bs, int print_frame) { enum gdb_signal stop_signal; diff --git a/gdb/python/py-stopevent.c b/gdb/python/py-stopevent.c index bec49bc..70cd111 100644 --- a/gdb/python/py-stopevent.c +++ b/gdb/python/py-stopevent.c @@ -35,12 +35,12 @@ create_stop_event_object (PyTypeObject *py_type) returns -1. */ int -emit_stop_event (struct bpstats *bs, enum gdb_signal stop_signal) +emit_stop_event (struct bpstat *bs, enum gdb_signal stop_signal) { gdbpy_ref<> stop_event_obj; gdbpy_ref<> list; PyObject *first_bp = NULL; - struct bpstats *current_bs; + struct bpstat *current_bs; if (evregpy_no_listeners_p (gdb_py_events.stop)) return 0; diff --git a/gdb/python/py-stopevent.h b/gdb/python/py-stopevent.h index 4f07bda..7622a79 100644 --- a/gdb/python/py-stopevent.h +++ b/gdb/python/py-stopevent.h @@ -25,7 +25,7 @@ extern gdbpy_ref<> create_stop_event_object (PyTypeObject *py_type); extern void stop_evpy_dealloc (PyObject *self); -extern int emit_stop_event (struct bpstats *bs, +extern int emit_stop_event (struct bpstat *bs, enum gdb_signal stop_signal); extern gdbpy_ref<> create_breakpoint_event_object (PyObject *breakpoint_list, diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h index 24e28bc..aece708 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -295,7 +295,7 @@ struct block; struct value; struct language_defn; struct program_space; -struct bpstats; +struct bpstat; struct inferior; extern int gdb_python_initialized; -- cgit v1.1