31i73 / atom-dbg

An Atom package - An interactive debugger frontend
https://atom.io/packages/dbg
MIT License
30 stars 4 forks source link

Remote Debugging - Buttons not working. #39

Closed mirage335 closed 6 years ago

mirage335 commented 6 years ago

Attempting to create a portable package, with Arduino and Atom, among other resources, wrapped in sophisticated shell scripts. Relevant configuration files, as linked. https://github.com/mirage335/arduinoUbiquitous https://github.com/mirage335/arduinoUbiquitous/tree/master/_lib/app/atom/home/.atom/packages https://github.com/mirage335/arduinoUbiquitous/blob/master/_lib/Blink/.atom-dbg.cson https://github.com/mirage335/arduinoUbiquitous/blob/master/_prog/core.sh

Running the GDB debugger manually works as expected.

git clone --recursive git@github.com:mirage335/arduinoUbiquitous.git
./_task_aide_blink

<within AtomIDE shell terminal>
"$scriptAbsoluteLocation" --parent _arduino_run_commands "$au_arduinoSketch"
_arduino_swd_openocd_zero &
_here_gdbinit "$au_arduinoFirmware_elf" > "$safeTmp"/.gdbinit

../../_gdb --parent

pkill openocd

However, while the atom-dbg/atom-dbg-gdb IDE starts up, shows the debugging buttons, windows, etc, none of the buttons (including pause, or setting breakpoints) are functional.

dbg-gdb >  -enable-pretty-printing
main.coffee? [sm]:303 dbg-gdb <  = thread-group-added 
Object {id: "i1"}
main.coffee? [sm]:303 dbg-gdb <  = thread-group-started 
Object {id: "i1", pid: "42000"}
main.coffee? [sm]:303 dbg-gdb <  = thread-created 
Object {id: "1", group-id: "i1"}
main.coffee? [sm]:303 dbg-gdb <  * stopped 
Object {frame: Object, thread-id: "1", stopped-threads: "all"}
main.coffee? [sm]:315 dbg-gdb <  @ target halted due to debug-request, current mode: Thread 
main.coffee? [sm]:315 dbg-gdb <  @ xPSR: 0x81000000 pc: 0x00000614 msp: 0x20007ffc
main.coffee? [sm]:315 dbg-gdb <  @ target halted due to debug-request, current mode: Thread 
main.coffee? [sm]:315 dbg-gdb <  @ xPSR: 0x81000000 pc: 0x00000614 msp: 0x20007ffc
main.coffee? [sm]:303 dbg-gdb <  * running 
Object {thread-id: "all"}
thread-id
:
"all"
__proto__
:
Object
constructor
:
function Object()
hasOwnProperty
:
function hasOwnProperty()
isPrototypeOf
:
function isPrototypeOf()
propertyIsEnumerable
:
function propertyIsEnumerable()
toLocaleString
:
function toLocaleString()
toString
:
function toString()
valueOf
:
function valueOf()
__defineGetter__
:
function __defineGetter__()
__defineSetter__
:
function __defineSetter__()
__lookupGetter__
:
function __lookupGetter__()
__lookupSetter__
:
function __lookupSetter__()
get __proto__
:
function __proto__()
set __proto__
:
function __proto__()
mirage335 commented 6 years ago

Latest commit seems to get the buttons working. However, continue seems to fail, running maybe a few lines of code until pause is clicked. Same problem now applies to running "../../_gdb" manually. In fact, it turns out, if "load" is used, then the buttons in atom-dbg work. However, only if "load" is not used, does "continue" work properly. Placing "monitor reset" after "load" in gdb_commands fixes this, though at the cost of breaking the buttons again.

Apparently, if gdb can continue, the atom-dbg GUI buttons are unable to interrupt.

mirage335 commented 6 years ago

Problem may be solved. This seems to work.

"Arduino Firmware":
    debugger: "dbg-gdb"
    gdb_executable: "_gdb"
    gdb_commands: [
      "target remote :3333"
      "monitor reset init"
        "monitor halt"
        "load"
        "monitor reset"
        "monitor halt"
      "stepi"
      "stepi"
        "stepi"
        "stepi"
    ]
mirage335 commented 6 years ago

Retested. Sequence works. Closing.