File ltrace.trunk-r39.patch of Package ltrace

------------------------------------------------------------------------
r39 | pgilliam-guest | 2006-04-24 16:25:37 +0000 (Mon, 24 Apr 2006) | 2 lines
Changed paths:
   M /ltrace/trunk/ChangeLog
   M /ltrace/trunk/elf.c
   M /ltrace/trunk/ltrace.h
   M /ltrace/trunk/sysdeps/linux-gnu/breakpoint.c
   M /ltrace/trunk/sysdeps/linux-gnu/trace.c

Adds some casts that keeps a more picky version of GCC happy.

------------------------------------------------------------------------
---
 ChangeLog                      |    7 +++++++
 elf.c                          |   10 +++++-----
 ltrace.h                       |    2 +-
 sysdeps/linux-gnu/breakpoint.c |    4 ++--
 sysdeps/linux-gnu/trace.c      |    4 ++--
 5 files changed, 17 insertions(+), 10 deletions(-)

Index: elf.c
===================================================================
--- elf.c.orig
+++ elf.c
@@ -213,7 +213,7 @@ static void do_init_elf(struct ltelf *lt
 				lte->plt_addr = shdr.sh_addr;
 				lte->plt_size = shdr.sh_size;
 			} else if (strcmp(name, ".opd") == 0) {
-				lte->opd_addr = (GElf_Addr *) shdr.sh_addr;
+				lte->opd_addr = (GElf_Addr *) (long) shdr.sh_addr;
 				lte->opd_size = shdr.sh_size;
 				lte->opd = elf_rawdata(scn, NULL);
 			}
@@ -300,7 +300,7 @@ static int in_load_libraries(const char 
 	if (!library_num)
 		return 1;
 
-	hash = elf_hash(name);
+	hash = elf_hash((const unsigned char *)name);
 	for (i = 1; i <= library_num; ++i) {
 		Elf32_Word nbuckets, symndx;
 		Elf32_Word *buckets, *chain;
@@ -335,7 +335,7 @@ static GElf_Addr elf_plt2addr(struct lte
 	GElf_Addr ret_val;
 
 	if (!lte->opd)
-		return (GElf_Addr) addr;
+		return (GElf_Addr) (long) addr;
 
 	base = (long)lte->opd->d_buf;
 	offset = (long)addr - (long)lte->opd_addr;
@@ -439,8 +439,8 @@ struct library_symbol *read_elf(struct p
 				/* FIXME: Should be able to use &library_symbols as above.  But
 				   when you do, none of the real library symbols cause breaks. */
 				add_library_symbol(elf_plt2addr
-						   (lte, (void *)addr), name,
-						   lib_tail, 1, 0);
+						   (lte, (void *) (long) addr),
+						   name, lib_tail, 1, 0);
 				xptr->found = 1;
 				break;
 			}
Index: ChangeLog
===================================================================
--- ChangeLog.orig
+++ ChangeLog
@@ -1,5 +1,12 @@
 2006-04-24  Paul Gilliam <pgilliam@us.ibm.com>
 
+	* elf.c: Adds some casts to keep a more picky version of GCC happy.
+	* sysdeps/linux-gnu/trace.c: ditto.
+	* sysdeps/linux-gnu/breakpoint.c: ditto.
+	* ltrace.h: ditto.
+
+2006-04-24  Paul Gilliam <pgilliam@us.ibm.com>
+
 	* summery.c: Correct a typo prevented the inclusion of "demangle.h".
 
 2006-03-16  Ian Wienand  <ianw@gelato.unsw.edu.au>
Index: sysdeps/linux-gnu/trace.c
===================================================================
--- sysdeps/linux-gnu/trace.c.orig
+++ sysdeps/linux-gnu/trace.c
@@ -50,7 +50,7 @@ static int fork_exec_syscalls[][5] = {
  */
 int fork_p(struct process *proc, int sysnum)
 {
-	int i;
+	unsigned int i;
 	if (proc->personality
 	    >= sizeof fork_exec_syscalls / sizeof(fork_exec_syscalls[0]))
 		return 0;
@@ -163,7 +163,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++) {
-			if (a.c[i] && offset + i < len) {
+			if (a.c[i] && offset + (signed)i < len) {
 				*(char *)(laddr + offset + i) = a.c[i];
 			} else {
 				*(char *)(laddr + offset + i) = '\0';
Index: sysdeps/linux-gnu/breakpoint.c
===================================================================
--- sysdeps/linux-gnu/breakpoint.c.orig
+++ sysdeps/linux-gnu/breakpoint.c
@@ -20,7 +20,7 @@ void enable_breakpoint(pid_t pid, struct
 #else
 void enable_breakpoint(pid_t pid, struct breakpoint *sbp)
 {
-	int i, j;
+	unsigned int i, j;
 
 	debug(1, "enable_breakpoint(%d,%p)", pid, sbp->addr);
 
@@ -50,7 +50,7 @@ void disable_breakpoint(pid_t pid, const
 #else
 void disable_breakpoint(pid_t pid, const struct breakpoint *sbp)
 {
-	int i, j;
+	unsigned int i, j;
 
 	if (opt_d > 1) {
 		output_line(0, "disable_breakpoint(%d,%p)", pid, sbp->addr);
Index: ltrace.h
===================================================================
--- ltrace.h.orig
+++ ltrace.h
@@ -98,7 +98,7 @@ struct process {
 	struct dict *breakpoints;
 	int breakpoints_enabled;	/* -1:not enabled yet, 0:disabled, 1:enabled */
 	int mask_32bit;		/* 1 if 64-bit ltrace is tracing 32-bit process.  */
-	int personality;
+	unsigned int personality;
 	int tracesysgood;	/* signal indicating a PTRACE_SYSCALL trap */
 
 	int callstack_depth;
openSUSE Build Service is sponsored by