This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Autoload-breakpoints new version [1/9] autoload breakpoints without sync function
- From: Hui Zhu <teawater at gmail dot com>
- To: Stan Shebs <stanshebs at earthlink dot net>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 24 Oct 2012 22:20:04 +0800
- Subject: Re: [RFC] Autoload-breakpoints new version [1/9] autoload breakpoints without sync function
- References: <5020BEB1.50601@mentor.com> <507C2F9C.9060608@earthlink.net>
On Mon, Oct 15, 2012 at 11:45 PM, Stan Shebs <stanshebs@earthlink.net> wrote:
> On 8/7/12 12:07 AM, Hui Zhu wrote:
>>
>> I thought make the autoload-breakpoints and sync function together make it
>> too hard to review. So I move the sync function to be a series of separate
>> patches after report-async.
>> The change of this patches with the prev version is I change the formart
>> of packet "QBDP"(add ":") to make it follow the rule of notification format.
>>
>> Thanks,
>> Hui
>>
>> 2012-08-07 Hui Zhu <hui_zhu@mentor.com>
>>
>> * breakpoint.c (hex2bin, unpack_varlen_hex): New extern.
>> (autoload_breakpoints_query, autoload_breakpoints_merge,
>> autoload_breakpoints_gdb, autoload_breakpoints_stub,
>> autoload_breakpoints_enums, this_ubpcmd): New variable.
>> (breakpoint_get_commands): New function.
>> (print_one_breakpoint): Add out for b->autoload_id.
>> (init_raw_breakpoint_without_location): Add init for autoload_id
>> and autoload_inserted.
>> (autoload_breakpoints_get_id, uploaded_bp_commands_clean,
>> uploaded_bp_commands_add, handle_autoload_breakpoint_cmd,
>> parse_autoload_breakpoint_definition,
>> handle_autoload_breakpoint_cmd_to_breakpoints,
>> parse_autoload_breakpoint_definition_to_breakpoints,
>> clean_upload_autoload_breakpoints,
>> show_upload_autoload_breakpoints,
>> read_autoload_breakpoints_action,
>> merge_uploaded_autoload_breakpoints, autoload_breakpoints_reset,
>> autoload_breakpoints_clean,
>> autoload_breakpoints_number): New function.
>
>
> Looking at this code, I think we need to share it with the tracepoint
> upload, since the data structures are nearly identical,
> and the algorithms are also quite similar.
The current target-defined breakpoints's packet is not good to handle
by the function parse_tracepoint_definition.
And I think the all of tracepoint update packet format can be use to
handle the target-defined breakpoint packet too.
So what I think is use the tracepoint update packet to be the
target-defined breakpoint packet and add "R" to be the "remove"
packet.
Rename parse_tracepoint_definition to a common name for example
parse_breakpoint_definition. And move it to a common file for example
breakpoint.c.
What do you think about it?
Best.
Hui
>
> +When this mode is \"merge\", the autoload-breakpoints\n\
> +of GDB and stub will merge together when GDB connect to stub.\n\
> +When this mode is \"gdb\", the autoload-breakpoints of stub will be
> removed\n\
> +when GDB connect to stub.\n\
> +When this mode is \"stub\", the autoload-breakpoints of GDB will be
> removed\n\
> +when GDB connect to stub."),
>
> This should say "target" since we don't know if the target is a stub, or a
> sprite, or gdbserver, etc.
>
>
> Stan
> stan@codesourcery.com
>