On Dienstag, 27. März 2018 23:41:54 CEST Tim Newsome wrote:
> On Tue, Mar 27, 2018 at 11:26 AM, Tim Newsome <t...@sifive.com> wrote:
> > However, reporting an error to gdb doesn't seem to be all that useful.
> > I've
> > 
> >> been trying with a Cortex-M target (STM32F303) and effectively the error
> >> prevents gdb from fetching all registers from the target. Here's what I
> >> get on
> >> "info reg":
> >> 
> >> Debug: 585 5119 gdb_server.c:3129 gdb_input_inner(): received packet:
> >> 'p27'
> >> Debug: 586 5119 gdb_server.c:1308 gdb_get_register_packet(): Couldn't get
> >> register fpscr.
> >> Debug: 587 5119 gdb_server.c:1388 gdb_error(): Reporting -4 to GDB as
> >> generic
> >> error
> > 
> > Yes, gdb's behavior is pretty poor there. I'd like to address that at some
> > point, but haven't yet.
> 
> Here's a RISC-V-specific patch to deal with this problem:
> https://github.com/riscv/riscv-binutils-gdb/pull/143
> It's probably possible to do this target-independently
> in frame_register_unwind() but I'm not feeling brave enough to touch that
> right now.

OK, here's my position on this patch: We already have a similar issue with 
memory access failure reporting. There's a command to enable it. If we want to 
make it easy for gdb people to improve their prodcuts behaviour we should also 
make the error reporting for register access failure a parameter that can be 
changed at runtime instead of keying it to a target. Especially, Tim, as it is 
_not_ openocd-target specific but specific to the particular target support in 
gdb. So, I suggest you change your patch to introduce a command  
'gdb_report_register_access_error' similar to 'gdb_report_data_abort'  and 
make sure it defaults to 'off'. Please also add documentation to openocd.texi. 
Your RISC-V target configuration scripts can then enable this option, as can 
everyone else who wants to experiment with it.

BR,
Matthias





> 
> Tim


-- 
Mit freundlichen Grüßen/Best regards,

Matthias Welwarsky
Project Engineer

SYSGO AG
Office Mainz
Am Pfaffenstein 14 / D-55270 Klein-Winternheim / Germany
Phone: +49-6136-9948-0 / Fax: +49-6136-9948-10
VoIP: SIP:m...@sysgo.com
E-mail: matthias.welwar...@sysgo.com / Web: http://www.sysgo.com
_________________________________________________________________________________
 
Web: https://www.sysgo.com
Blog: https://www.sysgo.com/blog
Events: https://www.sysgo.com/events
Newsletter: https://www.sysgo.com/newsletter 
_________________________________________________________________________________
 
Handelsregister/Commercial Registry: HRB Mainz 90 HRB 8066
Vorstand/Executive Board: Etienne Butery (CEO), Kai Sablotny (COO)
Aufsichtsratsvorsitzender/Supervisory Board Chairman: Marc Darmon
USt-Id-Nr./VAT-Id-No.: DE 149062328

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to