Closed ivankravets closed 7 years ago
I've made a few dumps to console and found that dbg
doesn't parse .atom-dbg.json
from a project. As result, options.gdb_executable
and options.gdb_commands
are undefined.
The other problem is incorrect detector for active project. For example, I have a few projects opened in Atom. dbg
each time looks into the first project in TreeView and doesn't handle active project. Maybe, this will help you https://github.com/platformio/platformio-atom-ide/blob/develop/lib/project/helpers.js#L55
dbg finds any .atom-dbg.json/cson files in folders returned by atom.project.getPaths() and makes them all available via the Dbg: Select Config command.
In the screen shot below all three configurations are available to run.
could you post your console dumps?
Could you also check you're running the latest version of dbg
(1.4.0)?
If it's listing the options in the file, but not parsing the gdb parameters, it might be you're still running an older version of dbg
.
Check Updates under atom settings.
Tried to debug dbg
code. I found an issue in https://github.com/31i73/atom-dbg/blob/master/lib/main.coffee#L216
First time when you "save configuration", it writes invalid debugger name. The same is on the screen by @vanossj above. Changed "debugger": "GDB Debugger" to "debugger": "dbg-gdb",
and it helped.
Ok, it's started but failed with next error: https://sourceware.org/gdb/onlinedocs/gdb/Starting.html
The "remote" target does not support "run".
Now, I went to https://github.com/31i73/atom-dbg-gdb/blob/master/lib/main.coffee#L148 and replace with -exec-continue
as docs says. Now, a little further but with new errors. See https://pastebin.com/t8NzVCQ0
My configuration:
Thanks!
Cheers Ivan, good spots
I've updated dbg and abd dbg-gdb. If you update to latest these issues should all be resolved now (fingers crossed)
With regard to active project, are you referring to saving debug configs? If so I believe it always saves in the first project directory, yes. I'll look to ensuring it always it uses in the same root project directory as used by the executable, although that will be a task for another night.
Let me know if it runs for you okay now, or if you're still having issues
Cheers o/
@ProPuke Hm... Very strange! It works! 😊
What I really like about your work, that is Provide/Consume architecture. I integrated dbg
in a few clicks with our IDE. Now, need to perform hard work on the PIO Core side, provide hardware debug interface for compatible boards and link it with your front-end.
A few questions:
How about to move control buttons into the right panel? On top of it? For example, https://atom.io/packages/go-debug or https://atom.io/packages/atom-gdb-debugger It will allow saving vertical space for source code.
Strange icons for the actions. Should we change "Step into" icon with "Step out"? Again, see GUI from plugins above, or even Eclipse. "Step into" means "down, inside, deep", but not TOP
Simple mbed blink program. Ok, I see that we can't specify watch expressions here. However, how to reveal scope variables in right side? Where is "myled"?
In any case, great work! 👍
Cheers. That was actually why I built it - I was also turning atom into a dedicated ide for a project and needed a working debugger to integrate. There was nothing completed so I made one :S (although, granted, dbg isn't entirely there yet, either)
Yeah, I'm still pondering the best way of laying things out. Having it on the right might make more sense. I'm unsure atm as the toolbar is likely to get a bit wider (I may also add controls for selecting which thread you're operating on, and some status info to this toolbar)
I like to be awkward. My thinking behind the current buttons is based on the layout of the callstack on the right. You go up the stack to enter functions, and down the stack to exit, hence the icons matching those directions. Maybe this does go against the norm too much. If it turns out to be a big issue I'll change it.
Yeah, embarrassingly I haven't found the gdb mi command for listing static variables yet :S If you happen know what it is, please tell me!
" I'm unsure atm as the toolbar is likely to get a bit wider ". Yep, I agree here. Nevertheless, Atom's inline buttons can "jump" to a new line when panel width is small.
"You go up the stack to enter functions", - please don't see on the right side and try to think as normal user that doesn't know something about stack or gdb internal. For example, let's take a look "Go to declaration"... IF we click on some prototype/function/etc, we go down to nested file and etc. Here is the same, user has "initial/main" file, he decides to go "deeper" from this "initial" point. The question: which direction should be used here? :)
"Yeah, embarrassingly I haven't found the gdb mi command for listing static variables yet". A small hint here and maybe for the further your work. Please open Eclipse CDT and in the GDB settings enable "traces". Then you will see multiple interesting, mi-commands. No need to re-invent a wheel here, we can re-use CDT experience, they spent for that multiple years.
Would be good to have resize for "right panel".
Do you have any plans for Registers/Memory View panels?
I've just deployed first public version of working debug within new PIO IDE. Let's wait for the first feedback. Currently, only the one development platform is ready, but I'm working on further...
I'm sure that users will ask Registers/Memory View, they are very important instruments for embedded developer. Nevertheless, I can't force you to add support for it or even work on it. Of course, that is open source. If debug will be popular within our ecosystem, we will create own front-end WITHOUT GDB logic on a client side. Ideally, it should live on back-end side (PIO Core).
In any case, that is very good work! I think desktop coders will use it. Thank you very much and have a nice weekend! :)
I do think visual language is important, but yeah it should also correspond to what's actually going on, from a technical standing. In this case I think it's ambiguous - By definition stacks grow upward. The bottom of a stack is the start. But conversely, in computing, trees are usually always represented to grow downwards, not up. Also linguistically, and metaphorically "entering" something often brings to mind going "deeper" and by association going down. It might just be the best route is to avoid vertical cues, and perhaps use horizontal arrows instead to avoid ambiguities. I've seen this in a few development tools.
Seems there isn't an mi command for this , that's why I couldn't find one. I may have to manually parse the info variables
cli command :S
I don't use Eclipse. I did just download it to check it out, but either it or jre seems to be crashing on launch -_-.
Yeah, it would. There's also been the suggestion to use regular tabbed panes for these. Then you'd be able to completely customise the layout. Unfortunately the output panel is a panel atm, which sits outside of the pane layout, as does the toolbar, which means they'd take up the full width of atom if the side panels were panes. This might change in future versions of Atom. We'll see. There's also been the request to add tabs to panels, but that's yet to happen. So I'm unsure about whether it's worth the effort to code in custom sizing mechanics or not. I'm kind of waiting to see what happens here.
Personally, no. It's not something I need atm, so it won't be a focus for me. However, if other people want to add it and submit a PR I'd be very glad to pull it in (although I may have to reconsider the side panel a bit with more than 2 sections).
Cheers for the feedback. All the best with platformio!
I got you, thanks! I think we can close this issue, it works with the latest version.
Cheers for the feedback. All the best with platformio!
You too with all your projects! ;)
I'm looking for GDB backend for @PlatformIO IDE. We have multiple GDBs depending on MCU architecture. Diving into the source code of both packages: dbg & gdb, I made this config:
I enabled "log to console". F5, it asks me about configuration, OK for
firmware.elf
... Now, ... NOTHING! :)Am I doing something wrong?
Thanks!