Hello community, here is the log from the commit of package ltrace checked in at Wed Apr 18 00:39:59 CEST 2007. -------- --- ltrace/ltrace.changes 2007-01-26 12:04:00.000000000 +0100 +++ /mounts/work_src_done/STABLE/ltrace/ltrace.changes 2007-04-17 22:39:49.000000000 +0200 @@ -1,0 +2,5 @@ +Tue Apr 17 22:39:40 CEST 2007 - schwab@suse.de + +- Fix argument decoding. + +------------------------------------------------------------------- New: ---- ltrace.decode-args.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ltrace.spec ++++++ --- /var/tmp/diff_new_pack.X31609/_old 2007-04-18 00:39:50.000000000 +0200 +++ /var/tmp/diff_new_pack.X31609/_new 2007-04-18 00:39:50.000000000 +0200 @@ -19,7 +19,7 @@ Autoreqprov: on Summary: Trace the Library and System Calls a Program Makes Version: 0.4 -Release: 33 +Release: 42 BuildRoot: %{_tmppath}/%{name}-%{version}-build ExclusiveArch: %ix86 sparc s390 s390x ppc ppc64 armv4l x86_64 alpha ia64 Prefix: /usr @@ -72,6 +72,7 @@ # Patch203: ltrace.trace_exec.patch Patch204: ltrace.ppc32-c-option.patch +Patch205: ltrace.decode-args.patch %description Ltrace is a program that runs the specified command until it exits. It @@ -141,6 +142,7 @@ # %patch203 -p1 %patch204 -p1 +%patch205 %build autoreconf -fi @@ -181,7 +183,9 @@ %{_mandir}/man1/ltrace.1.gz %config /etc/ltrace.conf -%changelog -n ltrace +%changelog +* Tue Apr 17 2007 - schwab@suse.de +- Fix argument decoding. * Fri Jan 26 2007 - olh@suse.de - update to ltrace mainline r75 fix -p behavior: wait for process to stop after PTRACE_ATTACH ++++++ ltrace.decode-args.patch ++++++ --- display_args.c | 40 ++++++++++++++++++++++++--------------- ltrace.h | 7 +++--- output.c | 21 +++++++------------- process_event.c | 3 -- read_config_file.c | 2 - sysdeps/linux-gnu/alpha/trace.c | 4 --- sysdeps/linux-gnu/arm/trace.c | 4 --- sysdeps/linux-gnu/i386/trace.c | 4 --- sysdeps/linux-gnu/ia64/trace.c | 3 -- sysdeps/linux-gnu/m68k/trace.c | 4 --- sysdeps/linux-gnu/ppc/trace.c | 4 --- sysdeps/linux-gnu/s390/trace.c | 3 -- sysdeps/linux-gnu/sparc/trace.c | 4 --- sysdeps/linux-gnu/x86_64/trace.c | 4 --- 14 files changed, 47 insertions(+), 60 deletions(-) Index: display_args.c =================================================================== --- display_args.c.orig 2007-04-17 22:37:15.000000000 +0200 +++ display_args.c 2007-04-17 22:37:15.000000000 +0200 @@ -36,9 +36,8 @@ static long get_length(enum tof type, st return len; } - info.arg_num = -len_spec - 1; info.type = ARGTYPE_INT; - return gimme_arg(type, proc, &info); + return gimme_arg(type, proc, -len_spec - 1, &info); } static int display_ptrto(enum tof type, struct process *proc, long item, @@ -243,16 +242,16 @@ int display_value(enum tof type, struct } } -int display_arg(enum tof type, struct process *proc, arg_type_info * info) +int display_arg(enum tof type, struct process *proc, int arg_num, arg_type_info * info) { long arg; if (info->type == ARGTYPE_VOID) { return 0; } else if (info->type == ARGTYPE_FORMAT) { - return display_format(type, proc, info->arg_num); + return display_format(type, proc, arg_num); } else { - arg = gimme_arg(type, proc, info); + arg = gimme_arg(type, proc, arg_num, info); return display_value(type, proc, arg, info, NULL, NULL); } } @@ -337,9 +336,8 @@ static int display_format(enum tof type, int len = 0; arg_type_info info; - info.arg_num = arg_num; info.type = ARGTYPE_POINTER; - addr = (void *)gimme_arg(type, proc, &info); + addr = (void *)gimme_arg(type, proc, arg_num, &info); if (!addr) { return fprintf(output, "NULL"); } @@ -382,67 +380,75 @@ static int display_format(enum tof type, break; } } else if (c == 'd' || c == 'i') { - info.arg_num = ++arg_num; + ++arg_num; info.type = ARGTYPE_LONG; if (!is_long || proc->mask_32bit) len += fprintf(output, ", %d", (int)gimme_arg(type, proc, + arg_num, &info)); else len += fprintf(output, ", %ld", gimme_arg(type, proc, + arg_num, &info)); break; } else if (c == 'u') { - info.arg_num = ++arg_num; + ++arg_num; info.type = ARGTYPE_LONG; if (!is_long || proc->mask_32bit) len += fprintf(output, ", %u", (int)gimme_arg(type, proc, + arg_num, &info)); else len += fprintf(output, ", %lu", gimme_arg(type, proc, + arg_num, &info)); break; } else if (c == 'o') { - info.arg_num = ++arg_num; + ++arg_num; info.type = ARGTYPE_LONG; if (!is_long || proc->mask_32bit) len += fprintf(output, ", 0%o", (int)gimme_arg(type, proc, + arg_num, &info)); else len += fprintf(output, ", 0%lo", gimme_arg(type, proc, + arg_num, &info)); break; } else if (c == 'x' || c == 'X') { - info.arg_num = ++arg_num; + ++arg_num; info.type = ARGTYPE_LONG; if (!is_long || proc->mask_32bit) len += fprintf(output, ", %#x", (int)gimme_arg(type, proc, + arg_num, &info)); else len += fprintf(output, ", %#lx", gimme_arg(type, proc, + arg_num, &info)); break; } else if (strchr("eEfFgGaACS", c) @@ -452,41 +458,45 @@ static int display_format(enum tof type, str1[i + 1] = '\0'; break; } else if (c == 'c') { - info.arg_num = ++arg_num; + ++arg_num; info.type = ARGTYPE_LONG; len += fprintf(output, ", '"); len += display_char((int) gimme_arg(type, proc, + arg_num, &info)); len += fprintf(output, "'"); break; } else if (c == 's') { - info.arg_num = ++arg_num; + ++arg_num; info.type = ARGTYPE_POINTER; len += fprintf(output, ", "); len += display_string(type, proc, (void *)gimme_arg(type, proc, + arg_num, &info), string_maxlength); break; } else if (c == 'p' || c == 'n') { - info.arg_num = ++arg_num; + ++arg_num; info.type = ARGTYPE_POINTER; len += fprintf(output, ", %p", (void *)gimme_arg(type, proc, + arg_num, &info)); break; } else if (c == '*') { - info.arg_num = ++arg_num; + ++arg_num; info.type = ARGTYPE_LONG; len += fprintf(output, ", %d", (int)gimme_arg(type, proc, + arg_num, &info)); } } Index: ltrace.h =================================================================== --- ltrace.h.orig 2007-04-17 22:37:15.000000000 +0200 +++ ltrace.h 2007-04-17 22:38:20.000000000 +0200 @@ -56,7 +56,6 @@ enum arg_type { typedef struct arg_type_info_t { enum arg_type type; - int arg_num; union { // ARGTYPE_ENUM struct { @@ -212,7 +211,8 @@ extern void *instruction_pointer; extern struct event *wait_for_something(void); extern void process_event(struct event *event); extern void execute_program(struct process *, char **); -extern int display_arg(enum tof type, struct process *proc, arg_type_info *info); +extern int display_arg(enum tof type, struct process *proc, int arg_num, + arg_type_info *info); extern struct breakpoint *address2bpstruct(struct process *proc, void *addr); extern void breakpoints_init(struct process *proc); extern void insert_breakpoint(struct process *proc, void *addr, @@ -248,7 +248,8 @@ extern void continue_after_signal(pid_t extern void continue_after_breakpoint(struct process *proc, struct breakpoint *sbp); extern void continue_enabling_breakpoint(pid_t pid, struct breakpoint *sbp); -extern long gimme_arg(enum tof type, struct process *proc, arg_type_info *); +extern long gimme_arg(enum tof type, struct process *proc, int arg_num, + arg_type_info *); extern void save_register_args(enum tof type, struct process *proc); extern int umovestr(struct process *proc, void *addr, int len, void *laddr); extern int umovelong(struct process *proc, void *addr, long *result); Index: output.c =================================================================== --- output.c.orig 2007-04-17 22:37:15.000000000 +0200 +++ output.c 2007-04-17 22:37:15.000000000 +0200 @@ -191,26 +191,23 @@ void output_left(enum tof type, struct p func = name2func(function_name); if (!func) { int i; - arg_type_info info = *arg_unknown; for (i = 0; i < 4; i++) { - info.arg_num = i; current_column += - display_arg(type, proc, &info); + display_arg(type, proc, i, arg_unknown); current_column += fprintf(output, ", "); } - info.arg_num = 4; - current_column += display_arg(type, proc, &info); + current_column += display_arg(type, proc, 4, arg_unknown); return; } else { int i; for (i = 0; i < func->num_params - func->params_right - 1; i++) { current_column += - display_arg(type, proc, func->arg_info[i]); + display_arg(type, proc, i, func->arg_info[i]); current_column += fprintf(output, ", "); } if (func->num_params > func->params_right) { current_column += - display_arg(type, proc, func->arg_info[i]); + display_arg(type, proc, i, func->arg_info[i]); if (func->params_right) { current_column += fprintf(output, ", "); } @@ -279,23 +276,21 @@ void output_right(enum tof type, struct } if (!func) { - arg_type_info info = *arg_unknown; current_column += fprintf(output, ") "); tabto(opt_a - 1); fprintf(output, "= "); - info.arg_num = -1; - display_arg(type, proc, &info); + display_arg(type, proc, -1, arg_unknown); } else { int i; for (i = func->num_params - func->params_right; i < func->num_params - 1; i++) { current_column += - display_arg(type, proc, func->arg_info[i]); + display_arg(type, proc, i, func->arg_info[i]); current_column += fprintf(output, ", "); } if (func->params_right) { current_column += - display_arg(type, proc, func->arg_info[i]); + display_arg(type, proc, i, func->arg_info[i]); } current_column += fprintf(output, ") "); tabto(opt_a - 1); @@ -303,7 +298,7 @@ void output_right(enum tof type, struct if (func->return_info->type == ARGTYPE_VOID) { fprintf(output, "<void>"); } else { - display_arg(type, proc, func->return_info); + display_arg(type, proc, -1, func->return_info); } } if (opt_T) { Index: process_event.c =================================================================== --- process_event.c.orig 2007-04-17 22:37:15.000000000 +0200 +++ process_event.c 2007-04-17 22:37:15.000000000 +0200 @@ -226,10 +226,9 @@ static void process_sysret(struct event if (fork_p(event->proc, event->e_un.sysnum)) { if (opt_f) { arg_type_info info; - info.arg_num = -1; /* Return value */ info.type = ARGTYPE_LONG; pid_t child = - gimme_arg(LT_TOF_SYSCALLR, event->proc, &info); + gimme_arg(LT_TOF_SYSCALLR, event->proc, -1, &info); if (child > 0) { open_pid(child, 0); } Index: read_config_file.c =================================================================== --- read_config_file.c.orig 2007-04-17 22:37:15.000000000 +0200 +++ read_config_file.c 2007-04-17 22:40:23.000000000 +0200 @@ -595,7 +595,6 @@ static struct function *process_line(cha debug(3, " Skipping line %d", line_no); return NULL; } - fun.return_info->arg_num = -1; debug(4, " return_type = %d", fun.return_info->type); eat_spaces(&str); tmp = start_of_arg_sig(str); @@ -633,7 +632,6 @@ static struct function *process_line(cha fun.arg_info[i]->u.float_info.float_index = float_num++; else if (fun.arg_info[i]->type == ARGTYPE_DOUBLE) fun.arg_info[i]->u.double_info.float_index = float_num++; - fun.arg_info[i]->arg_num = i; eat_spaces(&str); if (*str == ',') { str++; Index: sysdeps/linux-gnu/alpha/trace.c =================================================================== --- sysdeps/linux-gnu/alpha/trace.c.orig 2007-04-17 22:37:15.000000000 +0200 +++ sysdeps/linux-gnu/alpha/trace.c 2007-04-17 22:37:15.000000000 +0200 @@ -47,10 +47,8 @@ int syscall_p(struct process *proc, int return 0; } -long gimme_arg(enum tof type, struct process *proc, arg_type_info *info) +long gimme_arg(enum tof type, struct process *proc, int arg_num, arg_type_info *info) { - int arg_num = info->arg_num; - if (arg_num == -1) { /* return value */ return ptrace(PTRACE_PEEKUSER, proc->pid, 0 /* REG_R0 */ , 0); } Index: sysdeps/linux-gnu/arm/trace.c =================================================================== --- sysdeps/linux-gnu/arm/trace.c.orig 2007-04-17 22:37:15.000000000 +0200 +++ sysdeps/linux-gnu/arm/trace.c 2007-04-17 22:37:15.000000000 +0200 @@ -51,10 +51,8 @@ int syscall_p(struct process *proc, int return 0; } -long gimme_arg(enum tof type, struct process *proc, arg_type_info *info) +long gimme_arg(enum tof type, struct process *proc, int arg_num, arg_type_info *info) { - int arg_num = info->arg_num; - if (arg_num == -1) { /* return value */ return ptrace(PTRACE_PEEKUSER, proc->pid, off_r0, 0); } Index: sysdeps/linux-gnu/i386/trace.c =================================================================== --- sysdeps/linux-gnu/i386/trace.c.orig 2007-04-17 22:37:15.000000000 +0200 +++ sysdeps/linux-gnu/i386/trace.c 2007-04-17 22:37:15.000000000 +0200 @@ -43,10 +43,8 @@ int syscall_p(struct process *proc, int return 0; } -long gimme_arg(enum tof type, struct process *proc, arg_type_info *info) +long gimme_arg(enum tof type, struct process *proc, int arg_num, arg_type_info *info) { - int arg_num = info->arg_num; - if (arg_num == -1) { /* return value */ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * EAX, 0); } Index: sysdeps/linux-gnu/ia64/trace.c =================================================================== --- sysdeps/linux-gnu/ia64/trace.c.orig 2007-04-17 22:37:15.000000000 +0200 +++ sysdeps/linux-gnu/ia64/trace.c 2007-04-17 22:37:15.000000000 +0200 @@ -245,9 +245,8 @@ static double gimme_float_arg(enum tof t exit(1); } -long gimme_arg(enum tof type, struct process *proc, arg_type_info *info) +long gimme_arg(enum tof type, struct process *proc, int arg_num, arg_type_info *info) { - int arg_num = info->arg_num; union { long l; float f; Index: sysdeps/linux-gnu/m68k/trace.c =================================================================== --- sysdeps/linux-gnu/m68k/trace.c.orig 2007-04-17 22:37:15.000000000 +0200 +++ sysdeps/linux-gnu/m68k/trace.c 2007-04-17 22:37:15.000000000 +0200 @@ -48,10 +48,8 @@ int syscall_p(struct process *proc, int return 0; } -long gimme_arg(enum tof type, struct process *proc, arg_type_info *info) +long gimme_arg(enum tof type, struct process *proc, int arg_num, arg_type_info *info) { - int arg_num = info->arg_num; - if (arg_num == -1) { /* return value */ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * PT_D0, 0); } Index: sysdeps/linux-gnu/ppc/trace.c =================================================================== --- sysdeps/linux-gnu/ppc/trace.c.orig 2007-04-17 22:37:15.000000000 +0200 +++ sysdeps/linux-gnu/ppc/trace.c 2007-04-17 22:37:15.000000000 +0200 @@ -56,10 +56,8 @@ int syscall_p(struct process *proc, int return 0; } -long gimme_arg(enum tof type, struct process *proc, arg_type_info *info) +long gimme_arg(enum tof type, struct process *proc, int arg_num, arg_type_info *info) { - int arg_num = info->arg_num; - if (arg_num == -1) { /* return value */ return ptrace(PTRACE_PEEKUSER, proc->pid, sizeof(long) * PT_R3, 0); Index: sysdeps/linux-gnu/s390/trace.c =================================================================== --- sysdeps/linux-gnu/s390/trace.c.orig 2007-04-17 22:37:15.000000000 +0200 +++ sysdeps/linux-gnu/s390/trace.c 2007-04-17 22:37:15.000000000 +0200 @@ -161,9 +161,8 @@ int syscall_p(struct process *proc, int return 0; } -long gimme_arg(enum tof type, struct process *proc, arg_type_info *info) +long gimme_arg(enum tof type, struct process *proc, int arg_num, arg_type_info *info) { - int arg_num = info->arg_num; long ret; switch (arg_num) { Index: sysdeps/linux-gnu/sparc/trace.c =================================================================== --- sysdeps/linux-gnu/sparc/trace.c.orig 2007-04-17 22:37:15.000000000 +0200 +++ sysdeps/linux-gnu/sparc/trace.c 2007-04-17 22:37:15.000000000 +0200 @@ -48,10 +48,8 @@ int syscall_p(struct process *proc, int return 0; } -long gimme_arg(enum tof type, struct process *proc, arg_type_info *info) +long gimme_arg(enum tof type, struct process *proc, int arg_num, arg_type_info *info) { - int arg_num = info->arg_num; - proc_archdep *a = (proc_archdep *) proc->arch_ptr; if (!a->valid) { fprintf(stderr, "Could not get child registers\n"); Index: sysdeps/linux-gnu/x86_64/trace.c =================================================================== --- sysdeps/linux-gnu/x86_64/trace.c.orig 2007-04-17 22:37:15.000000000 +0200 +++ sysdeps/linux-gnu/x86_64/trace.c 2007-04-17 22:37:15.000000000 +0200 @@ -86,10 +86,8 @@ gimme_arg32(enum tof type, struct proces exit(1); } -long gimme_arg(enum tof type, struct process *proc, arg_type_info *info) +long gimme_arg(enum tof type, struct process *proc, int arg_num, arg_type_info *info) { - int arg_num = info->arg_num; - if (proc->mask_32bit) return (unsigned int)gimme_arg32(type, proc, arg_num); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org