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

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

问题描述

我在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.

编辑:多线程调试通常是只有当您的进程( ldd your-process )加载 libpthread.so 或等效文件时才启用,以检查是否链接为一个共享库),所以如果你不需要它,那么你的编译脚本中可能会出现的问题。

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天全站免登陆