-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breakpoint causes unhandled exeception #1409
Comments
I am facing this issue too within gdbserver. but during load with custom target. |
@Hoohaha Do you mean when executing load? Are you using remote or extended-remote in the target specifier? It does change the error depending on which way I try, but in my case seems to always be when a breakpoint is set or when you try to run (and, presumably, it tries to write the breakpoint). |
When an unexpected exception happened, the gdbserver will be crashed and report In your case, seems failed when read memory, I have no idea for that. |
Can you elaborate on how your flash was misconvigured? I also get the tuple message after the initial message. |
Thanks for the report! It's pretty clearly a bug in pyocd. Not sure why it didn't show up in CI, since breakpoints in gdb are tested. I'll take a look at it this weekend. |
@wd5gnr The "AssertionError: result size (6) != requested size (4)" seems to be the root cause. This spills down and causes a further exception because the gdbserver somehow handles it wrong. You're not doing anything wrong! 😄 The main question is why the data cache sees an incorrect size. It might be caused by attempting to read at the boundary of a memory region, such that 2 bytes are clipped off. I'll need a gdbserver debug log, and ideally a copy of the firmware .elf if you can provide it (or an equivalent reproducer .elf). To get the debug log, run with If you can provide the ELF file, you can send to me via email (please see my GitHub profile for my email address) or attach to a comment here. |
I'm going to zip together some full log files and also the elf file for you, but here's a quick excerpt:
|
Here's a full package. It is hard to say, but I think maybe pyocd doesn't do extended-remote gdbserver? I ran it both ways in case. Also, in some of the runs the chip was already flashed. In some I flashed with gdb and some I flashed with monitor load. The flashes appear successful since the device will run when reset. The zip has a very simple ELF along with full.txt which has a gdb transcript, command line, and the error log. The other files have a bit less info but are also logs. |
Thanks very much! Pyocd does support extended-remote. This makes the server persistent, and adds support for the |
Don't return the detach value, which was removed in 17ab710. This fixes one of the issues reported in pyocd#1409.
* gdbserver: correct return type from ._handle_message() on exceptions Don't return the detach value, which was removed in 17ab710. This fixes one of the issues reported in #1409. * gdbserver: replace GDBError exceptions with logs - .handle_query_xml() returns the correct empty packet or error instead of raising GDBError. - .get_symbol() logs the error and returns None to the caller. * gdbserver: qXfer command fixes - Restructure code to always call into .handle_query_xml() for qXfer read commands. - Return empty packet on unknown qXfer operation. - Pass annex to .handle_query_xml(). - Explicit check for read features annex being 'target.xml', and that the annex is empty for other objects.
* gdbserver: correct return type from ._handle_message() on exceptions Don't return the detach value, which was removed in 17ab710. This fixes one of the issues reported in pyocd#1409. * gdbserver: replace GDBError exceptions with logs - .handle_query_xml() returns the correct empty packet or error instead of raising GDBError. - .get_symbol() logs the error and returns None to the caller. * gdbserver: qXfer command fixes - Restructure code to always call into .handle_query_xml() for qXfer read commands. - Return empty packet on unknown qXfer operation. - Pass annex to .handle_query_xml(). - Explicit check for read features annex being 'target.xml', and that the annex is empty for other objects.
Same issues here with
Setting the
This is when paired with arm-none-eabi-gdb 10 q4 major. |
@maxgerhardt Thanks for the additional info! |
Setup: ST-Link v2 with an STM32F411CE. Setup works with Mbed Studio (which uses pyOCD). However, trying to use pyOCD without studio -- either the version included or the latest version -- causes a failure when gdb sets a breakpoint. I have tried both the stripped down pack included with Mbed Studio and the full pack. I've tried remote and extended remote. I've try gdb-multiarch and the arm noabi gdb. All the same results.
The exact same setup works fine with OpenOCD so I think wiring etc isn't the issue.
When I try to set a breakpoint I get:
I feel like I must be doing something wrong. I've tried simple invocations and trying to mimic the Mbed Studio invocation. So:
pyocd gdbserver -t stm32f411ce
Along with explicit pack definitions. Also
python3 -mpyocd gdbserver --target STM32F411CE --erase=chip --frequency 1800000 --pack '/home/alw/.config/Mbed Studio/mbed-studio-tools/cmsis-packs/Keil.STM32F4xx_DFP.2.15.0-small.pack' -O connect_mode=under-reset -O enable_swv=1 -O swv_system_clock=96000000 -O swv_raw_port=3443 -O swv_clock=2000000
And many variations (e.g., no swv, etc.).
The text was updated successfully, but these errors were encountered: