[Ltrace-devel] r79 - ltrace/trunk ltrace/trunk/etc ltrace/trunk/sysdeps/linux-gnu ltrace/trunk/testsuite/ltrace.main ltrace/trunk/testsuite/ltrace.minor packaging/debian

cespedes at alioth.debian.org cespedes at alioth.debian.org
Fri Aug 31 16:49:48 UTC 2007


Author: cespedes
Date: 2007-08-31 16:49:48 +0000 (Fri, 31 Aug 2007)
New Revision: 79

Modified:
   ltrace/trunk/BUGS
   ltrace/trunk/ChangeLog
   ltrace/trunk/TODO
   ltrace/trunk/debug.c
   ltrace/trunk/debug.h
   ltrace/trunk/display_args.c
   ltrace/trunk/etc/ltrace.conf
   ltrace/trunk/ltrace.1
   ltrace/trunk/ltrace.c
   ltrace/trunk/ltrace.h
   ltrace/trunk/options.c
   ltrace/trunk/options.h
   ltrace/trunk/proc.c
   ltrace/trunk/process_event.c
   ltrace/trunk/read_config_file.c
   ltrace/trunk/sysdeps/linux-gnu/trace.c
   ltrace/trunk/testsuite/ltrace.main/parameters.c
   ltrace/trunk/testsuite/ltrace.main/parameters.conf
   ltrace/trunk/testsuite/ltrace.main/parameters.exp
   ltrace/trunk/testsuite/ltrace.minor/attach-process.exp
   ltrace/trunk/testsuite/ltrace.minor/count-record.exp
   ltrace/trunk/testsuite/ltrace.minor/demangle.exp
   ltrace/trunk/testsuite/ltrace.minor/print-instruction-pointer.exp
   ltrace/trunk/testsuite/ltrace.minor/time-record-T.exp
   ltrace/trunk/testsuite/ltrace.minor/time-record-tt.exp
   ltrace/trunk/testsuite/ltrace.minor/time-record-ttt.exp
   ltrace/trunk/testsuite/ltrace.minor/trace-clone.c
   ltrace/trunk/testsuite/ltrace.minor/trace-clone.exp
   ltrace/trunk/testsuite/ltrace.minor/trace-exec.exp
   ltrace/trunk/testsuite/ltrace.minor/trace-fork.exp
   packaging/debian/changelog
   packaging/debian/control.in
   packaging/debian/copyright
   packaging/debian/rules
Log:
	* 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



Modified: ltrace/trunk/BUGS
===================================================================
--- ltrace/trunk/BUGS	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/BUGS	2007-08-31 16:49:48 UTC (rev 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

Modified: ltrace/trunk/ChangeLog
===================================================================
--- ltrace/trunk/ChangeLog	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/ChangeLog	2007-08-31 16:49:48 UTC (rev 79)
@@ -1,3 +1,19 @@
+2007-08-31  Juan Cespedes  <cespedes at 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 at redhat.com>
 
 	* Based on work of Supriya Kannery <supriyak at in.ibm.com>

Modified: ltrace/trunk/TODO
===================================================================
--- ltrace/trunk/TODO	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/TODO	2007-08-31 16:49:48 UTC (rev 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)

Modified: ltrace/trunk/debug.c
===================================================================
--- ltrace/trunk/debug.c	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/debug.c	2007-08-31 16:49:48 UTC (rev 79)
@@ -31,54 +31,9 @@
 #include <stdlib.h>
 #include <sys/ptrace.h>
 
-int xwrite(const char *string, size_t len)
+static int xwritehexl(long i)
 {
 	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)
-{
-	int rc = 0;
 	char text[17];
 	int j;
 	unsigned long temp = (unsigned long)i;
@@ -97,7 +52,7 @@
 	return rc;
 }
 
-int xwritec(char c)
+static int xwritec(char c)
 {
 	char temp = c;
 	char *text = &temp;
@@ -106,12 +61,12 @@
 	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;

Modified: ltrace/trunk/debug.h
===================================================================
--- ltrace/trunk/debug.h	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/debug.h	2007-08-31 16:49:48 UTC (rev 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)

Modified: ltrace/trunk/display_args.c
===================================================================
--- ltrace/trunk/display_args.c	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/display_args.c	2007-08-31 16:49:48 UTC (rev 79)
@@ -176,12 +176,10 @@
 	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);

Modified: ltrace/trunk/etc/ltrace.conf
===================================================================
--- ltrace/trunk/etc/ltrace.conf	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/etc/ltrace.conf	2007-08-31 16:49:48 UTC (rev 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_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);

Modified: ltrace/trunk/ltrace.1
===================================================================
--- ltrace/trunk/ltrace.1	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/ltrace.1	2007-08-31 16:49:48 UTC (rev 79)
@@ -80,7 +80,7 @@
 .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

Modified: ltrace/trunk/ltrace.c
===================================================================
--- ltrace/trunk/ltrace.c	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/ltrace.c	2007-08-31 16:49:48 UTC (rev 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 @@
 				if (!tmp) {
 					return;
 				}
-				break;
+				tmp2 = opt_p;
+				continue;
 			}
 			tmp2 = tmp2->next;
 		}
@@ -51,6 +51,10 @@
 {
 	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 @@
 	if (opt_c) {
 		show_summary();
 	}
+	if (opt_o) {
+		fclose(output);
+	}
 }
 
 static void guess_cols(void)
@@ -102,24 +109,24 @@
 
 	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;

Modified: ltrace/trunk/ltrace.h
===================================================================
--- ltrace/trunk/ltrace.h	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/ltrace.h	2007-08-31 16:49:48 UTC (rev 79)
@@ -46,59 +46,58 @@
 	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;
+	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_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_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_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_POINTER
+		struct {
+			struct arg_type_info_t *info;
+		} ptr_info;
 
-        // ARGTYPE_FLOAT
-	struct {
-	    size_t float_index;
-	} float_info;
+		// ARGTYPE_FLOAT
+		struct {
+			size_t float_index;
+		} float_info;
 
-        // ARGTYPE_DOUBLE
-	struct {
-	    size_t float_index;
-	} double_info;
-    } u;
+		// ARGTYPE_DOUBLE
+		struct {
+			size_t float_index;
+		} double_info;
+	} u;
 } arg_type_info;
 
 enum tof {

Modified: ltrace/trunk/options.c
===================================================================
--- ltrace/trunk/options.c	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/options.c	2007-08-31 16:49:48 UTC (rev 79)
@@ -29,12 +29,12 @@
 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 @@
 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 @@
 # 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 @@
 		"  -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 @@
 		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 @@
 #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 @@
 		case 'a':
 			opt_a = atoi(optarg);
 			break;
-                case 'A':
+		case 'A':
 			opt_A = atoi(optarg);
 			break;
 		case 'c':
@@ -270,18 +271,18 @@
 		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 @@
 			opt_n = atoi(optarg);
 			break;
 		case 'o':
+			opt_o++;
 			output = fopen(optarg, "w");
 			if (!output) {
 				fprintf(stderr,
@@ -316,8 +318,7 @@
 			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 @@
 			break;
 		case 'V':
 			printf("ltrace version " PACKAGE_VERSION ".\n"
-			       "Copyright (C) 1997-2006 Juan Cespedes <cespedes at 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 at 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 @@
 	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) {

Modified: ltrace/trunk/options.h
===================================================================
--- ltrace/trunk/options.h	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/options.h	2007-08-31 16:49:48 UTC (rev 79)
@@ -21,6 +21,7 @@
 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;

Modified: ltrace/trunk/proc.c
===================================================================
--- ltrace/trunk/proc.c	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/proc.c	2007-08-31 16:49:48 UTC (rev 79)
@@ -56,6 +56,6 @@
 #endif
 
 	proc = open_program(filename, pid);
-	continue_process (pid);
+	continue_process(pid);
 	proc->breakpoints_enabled = 1;
 }

Modified: ltrace/trunk/process_event.c
===================================================================
--- ltrace/trunk/process_event.c	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/process_event.c	2007-08-31 16:49:48 UTC (rev 79)
@@ -185,7 +185,9 @@
 		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);

Modified: ltrace/trunk/read_config_file.c
===================================================================
--- ltrace/trunk/read_config_file.c	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/read_config_file.c	2007-08-31 16:49:48 UTC (rev 79)
@@ -44,7 +44,6 @@
 	"array", ARGTYPE_ARRAY}, {
 	"struct", ARGTYPE_STRUCT}, {
 	"enum", ARGTYPE_ENUM}, {
-	"ignore", ARGTYPE_IGNORE}, {
 	NULL, ARGTYPE_UNKNOWN}	/* Must finish with NULL */
 };
 
@@ -71,7 +70,6 @@
 	{ ARGTYPE_ARRAY },
 	{ ARGTYPE_ENUM },
 	{ ARGTYPE_STRUCT },
-	{ ARGTYPE_IGNORE },
 	{ ARGTYPE_POINTER },
 	{ ARGTYPE_UNKNOWN }
 };
@@ -590,7 +588,7 @@
 	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 @@
 	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;

Modified: ltrace/trunk/sysdeps/linux-gnu/trace.c
===================================================================
--- ltrace/trunk/sysdeps/linux-gnu/trace.c	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/sysdeps/linux-gnu/trace.c	2007-08-31 16:49:48 UTC (rev 79)
@@ -150,15 +150,6 @@
 		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;
 }
 

Modified: ltrace/trunk/testsuite/ltrace.main/parameters.c
===================================================================
--- ltrace/trunk/testsuite/ltrace.main/parameters.c	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/testsuite/ltrace.main/parameters.c	2007-08-31 16:49:48 UTC (rev 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 @@
   int *ai;
   float *af;
 
-  func_ignore(1, 2, 3);
-
   func_intptr(&x);
 
   func_intptr_ret(&x);

Modified: ltrace/trunk/testsuite/ltrace.main/parameters.conf
===================================================================
--- ltrace/trunk/testsuite/ltrace.main/parameters.conf	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/testsuite/ltrace.main/parameters.conf	2007-08-31 16:49:48 UTC (rev 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_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])*)

Modified: ltrace/trunk/testsuite/ltrace.main/parameters.exp
===================================================================
--- ltrace/trunk/testsuite/ltrace.main/parameters.exp	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/testsuite/ltrace.main/parameters.exp	2007-08-31 16:49:48 UTC (rev 79)
@@ -36,8 +36,6 @@
 }
 
 # 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)"

Modified: ltrace/trunk/testsuite/ltrace.minor/attach-process.exp
===================================================================
--- ltrace/trunk/testsuite/ltrace.minor/attach-process.exp	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/testsuite/ltrace.minor/attach-process.exp	2007-08-31 16:49:48 UTC (rev 79)
@@ -17,7 +17,7 @@
 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
 

Modified: ltrace/trunk/testsuite/ltrace.minor/count-record.exp
===================================================================
--- ltrace/trunk/testsuite/ltrace.minor/count-record.exp	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/testsuite/ltrace.minor/count-record.exp	2007-08-31 16:49:48 UTC (rev 79)
@@ -13,7 +13,7 @@
 # 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.

Modified: ltrace/trunk/testsuite/ltrace.minor/demangle.exp
===================================================================
--- ltrace/trunk/testsuite/ltrace.minor/demangle.exp	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/testsuite/ltrace.minor/demangle.exp	2007-08-31 16:49:48 UTC (rev 79)
@@ -21,7 +21,7 @@
 # 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.

Modified: ltrace/trunk/testsuite/ltrace.minor/print-instruction-pointer.exp
===================================================================
--- ltrace/trunk/testsuite/ltrace.minor/print-instruction-pointer.exp	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/testsuite/ltrace.minor/print-instruction-pointer.exp	2007-08-31 16:49:48 UTC (rev 79)
@@ -13,7 +13,7 @@
 
 # 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.

Modified: ltrace/trunk/testsuite/ltrace.minor/time-record-T.exp
===================================================================
--- ltrace/trunk/testsuite/ltrace.minor/time-record-T.exp	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/testsuite/ltrace.minor/time-record-T.exp	2007-08-31 16:49:48 UTC (rev 79)
@@ -13,7 +13,7 @@
 # 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"
 

Modified: ltrace/trunk/testsuite/ltrace.minor/time-record-tt.exp
===================================================================
--- ltrace/trunk/testsuite/ltrace.minor/time-record-tt.exp	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/testsuite/ltrace.minor/time-record-tt.exp	2007-08-31 16:49:48 UTC (rev 79)
@@ -13,7 +13,7 @@
 # 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.

Modified: ltrace/trunk/testsuite/ltrace.minor/time-record-ttt.exp
===================================================================
--- ltrace/trunk/testsuite/ltrace.minor/time-record-ttt.exp	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/testsuite/ltrace.minor/time-record-ttt.exp	2007-08-31 16:49:48 UTC (rev 79)
@@ -13,7 +13,7 @@
 # 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]
 
 

Modified: ltrace/trunk/testsuite/ltrace.minor/trace-clone.c
===================================================================
--- ltrace/trunk/testsuite/ltrace.minor/trace-clone.c	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/testsuite/ltrace.minor/trace-clone.c	2007-08-31 16:49:48 UTC (rev 79)
@@ -11,6 +11,7 @@
 
 int child ()
 {
+  sleep(1);
   return 0;
 }
 

Modified: ltrace/trunk/testsuite/ltrace.minor/trace-clone.exp
===================================================================
--- ltrace/trunk/testsuite/ltrace.minor/trace-clone.exp	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/testsuite/ltrace.minor/trace-clone.exp	2007-08-31 16:49:48 UTC (rev 79)
@@ -12,7 +12,7 @@
 }
 global LTRACE
 
-#Run PUT for ltarce.
+#Run PUT for ltrace.
 spawn $LTRACE -f $srcdir/$subdir/$binfile
 set timeout 4
 expect timeout  {

Modified: ltrace/trunk/testsuite/ltrace.minor/trace-exec.exp
===================================================================
--- ltrace/trunk/testsuite/ltrace.minor/trace-exec.exp	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/testsuite/ltrace.minor/trace-exec.exp	2007-08-31 16:49:48 UTC (rev 79)
@@ -15,15 +15,15 @@
 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"

Modified: ltrace/trunk/testsuite/ltrace.minor/trace-fork.exp
===================================================================
--- ltrace/trunk/testsuite/ltrace.minor/trace-fork.exp	2007-08-30 14:40:44 UTC (rev 78)
+++ ltrace/trunk/testsuite/ltrace.minor/trace-fork.exp	2007-08-31 16:49:48 UTC (rev 79)
@@ -13,7 +13,7 @@
 global LTRACE
 set exec_output ""
 
-#Run PUT for ltarce.
+#Run PUT for ltrace.
 spawn $LTRACE -f $srcdir/$subdir/$binfile
 set timeout 4
 expect timeout  {

Modified: packaging/debian/changelog
===================================================================
--- packaging/debian/changelog	2007-08-30 14:40:44 UTC (rev 78)
+++ packaging/debian/changelog	2007-08-31 16:49:48 UTC (rev 79)
@@ -1,13 +1,25 @@
+ltrace (0.5-2) unstable; urgency=low
+
+  * Fixed compilation issue in ppc
+
+ -- Juan Cespedes <cespedes at debian.org>  Fri, 31 Aug 2007 13:53:27 +0200
+
 ltrace (0.5-1) unstable; urgency=low
 
-  * New upstream
-  * Closes: #372928, #372928: spelling fixes
-  * Change maintainer to ianw at debian.org, so I get bug reports
-  * Change Juan to an uploader
-  * Acknowledge 0.3.35.1 NMU, thanks Andrew Pollock
+  * New upstream version
+  * Remove some unneeded files in /usr/share/doc (ChangeLog, COPYING...)
+  * Fix several typos (closes: Bug#372928)
+  * Added more system calls to ltrace.conf
 
- -- Ian Wienand <ianw at debian.org>  Fri, 16 Jun 2006 11:15:45 +1000
+ -- Juan Cespedes <cespedes at debian.org>  Thu, 30 Aug 2007 14:54:44 +0200
 
+ltrace (0.4-2) unstable; urgency=low
+
+  * Use fclose() to close the output file when using option '-o'
+    (thanks to GuiJianfeng <jianfenggui at gmail.com>)
+
+ -- Juan Cespedes <cespedes at debian.org>  Tue, 07 Aug 2007 11:49:27 +0200
+
 ltrace (0.4-1) unstable; urgency=low
 
   * Rebase code from Redhat patches, now everything lives in SVN

Modified: packaging/debian/control.in
===================================================================
--- packaging/debian/control.in	2007-08-30 14:40:44 UTC (rev 78)
+++ packaging/debian/control.in	2007-08-31 16:49:48 UTC (rev 79)
@@ -1,10 +1,10 @@
 Source: ltrace
 Section: utils
 Priority: optional
-Maintainer: Ian Wienand <ianw at debian.org>
-Uploaders: Juan Cespedes <cespedes at debian.org>
-Standards-Version: 3.6.2.2
-Build-Depends: @cdbs@, binutils-dev, dpatch, libelfg0-dev
+Maintainer: Juan Cespedes <cespedes at debian.org>
+Uploaders: Ian Wienand <ianw at debian.org>
+Standards-Version: 3.7.2
+Build-Depends: @cdbs@, binutils-dev, libelfg0-dev
 
 Package: ltrace
 Architecture: i386 arm m68k s390 powerpc sparc alpha amd64 ia64 ppc64

Modified: packaging/debian/copyright
===================================================================
--- packaging/debian/copyright	2007-08-30 14:40:44 UTC (rev 78)
+++ packaging/debian/copyright	2007-08-31 16:49:48 UTC (rev 79)
@@ -4,7 +4,7 @@
 
 Copyrights
 ----------
-Copyright (C) 1997-2006 Juan Cespedes <cespedes at debian.org>
+Copyright (C) 1997-2007 Juan Cespedes <cespedes at debian.org>
 
 ARMLinux port: Copyright (C) 1998 Pat Beirne <pbeirne at home.com>
 m68k port: Copyright (C) 1998 Roman Hodek <Roman.Hodek at informatik.uni-erlangen.de>

Modified: packaging/debian/rules
===================================================================
--- packaging/debian/rules	2007-08-30 14:40:44 UTC (rev 78)
+++ packaging/debian/rules	2007-08-31 16:49:48 UTC (rev 79)
@@ -1,4 +1,7 @@
 #!/usr/bin/make -f
 
+include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/class/autotools.mk
-include /usr/share/cdbs/1/rules/debhelper.mk
+
+install/ltrace::
+	rm -f debian/ltrace/usr/share/doc/ltrace/*




More information about the Ltrace-devel mailing list