我在/usr/share/gdb中找到了三个目录
auto-load:这是用于自动加载脚本;python:这是用于gdb python扩展的;syscalls:这包含几个xml文件,比如amd64 64-linux.xml,我无法通过google找到任何信息。顺便说一下:我的操作系统是Fedora 13。
有人能告诉我这些xml文件是干什么用的吗?谢谢和问候!
发布于 2012-11-03 12:04:31
较新的GDB可以中断系统调用:
(gdb) help catch syscall
Catch system calls by their names and/or numbers.
Arguments say which system calls to catch. If no arguments
are given, every system call will be caught.
Arguments, if given, should be one or more system call names
(if your system supports that), or system call numbers.示例:
$ gdb /bin/true
(gdb) catch syscall exit_group
Catchpoint 1 (syscall 'exit_group' [231])
(gdb) run
Starting program: /usr/bin/true
Catchpoint 1 (call to syscall exit_group), 0x00000038464baa09 in __GI__exit (status=status@entry=0)
at ../sysdeps/unix/sysv/linux/_exit.c:33
33 INLINE_SYSCALL (exit_group, 1, status);XML文件为数字映射提供syscall名称,例如exit_group是x86-64Linux上的syscall编号231。
发布于 2012-10-19 19:13:04
这是一个非常简单的列表,它告诉GDB syscall数字映射到特定系统上的哪个系统(因为它们是特定于体系结构的)。
它们是从相应的Linux内核头(例如arch/x86/include/asm/unistd_32.h for linux-i386)生成的。
示例:
<syscalls_info>
<syscall name="restart_syscall" number="0"/>
<syscall name="exit" number="1"/>
<syscall name="fork" number="2"/>
<syscall name="read" number="3"/>
<syscall name="write" number="4"/>
<syscall name="open" number="5"/>
...
</syscalls_info>https://stackoverflow.com/questions/12980870
复制相似问题