Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
openSUSE:Evergreen:11.1:kernel-2.6.32
ltrace
ltrace.trunk-r79.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ltrace.trunk-r79.patch of Package ltrace
------------------------------------------------------------------------ r79 | cespedes | 2007-08-31 16:49:48 +0000 (Fri, 31 Aug 2007) | 15 lines Changed paths: M /ltrace/trunk/BUGS M /ltrace/trunk/ChangeLog M /ltrace/trunk/TODO M /ltrace/trunk/debug.c M /ltrace/trunk/debug.h M /ltrace/trunk/display_args.c M /ltrace/trunk/etc/ltrace.conf M /ltrace/trunk/ltrace.1 M /ltrace/trunk/ltrace.c M /ltrace/trunk/ltrace.h M /ltrace/trunk/options.c M /ltrace/trunk/options.h M /ltrace/trunk/proc.c M /ltrace/trunk/process_event.c M /ltrace/trunk/read_config_file.c M /ltrace/trunk/sysdeps/linux-gnu/trace.c M /ltrace/trunk/testsuite/ltrace.main/parameters.c M /ltrace/trunk/testsuite/ltrace.main/parameters.conf M /ltrace/trunk/testsuite/ltrace.main/parameters.exp M /ltrace/trunk/testsuite/ltrace.minor/attach-process.exp M /ltrace/trunk/testsuite/ltrace.minor/count-record.exp M /ltrace/trunk/testsuite/ltrace.minor/demangle.exp M /ltrace/trunk/testsuite/ltrace.minor/print-instruction-pointer.exp M /ltrace/trunk/testsuite/ltrace.minor/time-record-T.exp M /ltrace/trunk/testsuite/ltrace.minor/time-record-tt.exp M /ltrace/trunk/testsuite/ltrace.minor/time-record-ttt.exp M /ltrace/trunk/testsuite/ltrace.minor/trace-clone.c M /ltrace/trunk/testsuite/ltrace.minor/trace-clone.exp M /ltrace/trunk/testsuite/ltrace.minor/trace-exec.exp M /ltrace/trunk/testsuite/ltrace.minor/trace-fork.exp M /packaging/debian/changelog M /packaging/debian/control.in M /packaging/debian/copyright M /packaging/debian/rules * General: Small fixes (indentation, typos, clean-up of code) * ltrace.c: Close output file on exit * ltrace.c: use getenf("HOME") instead of getpwuid(geteuid())->pw_dir * read_config_file.c, display_args.c: remove "ignore" argtype; that's what "void" is for * packaging/debian/: misc fixes, sync with version 0.5-1 * etc/ltrace.conf: added more system calls * testsuite/ltrace.minor/trace-clone.c: sleep(1) to avoid earlier termination of process * sysdeps/linux-gnu/trace.c: trace_pid(): reverted Petr's patch to wait for child to stop, as it stopped following clone() * process_event.c: Disable breakpoints before doing fork() (again!), to make children work as expected ------------------------------------------------------------------------ Index: read_config_file.c =================================================================== --- read_config_file.c (revision 78) +++ read_config_file.c (revision 79) @@ -44,7 +44,6 @@ static struct list_of_pt_t { "array", ARGTYPE_ARRAY}, { "struct", ARGTYPE_STRUCT}, { "enum", ARGTYPE_ENUM}, { - "ignore", ARGTYPE_IGNORE}, { NULL, ARGTYPE_UNKNOWN} /* Must finish with NULL */ }; @@ -71,7 +70,6 @@ static arg_type_info arg_type_prototypes { ARGTYPE_ARRAY }, { ARGTYPE_ENUM }, { ARGTYPE_STRUCT }, - { ARGTYPE_IGNORE }, { ARGTYPE_POINTER }, { ARGTYPE_UNKNOWN } }; @@ -590,7 +588,7 @@ static struct function *process_line(cha eat_spaces(&str); fun.return_info = parse_type(&str); if (fun.return_info == NULL) - return NULL; + return NULL; if (fun.return_info->type == ARGTYPE_UNKNOWN) { debug(3, " Skipping line %d", line_no); return NULL; @@ -661,13 +659,13 @@ void read_config_file(char *file) char buf[1024]; filename = file; - - debug(1, "Reading config file `%s'...", filename); - stream = fopen(filename, "r"); if (!stream) { return; } + + debug(1, "Reading config file `%s'...", filename); + line_no = 0; while (fgets(buf, 1024, stream)) { struct function *tmp; Index: options.h =================================================================== --- options.h (revision 78) +++ options.h (revision 79) @@ -21,6 +21,7 @@ extern int opt_t; /* print absolute tim extern int opt_C; /* Demanglelow-level symbol names into user-level names */ extern int opt_n; /* indent trace output according to program flow */ extern int opt_T; /* show the time spent inside each call */ +extern int opt_o; /* output to a specific file */ struct opt_p_t { pid_t pid; Index: BUGS =================================================================== --- BUGS (revision 78) +++ BUGS (revision 79) @@ -1,5 +1,5 @@ * Option -f sometimes fails to trace some children * Manual page is not accurate (config files...) -* elf.c only supports elf32 binaries -* netscape sometimes dies with SIGSEGV (is this still true?) +* Doesn't work with threads +* Doesn't do inter-library calls (BP is in the executable's PLT) * It lacks support for several Linux archs, and many operating systems Index: display_args.c =================================================================== --- display_args.c (revision 78) +++ display_args.c (revision 79) @@ -176,12 +176,10 @@ int display_value(enum tof type, struct switch (info->type) { case ARGTYPE_VOID: return 0; - case ARGTYPE_IGNORE: - return 0; /* Empty gap between commas */ case ARGTYPE_INT: - return fprintf(output, "%d", (int) value); + return fprintf(output, "%d", (int) value); case ARGTYPE_UINT: - return fprintf(output, "%u", (unsigned) value); + return fprintf(output, "%u", (unsigned) value); case ARGTYPE_LONG: if (proc->mask_32bit) return fprintf(output, "%d", (int) value); Index: debug.c =================================================================== --- debug.c (revision 78) +++ debug.c (revision 79) @@ -31,52 +31,7 @@ debug_(int level, const char *file, int #include <stdlib.h> #include <sys/ptrace.h> -int xwrite(const char *string, size_t len) -{ - int rc = 0; - rc = write(1, string, len); - return rc; -} - -int xwrites(const char *string) -{ - size_t len = 0; - int rc = 0; - const char *tstring = string; - - while (*tstring++ != '\0') { - len++; - } - - if (len > 0) { - rc = xwrite(string, len); - } - - return rc; -} - -int xwritehexi(int i) -{ - int rc = 0; - char text[9]; - int j; - unsigned int temp = (unsigned int)i; - - for (j = 7; j >= 0; j--) { - char c; - c = (char)((temp & 0x0f) + '0'); - if (c > '9') { - c = (char)(c + ('a' - '9' - 1)); - } - text[j] = c; - temp = temp >> 4; - } - - rc = write(1, text, 8); - return rc; -} - -int xwritehexl(long i) +static int xwritehexl(long i) { int rc = 0; char text[17]; @@ -97,7 +52,7 @@ int xwritehexl(long i) return rc; } -int xwritec(char c) +static int xwritec(char c) { char temp = c; char *text = &temp; @@ -106,12 +61,12 @@ int xwritec(char c) return rc; } -int xwritecr(void) +static int xwritecr(void) { return xwritec('\n'); } -int xwritedump(void *ptr, long addr, int len) +static int xwritedump(void *ptr, long addr, int len) { int rc = 0; long *tprt = (long *)ptr; Index: debug.h =================================================================== --- debug.h (revision 78) +++ debug.h (revision 79) @@ -3,13 +3,6 @@ void debug_(int level, const char *file, int line, const char *func, const char *fmt, ...) __attribute__((format(printf,5,6))); -int xwrite(const char *, size_t); -int xwrites(const char *); -int xwritehexi(int); -int xwritehexl(long); -int xwritec(char); -int xwritecr(void); -int xwritedump(void *, long, int); int xinfdump(long, void *, int); # define debug(level, expr...) debug_(level, __FILE__, __LINE__, DEBUG_FUNCTION, expr) Index: proc.c =================================================================== --- proc.c (revision 78) +++ proc.c (revision 79) @@ -56,6 +56,6 @@ void open_pid(pid_t pid, int verbose) #endif proc = open_program(filename, pid); - continue_process (pid); + continue_process(pid); proc->breakpoints_enabled = 1; } Index: ChangeLog =================================================================== --- ChangeLog (revision 78) +++ ChangeLog (revision 79) @@ -1,3 +1,19 @@ +2007-08-31 Juan Cespedes <cespedes@debian.org> + + * General: Small fixes (indentation, typos, clean-up of code) + * ltrace.c: Close output file on exit + * ltrace.c: use getenf("HOME") instead of getpwuid(geteuid())->pw_dir + * read_config_file.c, display_args.c: remove "ignore" argtype; + that's what "void" is for + * packaging/debian/: misc fixes, sync with version 0.5-2 + * etc/ltrace.conf: added more system calls + * testsuite/ltrace.minor/trace-clone.c: sleep(1) to avoid earlier + termination of process + * sysdeps/linux-gnu/trace.c: trace_pid(): reverted Petr's patch + to wait for child to stop, as it stopped following clone() + * process_event.c: Disable breakpoints before doing fork() (again!), + to make children work as expected + 2007-05-10 Petr Machata <pmachata@redhat.com> * Based on work of Supriya Kannery <supriyak@in.ibm.com> Index: testsuite/ltrace.main/parameters.c =================================================================== --- testsuite/ltrace.main/parameters.c (revision 78) +++ testsuite/ltrace.main/parameters.c (revision 79) @@ -12,7 +12,6 @@ #include <string.h> #include <stdlib.h> -void func_ignore(int a, int b, int c); void func_intptr(int *i); void func_intptr_ret(int *i); int func_strlen(char*); @@ -46,8 +45,6 @@ main () int *ai; float *af; - func_ignore(1, 2, 3); - func_intptr(&x); func_intptr_ret(&x); Index: testsuite/ltrace.main/parameters.conf =================================================================== --- testsuite/ltrace.main/parameters.conf (revision 78) +++ testsuite/ltrace.main/parameters.conf (revision 79) @@ -1,4 +1,3 @@ -void func_ignore(int,ignore,int) void func_intptr(int*) void func_intptr_ret(+int*) int func_strlen(+string[retval]) @@ -11,6 +10,6 @@ void func_ushort(ushort, ushort) void func_float(float,float) typedef color = enum (RED=0,GREEN=1,BLUE=2,CHARTREUSE=3,PETUNIA=4) void func_typedef(color) -void func_arrayi(array(int,arg2)*,ignore) -void func_arrayf(array(float,arg2)*,ignore) +void func_arrayi(array(int,arg2)*,void) +void func_arrayf(array(float,arg2)*,void) void func_struct(struct(int,int,int,array(struct(int,int),elt2)*,array(struct(int,int),3),string[elt3])*) Index: testsuite/ltrace.main/parameters.exp =================================================================== --- testsuite/ltrace.main/parameters.exp (revision 78) +++ testsuite/ltrace.main/parameters.exp (revision 79) @@ -36,8 +36,6 @@ if [regexp {ELF from incompatible archit } # Verify the output -set pattern "func_ignore(1, *, *3)" -ltrace_verify_output ${srcdir}/${subdir}/${testfile}.ltrace $pattern 1 set pattern "func_intptr(17)" ltrace_verify_output ${srcdir}/${subdir}/${testfile}.ltrace $pattern 1 set pattern "func_intptr_ret(42)" Index: testsuite/ltrace.minor/print-instruction-pointer.exp =================================================================== --- testsuite/ltrace.minor/print-instruction-pointer.exp (revision 78) +++ testsuite/ltrace.minor/print-instruction-pointer.exp (revision 79) @@ -13,7 +13,7 @@ if { [ltrace_compile "${srcdir}/${subdir # set options for ltrace. ltrace_options "-i" -# Run PUT for ltarce. +# Run PUT for ltrace. set exec_output [ltrace_runtest $srcdir/$subdir $srcdir/$subdir/$binfile] # Check the output of this program. Index: testsuite/ltrace.minor/trace-clone.exp =================================================================== --- testsuite/ltrace.minor/trace-clone.exp (revision 78) +++ testsuite/ltrace.minor/trace-clone.exp (revision 79) @@ -12,7 +12,7 @@ if { [ ltrace_compile "${srcdir}/${subd } global LTRACE -#Run PUT for ltarce. +#Run PUT for ltrace. spawn $LTRACE -f $srcdir/$subdir/$binfile set timeout 4 expect timeout { Index: testsuite/ltrace.minor/trace-fork.exp =================================================================== --- testsuite/ltrace.minor/trace-fork.exp (revision 78) +++ testsuite/ltrace.minor/trace-fork.exp (revision 79) @@ -13,7 +13,7 @@ if { [ ltrace_compile "${srcdir}/${subd global LTRACE set exec_output "" -#Run PUT for ltarce. +#Run PUT for ltrace. spawn $LTRACE -f $srcdir/$subdir/$binfile set timeout 4 expect timeout { Index: testsuite/ltrace.minor/time-record-tt.exp =================================================================== --- testsuite/ltrace.minor/time-record-tt.exp (revision 78) +++ testsuite/ltrace.minor/time-record-tt.exp (revision 79) @@ -13,7 +13,7 @@ if { [ ltrace_compile "${srcdir}/${subd # Set options for ltrace. ltrace_options "-tt" -# Run PUT for ltarce. +# Run PUT for ltrace. set exec_output [ltrace_runtest $srcdir/$subdir $srcdir/$subdir/$binfile] # Check the output of this program. Index: testsuite/ltrace.minor/count-record.exp =================================================================== --- testsuite/ltrace.minor/count-record.exp (revision 78) +++ testsuite/ltrace.minor/count-record.exp (revision 79) @@ -13,7 +13,7 @@ if { [ ltrace_compile "${srcdir}/${subd # set options for ltrace. ltrace_options "-c" -# Run PUT for ltarce. +# Run PUT for ltrace. set exec_output [ltrace_runtest $srcdir/$subdir $srcdir/$subdir/$binfile] # Check the output of this program. Index: testsuite/ltrace.minor/time-record-T.exp =================================================================== --- testsuite/ltrace.minor/time-record-T.exp (revision 78) +++ testsuite/ltrace.minor/time-record-T.exp (revision 79) @@ -13,7 +13,7 @@ if { [ ltrace_compile "${srcdir}/${subd # set options for ltrace. ltrace_options "-T" -# Run PUT for ltarce. +# Run PUT for ltrace. set exec_output [ltrace_runtest $srcdir/$subdir $srcdir/$subdir/$binfile] verbose "ltrace runtest output: $exec_output\n" Index: testsuite/ltrace.minor/demangle.exp =================================================================== --- testsuite/ltrace.minor/demangle.exp (revision 78) +++ testsuite/ltrace.minor/demangle.exp (revision 79) @@ -21,7 +21,7 @@ if { [ltrace_compile_shlib $libsrc $lib_ # set options for ltrace. ltrace_options "-C" -# Run PUT for ltarce. +# Run PUT for ltrace. set exec_output [ltrace_runtest $srcdir/$subdir $srcdir/$subdir/$binfile] # Check the output of this program. Index: testsuite/ltrace.minor/attach-process.exp =================================================================== --- testsuite/ltrace.minor/attach-process.exp (revision 78) +++ testsuite/ltrace.minor/attach-process.exp (revision 79) @@ -17,7 +17,7 @@ catch "exec $srcdir/$subdir/$binfile &" regexp {([0-9]+)} $output match PID verbose "PID = $PID" -# Run PUT for ltarce. +# Run PUT for ltrace. global LTRACE catch "exec $LTRACE -S -p $PID -o ${srcdir}/${subdir}/${testfile}.ltrace" exec_output Index: testsuite/ltrace.minor/trace-exec.exp =================================================================== --- testsuite/ltrace.minor/trace-exec.exp (revision 78) +++ testsuite/ltrace.minor/trace-exec.exp (revision 79) @@ -15,15 +15,15 @@ if { [ ltrace_compile "${srcdir}/${subd global LTRACE set exec_output "" -#Run PUT for ltarce. -spawn $LTRACE -f $srcdir/$subdir/$testfile $srcdir/$subdir/${testfile}1 +#Run PUT for ltrace. +spawn $LTRACE $srcdir/$subdir/$testfile $srcdir/$subdir/${testfile}1 set timeout 4 expect timeout { fail "Time out! Maybe caused by ltrace segment fault or improper timeout value here!" return } -catch "exec $LTRACE -f $srcdir/$subdir/$testfile $srcdir/$subdir/${testfile}1" exec_output +catch "exec $LTRACE $srcdir/$subdir/$testfile $srcdir/$subdir/${testfile}1" exec_output #check the output of this program. verbose "ltrace runtest output: $exec_output\n" Index: testsuite/ltrace.minor/trace-clone.c =================================================================== --- testsuite/ltrace.minor/trace-clone.c (revision 78) +++ testsuite/ltrace.minor/trace-clone.c (revision 79) @@ -11,6 +11,7 @@ int child () { + sleep(1); return 0; } Index: testsuite/ltrace.minor/time-record-ttt.exp =================================================================== --- testsuite/ltrace.minor/time-record-ttt.exp (revision 78) +++ testsuite/ltrace.minor/time-record-ttt.exp (revision 79) @@ -13,7 +13,7 @@ if { [ ltrace_compile "${srcdir}/${subd # Set options for ltrace. ltrace_options "-ttt" -# Run PUT for ltarce. +# Run PUT for ltrace. set exec_output [ltrace_runtest $srcdir/$subdir $srcdir/$subdir/$binfile] Index: sysdeps/linux-gnu/trace.c =================================================================== --- sysdeps/linux-gnu/trace.c (revision 78) +++ sysdeps/linux-gnu/trace.c (revision 79) @@ -150,15 +150,6 @@ int trace_pid(pid_t pid) 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: ltrace.c =================================================================== --- ltrace.c (revision 78) +++ ltrace.c (revision 79) @@ -5,7 +5,6 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> -#include <pwd.h> #include <string.h> #include <errno.h> #include <sys/param.h> @@ -37,7 +36,8 @@ static void signal_alarm(int sig) if (!tmp) { return; } - break; + tmp2 = opt_p; + continue; } tmp2 = tmp2->next; } @@ -51,6 +51,10 @@ static void signal_exit(int sig) { exiting = 1; debug(1, "Received interrupt signal; exiting..."); + if (opt_o) { + fclose(output); + opt_o = 0; + } signal(SIGINT, SIG_IGN); signal(SIGTERM, SIG_IGN); signal(SIGALRM, signal_alarm); @@ -71,6 +75,9 @@ static void normal_exit(void) if (opt_c) { show_summary(); } + if (opt_o) { + fclose(output); + } } static void guess_cols(void) @@ -102,24 +109,24 @@ int main(int argc, char **argv) guess_cols(); argv = process_options(argc, argv); - while (opt_F) { - /* If filename begins with ~, expand it to the user's home */ - /* directory. This does not correctly handle ~yoda, but that */ - /* isn't as bad as it seems because the shell will normally */ - /* be doing the expansion for us; only the hardcoded */ - /* ~/.ltrace.conf should ever use this code. */ - if (opt_F->filename[0] == '~') { - char path[PATH_MAX]; - char *home_dir = getpwuid(geteuid())->pw_dir; - strncpy(path, home_dir, PATH_MAX - 1); - path[PATH_MAX - 1] = '\0'; - strncat(path, opt_F->filename + 1, - PATH_MAX - strlen(path) - 1); - read_config_file(path); - } else { - read_config_file(opt_F->filename); - } - opt_F = opt_F->next; + while (opt_F) { + /* If filename begins with ~, expand it to the user's home */ + /* directory. This does not correctly handle ~yoda, but that */ + /* isn't as bad as it seems because the shell will normally */ + /* be doing the expansion for us; only the hardcoded */ + /* ~/.ltrace.conf should ever use this code. */ + if (opt_F->filename[0] == '~') { + char path[PATH_MAX]; + char *home_dir = getenv("HOME"); + strncpy(path, home_dir, PATH_MAX - 1); + path[PATH_MAX - 1] = '\0'; + strncat(path, opt_F->filename + 1, + PATH_MAX - strlen(path) - 1); + read_config_file(path); + } else { + read_config_file(opt_F->filename); + } + opt_F = opt_F->next; } if (opt_e) { struct opt_e_t *tmp = opt_e; Index: ltrace.h =================================================================== --- ltrace.h (revision 78) +++ ltrace.h (revision 79) @@ -46,59 +46,58 @@ enum arg_type { ARGTYPE_FORMAT, /* printf-like format */ ARGTYPE_STRING, /* NUL-terminated string */ ARGTYPE_STRING_N, /* String of known maxlen */ - ARGTYPE_ARRAY, /* Series of values in memory */ - ARGTYPE_ENUM, /* Enumeration */ - ARGTYPE_STRUCT, /* Structure of values */ - ARGTYPE_IGNORE, /* Leave parameter blank */ - ARGTYPE_POINTER, /* Pointer to some other type */ - ARGTYPE_COUNT /* number of ARGTYPE_* values */ + ARGTYPE_ARRAY, /* Series of values in memory */ + ARGTYPE_ENUM, /* Enumeration */ + ARGTYPE_STRUCT, /* Structure of values */ + ARGTYPE_POINTER, /* Pointer to some other type */ + ARGTYPE_COUNT /* number of ARGTYPE_* values */ }; typedef struct arg_type_info_t { - enum arg_type type; - int arg_num; - union { - // ARGTYPE_ENUM - struct { - size_t entries; - char **keys; - int *values; - } enum_info; - - // ARGTYPE_ARRAY - struct { - struct arg_type_info_t *elt_type; - size_t elt_size; - int len_spec; - } array_info; - - // ARGTYPE_STRING_N - struct { - int size_spec; - } string_n_info; - - // ARGTYPE_STRUCT - struct { - struct arg_type_info_t **fields; // NULL-terminated - size_t *offset; - size_t size; - } struct_info; - - // ARGTYPE_POINTER - struct { - struct arg_type_info_t *info; - } ptr_info; - - // ARGTYPE_FLOAT - struct { - size_t float_index; - } float_info; - - // ARGTYPE_DOUBLE - struct { - size_t float_index; - } double_info; - } u; + enum arg_type type; + int arg_num; + union { + // ARGTYPE_ENUM + struct { + size_t entries; + char **keys; + int *values; + } enum_info; + + // ARGTYPE_ARRAY + struct { + struct arg_type_info_t *elt_type; + size_t elt_size; + int len_spec; + } array_info; + + // ARGTYPE_STRING_N + struct { + int size_spec; + } string_n_info; + + // ARGTYPE_STRUCT + struct { + struct arg_type_info_t **fields; // NULL-terminated + size_t *offset; + size_t size; + } struct_info; + + // ARGTYPE_POINTER + struct { + struct arg_type_info_t *info; + } ptr_info; + + // ARGTYPE_FLOAT + struct { + size_t float_index; + } float_info; + + // ARGTYPE_DOUBLE + struct { + size_t float_index; + } double_info; + } u; } arg_type_info; enum tof { Index: process_event.c =================================================================== --- process_event.c (revision 78) +++ process_event.c (revision 79) @@ -185,7 +185,9 @@ static void process_syscall(struct event output_left(LT_TOF_SYSCALL, event->proc, sysname(event->proc, event->e_un.sysnum)); } - if (event->proc->breakpoints_enabled == 0) { + if (fork_p(event->proc, event->e_un.sysnum)) { + disable_all_breakpoints(event->proc); + } else if (event->proc->breakpoints_enabled == 0) { enable_all_breakpoints(event->proc); } callstack_push_syscall(event->proc, event->e_un.sysnum); Index: TODO =================================================================== --- TODO (revision 78) +++ TODO (revision 79) @@ -4,18 +4,15 @@ + Read list of undefined symbols in executables + Read list of exported symbols in libraries + Read debugging info from executables/libraries -* Update list of syscalls automatically? +* Automatically update list of syscalls? * Improve documentation -* Improve -e option +* Improve -e/-x options (regexp?) * Improve -l option * Improve C++ name demangling * Display different argument types: + how to display execl...? + format+: for scanf()...: display args as pointers, and imply `+' for args * Update /etc/ltrace.conf -* netscape: - + Why does it show so many `breakpointed at:' messages? - \- Is this still true? * More architectures: sparc64... * More operating systems (solaris?) * Option -I (inter-library calls) Index: ltrace.1 =================================================================== --- ltrace.1 (revision 78) +++ ltrace.1 (revision 79) @@ -80,7 +80,7 @@ Print the instruction pointer at the tim .I \-l, \-\-library filename Display only the symbols included in the library .I filename. -Up to 20 library names can be specified with several instances +Up to 30 library names can be specified with several instances of this option. .TP .I \-L Index: etc/ltrace.conf =================================================================== --- etc/ltrace.conf (revision 78) +++ etc/ltrace.conf (revision 79) @@ -25,7 +25,6 @@ ; string[retval] == (char *) [show only up to (return val) bytes] ; string[arg0] == (char *) [same as string[retval]] ; string[N] == (char *) [N>0] [show only up to N bytes] -; ignore == (any) [ignore arg, output blank] ; type* == (type *) [pointer to any other type] ; enum (key=value,key=value,...) [enumeration, see below] ; array(type,argN) @@ -525,3 +524,81 @@ int SYS_flistxattr(int,addr,uint); int SYS_removexattr(string,string); int SYS_lremovexattr(string,string); int SYS_fremovexattr(int,string); +int SYS_chdir(string); +int SYS_fchdir(int); +int SYS_chmod(string,octal); +int SYS_fchmod(int,octal); +int SYS_chown(string,int,int); +int SYS_fchown(int,int,int); +int SYS_lchown(string,int,int); +int SYS_chroot(string); +int SYS_dup(int); +int SYS_dup2(int,int); +int SYS_fdatasync(int); +int SYS_fsync(int); +int SYS_getpriority(int,int); +int SYS_setpriority(int,int,int); +int SYS_getrlimit(int,addr); +int SYS_setrlimit(int,addr); +int SYS_gettimeofday(addr,addr); +int SYS_settimeofday(addr,addr); +int SYS_setfsgid(int); +int SYS_setfsuid(int); +int SYS_getuid(void); +int SYS_setuid(int); +int SYS_getgid(void); +int SYS_setgid(int); +int SYS_getsid(int); +int SYS_setsid(int); +int SYS_setreuid(int,int); +int SYS_setregid(int,int); +int SYS_geteuid(void); +int SYS_getegid(void); +int SYS_setpgid(int,int); +int SYS_getresuid(addr,addr,addr); +int SYS_setresuid(int,int,int); +int SYS_getresgid(addr,addr,addr); +int SYS_setresgid(int,int,int); +int SYS_kill(int,int); +int SYS_link(string,string); +int SYS_madvise(addr,ulong,int); +int SYS_mkdir(string,octal); +int SYS_mknod(string,octal,int); +int SYS_msync(addr,ulong,int); +int SYS_nice(int); +int SYS_poll(addr,uint,int); +int SYS_readdir(uint,addr,uint); +int SYS_readlink(string,string,ulong); +int SYS_reboot(int,int,int,addr); +int SYS_rename(string,string); +int SYS_rmdir(string); +int SYS_sigaltstack(addr,addr); +int SYS_statfs(string,addr); +int SYS_fstatfs(int,addr); +int SYS_fstat(int,addr); +int SYS_lstat(string,addr); +int SYS_stime(addr); +int SYS_symlink(string, string); +int SYS_sysinfo(addr); +int SYS_syslog(int,string,int); +int SYS_truncate(string,long); +int SYS_ftruncate(int,long); +int SYS_mount(string,string,string,ulong,addr); +int SYS_umount(string); +int SYS_umount2(string,int); +int SYS_unlink(string); +int SYS_utime(string,addr); +long SYS_lseek(int,long,int); +addr SYS_signal(int,addr); +int SYS_sigaction(int,addr,addr); +int SYS_pause(void); +int SYS_sigpending(addr); +int SYS_sigprocmask(int,addr,addr); +int SYS_sigqueue(int,int,addr); +int SYS_sigsuspend(addr); +int SYS_wait(addr); +int SYS_waitpid(int,addr,int); +ulong SYS_readv(int,addr,int); +ulong SYS_writev(int,addr,int); +int SYS_mprotect(addr,int,int); +int SYS_access(string,octal); Index: options.c =================================================================== --- options.c (revision 78) +++ options.c (revision 79) @@ -29,12 +29,12 @@ char *library[MAX_LIBRARY]; int library_num = 0; static char *progname; /* Program name (`ltrace') */ FILE *output; -int opt_a = DEFAULT_ACOLUMN; /* default alignment column for results */ -int opt_A = DEFAULT_ARRAYLEN; /* default maximum # array elements to print */ -int opt_c = 0; /* Count time, calls, and report a summary on program exit */ +int opt_a = DEFAULT_ACOLUMN; /* alignment column for results */ +int opt_A = DEFAULT_ARRAYLEN; /* maximum # array elements to print */ +int opt_c = 0; /* Report a summary on program exit */ int opt_d = 0; /* debug */ int opt_i = 0; /* instruction pointer */ -int opt_s = DEFAULT_STRLEN; /* default maximum # of bytes printed in strings */ +int opt_s = DEFAULT_STRLEN; /* maximum # of bytes printed in strings */ int opt_S = 0; /* display syscalls */ int opt_L = 1; /* display library calls */ int opt_f = 0; /* trace child processes as they are created */ @@ -42,10 +42,11 @@ char *opt_u = NULL; /* username to run int opt_r = 0; /* print relative timestamp */ int opt_t = 0; /* print absolute timestamp */ #ifdef USE_DEMANGLE -int opt_C = 0; /* Demangle low-level symbol names into user-level names */ +int opt_C = 0; /* Demangle low-level symbol names */ #endif -int opt_n = 0; /* indent trace output according to program flow */ +int opt_n = 0; /* indent output according to program flow */ int opt_T = 0; /* show the time spent inside each call */ +int opt_o = 0; /* output to a specific file */ /* List of pids given to option -p: */ struct opt_p_t *opt_p = NULL; /* attach to process with a given pid */ @@ -79,7 +80,7 @@ static void usage(void) # else " -a COLUMN align return values in a secific column.\n" # endif - " -A ARRAYLEN maximum number of array elements to print.\n" + " -A ARRAYLEN maximum number of array elements to print.\n" " -c count time and calls, and report a summary on exit.\n" # ifdef USE_DEMANGLE # if HAVE_GETOPT_LONG @@ -96,11 +97,11 @@ static void usage(void) " -e expr modify which events to trace.\n" " -f follow forks.\n" # if HAVE_GETOPT_LONG - " -F, --config=FILE load alternate configuration file\n" + " -F, --config=FILE load alternate configuration file\n" # else - " -F FILE load alternate configuration file\n" + " -F FILE load alternate configuration file\n" # endif - " (can be repeated).\n" + " (can be repeated).\n" # if HAVE_GETOPT_LONG " -h, --help display this help and exit.\n" # else @@ -188,7 +189,7 @@ char **process_options(int argc, char ** int option_index = 0; static struct option long_options[] = { {"align", 1, 0, 'a'}, - {"config", 1, 0, 'F'}, + {"config", 1, 0, 'F'}, {"debug", 0, 0, 'd'}, # ifdef USE_DEMANGLE {"demangle", 0, 0, 'C'}, @@ -209,9 +210,9 @@ char **process_options(int argc, char ** #else c = getopt(argc, argv, "+cdfhiLrStTV" # ifdef USE_DEMANGLE - "C" + "C" # endif - "a:A:e:F:l:n:o:p:s:u:x:X:"); + "a:A:e:F:l:n:o:p:s:u:x:X:"); #endif if (c == -1) { break; @@ -220,7 +221,7 @@ char **process_options(int argc, char ** case 'a': opt_a = atoi(optarg); break; - case 'A': + case 'A': opt_A = atoi(optarg); break; case 'c': @@ -270,18 +271,18 @@ char **process_options(int argc, char ** case 'f': opt_f = 1; break; - case 'F': - { - struct opt_F_t *tmp = malloc(sizeof(struct opt_F_t)); - if (!tmp) { - perror("ltrace: malloc"); - exit(1); - } - tmp->filename = strdup(optarg); - tmp->next = opt_F; - opt_F = tmp; - break; - } + case 'F': + { + struct opt_F_t *tmp = malloc(sizeof(struct opt_F_t)); + if (!tmp) { + perror("ltrace: malloc"); + exit(1); + } + tmp->filename = strdup(optarg); + tmp->next = opt_F; + opt_F = tmp; + break; + } case 'h': usage(); exit(0); @@ -304,6 +305,7 @@ char **process_options(int argc, char ** opt_n = atoi(optarg); break; case 'o': + opt_o++; output = fopen(optarg, "w"); if (!output) { fprintf(stderr, @@ -316,8 +318,7 @@ char **process_options(int argc, char ** break; case 'p': { - struct opt_p_t *tmp = - malloc(sizeof(struct opt_p_t)); + struct opt_p_t *tmp = malloc(sizeof(struct opt_p_t)); if (!tmp) { perror("ltrace: malloc"); exit(1); @@ -347,15 +348,15 @@ char **process_options(int argc, char ** break; case 'V': printf("ltrace version " PACKAGE_VERSION ".\n" - "Copyright (C) 1997-2006 Juan Cespedes <cespedes@debian.org>.\n" - "This is free software; see the GNU General Public Licence\n" - "version 2 or later for copying conditions. There is NO warranty.\n"); + "Copyright (C) 1997-2007 Juan Cespedes <cespedes@debian.org>.\n" + "This is free software; see the GNU General Public Licence\n" + "version 2 or later for copying conditions. There is NO warranty.\n"); exit(0); case 'X': #ifdef PLT_REINITALISATION_BP PLTs_initialized_by_here = optarg; #else - fprintf(stderr, "WANRING: \"-X\" not used for this " + fprintf(stderr, "WARNING: \"-X\" not used for this " "architecture: assuming you meant \"-x\"\n"); #endif /* Fall Thru */ @@ -401,27 +402,27 @@ char **process_options(int argc, char ** argv += optind; #endif - if (!opt_F) { - opt_F = malloc(sizeof(struct opt_F_t)); - opt_F->next = malloc(sizeof(struct opt_F_t)); - opt_F->next->next = NULL; - opt_F->filename = USER_CONFIG_FILE; - opt_F->next->filename = SYSTEM_CONFIG_FILE; - } + if (!opt_F) { + opt_F = malloc(sizeof(struct opt_F_t)); + opt_F->next = malloc(sizeof(struct opt_F_t)); + opt_F->next->next = NULL; + opt_F->filename = USER_CONFIG_FILE; + opt_F->next->filename = SYSTEM_CONFIG_FILE; + } /* Reverse the config file list since it was built by * prepending, and it would make more sense to process the * files in the order they were given. Probably it would make * more sense to keep a tail pointer instead? */ { - struct opt_F_t *egg = NULL; - struct opt_F_t *chicken; - while (opt_F) { - chicken = opt_F->next; - opt_F->next = egg; - egg = opt_F; - opt_F = chicken; - } - opt_F = egg; + struct opt_F_t *egg = NULL; + struct opt_F_t *chicken; + while (opt_F) { + chicken = opt_F->next; + opt_F->next = egg; + egg = opt_F; + opt_F = chicken; + } + opt_F = egg; } if (!opt_p && argc < 1) {
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