c - 如何在 Linux 中调试无调试符号的 C 程序?
问题描述
int goo(int g)
{
int filedesc = open("testfile.txt", O_WRONLY | O_APPEND);
}
int foo(int f)
{
goo(2);
}
int main()
{
foo(1);
}
gcc no_symbol.c -o no_symbol
在 GDB 中
(gdb) r
Starting program: /home/samuel/project/no_symbol
Breakpoint 1, 0x000055555555463e in goo ()
(gdb) bt full
#0 0x000055555555463e in goo ()
No symbol table info available.
#1 0x0000555555554676 in foo ()
No symbol table info available.
#2 0x0000555555554687 in main ()
No symbol table info available.
有没有什么方法我可以在没有源代码的情况下知道 g 和 f 的值?
解决方案
推荐阅读
- react-native - 无法自定义 react-native-google-places-autocomplete。列表视图在另一个视图上重叠时不可点击
- database - 用于数据库和可扩展性的容器
- python - 单个 Django 模型中的最大字段数?
- rest-assured - 请放心,基本获取查询会出错
- c# - 如何更改日期时间的格式?
- php - Redis Laravel - strlen() 期望参数 1 是字符串,给定数组
- assembly - 从 Intel 上的 CPUID 结果了解 TLB
- ios - 关于在 Swift 中一个按钮处于活动状态时禁用一个按钮的问题
- angular - 传单 - 从单选按钮更改事件时重叠标记
- vb.net - 在 LAN 上运行 vb dotnet 应用程序