1

Linuxで実行されている最大200個のスレッドを持つマルチスレッドプログラムがあります。まあ、これはレガシー プログラムです :) このプログラムは 2.6.29 で debian OS で実行されています。どのスレッドのスタック フレームに functionA のようなものが含まれているかを簡単に調べるにはどうすればよいですか? 「thread apply all bt」を使用して、すべてのスレッドのバックトレースを表示しています。ただし、各スタック フレームを調べて、functionA を含む正しいスレッドを見つける必要があります。

ありがとう!質問子

4

1 に答える 1

2

thread apply all btの出力をログ ファイルに保存してから、それを grep するか、他の方法で調べることができます。また、ページネーションを無効にすると便利です。

[root@localhost ~]# gdb
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) set logging on
(gdb) set pagination off
(gdb) thread apply all bt
于 2010-11-05T09:59:38.210 に答える