How to Terminate Gdbserver

How to terminate gdbserver when using GDB inside Qt Creator?

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).

gdbserver can't intrrupt SOME process,kill(pid,2) called by gdbserver didn't send SIGINT to process,what's happening?

Found out a possible match bug of gdbserver.
parameter of kill() called by gdbserver is -PID,not PID.

gdbserver sends SIGINT not to the process, but to the process group (-signal_pid).
But the attached process is not always a process group leader.
If not, "kill (-signal_pid, SIGINT)" returns error and fails to interrupt the attached process.

static void linux_request_interrupt (void)
{
/* Send a SIGINT to the process group. This acts just like the user
typed a ^C on the controlling terminal. */
- kill (-signal_pid, SIGINT);
+ kill (signal_pid, SIGINT);
}

This problem remained in gdb-8.1,don't know why they don't think it's a problem.

GDB 'find' command terminating early

The problem was that I was using gdbserver, and there is a bug in gdbserver where the 'find' function gives up if it doesn't find what it's looking for in 16,000 bytes. See https://sourceware.org/pipermail/gdb-patches/2020-April/167829.html for the official bug report.

The solutions are either update to gdb 10 (which will have a fix), or limit 'find' queries to less than 16,000 bytes

How to stop GDB from executing break main by default in Eclipse?

Make sure you are in the c++ perspective, then go to menu Run -> Debug Configurations. Make sure your application is chosen in the left pane, press the Debugger tab, and uncheck Stop on startup at: checkbox.

EDIT: you can see a screen-shot here: Method/Function Breakpoints in Eclipse CDT

Quit valgrind cleanly when debugging with gdb

you can also use the comand

(gdb)monitor v.kill

it was listed on monitor help on gdb.

Quit gdb while the target keeps running on STM32H7

After connecting to the target with target remote ... you should be able to use the detach command. This will tell GDB to close the remote connection but leave the remote running.

Once detached you should be able to quit GDB without causing your remote target to be killed.

GDB: Ctrl+C doesn't interrupt process as it usually does but rather terminates the program

I'll bet that xmms2d is using sigwait() to handle signals, which breaks gdb's ability to catch CTRL-C. See https://bugzilla.kernel.org/show_bug.cgi?id=9039

I got an idea for a workaround by reading Continue to debug after failed assertion on Linux? -- when I'm ready to break in gdb, I run "kill -TRAP <pid>" from another terminal window.



Related Topics



Leave a reply



Submit