This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

New branch for the "catch syscall" feature


Hello guys :-),

I've just set up a new branch on the git repo for the "catch syscall"
feature that I've been working with.

You can see this branch using gitweb:

http://sourceware.org/git/gitweb.cgi?p=archer.git;a=tree;h=refs/heads/archer-sergio-catch-syscall;hb=archer-sergio-catch-syscall

If you pull this branch out, you'll find an "almost-done" version of the
catch syscall implementation that I'm working on. Basically, the current
status of this feature is:

1) The user can ask GDB to start catching syscalls using the command
"catch syscalls". I'm still implementing a kind of "filter" that would
allow the user to specify which syscall to catch for GDB.

2) When a syscall gets caught, GDB prints its name for the user
(printing arguments is left for a future version of this feature).

It's also good to note that currently this feature only works in PPC
arch. Eventually, it will be implemented by PPC64 and x86 too.


Below you can see an example of what happens:

sergio@elm3b188 ~/work/gdb/archer/build-32/gdb $
cat ../../../catch_syscall/ex_syscall.c
#include <unistd.h>
int main ()
{
        _exit (0);
}

sergio@elm3b188 ~/work/gdb/archer/build-32/gdb
$ ./gdb ../../../catch_syscall/ex_syscall
GNU gdb (GDB) 6.8.50.20080811-cvs
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show
copying"
and "show warranty" for details.
This GDB was configured as "powerpc64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Setting up the environment for debugging gdb.
Function "internal_error" not defined.
Make breakpoint pending on future shared library load? (y or [n])
[answered N; input not from terminal]
Function "info_command" not defined.
Make breakpoint pending on future shared library load? (y or [n])
[answered N; input not from terminal]
/home/sergio/work/gdb/archer/build-32/gdb/.gdbinit:8: Error in sourced
command file:
No breakpoint number 0.
(gdb) catch syscall
Catchpoint 1 (syscall)
(gdb) r
Starting program: /home/sergio/work/gdb/catch_syscall/ex_syscall

Catchpoint 1 (called syscall 'exit_group()'), 0x0ff32908 in _exit ()
from /lib/ppc970/libc.so.6
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/sergio/work/gdb/catch_syscall/ex_syscall

Catchpoint 1 (called syscall 'exit_group()'), 0x0ff32908 in _exit ()
from /lib/ppc970/libc.so.6
(gdb) c
Continuing.

Program exited normally.
(gdb) quit


Any comments/suggestions/questions are welcome :-)

Regards,

-- 
Sérgio Durigan Júnior
Linux on Power Toolchain - Software Engineer
Linux Technology Center - LTC
IBM Brazil


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]