-
Notifications
You must be signed in to change notification settings - Fork 93
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
Interfacing with avr-gdb #6
Comments
Hi Bernhard, Thanks for try it out! And, of course, thanks for your very detailed descriptions. To be honest, I've never used gdbserver before. I knew I would have to revisit it eventually. I'll get to your points hopefully soon. Thanks again! |
Hi Bernhard, For the "alternate gdb executable" bug, I've fixed that in version 1.0.6. I will be working on the other problems you mention. |
Cool, will try it out! My "hardware debugger" for classic AVR ATtinys is meanwhile in state so that people can use it: https://github.com/felias-fogg/dw-link |
Wow, almost a year to the day. I'm getting back to this task. Over the past year, I've learned a lot about 'gdbserver' and some more about embedded development/debugging. I hope to use this time now to resolve this ticket.
Fantastic advice. I also found this tidbit that should help me. https://blog.oddbit.com/post/2019-01-22-debugging-attiny-code-pt-1/
The 'file' command is already there. It's loading the executable and symbol table from the file. Seer does this and has a optional way to load the symbols from a separate file. The 'load' command is new to me. It appears to download the executable to the remote end. I'll look to implement this as part of the 'connect' mode in Seer.
I'll debug this with the simavr setup.
Those control characters are actually UTF-8 characters. The first one is a visual tab '>>' character. I wonder how your got the filename? Cut-n-Paste? Or was the filename returned by something? I can filter them out. I just need to know where they are coming from. |
I got Seer working with simavr and avr-gdb. avr-gdb seems to have an older version of the MI interpreter (the api for frontends to interface with gdb). I'll see if I can work around this. Also, I have to manually enter the 'file' and 'load' commands, too. I'll work on this. Anyway, a pic.
|
Specifying the program name as the symbol file works for seer.
This has the same effect as using the 'file' command. |
After playing around for a bit, I discovered the "avr" package that OpenSuse provides is extremely out of date. Especially for the version of gdb that is provided. Many of the "mi" api calls that Seer depends on just don't exist or work. I posted a question on r/embedded and someone responded with a website that does standalone builds of the "avr" toolchain. https://www.reddit.com/r/embedded/comments/18uockj/latest_avr_linux_toolchain/ Installing this on my machine works perfectly. Here's a screenshot. |
It seems "FLAGS" is not available on avr chips. I'll make this optional in the "assembly view". |
So the summary is to use an avr toolchain that is recent. Like gcc/gdb version 12 or newer. |
Closing this task. The mainline has been updated. |
Hi,
I tried out seer and it worked quite well. Thanks a lot for your work! There are a few hickups when it comes to embedded debugging for AVR MCUs, though.
You cannot specify an alternative gdb executable as already pointed out in issue #3. I changed the source code in order to try it out. Would be great to have a menu for that.
When specifying the executable to be debugged, I specified the ELF file and for the Gdbserver I gave the serial device. With that seer/avr-gdb could make the connection to thze hardware debugger, but I got the following warning:
So, I issued the
file
and theload
command:After that I could set breakpoints, start and stop the program etc.
The debugger does not show any file under the list of source or library files. I could manually select the source file, though.
When the debugger ended up in one of the Arduino 'core' files, I could not set a breakpoint (probably something caused by the two control characters in front of the file name):
If you want to debug things having to do with avr-gdb, I recommend to download the packages gdb-avr (the avr debugger), simavr (an AVR simulator), and, of course, the avr toolchain gcc-avr.
Best regards,
Bernhard
The text was updated successfully, but these errors were encountered: