user5485904
user5485904

Reputation: 21

gdb cant execute command while the target in running while remote debugging

I am using gdb and gdbserver for debugging my exe. My target is same as local host currently. I start the gdbserver using

gdbserver.exe :6000 MyTest.exe 1> NUL 2> NUL

and my gdb is started using

gdb.exe -ex "set target-async on" -ex "target remote :6000"

But when I try info threads or set or get a global variable , I get cannot execute command target running. I tried to use interrupt before set but this doesn't change anything. Does any one know what could be wrong or what I'm doing wrong?

Upvotes: 1

Views: 3104

Answers (1)

The Philomath
The Philomath

Reputation: 992

There is no input file to the gdb.exe in your code. Provide the same MyTest.exe file to gdb on host so that gdb can load the symbols

gdb.exe MYTest.exe
(gdb)set target-async on
(gdb)set target remote :6000

Upvotes: 0

Related Questions