[Ltrace-devel] r39 - in ltrace/trunk: . sysdeps/linux-gnu

Paul Gilliam pgilliam-guest at costa.debian.org
Mon Apr 24 16:25:38 UTC 2006


Author: pgilliam-guest
Date: 2006-04-24 16:25:37 +0000 (Mon, 24 Apr 2006)
New Revision: 39

Modified:
   ltrace/trunk/ChangeLog
   ltrace/trunk/elf.c
   ltrace/trunk/ltrace.h
   ltrace/trunk/sysdeps/linux-gnu/breakpoint.c
   ltrace/trunk/sysdeps/linux-gnu/trace.c
Log:
Adds some casts that keeps a more picky version of GCC happy.


Modified: ltrace/trunk/ChangeLog
===================================================================
--- ltrace/trunk/ChangeLog	2006-04-24 16:14:01 UTC (rev 38)
+++ ltrace/trunk/ChangeLog	2006-04-24 16:25:37 UTC (rev 39)
@@ -1,5 +1,12 @@
 2006-04-24  Paul Gilliam <pgilliam at 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 at us.ibm.com>
+
 	* summery.c: Correct a typo prevented the inclusion of "demangle.h".
 
 2006-03-16  Ian Wienand  <ianw at gelato.unsw.edu.au>

Modified: ltrace/trunk/elf.c
===================================================================
--- ltrace/trunk/elf.c	2006-04-24 16:14:01 UTC (rev 38)
+++ ltrace/trunk/elf.c	2006-04-24 16:25:37 UTC (rev 39)
@@ -213,7 +213,7 @@
 				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 @@
 	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 @@
 	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 @@
 				/* 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;
 			}

Modified: ltrace/trunk/ltrace.h
===================================================================
--- ltrace/trunk/ltrace.h	2006-04-24 16:14:01 UTC (rev 38)
+++ ltrace/trunk/ltrace.h	2006-04-24 16:25:37 UTC (rev 39)
@@ -98,7 +98,7 @@
 	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;

Modified: ltrace/trunk/sysdeps/linux-gnu/breakpoint.c
===================================================================
--- ltrace/trunk/sysdeps/linux-gnu/breakpoint.c	2006-04-24 16:14:01 UTC (rev 38)
+++ ltrace/trunk/sysdeps/linux-gnu/breakpoint.c	2006-04-24 16:25:37 UTC (rev 39)
@@ -20,7 +20,7 @@
 #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 @@
 #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);

Modified: ltrace/trunk/sysdeps/linux-gnu/trace.c
===================================================================
--- ltrace/trunk/sysdeps/linux-gnu/trace.c	2006-04-24 16:14:01 UTC (rev 38)
+++ ltrace/trunk/sysdeps/linux-gnu/trace.c	2006-04-24 16:25:37 UTC (rev 39)
@@ -50,7 +50,7 @@
  */
 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 @@
 	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';




More information about the Ltrace-devel mailing list