Skip to content

Using ThreadDebug Lib: GDB Debugger Terminated Unexpectedly. #102

Open
@jwestmoreland

Description

@jwestmoreland

Describe the bug
Attempting to debug with the ThreadLib debug library - get message GDB debugger terminated unexpectedly.

To Reproduce
Steps to reproduce the behavior:

  1. At the top of your code:
    #include <ThreadDebug.h>
    
    // UartDebugCommInterface debugComm(SERIAL1_TX, SERIAL1_RX, 230400);
    // ThreadDebug threadDebug(&debugComm, DEBUG_BREAK_IN_SETUP);
    UsbDebugCommInterface debugComm(&SerialUSB);
    ThreadDebug threadDebug(&debugComm, DEBUG_NO_BREAK_IN_SETUP);
  2. Build & Download
  3. Start debug session by Debug->Start Debugging
  4. See error - GDB debugger terminated unexpectedly.

Expected behavior
Debug session should start.

Screenshots
If applicable, add screenshots to help explain your problem.

Message pops up and goes away.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]
    Windows 10 - 2020 latest released from M$

Activity

jwestmoreland

jwestmoreland commented on Aug 24, 2020

@jwestmoreland
Author

From the command line - using what was compiled by the 0.1.0 IDE - it does run:

C:\tmp\demo-web-server\build\arduinobeta.mbed.envie_m7>C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\bin\arm-none-eabi-gdb -ex "set pagination off" --baud 230400 -ex "set target-charset ASCII" -ex "set print pretty on" -ex "set remotelogfile mri.log" -ex "target remote COM4" demo-web-server.ino.elf
GNU gdb (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 8.0.50.20171128-git
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from demo-web-server.ino.elf...done.
Remote debugging using COM4
0x08061682 in osKernelResume (sleep_ticks=14) at ./mbed-os/rtos/source/TARGET_CORTEX/rtx5/RTX/Source/rtx_kernel.c:492
492     ./mbed-os/rtos/source/TARGET_CORTEX/rtx5/RTX/Source/rtx_kernel.c: No such file or directory.
(gdb) finish
Run till exit from #0  0x08061682 in osKernelResume (sleep_ticks=14) at ./mbed-os/rtos/source/TARGET_CORTEX/rtx5/RTX/Source/rtx_kernel.c:492
Note: automatically using hardware breakpoints for read-only addresses.
rtos_idle_loop () at ./mbed-os/rtos/source/TARGET_CORTEX/mbed_rtx_idle.cpp:173
173     ./mbed-os/rtos/source/TARGET_CORTEX/mbed_rtx_idle.cpp: No such file or directory.
(gdb) continue
Continuing.
self-assigned this
on Aug 25, 2020
ubidefeo

ubidefeo commented on Aug 25, 2020

@ubidefeo

hi John

I'm glad you downloaded this right away.
@kittaakos is looking into this, we must have added some regression in the communication between UI and CLI.

As I was telling you a couple days back the debugger didn't get much love this time around, as we had to focus on releasing a more stable editor with broader compatibility, but it's definitely on our list for the next few weeks.
At least now you have access to nightly builds, so if it's something we figure out quickly you'll be able to get a working version faster than 4 months from now :D
I'll make sure this issue gets updated as we know more.

Thank you :)

jwestmoreland

jwestmoreland commented on Aug 25, 2020

@jwestmoreland
Author

Hello @ubidefeo ,

Yes, not much love appears to be no love at all actually; ;) - hope this can move forward but there's more ways to debug as we've discussed as well.

That's cool we have access to nightly builds now - thanks for letting us know about that!

And, thanks for looking at the debugger issues as well.

You are more than welcome!

Best Regards,
John W.

kittaakos

kittaakos commented on Aug 25, 2020

@kittaakos
Contributor

I have a quick update: we have identified the breaking change. I built a CLI with a tiny modification locally, dropped it into the IDE and the debugger works.

jwestmoreland

jwestmoreland commented on Aug 25, 2020

@jwestmoreland
Author

Hello @kittaakos ,

So, will this be in the nightly update or how can I give it a try?

Thanks,
John W.

kittaakos

kittaakos commented on Aug 25, 2020

@kittaakos
Contributor

will this be in the nightly

Yes, once we fix the issue and very it, we will make it available in the nightly.

how can I give it a try?

I will keep you posted. Thank you for logging the bug.

jwestmoreland

jwestmoreland commented on Aug 25, 2020

@jwestmoreland
Author

Hello @kittaakos ,

Thanks for getting to this so quickly!

And, sure, NP - been waiting for the ThreadLib stuff to get stable.

Thanks Again,
John W.

ubidefeo

ubidefeo commented on Aug 26, 2020

@ubidefeo

@jwestmoreland
you could try the nightly but we're also doing a patch release possibly today

kittaakos

kittaakos commented on Aug 26, 2020

@kittaakos
Contributor

you could try the nightly

Please note, the nightly won't work until we have another CLI release.

kittaakos

kittaakos commented on Aug 26, 2020

@kittaakos
Contributor
jwestmoreland

jwestmoreland commented on Aug 27, 2020

@jwestmoreland
Author

Hello @kittaakos ,

OK - thanks for that - and loaded it - just wondering, has anyone debugged anything with it?

I got this when I tried to debug:

GNU gdb (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 8.0.50.20171128-git
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from c:/tmp/demo-web-server/build/arduinobeta.mbed.envie_m7/demo-web-server.ino.elf...
done.
GDB unhandled notify: cmd-param-changed: {"param":"pagination","value":"off"}
GDB unhandled notify: cmd-param-changed: {"param":"target-charset","value":"ASCII"}
Remote debugging using COM4
0x08061682 in osKernelResume (sleep_ticks=20) at ./mbed-os/rtos/source/TARGET_CORTEX/rtx5/RTX/Source/rtx_kernel.c:492
492	./mbed-os/rtos/source/TARGET_CORTEX/rtx5/RTX/Source/rtx_kernel.c: No such file or directory.
Will reset on next continue.
Note: automatically using hardware breakpoints for read-only addresses.
Remote connection closed
finish
Evaluation of expression without frameId is not supported.

From what I can tell, status (somewhat) unchanged from here.

Thanks,
John W.

kittaakos

kittaakos commented on Aug 27, 2020

@kittaakos
Contributor

has anyone debugged anything with it?

Of course.

On Windows and macOS, we verified the basic debugging features on a compiled sketch,

  • such as start debugging,
  • hit breakpoint,
  • step in/out,
  • change local variables (int),
  • stop/restart the debug session.

On both Windows and macOS, we used an Arduino Zero board, plus we tried it with CMSIS-DAP debugger on Windows.

Reading symbols from c:/tmp/demo-web-server/build/arduinobeta.mbed.envie_m7/demo-web-server.ino.elf...
done.

I do not know if debugging works with the Portenta board. @ubidefeo, can you please help with this?

jwestmoreland

jwestmoreland commented on Aug 27, 2020

@jwestmoreland
Author

Hello @kittaakos ,

Thanks for the response.

Since this is the arduino-pro-ide 'forum' - thought Portenta as the target was/is implied.

Thanks,
John W.

pnaybour

pnaybour commented on Aug 27, 2020

@pnaybour

@jwestmoreland i am not to sure about the support for Portenta board.

8 remaining items

jwestmoreland

jwestmoreland commented on Feb 24, 2021

@jwestmoreland
Author

@kittaakos ,

Can you let me know what's unclear now - I'm wondering what the actual question(s) is/are that you want me to answer?

Thanks,
John W.

ubidefeo

ubidefeo commented on Feb 26, 2021

@ubidefeo

hi @jwestmoreland
This is a fairly old thread.
We have since assessed that changes are to be made to the arduino:mbed core in order to get the ThreadDebug port to be recognised and used at the start of a debug session.

The issue will remain open until we have this implemented and working :)

removed their assignment
on Jul 18, 2021
added and removed
priority: lowResolution is a low priority
on Nov 2, 2021
changed the title [-]v0.1.0 - Using TheadDebug Lib: GDB Debugger Terminated Unexpectedly.[/-] [+]Using TheadDebug Lib: GDB Debugger Terminated Unexpectedly.[/+] on May 5, 2022
changed the title [-]Using TheadDebug Lib: GDB Debugger Terminated Unexpectedly.[/-] [+]Using ThreadDebug Lib: GDB Debugger Terminated Unexpectedly.[/+] on Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @cmaglie@kittaakos@ubidefeo@jwestmoreland@silvanocerza

        Issue actions

          Using ThreadDebug Lib: GDB Debugger Terminated Unexpectedly. · Issue #102 · arduino/arduino-ide