简体   繁体   English

列出来自GDB的可调用函数

[英]List callable functions from GDB

Using GDB on the command line, I sometimes break at a certain line of code. 在命令行上使用GDB时,有时会在特定的代码行处中断。 At that breakpoint, I can then call functions as if my executable contained the call. 然后,在该断点处,我可以调用可执行文件一样调用函数。

How can I get GDB to print the list of all the possible functions that are callable at a given breakpoint? 如何让GDB打印在给定断点处可调用的所有可能函数的列表?

You could type call and then hit <tab> (until a list displays). 您可以键入call ,然后按<tab> (直到显示列表)。 This seems to list the functions contained in the binary. 这似乎列出了二进制文件中包含的功能。

The whole list of callable functions can be rather large. 可调用函数的整个列表可能很大。 For example it includes all libc functions. 例如,它包括所有libc函数。 Instead, you can start typing function name and press Tab key to get shorter list. 相反,您可以开始输入函数名称,然后按Tab键以获得更短的列表。 Also note that global variables and file names also will be listed along with functions. 还要注意,全局变量和文件名也会与函数一起列出。

(gdb) call 'open
open              open_memstream    openat.c          opendir.c
open64            open_path         openat64          opendir@plt
open64.c          open_socket       openat64.c        openlog
open64@plt        open_translit     openaux           openlog_internal
open64_2.c        open_verify       openaux_args      opensock.c
open_2.c          open_wmemstream   openchild.c       
open_catalog.c    openat            opendir           

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM