How can we list all the functions being called in an application
For any realistically sized application, this list will have thousands of entries, which will probably make it useless. You can find out all functions defined (but not necessarily called) in an application with the nm command, e.g. nm /path/to/a.out | egrep ' [TW] '
EG:
[root@monitor ~]# nm ./test | egrep ' [TW] '              
00000000004005f0 T __libc_csu_fini
0000000000400600 T __libc_csu_init
00000000004006c8 T _fini
00000000004003c8 T _init
0000000000400420 T _start
0000000000600990 W data_start
0000000000400504 T main
You can also use GDB to set a breakpoint on each function: (gdb) set logging on # collect trace in gdb.txt
(gdb) set confirm off # you wouldn't want to confirm every one of them
(gdb) rbreak . # set a breakpoint on each function
Once you continue, you'll hit a breakpoint for each function called.
Use the disable and continue commands to move forward. I don't believe there is an easy way to automate that, unless you want to use Python scripting. Already mentioned gprof is another good option.
record function-call-history should be a great hardware accelerated possibility 

if you are one of the few people () with a CPU that supports Intel Processor Tracing (Intel PT, intel_pt in /proc/cpuinfo).

GDB docs claim that it can produce output like:

(gdb) list ,
void foo (void)
{
} void bar (void)
{
...
foo ();
...
}
(gdb) record function-call-history /ilc
bar inst , at foo.c:,
foo inst , at foo.c:,
bar inst , at foo.c:,
Before using it you need to run: start
record btrace
which is where a non capable CPU fails with: Target does not support branch tracing.
CPU support is further discussed at: How to run record instruction-history and function-call-history in GDB?

gdb - 列出所有函数调用的更多相关文章

  1. GDB教程详解

    GDB是GNU开源组织发布的一个强大的UNIX下的程序调试工具.或许,各位比较喜欢那种图形界面方式的,像VC.BCB等IDE的调试,但如果你是在UNIX平台下做软件,你会发现GDB这个调试工具有比VC ...

  2. GDB中文手册

    用GDB调试程序GDB概述 2使用GDB 5GDB中运行UNIX的shell程序 8在GDB中运行程序 8调试已运行的程序 两种方法: 9暂停 / 恢复程序运行 9一.设置断点(BreakPoint) ...

  3. Linux高级编程--04.GDB调试程序(设置断点)

    调试已运行的程序 在UNIX下用ps查看正在运行的程序的PID(进程ID),然后用gdb PID格式挂接正在运行的程序. 先用gdb 关联上源代码,并进行gdb,在gdb中用attach命令来挂接进程 ...

  4. linux下gcc编译多个源文件、gdb的使用方法

    一. gcc常用编译命令选项 假设源程序文件名为test.c. 1. 无选项编译链接 用法:#gcc test.c 作用:将test.c预处理.汇编.编译并链接形成可执行文件.这里未指定输出文件,默认 ...

  5. GDB 使用大法

    一.GDB 我用的是 GCC+POWERSHELL+GDB,  GDB刚刚接触也有很多要记的. 二.一个调试示例 tst.c #include <stdio.h> int func(int ...

  6. linux c/c++ GDB教程详解

    学习使用了GDB一段时间后,发现它真的好强大!好用! GDB是GNU开源组织发布的一个强大的UNIX下的程序调试工具.或许,各位比较喜欢那种图形界面方式的,像VC.BCB等IDE的调试,但如果你是在U ...

  7. 比较全面的gdb调试命令 (转载)

    转自http://blog.csdn.net/dadalan/article/details/3758025 用GDB调试程序 GDB是一个强大的命令行调试工具.大家知道命令行的强大就是在于,其可以形 ...

  8. linux下的gdb调试工具--断点调试

    到目前为止我们的调试手段只有一种: 根据程序执行时的出错现象假设错误原因,然后在代码中适当的位置插入printf,执行程序并分析打印结果,如果结果和预期的一样,就基本上证明了自己假设的错误原因,就可以 ...

  9. GDB单步调试程序

    linux下gdb单步调试 用 GDB 调试程序 GDB 概述———— GDB 是 GNU开源组织发布的一个强大的 UNIX下的程序调试工具.或许,各位比较喜欢那种图形界面方式的,像 VC. BCB等 ...

随机推荐

  1. Day21 Django之Form文件上传、原生Ajax和实现抽屉实例

    一.Form文件上传 """ Django settings for prev_chouti project. Generated by 'django-admin st ...

  2. odoo 错误 Resource interpreted as Stylesheet but transferred with MIME type application/x-css:

    odoo8   页面内容显示一半,  web 控制台显示错误  Resource interpreted as Stylesheet but transferred with MIME type ap ...

  3. WPF Window对象

    户通过窗口与 Windows Presentation Foundation (WPF) 独立应用程序进行交互.窗口的主要用途是承载可视化数据并使用户可以与数据进行交互的内容.独立 WPF 应用程序使 ...

  4. 修改虚拟机linux硬盘的大小

    一.概述 Ubuntu用了一段时间,系统已从原来的4G增长到8G,导致虚拟磁盘不够用,需要修改虚拟硬盘的大小. 但是,修改虚拟机硬盘的大小不像修改内存那么简单,操作一个滑动条就轻松搞定.要知道虚拟硬盘 ...

  5. java web 代码

    原 30套JSP网站源代码合集 IT小白白 发布时间: 2012/12/28 14:30 阅读: 272 收藏: 3 点赞: 0 评论: 0 JSP技术是以Java语言作为脚本语言的,JSP网页为整个 ...

  6. iPhone开发 - 常用库

    iPhone开发 - 常用库 这里总结了iPhone开发者开发过程中可能需要的一些资源 如何用Facebook graphic api上传视频: http://developers.facebook. ...

  7. input text 不可编辑的解决办法

    <div class="inp bg"> <input id="inp-query" type="text" name=& ...

  8. uva 11731 - Ex-circles

    题意:已知三角形ABC的3条边长,求三角形ABC 的面积,以及阴影部分的总面积. #include<iostream> #include<cstdio> #include< ...

  9. 去掉eclipse js 错误提示

    1.去掉项目目录底下的.project文件中的以下部分:<buildCommand>      <name>org.eclipse.wst.jsdt.core.javascri ...

  10. 【转】ByteBuffer 到底怎么用?网络编程中一点总结!--不错

    原文网址:http://cuisuqiang.iteye.com/blog/1443212 做tcp网络编程,要解析一批批的数据,可是数据是通过Socket连接的InputStream一次次读取的,读 ...