[PATCH 1/4] catch syscall -- try 3 -- Architecture-independent part

Sérgio Durigan Júnior sergiodj@linux.vnet.ibm.com
Tue Nov 18 20:02:00 GMT 2008


Arch-independent part of the patch.

Regards,

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

gdb/ChangeLog:

2008-11-18  Sergio Durigan Junior  <sergiodj@linux.vnet.ibm.com>

	* breakpoint.c (clear_syscall_catchpoints_info): New function.
	(print_it_typical): Handle the case of the breakpoint at the
	entrypoint.
	(bpstat_what): Add the entry breakpoint case.
	(print_one_breakpoint_location): Add the entry breakpoint.
	(allocate_bp_location): Likewise.
	(set_raw_breakpoint_without_location): New.  Used by the
	catch syscall feature because it needs to mention the
	catchpoint after some few adjustments.
	(create_entry_breakpoint): New.
	(any_syscall_count, syscall_counts, syscalls_size,
	 total_syscalls_count): New variables to keep track of requested
	syscall catchpoints.
	(insert_catch_syscall): New.
	(remove_catch_syscall): New.
	(breakpoint_hit_catch_syscall): New.
	(print_it_catch_syscall): New.
	(print_one_catch_syscall): New.
	(print_mention_catch_syscall): New.
	(catch_syscall_breakpoint_ops): New struct.
	(syscall_catchpoint_p): New.
	(create_catchpoint): Modified in order to use
	create_catchpoint_without_mention.
	(create_syscall_event_catchpoint): New.
	(mention): Add the entry breakpoint.
	(clean_up_filters): New.
	(catch_syscall_split_args): New.
	(catch_syscall_command_1): New.
	(delete_breakpoint): Add cleanup for catch syscall.
	(delete_command): Add the entry breakpoint case.
	(breakpoint_re_set_one): Likewise.
	(is_syscall_catchpoint_enabled): New.
	(catch_syscall_enabled): New.
	(catching_syscall_number): New.
	(catch_syscall_completer): New completer function.
	(add_catch_command): Add the completer function for catchpoints.
	* breakpoint.h (enum bptype): Add the entry breakpoint case.
	(syscall_filter): New.
	(struct breakpoint): Add field 'syscall_number' (used to know
	which syscall triggered the catchpoint) and
	'syscall_to_be_caught' (used to know which syscall we are trying
	to catch).
	(enum bpstat_what_main_action): Add BPSTAT_WHAT_ENTRY_BREAKPOINT,
	to identify whether we hit an entry breakpoint.
	(catch_syscall_enabled): New.
	(catching_syscall_number): New.
	(create_entry_breakpoint): New.
	* defs.h (gdb_datadir): New variable.
	* gdbarch.c: Regenerated.
	* gdbarch.h: Regenerated.
	* gdbarch.sh: Add syscall catchpoint functions.
	(get_syscall_number): New.
	(get_syscall_by_number): new.
	(get_syscall_by_name): New.
	(get_syscalls_names): New.
	(xml_syscall_filename): New variable.
	* inf-child.c (inf_child_insert_syscall_catchpoint): New.
	(inf_child_target): Assign default values to target_ops.
	* inf-ptrace.c (inf_ptrace_resume): Select the proper request
	to be made for ptrace() considering if we are catching syscalls
	or not.
	* infcmd.c (run_command_1): Clean syscall catchpoint info on every
	run.
	* infrun.c (resume): Add syscall catchpoint and entry breakpoint.
	(deal_with_syscall_event): New.
	(handle_inferior_event): Add syscall entry/return events.  Also,
	add entry breakpoint event.
	(inferior_has_called_syscall): New.
	* main.c: Add gdb_datadir variable to store the current GDB datadir.
	(captured_main): Add the GDB datadir relocatable handler.
	* maint.c: Create the "maintanence set gdb_datadir" command.
	* target.c (update_current_target): Update/copy functions related to
	syscall catchpoint and entry breakpoint.
	(debug_to_wait): Add syscall catchpoint entry/return events.
	* target.h (struct target_waitstatus): Add syscall number.
	(struct syscall): New struct to hold information about syscalls
	in the system.
	(struct target_ops): Add ops for syscall catchpoint and entry
	breakpoint.
	(inferior_has_called_syscall): New.
	(target_passed_by_entrypoint): New.
	(target_set_syscall_catchpoint): New.
	(target_enable_tracesysgood): New.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: catch-syscall-arch-indep.patch
Type: text/x-patch
Size: 56172 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20081118/5f7dc9a8/attachment.bin>


More information about the Gdb-patches mailing list