This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] gdbarch software_single_step returns VEC (CORE_ADDR) *
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 2 May 2016 11:21:05 +0100
- Subject: Re: [PATCH 1/2] gdbarch software_single_step returns VEC (CORE_ADDR) *
- Authentication-results: sourceware.org; auth=none
- References: <1458742206-622-1-git-send-email-yao dot qi at linaro dot org> <1458742206-622-2-git-send-email-yao dot qi at linaro dot org> <56F2D1A2 dot 80103 at redhat dot com> <86egasrr2a dot fsf at gmail dot com> <b76700ae-10a5-80f8-643a-c42207095f6a at redhat dot com> <86d1p8eajb dot fsf at gmail dot com>
On 04/29/2016 03:48 PM, Yao Qi wrote:
>
>> > So when setting a single-step breakpoint, we'd get the "kind"
>> > from the current mode, and when setting breakpoints from
>> > user-input, we'd get it from the symbols tables / mapping symbols.
> This means we need this to get the "kind" from the current mode,
>
> /* Return the breakpoint kind for this target based on the current
> processor state (e.g. the current instruction mode on ARM) and the
> PC. The PCPTR is adjusted to the real memory location in case a flag
> (e.g., the Thumb bit on ARM) is present in the PC. */
> int (*breakpoint_kind_from_current_state) (CORE_ADDR *pcptr);
Hmm, not sure, maybe. From the perspective of syncing design with
gdbserver, it makes sense. On gdbserver, I think that's only used for advancing
past a permanent breakpoint. On gdb side, we use
gdbarch_skip_permanent_breakpoint, which I think no arch overrides currently,
so it always ends up in default_skip_permanent_breakpoint -> gdbarch_breakpoint_from_pc.
(Looks like we could eliminate gdbarch_skip_permanent_breakpoint.)
We could also say we should keep gdb's permanent breakpoint skipping's
logic of determining which breakpoint instruction to skip in sync with
bp_loc_is_permanent -> program_breakpoint_here_p -> gdbarch_breakpoint_from_pc,
though in this case looking at the current mode doesn't make sense.
>
> and also need to pass breakpoint location to to_insert_breakpoint to get
> the type of breakpoint we are inserting, right?
I was thinking we'd have all we need in bp_target_info->placed_size,
but of course I may be missing something.
Thanks,
Pedro Alves