diff options
author | Juan Cespedes <cespedes@debian.org> | 2007-08-31 18:49:48 +0200 |
---|---|---|
committer | Juan Cespedes <cespedes@debian.org> | 2007-08-31 18:49:48 +0200 |
commit | aee093126654f722523b47848a0c5449e39cf4bb (patch) | |
tree | 30c8c62185406f4aab5c907f947e0a8d5af90055 /debug.c | |
parent | 55ed83b24df9c6d671091a8c75caab33ffecd40e (diff) | |
download | ltrace-aee093126654f722523b47848a0c5449e39cf4bb.tar.gz |
Some random fixes
* 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
Diffstat (limited to 'debug.c')
-rw-r--r-- | debug.c | 53 |
1 files changed, 4 insertions, 49 deletions
@@ -31,52 +31,7 @@ debug_(int level, const char *file, int line, const char *func, const char *fmt, #include <stdlib.h> #include <sys/ptrace.h> -int xwrite(const char *string, size_t len) -{ - 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) +static int xwritehexl(long i) { int rc = 0; char text[17]; @@ -97,7 +52,7 @@ int xwritehexl(long i) return rc; } -int xwritec(char c) +static int xwritec(char c) { char temp = c; char *text = &temp; @@ -106,12 +61,12 @@ int xwritec(char c) 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; |