This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2] gdbarch software_single_step returns VEC (CORE_ADDR) *


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]