This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: read target register to decide breakpoint size
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Tim Newsome <tim at sifive dot com>
- Cc: Antoine Tremblay <antoine dot tremblay at ericsson dot com>, gdb <gdb at sourceware dot org>
- Date: Wed, 14 Dec 2016 09:18:11 +0000
- Subject: Re: read target register to decide breakpoint size
- Authentication-results: sourceware.org; auth=none
- References: <CAGDihemd3g3_ropX=Y-wWSeyWBbH-sCA6FDX2FaTwKP8e-3Nng@mail.gmail.com> <wwok1sy4zt6d.fsf@ericsson.com> <CAGDihe=cyG646+D1POAaBSiWYAxH_ap+C0j=+hxVBdZq1N0LBA@mail.gmail.com> <CAGDihemhV1jvCoP5bQnmFqqrSCP7=M9OyzkeyLB=-kj5UpgAoQ@mail.gmail.com> <CAGDihemz5vACCHsxK6WtFOwPYhKr5h1-bU+yKLdvZqYgjGng6g@mail.gmail.com>
On 16-12-13 13:30:02, Tim Newsome wrote:
> Actually, this seems to work inside breakpoint_kind_from_pc():
> ```
> struct frame_info *frame = get_current_frame ();
> uint32_t misa = get_frame_register_unsigned (frame, RISCV_CSR_MISA_REGNUM);
> ```
>
> Is that kosher? If so, is there any reason for me to implement
> breakpoint_kind_from_current_state?
I'd like not to do so. Can't you decode the instruction to see whether
it is compressed or uncompressed? I also think it is a good idea to
make a decision based on ELF info, as you mentioned in the first email.
--
Yao (齐尧)