Hello community,
here is the log from the commit of package ltrace
checked in at Fri Feb 29 12:39:59 CET 2008.
--------
--- ltrace/ltrace.changes 2008-02-27 14:23:48.000000000 +0100
+++ /mounts/work_src_done/STABLE/ltrace/ltrace.changes 2008-02-29 11:50:25.000000000 +0100
@@ -1,0 +2,5 @@
+Fri Feb 29 11:48:51 CET 2008 - olh@suse.de
+
+- update last patch to not use global variables
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ltrace.spec ++++++
--- /var/tmp/diff_new_pack.K26691/_old 2008-02-29 12:39:11.000000000 +0100
+++ /var/tmp/diff_new_pack.K26691/_new 2008-02-29 12:39:11.000000000 +0100
@@ -25,7 +25,7 @@
AutoReqProv: on
Summary: Trace the Library and System Calls a Program Makes
Version: 0.4
-Release: 104
+Release: 106
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: %ix86 sparc s390 s390x ppc ppc64 armv4l x86_64 alpha ia64
Prefix: /usr
@@ -205,6 +205,8 @@
%config /etc/ltrace.conf
%changelog
+* Fri Feb 29 2008 olh@suse.de
+- update last patch to not use global variables
* Wed Feb 27 2008 olh@suse.de
- more complete powerpc ABI handling (bnc#364988 - LTC41151)
* Thu Jan 03 2008 olh@suse.de
++++++ ltrace.powerpc-ABI-support.patch ++++++
--- /var/tmp/diff_new_pack.K26691/_old 2008-02-29 12:39:11.000000000 +0100
+++ /var/tmp/diff_new_pack.K26691/_new 2008-02-29 12:39:11.000000000 +0100
@@ -1,6 +1,6 @@
Bug 364988 - LTC41151 - ltrace64 testcase (parameters.exp) fails in SLES10
-2008-02-25 Luis Machado
+2008-02-27 Luis Machado
* sysdeps/linux-gnu/ppc/trace.c (arch_umovelong): New function.
* sysdeps/linux-gnu/ppc/regs.c (get_instruction): New function.
@@ -15,42 +15,35 @@
---
display_args.c | 6 +-
ltrace.h | 2
- process_event.c | 34 ++++++++----
+ process_event.c | 28 +++++++----
sysdeps/linux-gnu/ppc/arch.h | 3 +
- sysdeps/linux-gnu/ppc/regs.c | 21 ++++++++
- sysdeps/linux-gnu/ppc/trace.c | 110 +++++++++++++++++++++++++++++++++++++-----
- sysdeps/linux-gnu/trace.c | 41 +++++++++------
- 7 files changed, 173 insertions(+), 44 deletions(-)
+ sysdeps/linux-gnu/ppc/regs.c | 7 ++
+ sysdeps/linux-gnu/ppc/trace.c | 103 +++++++++++++++++++++++++++++++++++++-----
+ sysdeps/linux-gnu/trace.c | 37 +++++++++------
+ 7 files changed, 148 insertions(+), 38 deletions(-)
--- a/display_args.c
+++ b/display_args.c
-@@ -32,7 +32,7 @@ static long get_length(enum tof type, st
+@@ -32,7 +32,8 @@ static long get_length(enum tof type, st
if (len_spec > 0)
return len_spec;
if (type == LT_TOF_STRUCT) {
- umovelong(proc, st + st_info->u.struct_info.offset[-len_spec-1], &len);
-+ umovelong (proc, st + st_info->u.struct_info.offset[-len_spec-1], &len, st_info->u.struct_info.fields[-len_spec-1]);
++ umovelong (proc, st + st_info->u.struct_info.offset[-len_spec-1],
++ &len, st_info->u.struct_info.fields[-len_spec-1]);
return len;
}
-@@ -135,7 +135,7 @@ static int display_pointer(enum tof type
+@@ -135,7 +136,8 @@ static int display_pointer(enum tof type
} else {
if (value == 0)
return fprintf(output, "NULL");
- else if (umovelong(proc, (void *) value, &pointed_to) < 0)
-+ else if (umovelong (proc, (void *) value, &pointed_to, info->u.ptr_info.info) < 0)
++ else if (umovelong (proc, (void *) value, &pointed_to,
++ info->u.ptr_info.info) < 0)
return fprintf(output, "?");
else
return display_value(type, proc, pointed_to, inner,
-@@ -178,7 +178,7 @@ int display_value(enum tof type, struct
- case ARGTYPE_INT:
- return fprintf(output, "%d", (int) value);
- case ARGTYPE_UINT:
-- return fprintf(output, "%u", (unsigned) value);
-+ return fprintf (output, "%u", (unsigned int) value);
- case ARGTYPE_LONG:
- if (proc->mask_32bit)
- return fprintf(output, "%d", (int) value);
--- a/ltrace.h
+++ b/ltrace.h
@@ -250,7 +250,7 @@ extern void continue_enabling_breakpoint
@@ -64,7 +57,7 @@
--- a/process_event.c
+++ b/process_event.c
-@@ -248,21 +248,31 @@ static void process_breakpoint(struct ev
+@@ -248,21 +248,29 @@ static void process_breakpoint(struct ev
struct breakpoint *sbp;
debug(2, "event: breakpoint (%p)", event->e_un.brk_addr);
@@ -80,29 +73,25 @@
- if (nxtbp != 0) {
- enable_breakpoint(event->proc->pid, sbp);
- continue_after_breakpoint(event->proc, nxtbp);
-- return;
-- }
-+ /* Need to skip following NOP's to prevent a fake function from being stacked. */
-+ long stub_addr = (long) get_count_register(event->proc);
-+ struct breakpoint *stub_bp = NULL;
-+ char nop_instruction[] = PPC_NOP;
-+
-+ stub_bp = address2bpstruct (event->proc, event->e_un.brk_addr);
-+
-+ if (stub_bp)
-+ {
-+ unsigned char *bp_instruction = stub_bp->orig_value;
-+
-+ if (memcmp(bp_instruction, nop_instruction, PPC_NOP_LENGTH) == 0)
-+ {
-+ if (stub_addr != (long) event->e_un.brk_addr)
-+ {
-+ set_instruction_pointer (event->proc, event->e_un.brk_addr + 4);
-+ continue_process(event->proc->pid);
-+ return;
++ /* Need to skip following NOP's to prevent a fake function from being stacked. */
++ long stub_addr = (long) get_count_register(event->proc);
++ struct breakpoint *stub_bp = NULL;
++ char nop_instruction[] = PPC_NOP;
++
++ stub_bp = address2bpstruct (event->proc, event->e_un.brk_addr);
++
++ if (stub_bp) {
++ unsigned char *bp_instruction = stub_bp->orig_value;
++
++ if (memcmp(bp_instruction, nop_instruction,
++ PPC_NOP_LENGTH) == 0) {
++ if (stub_addr != (long) event->e_un.brk_addr) {
++ set_instruction_pointer (event->proc, event->e_un.brk_addr + 4);
++ continue_process(event->proc->pid);
+ return;
+ }
}
-+ }
-+ }
++ }
#endif
+ if ((sbp = event->proc->breakpoint_being_enabled) != 0) {
/* Reinsert breakpoint */
@@ -122,7 +111,7 @@
--- a/sysdeps/linux-gnu/ppc/regs.c
+++ b/sysdeps/linux-gnu/ppc/regs.c
-@@ -38,3 +38,24 @@ void *get_return_addr(struct process *pr
+@@ -38,3 +38,10 @@ void *get_return_addr(struct process *pr
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, sizeof(long) * PT_LNK,
0);
}
@@ -130,23 +119,9 @@
+/* Grab the value of CTR registers. */
+void *get_count_register (struct process *proc)
+{
-+ return (void *) ptrace (PTRACE_PEEKUSER, proc->pid, sizeof (long) * PT_CTR, 0);
-+}
-+
-+/* Get instruction at address ADDR. */
-+void *get_instruction (struct process *proc, void *addr)
-+{
-+ long data;
-+
-+ data = ptrace (PTRACE_PEEKTEXT, proc->pid, addr,0);
-+
-+ if (proc->mask_32bit)
-+ data = (data >> 32) & 0x00000000ffffffff;
-+
-+ return (void *)data;
-+
++ return (void *) ptrace (PTRACE_PEEKUSER, proc->pid,
++ sizeof (long) * PT_CTR, 0);
+}
-+
--- a/sysdeps/linux-gnu/ppc/trace.c
+++ b/sysdeps/linux-gnu/ppc/trace.c
@@ -8,6 +8,7 @@
@@ -173,7 +148,7 @@
int syscall_p(struct process *proc, int status, int *sysnum)
{
if (WIFSTOPPED(status)
-@@ -56,21 +61,102 @@ int syscall_p(struct process *proc, int
+@@ -56,21 +61,97 @@ int syscall_p(struct process *proc, int
return 0;
}
@@ -189,63 +164,59 @@
- } else {
- return ptrace(PTRACE_PEEKDATA, proc->pid,
- proc->stack_pointer + 8 * (arg_num - 8), 0);
-- }
+ long data;
+
-+ if (type == LT_TOF_FUNCTIONR) /* return value */
-+ {
-+ if (info->type == ARGTYPE_FLOAT || info->type == ARGTYPE_DOUBLE)
-+ return ptrace (PTRACE_PEEKUSER, proc->pid, sizeof (long) * (PT_FPR0 + 1), 0);
-+ else
-+ return ptrace (PTRACE_PEEKUSER, proc->pid, sizeof (long) * PT_R3, 0);
-+ }
++ if (type == LT_TOF_FUNCTIONR) {
++ if (info->type == ARGTYPE_FLOAT || info->type == ARGTYPE_DOUBLE)
++ return ptrace (PTRACE_PEEKUSER, proc->pid,
++ sizeof (long) * (PT_FPR0 + 1), 0);
++ else
++ return ptrace (PTRACE_PEEKUSER, proc->pid,
++ sizeof (long) * PT_R3, 0);
++ }
+
+ /* Check if we're entering a new function call to list parameters. If
+ so, initialize the register control variables to keep track of where
+ the parameters were stored. */
-+ if (type == LT_TOF_FUNCTION && arg_num == 0)
-+ {
-+ /* Initialize the set of registrers for parameter passing. */
-+ greg = 3;
-+ freg = 1;
-+ vreg = 2;
-+ }
-+
-+ if (info->type == ARGTYPE_FLOAT || info->type == ARGTYPE_DOUBLE)
-+ {
-+ if (freg <= 13 || (proc->mask_32bit && freg <= 8))
-+ {
-+ data = ptrace (PTRACE_PEEKUSER, proc->pid,
-+ sizeof (long) * (PT_FPR0 + freg), 0);
++ if (type == LT_TOF_FUNCTION && arg_num == 0) {
++ /* Initialize the set of registrers for parameter passing. */
++ greg = 3;
++ freg = 1;
++ vreg = 2;
++ }
++
++ if (info->type == ARGTYPE_FLOAT || info->type == ARGTYPE_DOUBLE) {
++ if (freg <= 13 || (proc->mask_32bit && freg <= 8)) {
++ data = ptrace (PTRACE_PEEKUSER, proc->pid,
++ sizeof (long) * (PT_FPR0 + freg), 0);
++
++ if (info->type == ARGTYPE_FLOAT) {
++ /* float values passed in FP registers are automatically
++ promoted to double. We need to convert it back to float
++ before printing. */
++ union { long val; float fval; double dval; } cvt;
++ cvt.val = data;
++ cvt.fval = (float) cvt.dval;
++ data = cvt.val;
++ }
+
-+ if (info->type == ARGTYPE_FLOAT)
-+ {
-+ /* float values passed in FP registers are automatically
-+ promoted to double. We need to convert it back to float
-+ before printing. */
-+ union { long val; float fval; double dval; } cvt;
-+ cvt.val = data;
-+ cvt.fval = (float) cvt.dval;
-+ data = cvt.val;
-+ }
++ freg++;
++ greg++;
+
-+ freg++;
++ return data;
++ }
+ }
++ else if (greg <= 10) {
++ data = ptrace (PTRACE_PEEKUSER, proc->pid,
++ sizeof (long) * greg, 0);
+ greg++;
+
+ return data;
-+ }
-+ }
-+ else if (greg <= 10)
-+ {
-+ data = ptrace (PTRACE_PEEKUSER, proc->pid,
-+ sizeof (long) * greg, 0);
-+ greg++;
-+
-+ return data;
-+ }
++ }
+ else
-+ return ptrace (PTRACE_PEEKDATA, proc->pid,
-+ proc->stack_pointer + sizeof (long) * (arg_num - 8), 0);
++ return ptrace (PTRACE_PEEKDATA, proc->pid,
++ proc->stack_pointer + sizeof (long) *
++ (arg_num - 8), 0);
+
return 0;
}
@@ -259,32 +230,30 @@
+{
+ long pointed_to;
+
-+ errno = 0;
++ errno = 0;
+
-+ pointed_to = ptrace (PTRACE_PEEKTEXT, proc->pid, addr, 0);
++ pointed_to = ptrace (PTRACE_PEEKTEXT, proc->pid, addr, 0);
+
-+ if (pointed_to == -1 && errno)
-+ return -errno;
++ if (pointed_to == -1 && errno)
++ return -errno;
+
+ /* Since int's are 4-bytes (long is 8-bytes) in length for ppc64, we
+ need to shift the long values returned by ptrace to end up with
+ the correct value. */
+
-+ if (info)
-+ {
-+ if (info->type == ARGTYPE_INT || (proc->mask_32bit && (info->type == ARGTYPE_POINTER
-+ || info->type == ARGTYPE_STRING)))
-+ {
-+ pointed_to = pointed_to >> 32;
-+
-+ /* Make sure we have nothing in the upper word so we can
-+ do a explicit cast from long to int later in the code. */
-+ pointed_to &= 0x00000000ffffffff;
-+ }
-+ }
++ if (info) {
++ if (info->type == ARGTYPE_INT || (proc->mask_32bit && (info->type == ARGTYPE_POINTER
++ || info->type == ARGTYPE_STRING))) {
++ pointed_to = pointed_to >> 32;
++
++ /* Make sure we have nothing in the upper word so we can
++ do a explicit cast from long to int later in the code. */
++ pointed_to &= 0x00000000ffffffff;
++ }
++ }
+
-+ *result = pointed_to;
-+ return 0;
++ *result = pointed_to;
++ return 0;
+}
--- a/sysdeps/linux-gnu/trace.c
+++ b/sysdeps/linux-gnu/trace.c
@@ -302,15 +271,15 @@
+/* Read a single long from the process's memory address 'addr' */
+int umovelong (struct process *proc, void *addr, long *result, arg_type_info *info)
+{
-+ long pointed_to;
++ long pointed_to;
+
-+ errno = 0;
-+ pointed_to = ptrace (PTRACE_PEEKTEXT, proc->pid, addr, 0);
-+ if (pointed_to == -1 && errno)
-+ return -errno;
++ errno = 0;
++ pointed_to = ptrace (PTRACE_PEEKTEXT, proc->pid, addr, 0);
++ if (pointed_to == -1 && errno)
++ return -errno;
+
-+ *result = pointed_to;
-+ return 0;
++ *result = pointed_to;
++ return 0;
+}
+#endif
+
@@ -339,21 +308,3 @@
/* Read a series of bytes starting at the process's memory address
'addr' and continuing until a NUL ('\0') is seen or 'len' bytes
have been read.
-@@ -236,7 +245,7 @@ int umovestr(struct process *proc, void
-
- while (offset < len) {
- a.a = ptrace(PTRACE_PEEKTEXT, proc->pid, addr + offset, 0);
-- for (i = 0; i < sizeof(long); i++) {
-+ for (i = 0; i < sizeof (long); i++) {
- if (a.c[i] && offset + (signed)i < len) {
- *(char *)(laddr + offset + i) = a.c[i];
- } else {
-@@ -244,7 +253,7 @@ int umovestr(struct process *proc, void
- return 0;
- }
- }
-- offset += sizeof(long);
-+ offset += sizeof (long);
- }
- *(char *)(laddr + offset) = '\0';
- return 0;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org