Closed mikoff closed 7 years ago
Hi. Thanks.
It's not something I'm familiar with or use myself, so it's not likely to be a priority for me to add. (I'm more likely to work on multithreading, conditional breakpoints, and better integrations first).
But if anyone else wants to help and add it I would be very grateful :]
For remote debugging we need to use a cross-platform debugger (so, a configurable path to that debugger is needed) and a command file to configure the target parameters (which can be provided using debugger arguments, eg. '-command=file' or '-x file' arguments for gdb). A solution is to add new options in the .atom-dbg.json file, to also configure the debugger path and arguments, not only the target file path and arguments.
Hi I've added 3 new parameters to the new version of dbg-gdb
, listed in the readme, for specifying a custom gdb path, custom arguments, and custom commands to be executed before -exec-run
; Which can be included in your .atom-dbg.*
config file.
Hopefully this is a good start, or a usable solution for now.
It works fine, so far. This is a good solution, thank you very much !
Hi. Im trying to setup dbg gdb. When I run gdb from console everything works fine:
$ arm-none-eabi-gdb GNU gdb (GNU Tools for ARM Embedded Processors) 7.10.1.20160923-cvs Copyright (C) 2015 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". (gdb) target remote localhost:2331 Remote debugging using localhost:2331 0x00026654 in ?? () (gdb)
client: debugger: 'dbg-gdb' gdb_executable: 'arm-none-eabi-gdb' gdb_commands: ['target remote localhost:2331']
What is wrong with my config file?
Ok... I was digging into source code and I\ve not found place where commands are send. So I\ve added a few lines.
else
if line!='(gdb)' and line!='(gdb) '
if @logToConsole then console.log 'dbg-gdb < ',line
if @outputPanel
if !outputRevealed
outputRevealed = true
@outputPanel.show()
@outputPanel.print line
else
for ep in options.gdb_commands
@sendCommand ep
console.log ep
No, you only need add whole path to the debugger, not only the debugger name ( ex: gdf_executable: '/opt/toolchain/.../bin/arm-none-eabi-gdb' ). You can use it without path only if the debugger is available in the atom's search path too, otherwise... You may try o start the atom from console, not from the desktop icon.
I have debugger in the PATH. But there is something wrong with commands. After my change (prev. comment) gdb server said that are more then one gdb client connected, and I had a lot of disconnects and connects.
No need to modify the source to log things. There's a setting in dbg-gdb
's package settings for enabling debug console logging (Preferences > Packages > dbg-gdb > ☑ Log to developer console)
Once enabled you'll see all the commands and responses from gdb in the developer console.
has bug been fixed? I'm not sure that I can update to your version.
This thread was for a feature request, which was added before your query.
It's unknown if your issue is local or a dbg issue, yet. Are you able to paste a copy of your logs from the developer console? So I can investigate?
I'm sorry. Bug is in dbg-gdb package or my configuration. Not atom-dbg.
Usual GDB output:
$ gdb
GNU gdb (GNU Tools for ARM Embedded Processors) 7.10.1.20160923-cvs
Copyright (C) 2015 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".
(gdb) target remote localhost:2331
Remote debugging using localhost:2331
0x00012476 in ?? ()
(gdb)
Package is not sending command to GDB.
But if I've added sending command (a few post upper):
else
for ep in options.gdb_commands
@sendCommand ep
Some how was working. But I had many connects and disconnects in gdb server. main.coffee 253-259
If you want I can try to fix that.
I need to see the event log from dbg-gdb
to see what's actually going on.
spell-check:en-us Can't load en_US: Cannot find dictionary for en_US.
Uncaught (in promise) TypeError: Path must be a string. Received undefined(…)
assertPath @ path.js:7
resolve @ path.js:184
debug @ main.coffee:138
debugWithDebugger @ main.coffee:364
(anonymous function) @ main.coffee:217
debug @ main.coffee:204
module.exports.ConfigList.confirmed @ ConfigList.coffee:36
module.exports.SelectListView.confirmSelection @ C:\Users\jordanea\.atom\packages\dbg\node_modules\atom-space-pen-views\lib\select-list-view.js:338
atom.commands.add.core:confirm @ C:\Users\jordanea\.atom\packages\dbg\node_modules\atom-space-pen-views\lib\select-list-view.js:109
module.exports.CommandRegistry.handleCommandEvent @ command-registry.coffee:255
(anonymous function) @ command-registry.coffee:1
module.exports.KeymapManager.dispatchCommandEvent @ C:\Users\jordanea\AppData\Local\atom\app-1.16.0\resources\app.asar\node_modules\atom-keymap\lib\key…:599
module.exports.KeymapManager.handleKeyboardEvent @ C:\Users\jordanea\AppData\Local\atom\app-1.16.0\resources\app.asar\node_modules\atom-keymap\lib\key…:390
module.exports.WindowEventHandler.handleDocumentKeyEvent @ window-event-handler.coffee:76
(anonymous function) @ window-event-handler.coffee:1
dbg-gdb < = thread-group-added Object
Uncaught (in promise) TypeError: Path must be a string. Received undefined(…)
dbg-gdb < = thread-group-added Object {id: "i1"}id: "i1"__proto__: Object
client: debugger: 'dbg-gdb' gdb_executable: 'arm-none-eabi-gdb' cwd: 'C:\XXXYYYY' basedir: 'C:\XXXYYY' gdb_commands: ['target remote localhost:2331']
Okay, the problem is that currently dbg-gdb
expects there to always be a path
parameter, as it attempts to run -file-exec-and-symbols PATH
before executing custom commands. It's missing, so breaking in a bad way.
I should have noticed that missing in the config file >.>
I hadn't thought about this not being necessary with remote debugs.
I'll get this fixed, thanks.
:+1: No problem. But I think that is more issues here. But when you fix that we can go to commands :-)
Hi @dotevo (and anyone else following remote target support)
I've pushed live an update to fix the issue reported. The path
parameter is now optional and breakpoint commands aren't sent to gdb until after it's executed any custom commands specified; So remote debugging should hopefully be better now (although, admittedly, this isn't something I have experience with or can test, myself).
Can you let me know if it's okay now? Cheers
I think that is working fine. I didn't have any problems. There is one error log but I think that not affect on gdb:
dbg-gdb < ^ error Object {msg: "The "remote" target does not support "run". Try "help target" or "continue"."
Thank you
Nice, good to hear!
Yeah, that error's fine. It attempts to run
first, then if the target doesn't support it, defaults to continue
.
You might also see an error about mi-async
. This is also fine.
Cheers.
Receiving same (path must be a string) error, even with latest version of atom-dbg and atom-dbg-gdb imported from git repository.
Attempting to integrate Atom with Arduino as a more functional IDE, wrapped by sophisticated shell scripts. https://github.com/mirage335/arduinoUbiquitous/blob/master/_lib/Blink/.atom-dbg.cson
"Arduino Firmware":
gdb_executable: "_gdb"
Please assist!
EDIT: Thanks to ProPuke. Solution was to specify debugger: "dbg-gdb" . Next problem - 'Don't know how to run. Try "help target".' . Because my next problems are unrelated to this issue, I will take their discussion to a new issue.
Hello! First of all - thank you for new package, which is going to be universal and enough powerful to debug any target from atom editor. And a short question - do you have any plans on adding the remote target debugging feature? Thanks!