This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 07/12] Create sub classes of 'struct breakpoint'
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>, gdb-patches at sourceware dot org
- Date: Mon, 13 Jun 2016 16:09:16 +0100
- Subject: Re: [PATCH 07/12] Create sub classes of 'struct breakpoint'
- Authentication-results: sourceware.org; auth=none
- References: <1464859846-15619-1-git-send-email-yao dot qi at linaro dot org> <1464859846-15619-8-git-send-email-yao dot qi at linaro dot org>
On 06/02/2016 10:30 AM, Yao Qi wrote:
> Nowadays, there are three types of breakpoint in GDBserver,
>
> - gdb breakpoints,
> - reinsert breakpoints, used for software single step,
> - other breakpoints, used for tracepoint,
>
> but we only have one 'struct breakpoint' for all of them. Some fields
> are only useful to one type of breakpoint. For example, cond_list
> and command_list are only used by gdb breakpoints, while handler is
> only used by other breakpoints.
>
> This patch changes 'struct breakpoint' to a base class, which has fields
> needed by all breakpoint types, also add three sub-classes to
> 'struct breakpoint' to these three types of breakpoints.
>
> gdb/gdbserver:
>
> 2016-05-20 Yao Qi <yao.qi@linaro.org>
>
> * mem-break.c (struct breakpoint) <cond_list>: Remove.
> <command_list, handler>: Remove.
> (struct gdb_breakpoint): New.
> (struct other_breakpoint): New.
> (struct reinsert_breakpoint): New.
> (is_gdb_breakpoint): New function.
> (any_persistent_commands): Update command_list if
> is_gdb_breakpoint returns true.
> (set_breakpoint): Create breakpoints according to their types.
> (find_gdb_breakpoint): Return 'struct gdb_breakpoint *'.
> (set_gdb_breakpoint_1): Likewise.
> (set_gdb_breakpoint): Likewise.
> (clear_breakpoint_conditions): Change parameter type to
> 'struct gdb_breakpoint *'.
> (clear_breakpoint_commands): Likewise.
> (clear_breakpoint_conditions_and_commands): Likewise.
> (add_condition_to_breakpoint): Likewise.
> (add_breakpoint_condition): Likewise.
> (add_commands_to_breakpoint): Likewise.
> (check_breakpoints): Check other_breakpoint.
> (clone_one_breakpoint): Clone breakpopint according to its type.
> * mem-break.h (struct gdb_breakpoint): Declare.
> (set_gdb_breakpoint): Update declaration.
> (clear_breakpoint_conditions_and_commands): Likewise.
> (add_breakpoint_condition): Likewise.
> (add_breakpoint_commands): Likewise.
> * server.c (process_point_options): Change parameter type to
> 'struct gdb_breakpoint *'.
OK.
Thanks,
Pedro Alves