C 程序模仿 gdb 调用函数在核心上执行

标签 c gdb core

在我的程序中,IP 前缀存储为 Trie。我想从程序生成的 linux coredump 中转储 trie。我已经有一个 C 函数,它遍历树并打印存储在树中的前缀。但是,使用 gdb 我无法通过调用此函数来转储 trie。是否可以编写一个程序来加载核心并通过链接转储 Trie 的库来调用此函数。 (我正在考虑使用 Python gdb 模块,但这需要我将 C 程序转换为 Python)。

感谢您的帮助。

最佳答案

Is it possible to write a program to load the core and call this function by linking the library which dumps the Trie. ( I am thinking of using Python gdb module, but that would require me to convert the C program to Python).

当然:您可以将源代码构建到共享库中,将共享库包装到 Python 中,然后让 Python 加载并调用它。

但是将 C 程序转换为纯 Python 可能更容易。

关于C 程序模仿 gdb 调用函数在核心上执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44274528/

相关文章:

c - 动态内存访问仅在函数内部有效

linux - 在为 gdb 打开套接字之前 Pin 进程崩溃

c - 我正在用 C 搜索 cgi 库来构建一个安静的网络服务

c - 将数据写入文件 : fflush() takes a lot of time

c - 在 C 中读取和处理大于 0.5GB 的大型数据文件的最佳方法

c++ - 来自 addr2line 的错误行号

c++ - 如何使用 gdb 调试插件

克隆系统调用从其关联函数返回后退出

swift - 核心数据 : error in constraints

ant - 导入 ZXing - 缺少 core/build.xml