pthread_create 上的 gdb 断点 [英] gdb breakpoint on pthread_create

查看:30
本文介绍了pthread_create 上的 gdb 断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 gdb 中的 linux 中为创建线程的程序设置断点.我想在线程创建时设置一个断点,但不幸的是 pthread_create 是一个版本化符号,我无法得到它的全名.

I am trying to set a breakpoint in linux in gdb for a program creating threads. I would like to set a breakpoint on thread creation, but unfortunately pthread_create is a versioned symbol, and I can't get its full name.

如果我输入:

catch thread_start

我明白了

Catch of thread_start not yet implemented

在这种情况下,在 gdb 中捕获线程创建的最佳方法是什么?

How is the best way to catch thread creation in gdb for this situation?

推荐答案

试试这个:

(gdb) b __pthread_create_2_1

或使用 this 构建您自己的 GDB补丁已应用.

Or build your own GDB with this patch applied.

或尝试最新的预发行版GDB 这里,这应该允许你做 "catch syscall clone"

Or try the latest pre-release GDB here, which should allow you to do "catch syscall clone"

这篇关于pthread_create 上的 gdb 断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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