1

I have a quite similar question than the one done in this SO question, but with a small difference: I'm running GDB from within Qt Creator, not calling it from a terminal, so there is no terminal directly available to execute commands such as monitor exit or else to make gdbserver`stop running.

And there is one more problem: once I call the command for gdbserver to start listening to a port (and this is done via Minicom), I simply loose any command over Minicom or my target device! It doesn't matter what I type (ps, quit, kill ..., Ctr+C, etc.), nothing is accepted as command in Minicom once the command to start gdbserver is called.

So having this particular problems/situations, how can I terminate gdbserver when it's listening?

Community
  • 1
  • 1
Momergil
  • 2,213
  • 5
  • 29
  • 59

2 Answers2

1

In QtCreator, if you click on Window -> Views -> Debugger Log you can access the gdb console. From there, using the left pane of the panel being shown, you can send commands to gdb and read output on the right pane. I assume that you can also issue a monitor exit to make gdbserver stop running.

Anyway, in normal conditions, gdbserver is automatically terminated as soon as you stop debugging in QtCreator (at least on my PC it works like that).

Morix Dev
  • 2,700
  • 1
  • 28
  • 49
0

Haha, silly of me! It would seem a was induced to understand how the systems wrongly works and, because of that, I was doing everything wrong :)

Actually it seems that Qt Creator handles gdbserver on its own; its just a matter of having a gdbserver on the target device that Qt Creator will control it, so just press "run in debug mode" and go on (and it will automatically close gdbserver when the program is finished). I could verify that by reading the gdb console mentioned by Morix Dev.

Actual problem was that I though one would have to work with GDB + gdbserver with Qt Creator in the same way one would do it only using Terminal/command lines: one would have to start gdbserver inside the target running the command

gdbserver hostip:port app-name

and then run the app in Qt Creator in debug mode, but it seems I was mistaken; this "two part process" is only required when using all of the GDB system in Terminal. So what was happening is that Qt Creator would do its things fine and when I tried to close the gdbserver running in the target, I would find myself stuck with the mentioned problem.

Momergil
  • 2,213
  • 5
  • 29
  • 59