反步多线程错误 [英] reverse-step multithread error

查看:38
本文介绍了反步多线程错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 gdb(7.1 版)中收到以下消息:

I get the following message in gdb (version 7.1):

[启用使用 libthread_db 进行线程调试]

和命令reverse-step

导致以下错误消息:

(gdb) reverse-step
Target multi-thread does not support this command

我现在正在调试串行代码,所以我绝对不需要多线程.我可以以某种方式将其关闭,以便让最新的反向调试命令正常工作吗?此外,如果代码与 OpenMPI 并行化,则根本不需要多线程调试,对吧?

I am debugging a serial code right now, so I definitely do not need multi-threading. Can I turn this off somehow so that I get the latest reverse-debug commands to work? Also, if the code is parallelised with OpenMPI, there will be no need for multi-thread debugging at all, right?

这是否设置为可以排除的编译标志?

Is this set as a compilation flag that can be just excluded?

推荐答案

你没有提到你使用的是哪个版本的GDB,但是过了一会儿,参数libthread-db-search-path 可用.

You don't mention which version of GDB you're using, but since a little while, the parameter libthread-db-search-path is available.

(gdb) set libthread-db-search-path /tmp
(gdb) start
Temporary breakpoint 1 at 0x400632: file threads.c, line 14.
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

会告诉 GDB 在没有的目录中查找它的帮助程序库 (libthread-db.so),因此不会启用多线程调试!

will tell GDB to lookup it's helper library (libthread-db.so) in a directory where it isn't, so multithread debugging won't be enabled!

我不确定 OpenMPI 并行应用程序是否是多进程(与 OpenMP 相比,它们是多线程的),因此它不会为您带来任何改变.

I'm not sure about OpenMPI parallel applications are multiprocesses (in contrast with OpenMP where they are multithreaded), so it won't change anything for you.

EDIT:多线程调试通常仅在您的进程加载 libpthread.so 或等效项时启用(ldd your-process 以检查如果它作为共享库链接),所以如果您不需要它,可能在您的编译脚本中存在问题.

EDIT: Multithread debugging is usually only enabled when libpthread.so or equivalent is loaded by your process (ldd your-process to check if it's linked as a shared library) so if you don't need it, there might be a problem in your compilation script.

这篇关于反步多线程错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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