在gdb中设置应用程序关联 [英] Setting application affinity in gdb

查看:138
本文介绍了在gdb中设置应用程序关联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种简单的方法可以设置我正在调试的应用程序的相似性,而无需将gdb锁定在同一内核上?我问的原因是该应用程序以实时优先级运行,并且需要在单个内核上运行.目前,我使用此命令行

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

,但是应用程序停止响应并冻结了gdb服务器,从而导致无法进行调试.我怀疑应用程序的实时优先级会阻止gdb执行.如果我先启动应用程序,然后在不设置亲和力的情况下启动gdb,那么我可以在不冻结gdb的情况下附加和调试应用程序.

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.

是否有一种简单的方法来启动gdb和具有不同关联性的应用程序?或者更可取的是:是否存在一个gdb命令来设置子进程的亲和力?

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?

推荐答案

我找到了一个解决方案:使用--wrapper参数.

I found a solution: Use the --wrapper argument.

http://sourceware.org/gdb/onlinedocs/gdb/Server.html

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

这篇关于在gdb中设置应用程序关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆