Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1:kernel-2.6.32
ltrace
ltrace.trunk-r75.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ltrace.trunk-r75.patch of Package ltrace
------------------------------------------------------------------------ r75 | pmachata-guest | 2007-01-25 17:05:44 +0000 (Thu, 25 Jan 2007) | 4 lines Changed paths: M /ltrace/trunk/ChangeLog M /ltrace/trunk/breakpoints.c M /ltrace/trunk/proc.c M /ltrace/trunk/sysdeps/linux-gnu/trace.c - fix -p behavior: wait for process to stop after PTRACE_ATTACH - fix -L behavior: always initialize the breakpoint dictionary, and thus aviod NULL dereference. ------------------------------------------------------------------------ Index: proc.c =================================================================== --- proc.c (revision 74) +++ proc.c (revision 75) @@ -56,5 +56,6 @@ void open_pid(pid_t pid, int verbose) #endif proc = open_program(filename, pid); + continue_process (pid); proc->breakpoints_enabled = 1; } Index: ChangeLog =================================================================== --- ChangeLog (revision 74) +++ ChangeLog (revision 75) @@ -1,3 +1,13 @@ +2007-01-19 Petr Machata <pmachata@redhat.com> + + * sysdeps/linux-gnu/trace.c (trace_pid): wait for child to stop, + as indicated by ptrace documentation. + * proc.c (open_pid): start the traced child again, it will have + been stopped after trace_pid. Fixes tracing with -p. + * breakpoints.c: initialize proc->breakpoints always, don't wait + untill it might be needed. This renders a check in insert_breakpoint + superfluous. Fixes a sigsegvs experienced with -L. + 2006-12-28 Eric Vaitl <evaitl@cisco.com> * sysdeps/linux-gnu/mipsel/* Added mipsel support Index: sysdeps/linux-gnu/trace.c =================================================================== --- sysdeps/linux-gnu/trace.c (revision 74) +++ sysdeps/linux-gnu/trace.c (revision 75) @@ -4,6 +4,7 @@ #include <errno.h> #include <unistd.h> #include <sys/types.h> +#include <sys/wait.h> #include "ptrace.h" #include <asm/unistd.h> @@ -87,6 +88,16 @@ int trace_pid(pid_t pid) if (ptrace(PTRACE_ATTACH, pid, 1, 0) < 0) { return -1; } + + /* man ptrace: PTRACE_ATTACH attaches to the process specified + in pid. The child is sent a SIGSTOP, but will not + necessarily have stopped by the completion of this call; + use wait() to wait for the child to stop. */ + if (waitpid (pid, NULL, 0) != pid) { + perror ("trace_pid: waitpid"); + exit (1); + } + return 0; } Index: breakpoints.c =================================================================== --- breakpoints.c (revision 74) +++ breakpoints.c (revision 75) @@ -30,12 +30,6 @@ insert_breakpoint(struct process *proc, struct breakpoint *sbp; debug(1, "symbol=%s, addr=%p", libsym?libsym->name:"(nil)", addr); - if (!proc->breakpoints) { - proc->breakpoints = - dict_init(dict_key2hash_int, dict_key_cmp_int); - /* atexit(brk_dict_clear); *//* why bother to do this on exit? */ - } - if (!addr) return; @@ -169,6 +163,7 @@ void breakpoints_init(struct process *pr dict_clear(proc->breakpoints); proc->breakpoints = NULL; } + proc->breakpoints = dict_init(dict_key2hash_int, dict_key_cmp_int); if (opt_L && proc->filename) { proc->list_of_symbols = read_elf(proc);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor