Here is the architecture-dependent part of the patch. It's worth noting that the current supported architectures are x86, PPC and PPC64. I intend to submit a patch for x86_64 ASAP. Regards, -- Sérgio Durigan Júnior Linux on Power Toolchain - Software Engineer Linux Technology Center - LTC IBM Brazil gdb/ChangeLog: 2009-01-25 Sergio Durigan Junior * i386-linux-nat.c (i386_linux_resume): Select the proper request to be made for ptrace() considering if we are catching syscalls or not. * i386-linux-tdep.c: Include linux-tdep.h header, define the XML syscall name for the architecture. (i386_linux_get_syscall_number): New. (i386_linux_init_abi): Call linux_tdep_init to initialize common functions. Register the correct functions for syscall catchpoint. * linux-nat.c: Define some helpful variables to track wether we have support for the needed ptrace() option. (linux_test_for_tracesysgood): New. (linux_supports_tracesysgood): New. (linux_enable_tracesysgood): New. (linux_passed_by_entrypoint): New. (linux_enable_event_reporting): Save the current used ptrace() options. (linux_child_set_syscall_catchpoint): New function. (linux_child_post_startup_inferior): Create the entry breakpoint. (linux_child_insert_syscall_catchpoint): New. (linux_child_remove_syscall_catchpoint): New. (linux_nat_create_inferior): Properly set the flag which indicates if the inferior have already passed through its entrypoint. (linux_handle_extended_wait): Handle the case which the inferior stops because it has called or returned from a syscall. (linux_nat_filter_event): Likewise. (linux_target_install_ops): Install the necessary functions to handle syscall catchpoints and entry breakpoints. * linux-nat.h (struct lwp_info): Include syscall_state into the structure, which indicates if we are in a syscall entry or return. * linux-tdep.c: New file. (init_sysinfo): New function. (linux_get_syscall_by_number): Likewise. (linux_get_syscall_by_name): Likewise. (linux_get_syscall_names): Likewise. (linux_tdep_init): Likewise. * linux-tdep.h: New file. * ppc-linux-tdep.c: Include linux-tdep.h header, define the XML syscall filename for the arch. (ppc_linux_get_syscall_number): New. (ppc_linux_init_abi): Call linux_tdep_init to initialize common functions. Register the correct functions for syscall catchpoint.