misson20000 / twili

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

gdb: Correctly support multiprocessing for reporting threads. #77

Closed galli-leo closed 5 years ago

galli-leo commented 5 years ago

I came across this while trying to use the gdb stub with ida and ida did not list any threads because it did not recognize the format the threads where reported in. This checks whether the Supported query contains multiprocess+ and only then also sends the process id along with the thread id. It also errors if you try to attach to more than one process without multi process being enabled.

Btw. not sure if the + after multiprocess get's stripped or not.

misson20000 commented 5 years ago

I've pushed some codestyle fixes, but also fixed a logic bug. Your code was checking for multiprocess+ in the featureset the stub reports to gdb, not the featureset that gdb advertises. I've confirmed that this detects gdb's multiprocess support correctly. Can you make sure it works the way you expect with IDA?