misson20000 / twili

Homebrew debug monitor for the Nintendo Switch.
GNU General Public License v3.0
184 stars 23 forks source link

GDB monitor wait failures #93

Open jugeeya opened 4 years ago

jugeeya commented 4 years ago

Running either of the methods for PM suspended starts for non-monitored applications fail. I can split these into three issues, here with output:

1) monitor wait application failing:

(gdb) monitor wait application
Target error: 0x80f

2) monitor wait title succeeding but failing due to gdb remote timeout:

(gdb) monitor wait title 01006A800016E000
Ignoring packet error, continuing...
Ignoring packet error, continuing...
[4][2019-09-19 00:10] tool/GdbConnection.cpp:53: packet opened with bad character -
[4][2019-09-19 00:10] tool/GdbConnection.cpp:190: gdb connection error
PID: 0x85
(gdb) attach 0x85
Attaching to Remote target
Remote communication error.  Target disconnected.: Broken pipe.

The following issue ONLY occurs with SaltySD active as a sysmodule. It is likely due to SaltySD checking on the title using similar functions upon application start.

3) monitor wait title succeeding with remote timeout set, but failing to attach due to svcContinueDebugEvent error:

(gdb) target extended-remote | twib gdb
Remote debugging using | twib gdb
(gdb) set remotetimeout 999999999
(gdb) monitor wait title 01006A800016E000
PID: 0x85
(gdb) file main.elf
Reading symbols from main.elf...
(No debugging symbols found in main.elf)
(gdb) attach 0x85
Attaching to program: /home/user/main.elf, Remote target
terminate called after throwing an instance of 'twili::twib::ResultError'
  what():  ResultError: 0xf401
Remote connection closed