Setting application affinity in gdb

Posted by Marcus Ahlberg on Stack Overflow See other posts from Stack Overflow or by Marcus Ahlberg
Published on 2012-11-26T11:01:17Z Indexed on 2012/11/26 11:03 UTC
Read the original article Hit count: 265

Filed under:
|
|
|

Is there a simple way of setting the affinity of the application I'm debugging without locking gdb to the same core? The reason why I'm asking is that the application is running with real time priority and it needs to run on a single core. At the moment I use this command line

taskset -c 3 gdbserver :1234 ./app.out

but the application stops responding and freezes the gdb server, making debugging impossible. I suspect that the real time priority of the application prevents gdb from executing. If I start the application and then start gdb without affinity setting, then I can attach and debug the application without gdb freezing.

Is there a simple way to start gdb and the application with different affinities? Or preferably: Is there a gdb command to set affinity of the child process?

© Stack Overflow or respective owner

Related posts about linux

Related posts about gdb