Giter Site home page Giter Site logo

Interfacing with avr-gdb about seer HOT 10 CLOSED

epasveer avatar epasveer commented on April 28, 2024
Interfacing with avr-gdb

from seer.

Comments (10)

epasveer avatar epasveer commented on April 28, 2024

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!

from seer.

epasveer avatar epasveer commented on April 28, 2024

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.

from seer.

felias-fogg avatar felias-fogg commented on April 28, 2024

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

from seer.

epasveer avatar epasveer commented on April 28, 2024

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.

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.

Fantastic advice. I also found this tidbit that should help me.

https://blog.oddbit.com/post/2019-01-22-debugging-attiny-code-pt-1/

So, I issued the file and the load command:

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.

The debugger does not show any file under the list of source or library files. I could manually select the source file, though.

I'll debug this with the simavr setup.

I could not set a breakpoint (probably something caused by the two control characters in front of the file name):

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.

from seer.

epasveer avatar epasveer commented on April 28, 2024

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.

$ simavr -m attiny85 -f 1000000 pipower.elf  -g
Loaded 2498 bytes at 0
Loaded 6 bytes at 800060
avr_gdb_init listening on port 1234
$ seergdb --gdb-program /usr/bin/avr-gdb --connect :1234

image

from seer.

epasveer avatar epasveer commented on April 28, 2024

Specifying the program name as the symbol file works for seer.

$ seergdb --gdb-program /usr/bin/avr-gdb --connect :1234 --sym pipower.elf

This has the same effect as using the 'file' command.

from seer.

epasveer avatar epasveer commented on April 28, 2024

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/
https://blog.zakkemble.net/avr-gcc-builds/

Installing this on my machine works perfectly. Here's a screenshot.

image

from seer.

epasveer avatar epasveer commented on April 28, 2024

It seems "FLAGS" is not available on avr chips. I'll make this optional in the "assembly view".

from seer.

epasveer avatar epasveer commented on April 28, 2024

So the summary is to use an avr toolchain that is recent. Like gcc/gdb version 12 or newer.

https://blog.zakkemble.net/avr-gcc-builds/

from seer.

epasveer avatar epasveer commented on April 28, 2024

Closing this task. The mainline has been updated.

from seer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.