GDB断点在pthread

编程入门 行业动态 更新时间:2024-10-28 07:20:35
本文介绍了GDB断点在pthread_create上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

如果我输入:

catch thread_start

我得到

thread_start尚未实现的捕获

在这种情况下,如何在gdb中捕获线程创建的最佳方式?试试这个:

(gdb)b __pthread_create_2_1 $ b $ b

或者用 GDB =sourceware/ml/gdb-patches/2008-05/msg00396.html =noreferrer>此修补程序应用。

或者试试最新的预发布 GDB 这里,它应该允许你做catch syscall clone

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.

If I type:

catch thread_start

I get

Catch of thread_start not yet implemented

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

解决方案

Try this:

(gdb) b __pthread_create_2_1

Or build your own GDB with this patch applied.

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

更多推荐

GDB断点在pthread

本文发布于:2023-10-09 02:07:42,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:断点   GDB   pthread

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!