run Lindent over source to get everything looking about the same
diff --git a/breakpoints.c b/breakpoints.c
index d9ea6e9..96dd0b7 100644
--- a/breakpoints.c
+++ b/breakpoints.c
@@ -18,63 +18,69 @@
/*****************************************************************************/
-struct breakpoint *
-address2bpstruct(struct process * proc, void * addr) {
+struct breakpoint *address2bpstruct(struct process *proc, void *addr)
+{
return dict_find_entry(proc->breakpoints, addr);
}
void
-insert_breakpoint(struct process * proc, void * addr, struct library_symbol * libsym) {
- struct breakpoint * sbp;
+insert_breakpoint(struct process *proc, void *addr,
+ struct library_symbol *libsym)
+{
+ struct breakpoint *sbp;
if (!proc->breakpoints) {
- proc->breakpoints = dict_init(dict_key2hash_int, dict_key_cmp_int);
- /* atexit(brk_dict_clear); */ /* why bother to do this on exit? */
+ proc->breakpoints =
+ dict_init(dict_key2hash_int, dict_key_cmp_int);
+ /* atexit(brk_dict_clear); *//* why bother to do this on exit? */
}
- if (!addr)
- return;
+ if (!addr)
+ return;
- if (libsym)
+ if (libsym)
libsym->needs_init = 0;
sbp = dict_find_entry(proc->breakpoints, addr);
if (!sbp) {
sbp = calloc(1, sizeof(struct breakpoint));
if (!sbp) {
- return; /* TODO FIXME XXX: error_mem */
+ return; /* TODO FIXME XXX: error_mem */
}
dict_enter(proc->breakpoints, addr, sbp);
sbp->addr = addr;
- sbp->libsym = libsym;
- if (libsym)
- libsym->brkpnt = sbp;
+ sbp->libsym = libsym;
+ if (libsym)
+ libsym->brkpnt = sbp;
}
sbp->enabled++;
- if (sbp->enabled==1 && proc->pid) enable_breakpoint(proc->pid, sbp);
+ if (sbp->enabled == 1 && proc->pid)
+ enable_breakpoint(proc->pid, sbp);
}
-void
-delete_breakpoint(struct process * proc, void * addr) {
- struct breakpoint * sbp = dict_find_entry(proc->breakpoints, addr);
- assert(sbp); /* FIXME: remove after debugging has been done. */
+void delete_breakpoint(struct process *proc, void *addr)
+{
+ struct breakpoint *sbp = dict_find_entry(proc->breakpoints, addr);
+ assert(sbp); /* FIXME: remove after debugging has been done. */
/* This should only happen on out-of-memory conditions. */
- if (sbp == NULL) return;
+ if (sbp == NULL)
+ return;
sbp->enabled--;
- if (sbp->enabled == 0) disable_breakpoint(proc->pid, sbp);
+ if (sbp->enabled == 0)
+ disable_breakpoint(proc->pid, sbp);
assert(sbp->enabled >= 0);
}
-static void
-enable_bp_cb(void * addr, void * sbp, void * proc) {
+static void enable_bp_cb(void *addr, void *sbp, void *proc)
+{
if (((struct breakpoint *)sbp)->enabled) {
enable_breakpoint(((struct process *)proc)->pid, sbp);
}
}
-void
-enable_all_breakpoints(struct process * proc) {
+void enable_all_breakpoints(struct process *proc)
+{
if (proc->breakpoints_enabled <= 0) {
#ifdef __powerpc__
unsigned long a;
@@ -85,7 +91,10 @@
* dont enable the breakpoints
*/
if (opt_L) {
- a = ptrace(PTRACE_PEEKTEXT, proc->pid, plt2addr(proc, proc->list_of_symbols->enter_addr), 0);
+ a = ptrace(PTRACE_PEEKTEXT, proc->pid,
+ plt2addr(proc,
+ proc->list_of_symbols->enter_addr),
+ 0);
if (a == 0x0)
return;
}
@@ -93,21 +102,22 @@
debug(1, "Enabling breakpoints for pid %u...", proc->pid);
if (proc->breakpoints) {
- dict_apply_to_all(proc->breakpoints, enable_bp_cb, proc);
+ dict_apply_to_all(proc->breakpoints, enable_bp_cb,
+ proc);
}
}
proc->breakpoints_enabled = 1;
}
-static void
-disable_bp_cb(void * addr, void * sbp, void * proc) {
+static void disable_bp_cb(void *addr, void *sbp, void *proc)
+{
if (((struct breakpoint *)sbp)->enabled) {
disable_breakpoint(((struct process *)proc)->pid, sbp);
}
}
-void
-disable_all_breakpoints(struct process * proc) {
+void disable_all_breakpoints(struct process *proc)
+{
if (proc->breakpoints_enabled) {
debug(1, "Disabling breakpoints for pid %u...", proc->pid);
dict_apply_to_all(proc->breakpoints, disable_bp_cb, proc);
@@ -115,17 +125,17 @@
proc->breakpoints_enabled = 0;
}
-static void
-free_bp_cb(void * addr, void * sbp, void * data) {
+static void free_bp_cb(void *addr, void *sbp, void *data)
+{
assert(sbp);
free(sbp);
}
-void
-breakpoints_init(struct process * proc) {
- struct library_symbol * sym;
+void breakpoints_init(struct process *proc)
+{
+ struct library_symbol *sym;
- if (proc->breakpoints) { /* let's remove that struct */
+ if (proc->breakpoints) { /* let's remove that struct */
/* TODO FIXME XXX: free() all "struct breakpoint"s */
dict_apply_to_all(proc->breakpoints, free_bp_cb, NULL);
dict_clear(proc->breakpoints);
@@ -135,12 +145,12 @@
if (opt_L && proc->filename) {
proc->list_of_symbols = read_elf(proc);
if (opt_e) {
- struct library_symbol ** tmp1 = &(proc->list_of_symbols);
- while(*tmp1) {
- struct opt_e_t * tmp2 = opt_e;
+ struct library_symbol **tmp1 = &(proc->list_of_symbols);
+ while (*tmp1) {
+ struct opt_e_t *tmp2 = opt_e;
int keep = !opt_e_enable;
- while(tmp2) {
+ while (tmp2) {
if (!strcmp((*tmp1)->name, tmp2->name)) {
keep = opt_e_enable;
}
@@ -158,11 +168,11 @@
}
sym = proc->list_of_symbols;
while (sym) {
- /* proc->pid==0 delays enabling. */
+ /* proc->pid==0 delays enabling. */
if (sym->static_plt2addr) {
insert_breakpoint(proc, sym->enter_addr, sym);
- } else {
- insert_breakpoint(proc, plt2addr(proc, sym->enter_addr), sym); /* proc->pid==0 delays enabling. */
+ } else {
+ insert_breakpoint(proc, plt2addr(proc, sym->enter_addr), sym); /* proc->pid==0 delays enabling. */
}
sym = sym->next;
}
@@ -170,19 +180,21 @@
proc->breakpoints_enabled = -1;
}
-void
-reinitialize_breakpoints (struct process * proc) {
- struct library_symbol * sym = proc->list_of_symbols;
-
- while (sym) {
- if (sym->needs_init) {
- insert_breakpoint(proc, plt2addr(proc, sym->enter_addr), sym);
- if (sym->needs_init && !sym->is_weak) {
- fprintf(stderr, "could not re-initialize breakpoint for \"%s\" in file \"%s\"\n", sym->name, proc->filename);
- exit(1);
- }
- }
- sym = sym->next;
- }
-}
+void reinitialize_breakpoints(struct process *proc)
+{
+ struct library_symbol *sym = proc->list_of_symbols;
+ while (sym) {
+ if (sym->needs_init) {
+ insert_breakpoint(proc, plt2addr(proc, sym->enter_addr),
+ sym);
+ if (sym->needs_init && !sym->is_weak) {
+ fprintf(stderr,
+ "could not re-initialize breakpoint for \"%s\" in file \"%s\"\n",
+ sym->name, proc->filename);
+ exit(1);
+ }
+ }
+ sym = sym->next;
+ }
+}
diff --git a/debug.c b/debug.c
index 198581b..bdff766 100644
--- a/debug.c
+++ b/debug.c
@@ -6,7 +6,9 @@
#include "output.h"
void
-debug_(int level, const char *file, int line, const char *func, const char *fmt, ...) {
+debug_(int level, const char *file, int line, const char *func, const char *fmt,
+ ...)
+{
char buf[1024];
va_list args;
@@ -31,126 +33,119 @@
int xwrite(const char *string, size_t len)
{
- int rc = 0;
- rc = write (1, string, len);
- return rc;
+ 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;
+ size_t len = 0;
+ int rc = 0;
+ const char *tstring = string;
- while (*tstring++ != '\0')
- {
- len++;
- }
+ while (*tstring++ != '\0') {
+ len++;
+ }
- if (len >0)
- {
- rc = xwrite( string, len );
- }
+ if (len > 0) {
+ rc = xwrite(string, len);
+ }
- return rc;
+ return rc;
}
int xwritehexi(int i)
{
- int rc = 0;
- char text[9];
- int j;
- unsigned int temp = (unsigned 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;
- }
+ 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;
+ 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;
+ int rc = 0;
+ char text[17];
+ int j;
+ unsigned long temp = (unsigned long)i;
- for ( j = 15; 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;
- }
+ for (j = 15; 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, 16);
- return rc;
+ rc = write(1, text, 16);
+ return rc;
}
int xwritec(char c)
{
- char temp = c;
- char *text = &temp;
- int rc = 0;
- rc = write (1, text, 1);
- return rc;
+ char temp = c;
+ char *text = &temp;
+ int rc = 0;
+ rc = write(1, text, 1);
+ return rc;
}
int xwritecr(void)
{
- return xwritec('\n');
+ return xwritec('\n');
}
int xwritedump(void *ptr, long addr, int len)
{
- int rc = 0;
- long *tprt = (long*)ptr;
- int i;
+ int rc = 0;
+ long *tprt = (long *)ptr;
+ int i;
- for ( i = 0; i < len ; i+=8 )
- {
- xwritehexl( addr);
- xwritec('-');
- xwritec('>');
- xwritehexl( *tprt++);
- xwritecr();
- addr += sizeof(long);
- }
+ for (i = 0; i < len; i += 8) {
+ xwritehexl(addr);
+ xwritec('-');
+ xwritec('>');
+ xwritehexl(*tprt++);
+ xwritecr();
+ addr += sizeof(long);
+ }
- return rc;
+ return rc;
}
int xinfdump(long pid, void *ptr, int len)
{
- int rc;
- int i;
- long wrdcnt = len / sizeof(long) + 1;
- long *infwords = malloc(wrdcnt*sizeof(long));
- long addr = (long)ptr;
+ int rc;
+ int i;
+ long wrdcnt = len / sizeof(long) + 1;
+ long *infwords = malloc(wrdcnt * sizeof(long));
+ long addr = (long)ptr;
- addr = ((addr + sizeof(long) - 1) / sizeof(long)) * sizeof(long);
+ addr = ((addr + sizeof(long) - 1) / sizeof(long)) * sizeof(long);
- for (i=0; i<wrdcnt; ++i) {
- infwords[i] = ptrace(PTRACE_PEEKTEXT, pid, addr);
- addr += sizeof(long);
- }
+ for (i = 0; i < wrdcnt; ++i) {
+ infwords[i] = ptrace(PTRACE_PEEKTEXT, pid, addr);
+ addr += sizeof(long);
+ }
- rc = xwritedump(infwords, (long)ptr, len);
+ rc = xwritedump(infwords, (long)ptr, len);
- free(infwords);
- return rc;
+ free(infwords);
+ return rc;
}
diff --git a/debug.h b/debug.h
index 53626ef..ed28e8b 100644
--- a/debug.h
+++ b/debug.h
@@ -1,6 +1,7 @@
#include <features.h>
-void debug_(int level, const char *file, int line, const char *func, const char *fmt, ...);
+void debug_(int level, const char *file, int line, const char *func,
+ const char *fmt, ...);
int xwrite(const char *, size_t);
int xwrites(const char *);
@@ -11,7 +12,6 @@
int xwritedump(void *, long, int);
int xinfdump(long, void *, int);
-
# define debug(level, expr...) debug_(level, __FILE__, __LINE__, DEBUG_FUNCTION, expr)
/* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
diff --git a/defs.h b/defs.h
index 601c8b0..1dc9c98 100644
--- a/defs.h
+++ b/defs.h
@@ -1,13 +1,12 @@
#ifndef DEFAULT_ACOLUMN
-#define DEFAULT_ACOLUMN 50 /* default alignment column for results */
-#endif /* (-a switch) */
+#define DEFAULT_ACOLUMN 50 /* default alignment column for results */
+#endif /* (-a switch) */
#ifndef MAX_ARGS
-#define MAX_ARGS 32 /* maximum number of args for a function */
+#define MAX_ARGS 32 /* maximum number of args for a function */
#endif
#ifndef DEFAULT_STRLEN
-#define DEFAULT_STRLEN 32 /* default maximum # of bytes printed in */
-#endif /* strings (-s switch) */
-
+#define DEFAULT_STRLEN 32 /* default maximum # of bytes printed in */
+#endif /* strings (-s switch) */
diff --git a/demangle.c b/demangle.c
index 63b7da6..0d86888 100644
--- a/demangle.c
+++ b/demangle.c
@@ -16,19 +16,19 @@
/*****************************************************************************/
-static struct dict * d = NULL;
+static struct dict *d = NULL;
-static void
-my_demangle_dict_clear(void) {
+static void my_demangle_dict_clear(void)
+{
/* FIXME TODO XXX: I should also free all (key,value) pairs */
dict_clear(d);
}
-const char *
-my_demangle(const char * function_name) {
- const char * tmp, * fn_copy;
+const char *my_demangle(const char *function_name)
+{
+ const char *tmp, *fn_copy;
#if !defined HAVE_LIBIBERTY && defined HAVE_LIBSUPC__
- extern char *__cxa_demangle (const char *, char *, size_t *, int *);
+ extern char *__cxa_demangle(const char *, char *, size_t *, int *);
int status = 0;
#endif
@@ -36,7 +36,7 @@
d = dict_init(dict_key2hash_string, dict_key_cmp_string);
atexit(my_demangle_dict_clear);
}
-
+
tmp = dict_find_entry(d, (void *)function_name);
if (!tmp) {
fn_copy = strdup(function_name);
@@ -45,8 +45,10 @@
#elif defined HAVE_LIBSUPC__
tmp = __cxa_demangle(function_name, NULL, NULL, &status);
#endif
- if (!tmp) tmp = fn_copy;
- if (tmp) dict_enter(d, (void *)fn_copy, (void *)tmp);
+ if (!tmp)
+ tmp = fn_copy;
+ if (tmp)
+ dict_enter(d, (void *)fn_copy, (void *)tmp);
}
return tmp;
}
diff --git a/demangle.h b/demangle.h
index 8f4bb1d..ca7342f 100644
--- a/demangle.h
+++ b/demangle.h
@@ -2,14 +2,13 @@
#include "config.h"
#endif
-extern char * cplus_demangle (const char *mangled, int options);
+extern char *cplus_demangle(const char *mangled, int options);
-const char * my_demangle(const char * function_name);
+const char *my_demangle(const char *function_name);
/* Options passed to cplus_demangle (in 2nd parameter). */
-#define DMGL_NO_OPTS 0 /* For readability... */
-#define DMGL_PARAMS (1 << 0) /* Include function args */
-#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
-#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */
-
+#define DMGL_NO_OPTS 0 /* For readability... */
+#define DMGL_PARAMS (1 << 0) /* Include function args */
+#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
+#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */
diff --git a/dict.c b/dict.c
index 8d97220..a24370a 100644
--- a/dict.c
+++ b/dict.c
@@ -13,26 +13,27 @@
struct dict_entry {
unsigned int hash;
- void * key;
- void * value;
- struct dict_entry * next;
+ void *key;
+ void *value;
+ struct dict_entry *next;
};
/* #define DICTTABLESIZE 97 */
-#define DICTTABLESIZE 997 /* Semi-randomly selected prime number. */
+#define DICTTABLESIZE 997 /* Semi-randomly selected prime number. */
/* #define DICTTABLESIZE 9973 */
/* #define DICTTABLESIZE 99991 */
/* #define DICTTABLESIZE 999983 */
struct dict {
- struct dict_entry * buckets[DICTTABLESIZE];
- unsigned int (*key2hash)(void *);
- int (*key_cmp)(void *, void *);
+ struct dict_entry *buckets[DICTTABLESIZE];
+ unsigned int (*key2hash) (void *);
+ int (*key_cmp) (void *, void *);
};
-struct dict *
-dict_init(unsigned int (*key2hash)(void *), int (*key_cmp)(void *, void *)) {
- struct dict * d;
+struct dict *dict_init(unsigned int (*key2hash) (void *),
+ int (*key_cmp) (void *, void *))
+{
+ struct dict *d;
int i;
d = malloc(sizeof(struct dict));
@@ -40,7 +41,7 @@
perror("malloc()");
exit(1);
}
- for (i = 0; i < DICTTABLESIZE; i++) { /* better use memset()? */
+ for (i = 0; i < DICTTABLESIZE; i++) { /* better use memset()? */
d->buckets[i] = NULL;
}
d->key2hash = key2hash;
@@ -48,10 +49,10 @@
return d;
}
-void
-dict_clear(struct dict * d) {
+void dict_clear(struct dict *d)
+{
int i;
- struct dict_entry * entry, * nextentry;
+ struct dict_entry *entry, *nextentry;
assert(d);
for (i = 0; i < DICTTABLESIZE; i++) {
@@ -64,9 +65,9 @@
free(d);
}
-int
-dict_enter(struct dict * d, void * key, void * value) {
- struct dict_entry * entry, * newentry;
+int dict_enter(struct dict *d, void *key, void *value)
+{
+ struct dict_entry *entry, *newentry;
unsigned int hash = d->key2hash(key);
unsigned int bucketpos = hash % DICTTABLESIZE;
@@ -77,26 +78,29 @@
exit(1);
}
- newentry->hash = hash;
- newentry->key = key;
+ newentry->hash = hash;
+ newentry->key = key;
newentry->value = value;
- newentry->next = NULL;
+ newentry->next = NULL;
entry = d->buckets[bucketpos];
- while (entry && entry->next) entry = entry->next;
+ while (entry && entry->next)
+ entry = entry->next;
- if (entry) entry->next = newentry;
- else d->buckets[bucketpos] = newentry;
+ if (entry)
+ entry->next = newentry;
+ else
+ d->buckets[bucketpos] = newentry;
debug(3, "new dict entry at %p[%d]: (%p,%p)", d, bucketpos, key, value);
return 0;
}
-void *
-dict_find_entry(struct dict * d, void * key) {
+void *dict_find_entry(struct dict *d, void *key)
+{
unsigned int hash = d->key2hash(key);
unsigned int bucketpos = hash % DICTTABLESIZE;
- struct dict_entry * entry;
+ struct dict_entry *entry;
assert(d);
for (entry = d->buckets[bucketpos]; entry; entry = entry->next) {
@@ -111,14 +115,16 @@
}
void
-dict_apply_to_all(struct dict * d, void (*func)(void *key, void *value, void *data), void *data) {
+dict_apply_to_all(struct dict *d,
+ void (*func) (void *key, void *value, void *data), void *data)
+{
int i;
if (!d) {
return;
}
for (i = 0; i < DICTTABLESIZE; i++) {
- struct dict_entry * entry = d->buckets[i];
+ struct dict_entry *entry = d->buckets[i];
while (entry) {
func(entry->key, entry->value, data);
entry = entry->next;
@@ -128,35 +134,35 @@
/*****************************************************************************/
-unsigned int
-dict_key2hash_string(void * key) {
- const char * s = (const char *)key;
+unsigned int dict_key2hash_string(void *key)
+{
+ const char *s = (const char *)key;
unsigned int total = 0, shift = 0;
assert(key);
while (*s) {
total = total ^ ((*s) << shift);
shift += 5;
- if (shift > 24) shift -= 24;
+ if (shift > 24)
+ shift -= 24;
s++;
}
return total;
}
-int
-dict_key_cmp_string(void * key1, void * key2) {
+int dict_key_cmp_string(void *key1, void *key2)
+{
assert(key1);
assert(key2);
return strcmp((const char *)key1, (const char *)key2);
}
-unsigned int
-dict_key2hash_int(void * key) {
+unsigned int dict_key2hash_int(void *key)
+{
return (unsigned long)key;
}
-int
-dict_key_cmp_int(void * key1, void * key2) {
+int dict_key_cmp_int(void *key1, void *key2)
+{
return key1 - key2;
}
-
diff --git a/dict.h b/dict.h
index 6be0995..558e2f3 100644
--- a/dict.h
+++ b/dict.h
@@ -4,15 +4,16 @@
struct dict;
-extern struct dict * dict_init(unsigned int (*key2hash)(void *),
- int (*key_cmp)(void *, void *));
-extern void dict_clear(struct dict * d);
-extern int dict_enter(struct dict * d, void * key, void * value);
-extern void * dict_find_entry(struct dict * d, void * key);
-extern void dict_apply_to_all(struct dict * d,
- void (*func)(void *key, void *value, void *data), void *data);
+extern struct dict *dict_init(unsigned int (*key2hash) (void *),
+ int (*key_cmp) (void *, void *));
+extern void dict_clear(struct dict *d);
+extern int dict_enter(struct dict *d, void *key, void *value);
+extern void *dict_find_entry(struct dict *d, void *key);
+extern void dict_apply_to_all(struct dict *d,
+ void (*func) (void *key, void *value, void *data),
+ void *data);
-extern unsigned int dict_key2hash_string(void * key);
-extern int dict_key_cmp_string(void * key1, void * key2);
-extern unsigned int dict_key2hash_int(void * key);
-extern int dict_key_cmp_int(void * key1, void * key2);
+extern unsigned int dict_key2hash_string(void *key);
+extern int dict_key_cmp_string(void *key1, void *key2);
+extern unsigned int dict_key2hash_int(void *key);
+extern int dict_key_cmp_int(void *key1, void *key2);
diff --git a/display_args.c b/display_args.c
index e922d4b..083c9dc 100644
--- a/display_args.c
+++ b/display_args.c
@@ -11,109 +11,124 @@
#include "options.h"
static int display_char(int what);
-static int display_string(enum tof type, struct process * proc, int arg_num);
-static int display_stringN(int arg2, enum tof type, struct process * proc, int arg_num);
-static int display_unknown(enum tof type, struct process * proc, int arg_num);
-static int display_format(enum tof type, struct process * proc, int arg_num);
+static int display_string(enum tof type, struct process *proc, int arg_num);
+static int display_stringN(int arg2, enum tof type, struct process *proc,
+ int arg_num);
+static int display_unknown(enum tof type, struct process *proc, int arg_num);
+static int display_format(enum tof type, struct process *proc, int arg_num);
int
-display_arg(enum tof type, struct process * proc, int arg_num, enum arg_type at) {
+display_arg(enum tof type, struct process *proc, int arg_num, enum arg_type at)
+{
int tmp;
long arg;
- switch(at) {
- case ARGTYPE_VOID:
- return 0;
- case ARGTYPE_INT:
- return fprintf(output, "%d", (int)gimme_arg(type, proc, arg_num));
- case ARGTYPE_UINT:
- return fprintf(output, "%u", (unsigned)gimme_arg(type, proc, arg_num));
- case ARGTYPE_LONG:
- if (proc->mask_32bit)
- return fprintf(output, "%d", (int)gimme_arg(type, proc, arg_num));
- return fprintf(output, "%ld", gimme_arg(type, proc, arg_num));
- case ARGTYPE_ULONG:
- if (proc->mask_32bit)
- return fprintf(output, "%u", (unsigned)gimme_arg(type, proc, arg_num));
- return fprintf(output, "%lu", (unsigned long)gimme_arg(type, proc, arg_num));
- case ARGTYPE_OCTAL:
- return fprintf(output, "0%o", (unsigned)gimme_arg(type, proc, arg_num));
- case ARGTYPE_CHAR:
- tmp = fprintf(output, "'");
- tmp += display_char((int)gimme_arg(type, proc, arg_num));
- tmp += fprintf(output, "'");
- return tmp;
- case ARGTYPE_ADDR:
- arg = gimme_arg(type, proc, arg_num);
- if (!arg) {
- return fprintf(output, "NULL");
- } else {
- return fprintf(output, "%p", (void *)arg);
- }
- case ARGTYPE_FORMAT:
- return display_format(type, proc, arg_num);
- case ARGTYPE_STRING:
- return display_string(type, proc, arg_num);
- case ARGTYPE_STRING0:
- return display_stringN(0, type, proc, arg_num);
- case ARGTYPE_STRING1:
- return display_stringN(1, type, proc, arg_num);
- case ARGTYPE_STRING2:
- return display_stringN(2, type, proc, arg_num);
- case ARGTYPE_STRING3:
- return display_stringN(3, type, proc, arg_num);
- case ARGTYPE_STRING4:
- return display_stringN(4, type, proc, arg_num);
- case ARGTYPE_STRING5:
- return display_stringN(5, type, proc, arg_num);
- case ARGTYPE_UNKNOWN:
- default:
- return display_unknown(type, proc, arg_num);
+ switch (at) {
+ case ARGTYPE_VOID:
+ return 0;
+ case ARGTYPE_INT:
+ return fprintf(output, "%d",
+ (int)gimme_arg(type, proc, arg_num));
+ case ARGTYPE_UINT:
+ return fprintf(output, "%u",
+ (unsigned)gimme_arg(type, proc, arg_num));
+ case ARGTYPE_LONG:
+ if (proc->mask_32bit)
+ return fprintf(output, "%d",
+ (int)gimme_arg(type, proc, arg_num));
+ return fprintf(output, "%ld", gimme_arg(type, proc, arg_num));
+ case ARGTYPE_ULONG:
+ if (proc->mask_32bit)
+ return fprintf(output, "%u",
+ (unsigned)gimme_arg(type, proc,
+ arg_num));
+ return fprintf(output, "%lu",
+ (unsigned long)gimme_arg(type, proc, arg_num));
+ case ARGTYPE_OCTAL:
+ return fprintf(output, "0%o",
+ (unsigned)gimme_arg(type, proc, arg_num));
+ case ARGTYPE_CHAR:
+ tmp = fprintf(output, "'");
+ tmp += display_char((int)gimme_arg(type, proc, arg_num));
+ tmp += fprintf(output, "'");
+ return tmp;
+ case ARGTYPE_ADDR:
+ arg = gimme_arg(type, proc, arg_num);
+ if (!arg) {
+ return fprintf(output, "NULL");
+ } else {
+ return fprintf(output, "%p", (void *)arg);
+ }
+ case ARGTYPE_FORMAT:
+ return display_format(type, proc, arg_num);
+ case ARGTYPE_STRING:
+ return display_string(type, proc, arg_num);
+ case ARGTYPE_STRING0:
+ return display_stringN(0, type, proc, arg_num);
+ case ARGTYPE_STRING1:
+ return display_stringN(1, type, proc, arg_num);
+ case ARGTYPE_STRING2:
+ return display_stringN(2, type, proc, arg_num);
+ case ARGTYPE_STRING3:
+ return display_stringN(3, type, proc, arg_num);
+ case ARGTYPE_STRING4:
+ return display_stringN(4, type, proc, arg_num);
+ case ARGTYPE_STRING5:
+ return display_stringN(5, type, proc, arg_num);
+ case ARGTYPE_UNKNOWN:
+ default:
+ return display_unknown(type, proc, arg_num);
}
return fprintf(output, "?");
}
-static int
-display_char(int what) {
- switch(what) {
- case -1: return fprintf(output, "EOF");
- case '\r': return fprintf(output, "\\r");
- case '\n': return fprintf(output, "\\n");
- case '\t': return fprintf(output, "\\t");
- case '\b': return fprintf(output, "\\b");
- case '\\': return fprintf(output, "\\\\");
- default:
- if ((what<32) || (what>126)) {
- return fprintf(output, "\\%03o", (unsigned char)what);
- } else {
- return fprintf(output, "%c", what);
- }
+static int display_char(int what)
+{
+ switch (what) {
+ case -1:
+ return fprintf(output, "EOF");
+ case '\r':
+ return fprintf(output, "\\r");
+ case '\n':
+ return fprintf(output, "\\n");
+ case '\t':
+ return fprintf(output, "\\t");
+ case '\b':
+ return fprintf(output, "\\b");
+ case '\\':
+ return fprintf(output, "\\\\");
+ default:
+ if ((what < 32) || (what > 126)) {
+ return fprintf(output, "\\%03o", (unsigned char)what);
+ } else {
+ return fprintf(output, "%c", what);
+ }
}
}
-static int string_maxlength=INT_MAX;
+static int string_maxlength = INT_MAX;
#define MIN(a,b) (((a)<(b)) ? (a) : (b))
-static int
-display_string(enum tof type, struct process * proc, int arg_num) {
- void * addr;
- unsigned char * str1;
+static int display_string(enum tof type, struct process *proc, int arg_num)
+{
+ void *addr;
+ unsigned char *str1;
int i;
- int len=0;
+ int len = 0;
addr = (void *)gimme_arg(type, proc, arg_num);
if (!addr) {
return fprintf(output, "NULL");
}
- str1 = malloc(MIN(opt_s,string_maxlength)+3);
+ str1 = malloc(MIN(opt_s, string_maxlength) + 3);
if (!str1) {
return fprintf(output, "???");
}
- umovestr(proc, addr, MIN(opt_s,string_maxlength)+1, str1);
+ umovestr(proc, addr, MIN(opt_s, string_maxlength) + 1, str1);
len = fprintf(output, "\"");
- for(i=0; i<MIN(opt_s,string_maxlength); i++) {
+ for (i = 0; i < MIN(opt_s, string_maxlength); i++) {
if (str1[i]) {
len += display_char(str1[i]);
} else {
@@ -129,52 +144,53 @@
}
static int
-display_stringN(int arg2, enum tof type, struct process * proc, int arg_num) {
+display_stringN(int arg2, enum tof type, struct process *proc, int arg_num)
+{
int a;
- string_maxlength=gimme_arg(type, proc, arg2-1);
+ string_maxlength = gimme_arg(type, proc, arg2 - 1);
a = display_string(type, proc, arg_num);
- string_maxlength=INT_MAX;
+ string_maxlength = INT_MAX;
return a;
}
-static int
-display_unknown(enum tof type, struct process * proc, int arg_num) {
+static int display_unknown(enum tof type, struct process *proc, int arg_num)
+{
long tmp;
tmp = gimme_arg(type, proc, arg_num);
if (proc->mask_32bit) {
- if ((int)tmp<1000000 && (int)tmp>-1000000)
+ if ((int)tmp < 1000000 && (int)tmp > -1000000)
return fprintf(output, "%d", (int)tmp);
else
return fprintf(output, "%p", (void *)tmp);
- } else if (tmp<1000000 && tmp>-1000000) {
+ } else if (tmp < 1000000 && tmp > -1000000) {
return fprintf(output, "%ld", tmp);
} else {
return fprintf(output, "%p", (void *)tmp);
}
}
-static int
-display_format(enum tof type, struct process * proc, int arg_num) {
- void * addr;
- unsigned char * str1;
+static int display_format(enum tof type, struct process *proc, int arg_num)
+{
+ void *addr;
+ unsigned char *str1;
int i;
- int len=0;
+ int len = 0;
addr = (void *)gimme_arg(type, proc, arg_num);
if (!addr) {
return fprintf(output, "NULL");
}
- str1 = malloc(MIN(opt_s,string_maxlength)+3);
+ str1 = malloc(MIN(opt_s, string_maxlength) + 3);
if (!str1) {
return fprintf(output, "???");
}
- umovestr(proc, addr, MIN(opt_s,string_maxlength)+1, str1);
+ umovestr(proc, addr, MIN(opt_s, string_maxlength) + 1, str1);
len = fprintf(output, "\"");
- for(i=0; len<MIN(opt_s,string_maxlength)+1; i++) {
+ for (i = 0; len < MIN(opt_s, string_maxlength) + 1; i++) {
if (str1[i]) {
len += display_char(str1[i]);
} else {
@@ -185,68 +201,114 @@
if (str1[i] && (opt_s <= string_maxlength)) {
len += fprintf(output, "...");
}
- for(i=0; str1[i]; i++) {
- if (str1[i]=='%') {
+ for (i = 0; str1[i]; i++) {
+ if (str1[i] == '%') {
int is_long = 0;
- while(1) {
+ while (1) {
unsigned char c = str1[++i];
if (c == '%') {
break;
} else if (!c) {
break;
- } else if (strchr ("lzZtj", c)) {
+ } else if (strchr("lzZtj", c)) {
is_long++;
if (c == 'j')
is_long++;
if (is_long > 1
- && (sizeof (long) < sizeof (long long) || proc->mask_32bit)) {
+ && (sizeof(long) < sizeof(long long)
+ || proc->mask_32bit)) {
len += fprintf(output, ", ...");
- str1[i+1]='\0';
+ str1[i + 1] = '\0';
break;
}
- } else if (c=='d' || c=='i') {
+ } else if (c == 'd' || c == 'i') {
if (!is_long || proc->mask_32bit)
- len += fprintf(output, ", %d", (int)gimme_arg(type, proc, ++arg_num));
+ len +=
+ fprintf(output, ", %d",
+ (int)gimme_arg(type,
+ proc,
+ ++arg_num));
else
- len += fprintf(output, ", %ld", gimme_arg(type, proc, ++arg_num));
+ len +=
+ fprintf(output, ", %ld",
+ gimme_arg(type,
+ proc,
+ ++arg_num));
break;
- } else if (c=='u') {
+ } else if (c == 'u') {
if (!is_long || proc->mask_32bit)
- len += fprintf(output, ", %u", (int)gimme_arg(type, proc, ++arg_num));
+ len +=
+ fprintf(output, ", %u",
+ (int)gimme_arg(type,
+ proc,
+ ++arg_num));
else
- len += fprintf(output, ", %lu", gimme_arg(type, proc, ++arg_num));
+ len +=
+ fprintf(output, ", %lu",
+ gimme_arg(type,
+ proc,
+ ++arg_num));
break;
- } else if (c=='o') {
+ } else if (c == 'o') {
if (!is_long || proc->mask_32bit)
- len += fprintf(output, ", 0%o", (int)gimme_arg(type, proc, ++arg_num));
+ len +=
+ fprintf(output, ", 0%o",
+ (int)gimme_arg(type,
+ proc,
+ ++arg_num));
else
- len += fprintf(output, ", 0%lo", gimme_arg(type, proc, ++arg_num));
+ len +=
+ fprintf(output, ", 0%lo",
+ gimme_arg(type,
+ proc,
+ ++arg_num));
break;
- } else if (c=='x' || c=='X') {
+ } else if (c == 'x' || c == 'X') {
if (!is_long || proc->mask_32bit)
- len += fprintf(output, ", %#x", (int)gimme_arg(type, proc, ++arg_num));
+ len +=
+ fprintf(output, ", %#x",
+ (int)gimme_arg(type,
+ proc,
+ ++arg_num));
else
- len += fprintf(output, ", %#lx", gimme_arg(type, proc, ++arg_num));
+ len +=
+ fprintf(output, ", %#lx",
+ gimme_arg(type,
+ proc,
+ ++arg_num));
break;
} else if (strchr("eEfFgGaACS", c)
- || (is_long && (c=='c' || c=='s'))) {
+ || (is_long
+ && (c == 'c' || c == 's'))) {
len += fprintf(output, ", ...");
- str1[i+1]='\0';
+ str1[i + 1] = '\0';
break;
- } else if (c=='c') {
+ } else if (c == 'c') {
len += fprintf(output, ", '");
- len += display_char((int)gimme_arg(type, proc, ++arg_num));
+ len +=
+ display_char((int)
+ gimme_arg(type, proc,
+ ++arg_num));
len += fprintf(output, "'");
break;
- } else if (c=='s') {
+ } else if (c == 's') {
len += fprintf(output, ", ");
- len += display_string(type, proc, ++arg_num);
+ len +=
+ display_string(type, proc,
+ ++arg_num);
break;
- } else if (c=='p' || c=='n') {
- len += fprintf(output, ", %p", (void *)gimme_arg(type, proc, ++arg_num));
+ } else if (c == 'p' || c == 'n') {
+ len +=
+ fprintf(output, ", %p",
+ (void *)gimme_arg(type,
+ proc,
+ ++arg_num));
break;
- } else if (c=='*') {
- len += fprintf(output, ", %d", (int)gimme_arg(type, proc, ++arg_num));
+ } else if (c == '*') {
+ len +=
+ fprintf(output, ", %d",
+ (int)gimme_arg(type, proc,
+ ++arg_num));
}
}
}
diff --git a/elf.c b/elf.c
index c7ef400..1830930 100644
--- a/elf.c
+++ b/elf.c
@@ -17,453 +17,448 @@
#include "debug.h"
#include "options.h"
-static void do_init_elf (struct ltelf *lte, const char *filename);
-static void do_close_elf (struct ltelf *lte);
-static void add_library_symbol (GElf_Addr addr, const char *name,
- struct library_symbol **library_symbolspp,
- int use_elf_plt2addr, int is_weak);
-static int in_load_libraries (const char *name, struct ltelf *lte);
-static GElf_Addr elf_plt2addr (struct ltelf *ltc, void *addr);
+static void do_init_elf(struct ltelf *lte, const char *filename);
+static void do_close_elf(struct ltelf *lte);
+static void add_library_symbol(GElf_Addr addr, const char *name,
+ struct library_symbol **library_symbolspp,
+ int use_elf_plt2addr, int is_weak);
+static int in_load_libraries(const char *name, struct ltelf *lte);
+static GElf_Addr elf_plt2addr(struct ltelf *ltc, void *addr);
+extern char *PLTs_initialized_by_here;
-extern char * PLTs_initialized_by_here;
-
-static void
-do_init_elf (struct ltelf *lte, const char *filename)
+static void do_init_elf(struct ltelf *lte, const char *filename)
{
- int i;
- GElf_Addr relplt_addr = 0;
- size_t relplt_size = 0;
+ int i;
+ GElf_Addr relplt_addr = 0;
+ size_t relplt_size = 0;
- debug (1, "Reading ELF from %s...", filename);
+ debug(1, "Reading ELF from %s...", filename);
- memset (lte, 0, sizeof (*lte));
- lte->fd = open (filename, O_RDONLY);
- if (lte->fd == -1)
- error (EXIT_FAILURE, errno, "Can't open \"%s\"", filename);
+ memset(lte, 0, sizeof(*lte));
+ lte->fd = open(filename, O_RDONLY);
+ if (lte->fd == -1)
+ error(EXIT_FAILURE, errno, "Can't open \"%s\"", filename);
#ifdef HAVE_ELF_C_READ_MMAP
- lte->elf = elf_begin (lte->fd, ELF_C_READ_MMAP, NULL);
+ lte->elf = elf_begin(lte->fd, ELF_C_READ_MMAP, NULL);
#else
- lte->elf = elf_begin (lte->fd, ELF_C_READ, NULL);
+ lte->elf = elf_begin(lte->fd, ELF_C_READ, NULL);
#endif
- if (lte->elf == NULL || elf_kind (lte->elf) != ELF_K_ELF)
- error (EXIT_FAILURE, 0, "Can't open ELF file \"%s\"", filename);
+ if (lte->elf == NULL || elf_kind(lte->elf) != ELF_K_ELF)
+ error(EXIT_FAILURE, 0, "Can't open ELF file \"%s\"", filename);
- if (gelf_getehdr (lte->elf, <e->ehdr) == NULL)
- error (EXIT_FAILURE, 0, "Can't read ELF header of \"%s\"", filename);
+ if (gelf_getehdr(lte->elf, <e->ehdr) == NULL)
+ error(EXIT_FAILURE, 0, "Can't read ELF header of \"%s\"",
+ filename);
- if (lte->ehdr.e_type != ET_EXEC && lte->ehdr.e_type != ET_DYN)
- error (EXIT_FAILURE, 0, "\"%s\" is not an ELF executable nor shared library",
- filename);
+ if (lte->ehdr.e_type != ET_EXEC && lte->ehdr.e_type != ET_DYN)
+ error(EXIT_FAILURE, 0,
+ "\"%s\" is not an ELF executable nor shared library",
+ filename);
- if ((lte->ehdr.e_ident[EI_CLASS] != LT_ELFCLASS
- || lte->ehdr.e_machine != LT_ELF_MACHINE)
+ if ((lte->ehdr.e_ident[EI_CLASS] != LT_ELFCLASS
+ || lte->ehdr.e_machine != LT_ELF_MACHINE)
#ifdef LT_ELF_MACHINE2
- && (lte->ehdr.e_ident[EI_CLASS] != LT_ELFCLASS2
- || lte->ehdr.e_machine != LT_ELF_MACHINE2)
+ && (lte->ehdr.e_ident[EI_CLASS] != LT_ELFCLASS2
+ || lte->ehdr.e_machine != LT_ELF_MACHINE2)
#endif
#ifdef LT_ELF_MACHINE3
- && (lte->ehdr.e_ident[EI_CLASS] != LT_ELFCLASS3
- || lte->ehdr.e_machine != LT_ELF_MACHINE3)
+ && (lte->ehdr.e_ident[EI_CLASS] != LT_ELFCLASS3
+ || lte->ehdr.e_machine != LT_ELF_MACHINE3)
#endif
- )
- error (EXIT_FAILURE, 0, "\"%s\" is ELF from incompatible architecture",
- filename);
+ )
+ error(EXIT_FAILURE, 0,
+ "\"%s\" is ELF from incompatible architecture", filename);
- for (i = 1; i < lte->ehdr.e_shnum; ++i)
- {
- Elf_Scn *scn;
- GElf_Shdr shdr;
- const char *name;
+ for (i = 1; i < lte->ehdr.e_shnum; ++i) {
+ Elf_Scn *scn;
+ GElf_Shdr shdr;
+ const char *name;
- scn = elf_getscn (lte->elf, i);
- if (scn == NULL || gelf_getshdr (scn, &shdr) == NULL)
- error (EXIT_FAILURE, 0, "Couldn't get section header from \"%s\"",
- filename);
+ scn = elf_getscn(lte->elf, i);
+ if (scn == NULL || gelf_getshdr(scn, &shdr) == NULL)
+ error(EXIT_FAILURE, 0,
+ "Couldn't get section header from \"%s\"",
+ filename);
- name = elf_strptr (lte->elf, lte->ehdr.e_shstrndx, shdr.sh_name);
- if (name == NULL)
- error (EXIT_FAILURE, 0, "Couldn't get section header from \"%s\"",
- filename);
+ name = elf_strptr(lte->elf, lte->ehdr.e_shstrndx, shdr.sh_name);
+ if (name == NULL)
+ error(EXIT_FAILURE, 0,
+ "Couldn't get section header from \"%s\"",
+ filename);
- if (shdr.sh_type == SHT_SYMTAB)
- {
- Elf_Data *data;
+ if (shdr.sh_type == SHT_SYMTAB) {
+ Elf_Data *data;
- lte->symtab = elf_getdata (scn,NULL);
- lte->symtab_count = shdr.sh_size / shdr.sh_entsize;
- if ((lte->symtab == NULL || elf_getdata(scn, lte->symtab) != NULL)
- && opt_x != NULL)
- error (EXIT_FAILURE, 0, "Couldn't get .symtab data from \"%s\"",
- filename);
+ lte->symtab = elf_getdata(scn, NULL);
+ lte->symtab_count = shdr.sh_size / shdr.sh_entsize;
+ if ((lte->symtab == NULL
+ || elf_getdata(scn, lte->symtab) != NULL)
+ && opt_x != NULL)
+ error(EXIT_FAILURE, 0,
+ "Couldn't get .symtab data from \"%s\"",
+ filename);
- scn = elf_getscn (lte->elf, shdr.sh_link);
- if (scn == NULL || gelf_getshdr (scn, &shdr) == NULL)
- error (EXIT_FAILURE, 0, "Couldn't get section header from \"%s\"",
- filename);
+ scn = elf_getscn(lte->elf, shdr.sh_link);
+ if (scn == NULL || gelf_getshdr(scn, &shdr) == NULL)
+ error(EXIT_FAILURE, 0,
+ "Couldn't get section header from \"%s\"",
+ filename);
- data = elf_getdata (scn, NULL);
- if (data == NULL || elf_getdata (scn, data) != NULL
- || shdr.sh_size != data->d_size || data->d_off)
- error (EXIT_FAILURE, 0, "Couldn't get .strtab data from \"%s\"",
- filename);
+ data = elf_getdata(scn, NULL);
+ if (data == NULL || elf_getdata(scn, data) != NULL
+ || shdr.sh_size != data->d_size || data->d_off)
+ error(EXIT_FAILURE, 0,
+ "Couldn't get .strtab data from \"%s\"",
+ filename);
- lte->strtab = data->d_buf;
- }
- else if (shdr.sh_type == SHT_DYNSYM)
- {
- Elf_Data *data;
+ lte->strtab = data->d_buf;
+ } else if (shdr.sh_type == SHT_DYNSYM) {
+ Elf_Data *data;
- lte->dynsym = elf_getdata (scn, NULL);
- lte->dynsym_count = shdr.sh_size / shdr.sh_entsize;
- if (lte->dynsym == NULL || elf_getdata (scn, lte->dynsym) != NULL)
- error (EXIT_FAILURE, 0, "Couldn't get .dynsym data from \"%s\"",
- filename);
+ lte->dynsym = elf_getdata(scn, NULL);
+ lte->dynsym_count = shdr.sh_size / shdr.sh_entsize;
+ if (lte->dynsym == NULL
+ || elf_getdata(scn, lte->dynsym) != NULL)
+ error(EXIT_FAILURE, 0,
+ "Couldn't get .dynsym data from \"%s\"",
+ filename);
- scn = elf_getscn (lte->elf, shdr.sh_link);
- if (scn == NULL || gelf_getshdr (scn, &shdr) == NULL)
- error (EXIT_FAILURE, 0, "Couldn't get section header from \"%s\"",
- filename);
+ scn = elf_getscn(lte->elf, shdr.sh_link);
+ if (scn == NULL || gelf_getshdr(scn, &shdr) == NULL)
+ error(EXIT_FAILURE, 0,
+ "Couldn't get section header from \"%s\"",
+ filename);
- data = elf_getdata (scn, NULL);
- if (data == NULL || elf_getdata (scn, data) != NULL
- || shdr.sh_size != data->d_size || data->d_off)
- error (EXIT_FAILURE, 0, "Couldn't get .dynstr data from \"%s\"",
- filename);
+ data = elf_getdata(scn, NULL);
+ if (data == NULL || elf_getdata(scn, data) != NULL
+ || shdr.sh_size != data->d_size || data->d_off)
+ error(EXIT_FAILURE, 0,
+ "Couldn't get .dynstr data from \"%s\"",
+ filename);
- lte->dynstr = data->d_buf;
- }
- else if (shdr.sh_type == SHT_DYNAMIC)
- {
- Elf_Data *data;
- size_t j;
+ lte->dynstr = data->d_buf;
+ } else if (shdr.sh_type == SHT_DYNAMIC) {
+ Elf_Data *data;
+ size_t j;
- data = elf_getdata (scn, NULL);
- if (data == NULL || elf_getdata (scn, data) != NULL)
- error (EXIT_FAILURE, 0, "Couldn't get .dynamic data from \"%s\"",
- filename);
+ data = elf_getdata(scn, NULL);
+ if (data == NULL || elf_getdata(scn, data) != NULL)
+ error(EXIT_FAILURE, 0,
+ "Couldn't get .dynamic data from \"%s\"",
+ filename);
- for (j = 0; j < shdr.sh_size / shdr.sh_entsize; ++j)
- {
- GElf_Dyn dyn;
+ for (j = 0; j < shdr.sh_size / shdr.sh_entsize; ++j) {
+ GElf_Dyn dyn;
- if (gelf_getdyn (data, j, &dyn) == NULL)
- error (EXIT_FAILURE, 0, "Couldn't get .dynamic data from \"%s\"",
- filename);
+ if (gelf_getdyn(data, j, &dyn) == NULL)
+ error(EXIT_FAILURE, 0,
+ "Couldn't get .dynamic data from \"%s\"",
+ filename);
- if (dyn.d_tag == DT_JMPREL)
- relplt_addr = dyn.d_un.d_ptr;
- else if (dyn.d_tag == DT_PLTRELSZ)
- relplt_size = dyn.d_un.d_val;
- }
- }
- else if (shdr.sh_type == SHT_HASH)
- {
- Elf_Data *data;
- size_t j;
+ if (dyn.d_tag == DT_JMPREL)
+ relplt_addr = dyn.d_un.d_ptr;
+ else if (dyn.d_tag == DT_PLTRELSZ)
+ relplt_size = dyn.d_un.d_val;
+ }
+ } else if (shdr.sh_type == SHT_HASH) {
+ Elf_Data *data;
+ size_t j;
- data = elf_getdata (scn, NULL);
- if (data == NULL || elf_getdata (scn, data) != NULL
- || data->d_off || data->d_size != shdr.sh_size)
- error (EXIT_FAILURE, 0, "Couldn't get .hash data from \"%s\"",
- filename);
+ data = elf_getdata(scn, NULL);
+ if (data == NULL || elf_getdata(scn, data) != NULL
+ || data->d_off || data->d_size != shdr.sh_size)
+ error(EXIT_FAILURE, 0,
+ "Couldn't get .hash data from \"%s\"",
+ filename);
- if (shdr.sh_entsize == 4)
- {
- /* Standard conforming ELF. */
- if (data->d_type != ELF_T_WORD)
- error (EXIT_FAILURE, 0, "Couldn't get .hash data from \"%s\"",
- filename);
- lte->hash = (Elf32_Word *) data->d_buf;
- }
- else if (shdr.sh_entsize == 8)
- {
- /* Alpha or s390x. */
- Elf32_Word *dst, *src;
- size_t hash_count = data->d_size / 8;
+ if (shdr.sh_entsize == 4) {
+ /* Standard conforming ELF. */
+ if (data->d_type != ELF_T_WORD)
+ error(EXIT_FAILURE, 0,
+ "Couldn't get .hash data from \"%s\"",
+ filename);
+ lte->hash = (Elf32_Word *) data->d_buf;
+ } else if (shdr.sh_entsize == 8) {
+ /* Alpha or s390x. */
+ Elf32_Word *dst, *src;
+ size_t hash_count = data->d_size / 8;
- lte->hash = (Elf32_Word *)
- malloc (hash_count * sizeof (Elf32_Word));
- if (lte->hash == NULL)
- error (EXIT_FAILURE, 0, "Couldn't convert .hash section from \"%s\"",
- filename);
- lte->hash_malloced = 1;
- dst = lte->hash;
- src = (Elf32_Word *) data->d_buf;
- if ((data->d_type == ELF_T_WORD && __BYTE_ORDER == __BIG_ENDIAN)
- || (data->d_type == ELF_T_XWORD
- && lte->ehdr.e_ident[EI_DATA] == ELFDATA2MSB))
- ++src;
- for (j = 0; j < hash_count; ++j, src += 2)
- *dst++ = *src;
- }
- else
- error (EXIT_FAILURE, 0, "Unknown .hash sh_entsize in \"%s\"",
- filename);
- }
- else if (shdr.sh_type == SHT_PROGBITS || shdr.sh_type == SHT_NOBITS)
- {
- if (strcmp (name, ".plt") == 0)
- {
- 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_size = shdr.sh_size;
- lte->opd = elf_rawdata (scn, NULL);
- }
- }
- }
-
- if (lte->dynsym == NULL || lte->dynstr == NULL)
- error (EXIT_FAILURE, 0, "Couldn't find .dynsym or .dynstr in \"%s\"",
- filename);
-
- if (!relplt_addr || !lte->plt_addr)
- {
- debug (1, "%s has no PLT relocations", filename);
- lte->relplt = NULL;
- lte->relplt_count = 0;
- }
- else
- {
- for (i = 1; i < lte->ehdr.e_shnum; ++i)
- {
- Elf_Scn *scn;
- GElf_Shdr shdr;
-
- scn = elf_getscn (lte->elf, i);
- if (scn == NULL || gelf_getshdr (scn, &shdr) == NULL)
- error (EXIT_FAILURE, 0, "Couldn't get section header from \"%s\"",
- filename);
- if (shdr.sh_addr == relplt_addr && shdr.sh_size == relplt_size)
- {
- lte->relplt = elf_getdata (scn, NULL);
- lte->relplt_count = shdr.sh_size / shdr.sh_entsize;
- if (lte->relplt == NULL
- || elf_getdata (scn, lte->relplt) != NULL)
- error (EXIT_FAILURE, 0, "Couldn't get .rel*.plt data from \"%s\"",
- filename);
- break;
- }
+ lte->hash = (Elf32_Word *)
+ malloc(hash_count * sizeof(Elf32_Word));
+ if (lte->hash == NULL)
+ error(EXIT_FAILURE, 0,
+ "Couldn't convert .hash section from \"%s\"",
+ filename);
+ lte->hash_malloced = 1;
+ dst = lte->hash;
+ src = (Elf32_Word *) data->d_buf;
+ if ((data->d_type == ELF_T_WORD
+ && __BYTE_ORDER == __BIG_ENDIAN)
+ || (data->d_type == ELF_T_XWORD
+ && lte->ehdr.e_ident[EI_DATA] ==
+ ELFDATA2MSB))
+ ++src;
+ for (j = 0; j < hash_count; ++j, src += 2)
+ *dst++ = *src;
+ } else
+ error(EXIT_FAILURE, 0,
+ "Unknown .hash sh_entsize in \"%s\"",
+ filename);
+ } else if (shdr.sh_type == SHT_PROGBITS
+ || shdr.sh_type == SHT_NOBITS) {
+ if (strcmp(name, ".plt") == 0) {
+ 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_size = shdr.sh_size;
+ lte->opd = elf_rawdata(scn, NULL);
+ }
+ }
}
- if (i == lte->ehdr.e_shnum)
- error (EXIT_FAILURE, 0, "Couldn't find .rel*.plt section in \"%s\"",
- filename);
+ if (lte->dynsym == NULL || lte->dynstr == NULL)
+ error(EXIT_FAILURE, 0,
+ "Couldn't find .dynsym or .dynstr in \"%s\"", filename);
- debug (1, "%s %zd PLT relocations", filename, lte->relplt_count);
- }
+ if (!relplt_addr || !lte->plt_addr) {
+ debug(1, "%s has no PLT relocations", filename);
+ lte->relplt = NULL;
+ lte->relplt_count = 0;
+ } else {
+ for (i = 1; i < lte->ehdr.e_shnum; ++i) {
+ Elf_Scn *scn;
+ GElf_Shdr shdr;
+
+ scn = elf_getscn(lte->elf, i);
+ if (scn == NULL || gelf_getshdr(scn, &shdr) == NULL)
+ error(EXIT_FAILURE, 0,
+ "Couldn't get section header from \"%s\"",
+ filename);
+ if (shdr.sh_addr == relplt_addr
+ && shdr.sh_size == relplt_size) {
+ lte->relplt = elf_getdata(scn, NULL);
+ lte->relplt_count =
+ shdr.sh_size / shdr.sh_entsize;
+ if (lte->relplt == NULL
+ || elf_getdata(scn, lte->relplt) != NULL)
+ error(EXIT_FAILURE, 0,
+ "Couldn't get .rel*.plt data from \"%s\"",
+ filename);
+ break;
+ }
+ }
+
+ if (i == lte->ehdr.e_shnum)
+ error(EXIT_FAILURE, 0,
+ "Couldn't find .rel*.plt section in \"%s\"",
+ filename);
+
+ debug(1, "%s %zd PLT relocations", filename, lte->relplt_count);
+ }
+}
+
+static void do_close_elf(struct ltelf *lte)
+{
+ if (lte->hash_malloced)
+ free((char *)lte->hash);
+ elf_end(lte->elf);
+ close(lte->fd);
}
static void
-do_close_elf (struct ltelf *lte)
+add_library_symbol(GElf_Addr addr, const char *name,
+ struct library_symbol **library_symbolspp,
+ int use_elf_plt2addr, int is_weak)
{
- if (lte->hash_malloced)
- free ((char *) lte->hash);
- elf_end (lte->elf);
- close (lte->fd);
+ struct library_symbol *s;
+ s = malloc(sizeof(struct library_symbol) + strlen(name) + 1);
+ if (s == NULL)
+ error(EXIT_FAILURE, errno, "add_library_symbol failed");
+
+ s->needs_init = 1;
+ s->is_weak = is_weak;
+ s->static_plt2addr = use_elf_plt2addr;
+ s->next = *library_symbolspp;
+ s->enter_addr = (void *)(uintptr_t) addr;
+ s->brkpnt = NULL;
+ s->name = (char *)(s + 1);
+ strcpy(s->name, name);
+ *library_symbolspp = s;
+
+ debug(2, "addr: %p, symbol: \"%s\"", (void *)(uintptr_t) addr, name);
}
-static void
-add_library_symbol (GElf_Addr addr, const char *name,
- struct library_symbol **library_symbolspp,
- int use_elf_plt2addr, int is_weak)
+static int in_load_libraries(const char *name, struct ltelf *lte)
{
- struct library_symbol *s;
- s = malloc (sizeof (struct library_symbol) + strlen (name) + 1);
- if (s == NULL)
- error (EXIT_FAILURE, errno, "add_library_symbol failed");
+ size_t i;
+ unsigned long hash;
- s->needs_init = 1;
- s->is_weak = is_weak;
- s->static_plt2addr = use_elf_plt2addr;
- s->next = *library_symbolspp;
- s->enter_addr = (void *) (uintptr_t) addr;
- s->brkpnt = NULL;
- s->name = (char *) (s + 1);
- strcpy (s->name, name);
- *library_symbolspp = s;
+ if (!library_num)
+ return 1;
- debug (2, "addr: %p, symbol: \"%s\"", (void *) (uintptr_t) addr, name);
-}
+ hash = elf_hash(name);
+ for (i = 1; i <= library_num; ++i) {
+ Elf32_Word nbuckets, symndx;
+ Elf32_Word *buckets, *chain;
-static int
-in_load_libraries (const char *name, struct ltelf *lte)
-{
- size_t i;
- unsigned long hash;
+ if (lte[i].hash == NULL)
+ continue;
- if (!library_num)
- return 1;
+ nbuckets = lte[i].hash[0];
+ buckets = <e[i].hash[2];
+ chain = <e[i].hash[2 + nbuckets];
+ for (symndx = buckets[hash % nbuckets];
+ symndx != STN_UNDEF; symndx = chain[symndx]) {
+ GElf_Sym sym;
- hash = elf_hash (name);
- for (i = 1; i <= library_num; ++i)
- {
- Elf32_Word nbuckets, symndx;
- Elf32_Word *buckets, *chain;
+ if (gelf_getsym(lte[i].dynsym, symndx, &sym) == NULL)
+ error(EXIT_FAILURE, 0,
+ "Couldn't get symbol from .dynsym");
- if (lte[i].hash == NULL)
- continue;
-
- nbuckets = lte[i].hash[0];
- buckets = <e[i].hash[2];
- chain = <e[i].hash[2 + nbuckets];
- for (symndx = buckets[hash % nbuckets];
- symndx != STN_UNDEF;
- symndx = chain[symndx])
- {
- GElf_Sym sym;
-
- if (gelf_getsym (lte[i].dynsym, symndx, &sym) == NULL)
- error (EXIT_FAILURE, 0, "Couldn't get symbol from .dynsym");
-
- if (sym.st_value != 0
- && sym.st_shndx != SHN_UNDEF
- && strcmp (name, lte[i].dynstr + sym.st_name) == 0)
- return 1;
+ if (sym.st_value != 0
+ && sym.st_shndx != SHN_UNDEF
+ && strcmp(name, lte[i].dynstr + sym.st_name) == 0)
+ return 1;
+ }
}
- }
- return 0;
+ return 0;
}
-static GElf_Addr
-elf_plt2addr (struct ltelf *lte, void *addr)
+static GElf_Addr elf_plt2addr(struct ltelf *lte, void *addr)
{
- long base;
- long offset;
- GElf_Addr ret_val;
+ long base;
+ long offset;
+ GElf_Addr ret_val;
- if (!lte->opd)
- return (GElf_Addr)addr;
+ if (!lte->opd)
+ return (GElf_Addr) addr;
- base = (long)lte->opd->d_buf;
- offset = (long)addr - (long)lte->opd_addr;
- if (offset > lte->opd_size)
- error (EXIT_FAILURE, 0, "static plt not in .opd");
-
- ret_val = (GElf_Addr) *(long*)(base + offset);
- return ret_val;
+ base = (long)lte->opd->d_buf;
+ offset = (long)addr - (long)lte->opd_addr;
+ if (offset > lte->opd_size)
+ error(EXIT_FAILURE, 0, "static plt not in .opd");
+
+ ret_val = (GElf_Addr) * (long *)(base + offset);
+ return ret_val;
}
-struct library_symbol *
-read_elf (struct process * proc)
+struct library_symbol *read_elf(struct process *proc)
{
- struct library_symbol *library_symbols = NULL;
- struct ltelf lte[MAX_LIBRARY + 1];
- size_t i;
- struct opt_e_t * xptr;
- struct library_symbol **lib_tail = NULL;
- struct opt_e_t *main_cheat;
+ struct library_symbol *library_symbols = NULL;
+ struct ltelf lte[MAX_LIBRARY + 1];
+ size_t i;
+ struct opt_e_t *xptr;
+ struct library_symbol **lib_tail = NULL;
+ struct opt_e_t *main_cheat;
- elf_version (EV_CURRENT);
+ elf_version(EV_CURRENT);
- do_init_elf (lte, proc->filename);
- proc->e_machine = lte->ehdr.e_machine;
- for (i = 0; i < library_num; ++i)
- do_init_elf (<e[i + 1], library[i]);
+ do_init_elf(lte, proc->filename);
+ proc->e_machine = lte->ehdr.e_machine;
+ for (i = 0; i < library_num; ++i)
+ do_init_elf(<e[i + 1], library[i]);
- for (i = 0; i < lte->relplt_count; ++i)
- {
- GElf_Rel rel;
- GElf_Rela rela;
- GElf_Sym sym;
- GElf_Addr addr;
- void *ret;
- const char *name;
+ for (i = 0; i < lte->relplt_count; ++i) {
+ GElf_Rel rel;
+ GElf_Rela rela;
+ GElf_Sym sym;
+ GElf_Addr addr;
+ void *ret;
+ const char *name;
- if (lte->relplt->d_type == ELF_T_REL)
- {
- ret = gelf_getrel (lte->relplt, i, &rel);
- rela.r_offset = rel.r_offset;
- rela.r_info = rel.r_info;
- rela.r_addend = 0;
+ if (lte->relplt->d_type == ELF_T_REL) {
+ ret = gelf_getrel(lte->relplt, i, &rel);
+ rela.r_offset = rel.r_offset;
+ rela.r_info = rel.r_info;
+ rela.r_addend = 0;
+ } else
+ ret = gelf_getrela(lte->relplt, i, &rela);
+
+ if (ret == NULL
+ || ELF64_R_SYM(rela.r_info) >= lte->dynsym_count
+ || gelf_getsym(lte->dynsym, ELF64_R_SYM(rela.r_info),
+ &sym) == NULL)
+ error(EXIT_FAILURE, 0,
+ "Couldn't get relocation from \"%s\"",
+ proc->filename);
+
+ if (!sym.st_value && PLTs_initialized_by_here)
+ proc->need_to_reinitialize_breakpoints = 1;
+
+ name = lte->dynstr + sym.st_name;
+ if (in_load_libraries(name, lte)) {
+ addr = arch_plt_sym_val(lte, i, &rela);
+ add_library_symbol(addr, name, &library_symbols, 0,
+ ELF64_ST_BIND(sym.st_info) != 0);
+ if (!lib_tail)
+ lib_tail = &(library_symbols->next);
+ }
}
- else
- ret = gelf_getrela (lte->relplt, i, &rela);
- if (ret == NULL
- || ELF64_R_SYM (rela.r_info) >= lte->dynsym_count
- || gelf_getsym (lte->dynsym, ELF64_R_SYM (rela.r_info), &sym) == NULL)
- error (EXIT_FAILURE, 0, "Couldn't get relocation from \"%s\"",
- proc->filename);
+ if (proc->need_to_reinitialize_breakpoints) {
+ /* Add "PLTs_initialized_by_here" to opt_x list, if not already there. */
+ main_cheat = (struct opt_e_t *)malloc(sizeof(struct opt_e_t));
+ if (main_cheat == NULL)
+ error(EXIT_FAILURE, 0, "Couldn allocate memory");
+ main_cheat->next = opt_x;
+ main_cheat->name = PLTs_initialized_by_here;
- if ( ! sym.st_value && PLTs_initialized_by_here)
- proc->need_to_reinitialize_breakpoints = 1;
-
- name = lte->dynstr + sym.st_name;
- if (in_load_libraries (name, lte))
- {
- addr = arch_plt_sym_val (lte, i, &rela);
- add_library_symbol (addr, name, &library_symbols, 0,
- ELF64_ST_BIND (sym.st_info) != 0);
- if (!lib_tail)
- lib_tail = &(library_symbols->next);
+ for (xptr = opt_x; xptr; xptr = xptr->next)
+ if (strcmp(xptr->name, PLTs_initialized_by_here) == 0
+ && main_cheat) {
+ free(main_cheat);
+ main_cheat = NULL;
+ break;
+ }
+ if (main_cheat)
+ opt_x = main_cheat;
}
- }
- if (proc->need_to_reinitialize_breakpoints)
- {
- /* Add "PLTs_initialized_by_here" to opt_x list, if not already there. */
- main_cheat = (struct opt_e_t *)malloc(sizeof(struct opt_e_t));
- if (main_cheat == NULL)
- error (EXIT_FAILURE, 0, "Couldn allocate memory");
- main_cheat->next = opt_x;
- main_cheat->name = PLTs_initialized_by_here;
+ for (i = 0; i < lte->symtab_count; ++i) {
+ GElf_Sym sym;
+ GElf_Addr addr;
+ const char *name;
- for (xptr=opt_x; xptr; xptr=xptr->next)
- if (strcmp(xptr->name, PLTs_initialized_by_here) == 0 && main_cheat)
- {
- free(main_cheat);
- main_cheat = NULL;
- break;
- }
- if (main_cheat)
- opt_x = main_cheat;
- }
+ if (gelf_getsym(lte->symtab, i, &sym) == NULL)
+ error(EXIT_FAILURE, 0,
+ "Couldn't get symbol from \"%s\"",
+ proc->filename);
- for (i = 0; i < lte->symtab_count; ++i)
- {
- GElf_Sym sym;
- GElf_Addr addr;
- const char *name;
+ name = lte->strtab + sym.st_name;
+ addr = sym.st_value;
+ if (!addr)
+ continue;
- if (gelf_getsym (lte->symtab, i, &sym) == NULL)
- error (EXIT_FAILURE, 0, "Couldn't get symbol from \"%s\"", proc->filename);
-
- name = lte->strtab + sym.st_name;
- addr = sym.st_value;
- if ( ! addr)
- continue;
-
- for (xptr=opt_x; xptr; xptr=xptr->next)
- if (xptr->name && strcmp (xptr->name, name) == 0)
- {
- /* 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);
- break;
- }
- }
- for (xptr=opt_x; xptr; xptr=xptr->next)
- if (xptr->name)
- {
- if (strcmp(xptr->name, E_ENTRY_NAME) == 0)
- add_library_symbol (elf_plt2addr(lte, (void*)lte->ehdr.e_entry),
- "_start", lib_tail, 1, 0);
- else
- fprintf (stderr, "Warning: Couldn't get symbol \"%s\" "
- "from \"%s\" or it's a duplicate",
- xptr->name, proc->filename);
- }
+ for (xptr = opt_x; xptr; xptr = xptr->next)
+ if (xptr->name && strcmp(xptr->name, name) == 0) {
+ /* 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);
+ break;
+ }
+ }
+ for (xptr = opt_x; xptr; xptr = xptr->next)
+ if (xptr->name) {
+ if (strcmp(xptr->name, E_ENTRY_NAME) == 0)
+ add_library_symbol(elf_plt2addr
+ (lte,
+ (void *)lte->ehdr.e_entry),
+ "_start", lib_tail, 1, 0);
+ else
+ fprintf(stderr,
+ "Warning: Couldn't get symbol \"%s\" "
+ "from \"%s\" or it's a duplicate",
+ xptr->name, proc->filename);
+ }
- for (i = 0; i < library_num + 1; ++i)
- do_close_elf (<e[i]);
+ for (i = 0; i < library_num + 1; ++i)
+ do_close_elf(<e[i]);
- return library_symbols;
+ return library_symbols;
}
diff --git a/elf.h b/elf.h
index 1a318c6..45fd238 100644
--- a/elf.h
+++ b/elf.h
@@ -6,33 +6,32 @@
#include "ltrace.h"
-struct ltelf
-{
- int fd;
- Elf *elf;
- GElf_Ehdr ehdr;
- Elf_Data *dynsym;
- size_t dynsym_count;
- const char *dynstr;
- GElf_Addr plt_addr;
- size_t plt_size;
- Elf_Data *relplt;
- size_t relplt_count;
- Elf_Data *symtab;
- const char *strtab;
- size_t symtab_count;
- Elf_Data *opd;
- GElf_Addr *opd_addr;
- size_t opd_size;
- Elf32_Word *hash;
- int hash_malloced;
+struct ltelf {
+ int fd;
+ Elf *elf;
+ GElf_Ehdr ehdr;
+ Elf_Data *dynsym;
+ size_t dynsym_count;
+ const char *dynstr;
+ GElf_Addr plt_addr;
+ size_t plt_size;
+ Elf_Data *relplt;
+ size_t relplt_count;
+ Elf_Data *symtab;
+ const char *strtab;
+ size_t symtab_count;
+ Elf_Data *opd;
+ GElf_Addr *opd_addr;
+ size_t opd_size;
+ Elf32_Word *hash;
+ int hash_malloced;
};
extern int library_num;
extern char *library[MAX_LIBRARY];
-extern struct library_symbol *read_elf (struct process *);
+extern struct library_symbol *read_elf(struct process *);
-extern GElf_Addr arch_plt_sym_val (struct ltelf *, size_t, GElf_Rela *);
+extern GElf_Addr arch_plt_sym_val(struct ltelf *, size_t, GElf_Rela *);
#endif
diff --git a/execute_program.c b/execute_program.c
index 09db44a..6697386 100644
--- a/execute_program.c
+++ b/execute_program.c
@@ -17,8 +17,8 @@
#include "debug.h"
#include "sysdep.h"
-static void
-change_uid(struct process * proc) {
+static void change_uid(struct process *proc)
+{
uid_t run_uid, run_euid;
gid_t run_gid, run_egid;
@@ -26,7 +26,8 @@
struct passwd *pent;
if (getuid() != 0 || geteuid() != 0) {
- fprintf(stderr, "you must be root to use the -u option\n");
+ fprintf(stderr,
+ "you must be root to use the -u option\n");
exit(1);
}
if ((pent = getpwnam(opt_u)) == NULL) {
@@ -68,21 +69,22 @@
}
}
-void
-execute_program(struct process * sp, char **argv) {
+void execute_program(struct process *sp, char **argv)
+{
pid_t pid;
debug(1, "Executing `%s'...", sp->filename);
pid = fork();
- if (pid<0) {
+ if (pid < 0) {
perror("ltrace: fork");
exit(1);
} else if (!pid) { /* child */
change_uid(sp);
trace_me();
execvp(sp->filename, argv);
- fprintf(stderr, "Can't execute `%s': %s\n", sp->filename, strerror(errno));
+ fprintf(stderr, "Can't execute `%s': %s\n", sp->filename,
+ strerror(errno));
exit(1);
}
diff --git a/ltrace.c b/ltrace.c
index d31a981..ddddd61 100644
--- a/ltrace.c
+++ b/ltrace.c
@@ -22,19 +22,19 @@
#define SYSCONFDIR "/etc"
#endif
-char * command = NULL;
-struct process * list_of_processes = NULL;
+char *command = NULL;
+struct process *list_of_processes = NULL;
-int exiting=0; /* =1 if a SIGINT or SIGTERM has been received */
+int exiting = 0; /* =1 if a SIGINT or SIGTERM has been received */
-static void
-signal_alarm(int sig) {
- struct process * tmp = list_of_processes;
+static void signal_alarm(int sig)
+{
+ struct process *tmp = list_of_processes;
- signal(SIGALRM,SIG_DFL);
- while(tmp) {
- struct opt_p_t * tmp2 = opt_p;
- while(tmp2) {
+ signal(SIGALRM, SIG_DFL);
+ while (tmp) {
+ struct opt_p_t *tmp2 = opt_p;
+ while (tmp2) {
if (tmp->pid == tmp2->pid) {
tmp = tmp->next;
if (!tmp) {
@@ -44,23 +44,23 @@
}
tmp2 = tmp2->next;
}
- debug(2,"Sending SIGSTOP to process %u\n",tmp->pid);
+ debug(2, "Sending SIGSTOP to process %u\n", tmp->pid);
kill(tmp->pid, SIGSTOP);
tmp = tmp->next;
}
}
-static void
-signal_exit(int sig) {
- exiting=1;
- debug(1,"Received interrupt signal; exiting...");
- signal(SIGINT,SIG_IGN);
- signal(SIGTERM,SIG_IGN);
- signal(SIGALRM,signal_alarm);
+static void signal_exit(int sig)
+{
+ exiting = 1;
+ debug(1, "Received interrupt signal; exiting...");
+ signal(SIGINT, SIG_IGN);
+ signal(SIGTERM, SIG_IGN);
+ signal(SIGALRM, signal_alarm);
if (opt_p) {
- struct opt_p_t * tmp = opt_p;
- while(tmp) {
- debug(2,"Sending SIGSTOP to process %u\n",tmp->pid);
+ struct opt_p_t *tmp = opt_p;
+ while (tmp) {
+ debug(2, "Sending SIGSTOP to process %u\n", tmp->pid);
kill(tmp->pid, SIGSTOP);
tmp = tmp->next;
}
@@ -68,41 +68,41 @@
alarm(1);
}
-static void
-normal_exit(void) {
- output_line(0,0);
+static void normal_exit(void)
+{
+ output_line(0, 0);
if (opt_c) {
show_summary();
}
}
-static void
-guess_cols(void) {
+static void guess_cols(void)
+{
struct winsize ws;
- char * c;
+ char *c;
opt_a = DEFAULT_ACOLUMN;
c = getenv("COLUMNS");
if (c && *c) {
- char * endptr;
+ char *endptr;
int cols;
cols = strtol(c, &endptr, 0);
- if (cols>0 && !*endptr) {
- opt_a = cols * 5/8;
+ if (cols > 0 && !*endptr) {
+ opt_a = cols * 5 / 8;
}
- } else if (ioctl(1, TIOCGWINSZ, &ws) != -1 && ws.ws_col>0) {
- opt_a = ws.ws_col * 5/8;
+ } else if (ioctl(1, TIOCGWINSZ, &ws) != -1 && ws.ws_col > 0) {
+ opt_a = ws.ws_col * 5 / 8;
}
}
-int
-main(int argc, char **argv) {
- struct opt_p_t * opt_p_tmp;
- char * home;
+int main(int argc, char **argv)
+{
+ struct opt_p_t *opt_p_tmp;
+ char *home;
atexit(normal_exit);
- signal(SIGINT,signal_exit); /* Detach processes when interrupted */
- signal(SIGTERM,signal_exit); /* ... or killed */
+ signal(SIGINT, signal_exit); /* Detach processes when interrupted */
+ signal(SIGTERM, signal_exit); /* ... or killed */
guess_cols();
argv = process_options(argc, argv);
@@ -110,7 +110,7 @@
home = getenv("HOME");
if (home) {
char path[PATH_MAX];
- if (strlen(home) > PATH_MAX-15) {
+ if (strlen(home) > PATH_MAX - 15) {
fprintf(stderr, "Error: $HOME too long\n");
exit(1);
}
@@ -119,21 +119,21 @@
read_config_file(path);
}
if (opt_e) {
- struct opt_e_t * tmp = opt_e;
- while(tmp) {
- debug(1,"Option -e: %s\n", tmp->name);
+ struct opt_e_t *tmp = opt_e;
+ while (tmp) {
+ debug(1, "Option -e: %s\n", tmp->name);
tmp = tmp->next;
}
}
if (command) {
- execute_program(open_program(command,0), argv);
+ execute_program(open_program(command, 0), argv);
}
opt_p_tmp = opt_p;
while (opt_p_tmp) {
open_pid(opt_p_tmp->pid, 1);
opt_p_tmp = opt_p_tmp->next;
}
- while(1) {
+ while (1) {
process_event(wait_for_something());
}
}
diff --git a/ltrace.h b/ltrace.h
index 08cf626..db52fc3 100644
--- a/ltrace.h
+++ b/ltrace.h
@@ -17,19 +17,19 @@
# define USE_DEMANGLE
#endif
-extern char * command;
+extern char *command;
extern int exiting; /* =1 if we have to exit ASAP */
struct breakpoint {
- void * addr;
+ void *addr;
unsigned char orig_value[BREAKPOINT_LENGTH];
int enabled;
- struct library_symbol * libsym;
+ struct library_symbol *libsym;
};
enum arg_type {
- ARGTYPE_UNKNOWN=-1,
+ ARGTYPE_UNKNOWN = -1,
ARGTYPE_VOID,
ARGTYPE_INT,
ARGTYPE_UINT,
@@ -39,9 +39,9 @@
ARGTYPE_CHAR,
ARGTYPE_ADDR,
ARGTYPE_FILE,
- ARGTYPE_FORMAT, /* printf-like format */
+ ARGTYPE_FORMAT, /* printf-like format */
ARGTYPE_STRING,
- ARGTYPE_STRING0, /* stringN: string up to (arg N) bytes */
+ ARGTYPE_STRING0, /* stringN: string up to (arg N) bytes */
ARGTYPE_STRING1,
ARGTYPE_STRING2,
ARGTYPE_STRING3,
@@ -50,7 +50,7 @@
};
enum tof {
- LT_TOF_NONE=0,
+ LT_TOF_NONE = 0,
LT_TOF_FUNCTION, /* A real library function */
LT_TOF_FUNCTIONR, /* Return from a real library function */
LT_TOF_SYSCALL, /* A syscall */
@@ -58,66 +58,66 @@
};
struct function {
- const char * name;
+ const char *name;
enum arg_type return_type;
int num_params;
enum arg_type arg_types[MAX_ARGS];
int params_right;
- struct function * next;
+ struct function *next;
};
-extern struct function * list_of_functions;
-extern char * PLTs_initialized_by_here;
+extern struct function *list_of_functions;
+extern char *PLTs_initialized_by_here;
struct library_symbol {
- char * name;
- void * enter_addr;
- struct breakpoint *brkpnt;
- char needs_init;
- char static_plt2addr;
- char is_weak;
+ char *name;
+ void *enter_addr;
+ struct breakpoint *brkpnt;
+ char needs_init;
+ char static_plt2addr;
+ char is_weak;
- struct library_symbol * next;
+ struct library_symbol *next;
};
struct callstack_element {
union {
int syscall;
- struct library_symbol * libfunc;
+ struct library_symbol *libfunc;
} c_un;
int is_syscall;
- void * return_addr;
+ void *return_addr;
struct timeval time_spent;
};
#define MAX_CALLDEPTH 64
struct process {
- char * filename;
+ char *filename;
pid_t pid;
- struct dict * breakpoints;
+ 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 mask_32bit; /* 1 if 64-bit ltrace is tracing 32-bit process. */
int personality;
- int tracesysgood; /* signal indicating a PTRACE_SYSCALL trap */
+ int tracesysgood; /* signal indicating a PTRACE_SYSCALL trap */
int callstack_depth;
struct callstack_element callstack[MAX_CALLDEPTH];
- struct library_symbol * list_of_symbols;
+ struct library_symbol *list_of_symbols;
/* Arch-dependent: */
- void * instruction_pointer;
- void * stack_pointer; /* To get return addr, args... */
- void * return_addr;
- struct breakpoint * breakpoint_being_enabled;
- void * arch_ptr;
+ void *instruction_pointer;
+ void *stack_pointer; /* To get return addr, args... */
+ void *return_addr;
+ struct breakpoint *breakpoint_being_enabled;
+ void *arch_ptr;
short e_machine;
- short need_to_reinitialize_breakpoints;
+ short need_to_reinitialize_breakpoints;
/* output: */
enum tof type_being_displayed;
- struct process * next;
+ struct process *next;
};
struct event {
@@ -133,10 +133,10 @@
LT_EV_BREAKPOINT
} thing;
union {
- int ret_val; /* _EV_EXIT */
- int signum; /* _EV_SIGNAL, _EV_EXIT_SIGNAL */
- int sysnum; /* _EV_SYSCALL, _EV_SYSRET */
- void * brk_addr; /* _EV_BREAKPOINT */
+ int ret_val; /* _EV_EXIT */
+ int signum; /* _EV_SIGNAL, _EV_EXIT_SIGNAL */
+ int sysnum; /* _EV_SYSCALL, _EV_SYSRET */
+ void *brk_addr; /* _EV_BREAKPOINT */
} e_un;
};
@@ -144,58 +144,59 @@
int count;
struct timeval tv;
};
-extern struct dict * dict_opt_c;
+extern struct dict *dict_opt_c;
-extern struct process * list_of_processes;
+extern struct process *list_of_processes;
-extern void * instruction_pointer;
+extern void *instruction_pointer;
-extern struct event * wait_for_something(void);
-extern void process_event(struct event * event);
+extern struct event *wait_for_something(void);
+extern void process_event(struct event *event);
extern void execute_program(struct process *, char **);
-extern int display_arg(enum tof type, struct process * proc, int arg_num, enum arg_type at);
-extern struct breakpoint * address2bpstruct(struct process * proc, void * addr);
-extern void breakpoints_init(struct process * proc);
-extern void insert_breakpoint(struct process * proc, void * addr, struct library_symbol * libsym);
-extern void delete_breakpoint(struct process * proc, void * addr);
-extern void enable_all_breakpoints(struct process * proc);
-extern void disable_all_breakpoints(struct process * proc);
-extern void reinitialize_breakpoints (struct process *);
+extern int display_arg(enum tof type, struct process *proc, int arg_num,
+ enum arg_type at);
+extern struct breakpoint *address2bpstruct(struct process *proc, void *addr);
+extern void breakpoints_init(struct process *proc);
+extern void insert_breakpoint(struct process *proc, void *addr,
+ struct library_symbol *libsym);
+extern void delete_breakpoint(struct process *proc, void *addr);
+extern void enable_all_breakpoints(struct process *proc);
+extern void disable_all_breakpoints(struct process *proc);
+extern void reinitialize_breakpoints(struct process *);
-extern struct process * open_program(char * filename, pid_t pid);
+extern struct process *open_program(char *filename, pid_t pid);
extern void open_pid(pid_t pid, int verbose);
extern void show_summary(void);
-
/* Arch-dependent stuff: */
-extern char * pid2name(pid_t pid);
-extern void trace_set_options(struct process * proc, pid_t pid);
+extern char *pid2name(pid_t pid);
+extern void trace_set_options(struct process *proc, pid_t pid);
extern void trace_me(void);
extern int trace_pid(pid_t pid);
extern void untrace_pid(pid_t pid);
-extern void get_arch_dep(struct process * proc);
-extern void * get_instruction_pointer(struct process * proc);
-extern void set_instruction_pointer(struct process * proc, void * addr);
-extern void * get_stack_pointer(struct process * proc);
-extern void * get_return_addr(struct process * proc, void * stack_pointer);
-extern void enable_breakpoint(pid_t pid, struct breakpoint * sbp);
-extern void disable_breakpoint(pid_t pid, const struct breakpoint * sbp);
-extern int fork_p(struct process * proc, int sysnum);
-extern int exec_p(struct process * proc, int sysnum);
-extern int syscall_p(struct process * proc, int status, int * sysnum);
+extern void get_arch_dep(struct process *proc);
+extern void *get_instruction_pointer(struct process *proc);
+extern void set_instruction_pointer(struct process *proc, void *addr);
+extern void *get_stack_pointer(struct process *proc);
+extern void *get_return_addr(struct process *proc, void *stack_pointer);
+extern void enable_breakpoint(pid_t pid, struct breakpoint *sbp);
+extern void disable_breakpoint(pid_t pid, const struct breakpoint *sbp);
+extern int fork_p(struct process *proc, int sysnum);
+extern int exec_p(struct process *proc, int sysnum);
+extern int syscall_p(struct process *proc, int status, int *sysnum);
extern void continue_process(pid_t pid);
extern void continue_after_signal(pid_t pid, int signum);
-extern void continue_after_breakpoint(struct process * proc, struct breakpoint * sbp);
-extern void continue_enabling_breakpoint(pid_t pid, struct breakpoint * sbp);
-extern long gimme_arg(enum tof type, struct process * proc, int arg_num);
-extern void save_register_args(enum tof type, struct process * proc);
-extern int umovestr(struct process * proc, void * addr, int len, void * laddr);
+extern void continue_after_breakpoint(struct process *proc,
+ struct breakpoint *sbp);
+extern void continue_enabling_breakpoint(pid_t pid, struct breakpoint *sbp);
+extern long gimme_arg(enum tof type, struct process *proc, int arg_num);
+extern void save_register_args(enum tof type, struct process *proc);
+extern int umovestr(struct process *proc, void *addr, int len, void *laddr);
extern int ffcheck(void *maddr);
-extern void * plt2addr(struct process *, void **);
+extern void *plt2addr(struct process *, void **);
-#if 0 /* not yet */
-extern int umoven(struct process * proc, void * addr, int len, void * laddr);
+#if 0 /* not yet */
+extern int umoven(struct process *proc, void *addr, int len, void *laddr);
#endif
-
#endif
diff --git a/options.c b/options.c
index 63f2ff3..7454a40 100644
--- a/options.c
+++ b/options.c
@@ -25,7 +25,7 @@
char *library[MAX_LIBRARY];
int library_num = 0;
static char *progname; /* Program name (`ltrace') */
-FILE * output;
+FILE *output;
int opt_a = DEFAULT_ACOLUMN; /* default alignment column for results */
int opt_c = 0; /* Count time, calls, and report a summary on program exit */
int opt_d = 0; /* debug */
@@ -34,7 +34,7 @@
int opt_S = 0; /* display syscalls */
int opt_L = 1; /* display library calls */
int opt_f = 0; /* trace child processes as they are created */
-char * opt_u = NULL; /* username to run command as */
+char *opt_u = NULL; /* username to run command as */
int opt_r = 0; /* print relative timestamp */
int opt_t = 0; /* print absolute timestamp */
#ifdef USE_DEMANGLE
@@ -44,91 +44,90 @@
int opt_T = 0; /* show the time spent inside each call */
/* List of pids given to option -p: */
-struct opt_p_t * opt_p = NULL; /* attach to process with a given pid */
+struct opt_p_t *opt_p = NULL; /* attach to process with a given pid */
/* List of function names given to option -e: */
-struct opt_e_t * opt_e = NULL;
-int opt_e_enable=1;
+struct opt_e_t *opt_e = NULL;
+int opt_e_enable = 1;
/* List of global function names given to -x: */
-struct opt_e_t * opt_x = NULL;
+struct opt_e_t *opt_x = NULL;
/* Set a break on the routine named here in order to re-initialize breakpoints
after all the PLTs have been initialzed */
-char * PLTs_initialized_by_here = PLTs_INIT_BY_HERE;
+char *PLTs_initialized_by_here = PLTs_INIT_BY_HERE;
-static void
-usage(void) {
+static void usage(void)
+{
#if !(HAVE_GETOPT || HAVE_GETOPT_LONG)
fprintf(stdout, "Usage: %s [command [arg ...]]\n"
-"Trace library calls of a given program.\n\n", progname);
+ "Trace library calls of a given program.\n\n", progname);
#else
fprintf(stdout, "Usage: %s [option ...] [command [arg ...]]\n"
-"Trace library calls of a given program.\n\n"
-
+ "Trace library calls of a given program.\n\n"
# if HAVE_GETOPT_LONG
-" -a, --align=COLUMN align return values in a secific column.\n"
+ " -a, --align=COLUMN align return values in a secific column.\n"
# else
-" -a COLUMN align return values in a secific column.\n"
+ " -a COLUMN align return values in a secific column.\n"
# endif
-" -c count time and calls, and report a summary on exit.\n"
+ " -c count time and calls, and report a summary on exit.\n"
# ifdef USE_DEMANGLE
# if HAVE_GETOPT_LONG
-" -C, --demangle decode low-level symbol names into user-level names.\n"
+ " -C, --demangle decode low-level symbol names into user-level names.\n"
# else
-" -C decode low-level symbol names into user-level names.\n"
+ " -C decode low-level symbol names into user-level names.\n"
# endif
# endif
# if HAVE_GETOPT_LONG
-" -d, --debug print debugging info.\n"
+ " -d, --debug print debugging info.\n"
# else
-" -d print debugging info.\n"
+ " -d print debugging info.\n"
# endif
-" -e expr modify which events to trace.\n"
-" -f follow forks.\n"
+ " -e expr modify which events to trace.\n"
+ " -f follow forks.\n"
# if HAVE_GETOPT_LONG
-" -h, --help display this help and exit.\n"
+ " -h, --help display this help and exit.\n"
# else
-" -h display this help and exit.\n"
+ " -h display this help and exit.\n"
# endif
-" -i print instruction pointer at time of library call.\n"
+ " -i print instruction pointer at time of library call.\n"
# if HAVE_GETOPT_LONG
-" -l, --library=FILE print library calls from this library only.\n"
+ " -l, --library=FILE print library calls from this library only.\n"
# else
-" -l FILE print library calls from this library only.\n"
+ " -l FILE print library calls from this library only.\n"
# endif
-" -L do NOT display library calls.\n"
+ " -L do NOT display library calls.\n"
# if HAVE_GETOPT_LONG
-" -n, --indent=NR indent output by NR spaces for each call level nesting.\n"
+ " -n, --indent=NR indent output by NR spaces for each call level nesting.\n"
# else
-" -n NR indent output by NR spaces for each call level nesting.\n"
+ " -n NR indent output by NR spaces for each call level nesting.\n"
# endif
# if HAVE_GETOPT_LONG
-" -o, --output=FILE write the trace output to that file.\n"
+ " -o, --output=FILE write the trace output to that file.\n"
# else
-" -o FILE write the trace output to that file.\n"
+ " -o FILE write the trace output to that file.\n"
# endif
-" -p PID attach to the process with the process ID pid.\n"
-" -r print relative timestamps.\n"
-" -s STRLEN specify the maximum string size to print.\n"
-" -S display system calls.\n"
-" -t, -tt, -ttt print absolute timestamps.\n"
-" -T show the time spent inside each call.\n"
-" -u USERNAME run command with the userid, groupid of username.\n"
+ " -p PID attach to the process with the process ID pid.\n"
+ " -r print relative timestamps.\n"
+ " -s STRLEN specify the maximum string size to print.\n"
+ " -S display system calls.\n"
+ " -t, -tt, -ttt print absolute timestamps.\n"
+ " -T show the time spent inside each call.\n"
+ " -u USERNAME run command with the userid, groupid of username.\n"
# if HAVE_GETOPT_LONG
-" -V, --version output version information and exit.\n"
+ " -V, --version output version information and exit.\n"
# else
-" -V output version information and exit.\n"
+ " -V output version information and exit.\n"
# endif
-" -x NAME treat the global NAME like a library subroutine.\n"
-" -X NAME same as -x; and PLT's will be initialized by here.\n"
-"\nReport bugs to Juan Cespedes <cespedes@debian.org>\n"
- , progname);
+ " -x NAME treat the global NAME like a library subroutine.\n"
+ " -X NAME same as -x; and PLT's will be initialized by here.\n"
+ "\nReport bugs to Juan Cespedes <cespedes@debian.org>\n",
+ progname);
#endif
}
-static char *
-search_for_command(char * filename) {
+static char *search_for_command(char *filename)
+{
static char pathname[PATH_MAX];
char *path;
int m, n;
@@ -159,189 +158,220 @@
return filename;
}
-char **
-process_options(int argc, char **argv) {
+char **process_options(int argc, char **argv)
+{
progname = argv[0];
output = stderr;
#if HAVE_GETOPT || HAVE_GETOPT_LONG
- while(1) {
+ while (1) {
int c;
#if HAVE_GETOPT_LONG
int option_index = 0;
static struct option long_options[] = {
- { "align", 1, 0, 'a'},
- { "debug", 0, 0, 'd'},
+ {"align", 1, 0, 'a'},
+ {"debug", 0, 0, 'd'},
# ifdef USE_DEMANGLE
- { "demangle", 0, 0, 'C'},
+ {"demangle", 0, 0, 'C'},
#endif
- { "indent", 1, 0, 'n'},
- { "help", 0, 0, 'h'},
- { "library", 1, 0, 'l'},
- { "output", 1, 0, 'o'},
- { "version", 0, 0, 'V'},
- { 0, 0, 0, 0}
+ {"indent", 1, 0, 'n'},
+ {"help", 0, 0, 'h'},
+ {"library", 1, 0, 'l'},
+ {"output", 1, 0, 'o'},
+ {"version", 0, 0, 'V'},
+ {0, 0, 0, 0}
};
c = getopt_long(argc, argv, "+cdfhiLrStTV"
# ifdef USE_DEMANGLE
- "C"
+ "C"
# endif
- "a:e:l:n:o:p:s:u:x:X:", long_options, &option_index);
+ "a:e:l:n:o:p:s:u:x:X:", long_options,
+ &option_index);
#else
c = getopt(argc, argv, "+cdfhiLrStTV"
# ifdef USE_DEMANGLE
- "C"
+ "C"
# endif
- "a:e:l:n:o:p:s:u:x:X:");
+ "a:e:l:n:o:p:s:u:x:X:");
#endif
- if (c==-1) {
+ if (c == -1) {
break;
}
- switch(c) {
- case 'a': opt_a = atoi(optarg);
- break;
- case 'c': opt_c++;
- break;
+ switch (c) {
+ case 'a':
+ opt_a = atoi(optarg);
+ break;
+ case 'c':
+ opt_c++;
+ break;
#ifdef USE_DEMANGLE
- case 'C': opt_C++;
- break;
+ case 'C':
+ opt_C++;
+ break;
#endif
- case 'd': opt_d++;
- break;
- case 'e':
- {
- char * str_e = strdup(optarg);
- if (!str_e) {
- perror("ltrace: strdup");
- exit(1);
- }
- if (str_e[0]=='!') {
- opt_e_enable=0;
- str_e++;
- }
- while(*str_e) {
- struct opt_e_t * tmp;
- char *str2 = strchr(str_e,',');
- if (str2) {
- *str2 = '\0';
- }
- tmp = malloc(sizeof(struct opt_e_t));
- if (!tmp) {
- perror("ltrace: malloc");
- exit(1);
- }
- tmp->name = str_e;
- tmp->next = opt_e;
- opt_e = tmp;
- if (str2) {
- str_e = str2+1;
- } else {
- break;
- }
- }
- break;
+ case 'd':
+ opt_d++;
+ break;
+ case 'e':
+ {
+ char *str_e = strdup(optarg);
+ if (!str_e) {
+ perror("ltrace: strdup");
+ exit(1);
}
- case 'f': opt_f = 1;
- break;
- case 'h': usage();
- exit(0);
- case 'i': opt_i++;
- break;
- case 'l': if (library_num == MAX_LIBRARY) {
- fprintf(stderr, "Too many libraries. Maximum is %i.\n", MAX_LIBRARY);
- exit(1);
- }
- library[library_num++] = optarg;
- break;
- case 'L': opt_L = 0;
- break;
- case 'n': opt_n = atoi(optarg);
- break;
- case 'o': output = fopen(optarg, "w");
- if (!output) {
- fprintf(stderr, "Can't open %s for output: %s\n", optarg, strerror(errno));
- exit(1);
- }
- setvbuf(output, (char *)NULL, _IOLBF, 0);
- fcntl(fileno(output), F_SETFD, FD_CLOEXEC);
- break;
- case 'p':
- {
- struct opt_p_t * tmp = malloc(sizeof(struct opt_p_t));
+ if (str_e[0] == '!') {
+ opt_e_enable = 0;
+ str_e++;
+ }
+ while (*str_e) {
+ struct opt_e_t *tmp;
+ char *str2 = strchr(str_e, ',');
+ if (str2) {
+ *str2 = '\0';
+ }
+ tmp = malloc(sizeof(struct opt_e_t));
if (!tmp) {
perror("ltrace: malloc");
exit(1);
}
- tmp->pid = atoi(optarg);
- tmp->next = opt_p;
- opt_p = tmp;
- break;
+ tmp->name = str_e;
+ tmp->next = opt_e;
+ opt_e = tmp;
+ if (str2) {
+ str_e = str2 + 1;
+ } else {
+ break;
+ }
}
- case 'r': opt_r++;
- break;
- case 's': opt_s = atoi(optarg);
- break;
- case 'S': opt_S = 1;
- break;
- case 't': opt_t++;
- break;
- case 'T': opt_T++;
- break;
- case 'u': opt_u = optarg;
- break;
- case 'V': printf("ltrace version " PACKAGE_VERSION ".\n"
-"Copyright (C) 1997-2006 Juan Cespedes <cespedes@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': PLTs_initialized_by_here = optarg;
- /* Fall Thru */
-
- case 'x':
- {
- struct opt_e_t * p = opt_x;
+ break;
+ }
+ case 'f':
+ opt_f = 1;
+ break;
+ case 'h':
+ usage();
+ exit(0);
+ case 'i':
+ opt_i++;
+ break;
+ case 'l':
+ if (library_num == MAX_LIBRARY) {
+ fprintf(stderr,
+ "Too many libraries. Maximum is %i.\n",
+ MAX_LIBRARY);
+ exit(1);
+ }
+ library[library_num++] = optarg;
+ break;
+ case 'L':
+ opt_L = 0;
+ break;
+ case 'n':
+ opt_n = atoi(optarg);
+ break;
+ case 'o':
+ output = fopen(optarg, "w");
+ if (!output) {
+ fprintf(stderr,
+ "Can't open %s for output: %s\n",
+ optarg, strerror(errno));
+ exit(1);
+ }
+ setvbuf(output, (char *)NULL, _IOLBF, 0);
+ fcntl(fileno(output), F_SETFD, FD_CLOEXEC);
+ break;
+ case 'p':
+ {
+ struct opt_p_t *tmp =
+ malloc(sizeof(struct opt_p_t));
+ if (!tmp) {
+ perror("ltrace: malloc");
+ exit(1);
+ }
+ tmp->pid = atoi(optarg);
+ tmp->next = opt_p;
+ opt_p = tmp;
+ break;
+ }
+ case 'r':
+ opt_r++;
+ break;
+ case 's':
+ opt_s = atoi(optarg);
+ break;
+ case 'S':
+ opt_S = 1;
+ break;
+ case 't':
+ opt_t++;
+ break;
+ case 'T':
+ opt_T++;
+ break;
+ case 'u':
+ opt_u = optarg;
+ break;
+ case 'V':
+ printf("ltrace version " PACKAGE_VERSION ".\n"
+ "Copyright (C) 1997-2006 Juan Cespedes <cespedes@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':
+ PLTs_initialized_by_here = optarg;
+ /* Fall Thru */
- /* First, check for duplicate. */
- while (p && strcmp(p->name, optarg)) {
- p = p->next;
- }
- if (p) { break; }
+ case 'x':
+ {
+ struct opt_e_t *p = opt_x;
- /* If not duplicate, add to list. */
- p = malloc(sizeof(struct opt_e_t));
- if (!p) {
- perror("ltrace: malloc");
- exit(1);
- }
- p->name = optarg;
- p->next = opt_x;
- opt_x = p;
+ /* First, check for duplicate. */
+ while (p && strcmp(p->name, optarg)) {
+ p = p->next;
+ }
+ if (p) {
break;
}
+ /* If not duplicate, add to list. */
+ p = malloc(sizeof(struct opt_e_t));
+ if (!p) {
+ perror("ltrace: malloc");
+ exit(1);
+ }
+ p->name = optarg;
+ p->next = opt_x;
+ opt_x = p;
+ break;
+ }
- default:
+ default:
#if HAVE_GETOPT_LONG
- fprintf(stderr, "Try `%s --help' for more information\n", progname);
+ fprintf(stderr,
+ "Try `%s --help' for more information\n",
+ progname);
#else
- fprintf(stderr, "Try `%s -h' for more information\n", progname);
+ fprintf(stderr, "Try `%s -h' for more information\n",
+ progname);
#endif
- exit(1);
+ exit(1);
}
}
- argc -= optind; argv += optind;
+ argc -= optind;
+ argv += optind;
#endif
- if (!opt_p && argc<1) {
+ if (!opt_p && argc < 1) {
fprintf(stderr, "%s: too few arguments\n", progname);
usage();
exit(1);
}
if (opt_r && opt_t) {
- fprintf(stderr, "%s: Incompatible options -r and -t\n", progname);
+ fprintf(stderr, "%s: Incompatible options -r and -t\n",
+ progname);
exit(1);
}
- if (argc>0) {
+ if (argc > 0) {
command = search_for_command(argv[0]);
}
return &argv[0];
diff --git a/options.h b/options.h
index 2b63bbc..a88630f 100644
--- a/options.h
+++ b/options.h
@@ -5,37 +5,37 @@
#include <stdio.h>
#include <sys/types.h>
-extern FILE * output;
-extern int opt_a; /* default alignment column for results */
-extern int opt_c; /* count time, calls, and report a summary on program exit */
-extern int opt_d; /* debug */
-extern int opt_i; /* instruction pointer */
-extern int opt_s; /* default maximum # of bytes printed in strings */
-extern int opt_L; /* display library calls */
-extern int opt_S; /* display system calls */
-extern int opt_f; /* trace child processes */
-extern char * opt_u; /* username to run command as */
-extern int opt_r; /* print relative timestamp */
-extern int opt_t; /* print absolute timestamp */
-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 FILE *output;
+extern int opt_a; /* default alignment column for results */
+extern int opt_c; /* count time, calls, and report a summary on program exit */
+extern int opt_d; /* debug */
+extern int opt_i; /* instruction pointer */
+extern int opt_s; /* default maximum # of bytes printed in strings */
+extern int opt_L; /* display library calls */
+extern int opt_S; /* display system calls */
+extern int opt_f; /* trace child processes */
+extern char *opt_u; /* username to run command as */
+extern int opt_r; /* print relative timestamp */
+extern int opt_t; /* print absolute timestamp */
+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 */
struct opt_p_t {
pid_t pid;
- struct opt_p_t * next;
+ struct opt_p_t *next;
};
struct opt_e_t {
- char * name;
- struct opt_e_t * next;
+ char *name;
+ struct opt_e_t *next;
};
-extern struct opt_p_t * opt_p; /* attach to process with a given pid */
+extern struct opt_p_t *opt_p; /* attach to process with a given pid */
-extern struct opt_e_t * opt_e; /* list of function names to display */
+extern struct opt_e_t *opt_e; /* list of function names to display */
extern int opt_e_enable; /* 0 if '!' is used, 1 otherwise */
-extern struct opt_e_t * opt_x; /* list of functions to break at */
+extern struct opt_e_t *opt_x; /* list of functions to break at */
-extern char ** process_options(int argc, char **argv);
+extern char **process_options(int argc, char **argv);
diff --git a/output.c b/output.c
index 109a201..794239e 100644
--- a/output.c
+++ b/output.c
@@ -22,24 +22,25 @@
/* TODO FIXME XXX: include in ltrace.h: */
extern struct timeval current_time_spent;
-struct dict * dict_opt_c = NULL;
+struct dict *dict_opt_c = NULL;
static pid_t current_pid = 0;
static int current_depth = 0;
static int current_column = 0;
-static void
-output_indent(struct process * proc) {
- current_column += fprintf(output, "%*s", opt_n * proc->callstack_depth, "");
+static void output_indent(struct process *proc)
+{
+ current_column +=
+ fprintf(output, "%*s", opt_n * proc->callstack_depth, "");
}
-static void
-begin_of_line(enum tof type, struct process * proc) {
+static void begin_of_line(enum tof type, struct process *proc)
+{
current_column = 0;
if (!proc) {
return;
}
- if ((output!=stderr) && (opt_p || opt_f)) {
+ if ((output != stderr) && (opt_p || opt_f)) {
current_column += fprintf(output, "%u ", proc->pid);
} else if (list_of_processes->next) {
current_column += fprintf(output, "[pid %u] ", proc->pid);
@@ -47,14 +48,14 @@
if (opt_r) {
struct timeval tv;
struct timezone tz;
- static struct timeval old_tv={0,0};
+ static struct timeval old_tv = { 0, 0 };
struct timeval diff;
gettimeofday(&tv, &tz);
- if (old_tv.tv_sec==0 && old_tv.tv_usec==0) {
- old_tv.tv_sec=tv.tv_sec;
- old_tv.tv_usec=tv.tv_usec;
+ if (old_tv.tv_sec == 0 && old_tv.tv_usec == 0) {
+ old_tv.tv_sec = tv.tv_sec;
+ old_tv.tv_usec = tv.tv_usec;
}
diff.tv_sec = tv.tv_sec - old_tv.tv_sec;
if (tv.tv_usec >= old_tv.tv_usec) {
@@ -66,47 +67,50 @@
old_tv.tv_sec = tv.tv_sec;
old_tv.tv_usec = tv.tv_usec;
current_column += fprintf(output, "%3lu.%06d ",
- diff.tv_sec, (int)diff.tv_usec);
+ diff.tv_sec, (int)diff.tv_usec);
}
if (opt_t) {
struct timeval tv;
struct timezone tz;
gettimeofday(&tv, &tz);
- if (opt_t>2) {
+ if (opt_t > 2) {
current_column += fprintf(output, "%lu.%06d ",
- tv.tv_sec, (int)tv.tv_usec);
- } else if (opt_t>1) {
- struct tm * tmp = localtime(&tv.tv_sec);
- current_column += fprintf(output, "%02d:%02d:%02d.%06d ",
- tmp->tm_hour, tmp->tm_min, tmp->tm_sec, (int)tv.tv_usec);
+ tv.tv_sec, (int)tv.tv_usec);
+ } else if (opt_t > 1) {
+ struct tm *tmp = localtime(&tv.tv_sec);
+ current_column +=
+ fprintf(output, "%02d:%02d:%02d.%06d ",
+ tmp->tm_hour, tmp->tm_min, tmp->tm_sec,
+ (int)tv.tv_usec);
} else {
- struct tm * tmp = localtime(&tv.tv_sec);
+ struct tm *tmp = localtime(&tv.tv_sec);
current_column += fprintf(output, "%02d:%02d:%02d ",
- tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+ tmp->tm_hour, tmp->tm_min,
+ tmp->tm_sec);
}
}
if (opt_i) {
- if (type==LT_TOF_FUNCTION || type==LT_TOF_FUNCTIONR) {
+ if (type == LT_TOF_FUNCTION || type == LT_TOF_FUNCTIONR) {
current_column += fprintf(output, "[%p] ",
- proc->return_addr);
+ proc->return_addr);
} else {
current_column += fprintf(output, "[%p] ",
- proc->instruction_pointer);
+ proc->instruction_pointer);
}
}
- if (opt_n > 0 && type!=LT_TOF_NONE) {
+ if (opt_n > 0 && type != LT_TOF_NONE) {
output_indent(proc);
}
}
-static struct function *
-name2func(char * name) {
- struct function * tmp;
- const char * str1, * str2;
+static struct function *name2func(char *name)
+{
+ struct function *tmp;
+ const char *str1, *str2;
tmp = list_of_functions;
- while(tmp) {
+ while (tmp) {
#ifdef USE_DEMANGLE
str1 = opt_C ? my_demangle(tmp->name) : tmp->name;
str2 = opt_C ? my_demangle(name) : name;
@@ -123,8 +127,8 @@
return NULL;
}
-void
-output_line(struct process * proc, char *fmt, ...) {
+void output_line(struct process *proc, char *fmt, ...)
+{
va_list args;
if (opt_c) {
@@ -133,7 +137,7 @@
if (current_pid) {
fprintf(output, " <unfinished ...>\n");
}
- current_pid=0;
+ current_pid = 0;
if (!fmt) {
return;
}
@@ -143,34 +147,36 @@
vfprintf(output, fmt, args);
fprintf(output, "\n");
va_end(args);
- current_column=0;
+ current_column = 0;
}
-static void
-tabto(int col) {
+static void tabto(int col)
+{
if (current_column < col) {
- fprintf(output, "%*s", col-current_column, "");
+ fprintf(output, "%*s", col - current_column, "");
}
}
-void
-output_left(enum tof type, struct process * proc, char * function_name) {
- struct function * func;
+void output_left(enum tof type, struct process *proc, char *function_name)
+{
+ struct function *func;
if (opt_c) {
return;
}
if (current_pid) {
fprintf(output, " <unfinished ...>\n");
- current_pid=0;
- current_column=0;
+ current_pid = 0;
+ current_column = 0;
}
current_pid = proc->pid;
current_depth = proc->callstack_depth;
proc->type_being_displayed = type;
begin_of_line(type, proc);
#ifdef USE_DEMANGLE
- current_column += fprintf(output, "%s(", opt_C ? my_demangle(function_name): function_name);
+ current_column +=
+ fprintf(output, "%s(",
+ opt_C ? my_demangle(function_name) : function_name);
#else
current_column += fprintf(output, "%s(", function_name);
#endif
@@ -178,20 +184,23 @@
func = name2func(function_name);
if (!func) {
int i;
- for(i=0; i<4; i++) {
- current_column += display_arg(type, proc, i, ARGTYPE_UNKNOWN);
+ for (i = 0; i < 4; i++) {
+ current_column +=
+ display_arg(type, proc, i, ARGTYPE_UNKNOWN);
current_column += fprintf(output, ", ");
}
current_column += display_arg(type, proc, 4, ARGTYPE_UNKNOWN);
return;
} else {
int i;
- for(i=0; i< func->num_params - func->params_right - 1; i++) {
- current_column += display_arg(type, proc, i, func->arg_types[i]);
+ for (i = 0; i < func->num_params - func->params_right - 1; i++) {
+ current_column +=
+ display_arg(type, proc, i, func->arg_types[i]);
current_column += fprintf(output, ", ");
}
- if (func->num_params>func->params_right) {
- current_column += display_arg(type, proc, i, func->arg_types[i]);
+ if (func->num_params > func->params_right) {
+ current_column +=
+ display_arg(type, proc, i, func->arg_types[i]);
if (func->params_right) {
current_column += fprintf(output, ", ");
}
@@ -202,14 +211,16 @@
}
}
-void
-output_right(enum tof type, struct process * proc, char * function_name) {
- struct function * func = name2func(function_name);
+void output_right(enum tof type, struct process *proc, char *function_name)
+{
+ struct function *func = name2func(function_name);
if (opt_c) {
- struct opt_c_struct * st;
+ struct opt_c_struct *st;
if (!dict_opt_c) {
- dict_opt_c = dict_init(dict_key2hash_string, dict_key_cmp_string);
+ dict_opt_c =
+ dict_init(dict_key2hash_string,
+ dict_key_cmp_string);
}
st = dict_find_entry(dict_opt_c, function_name);
if (!st) {
@@ -233,41 +244,47 @@
st->count++;
st->tv.tv_sec += current_time_spent.tv_sec;
-// fprintf(output, "%s <%lu.%06d>\n", function_name,
-// current_time_spent.tv_sec, (int)current_time_spent.tv_usec);
+// fprintf(output, "%s <%lu.%06d>\n", function_name,
+// current_time_spent.tv_sec, (int)current_time_spent.tv_usec);
return;
}
- if (current_pid && (current_pid!=proc->pid ||
- current_depth != proc->callstack_depth)) {
+ if (current_pid && (current_pid != proc->pid ||
+ current_depth != proc->callstack_depth)) {
fprintf(output, " <unfinished ...>\n");
current_pid = 0;
}
if (current_pid != proc->pid) {
begin_of_line(type, proc);
#ifdef USE_DEMANGLE
- current_column += fprintf(output, "<... %s resumed> ", opt_C ? my_demangle(function_name) : function_name);
+ current_column +=
+ fprintf(output, "<... %s resumed> ",
+ opt_C ? my_demangle(function_name) : function_name);
#else
- current_column += fprintf(output, "<... %s resumed> ", function_name);
+ current_column +=
+ fprintf(output, "<... %s resumed> ", function_name);
#endif
}
if (!func) {
current_column += fprintf(output, ") ");
- tabto(opt_a-1);
+ tabto(opt_a - 1);
fprintf(output, "= ");
display_arg(type, proc, -1, ARGTYPE_UNKNOWN);
} else {
int i;
- for(i=func->num_params-func->params_right; i<func->num_params-1; i++) {
- current_column += display_arg(type, proc, i, func->arg_types[i]);
+ for (i = func->num_params - func->params_right;
+ i < func->num_params - 1; i++) {
+ current_column +=
+ display_arg(type, proc, i, func->arg_types[i]);
current_column += fprintf(output, ", ");
}
if (func->params_right) {
- current_column += display_arg(type, proc, i, func->arg_types[i]);
+ current_column +=
+ display_arg(type, proc, i, func->arg_types[i]);
}
current_column += fprintf(output, ") ");
- tabto(opt_a-1);
- fprintf(output, "= ");
+ tabto(opt_a - 1);
+ fprintf(output, "= ");
if (func->return_type == ARGTYPE_VOID) {
fprintf(output, "<void>");
} else {
@@ -276,9 +293,10 @@
}
if (opt_T) {
fprintf(output, " <%lu.%06d>",
- current_time_spent.tv_sec, (int)current_time_spent.tv_usec);
+ current_time_spent.tv_sec,
+ (int)current_time_spent.tv_usec);
}
fprintf(output, "\n");
- current_pid=0;
- current_column=0;
+ current_pid = 0;
+ current_column = 0;
}
diff --git a/output.h b/output.h
index 54926c2..94fdf80 100644
--- a/output.h
+++ b/output.h
@@ -2,7 +2,7 @@
#include "ltrace.h"
-void output_line(struct process * proc, char *fmt, ...);
+void output_line(struct process *proc, char *fmt, ...);
-void output_left(enum tof type, struct process * proc, char * function_name);
-void output_right(enum tof type, struct process * proc, char * function_name);
+void output_left(enum tof type, struct process *proc, char *function_name);
+void output_right(enum tof type, struct process *proc, char *function_name);
diff --git a/proc.c b/proc.c
index aae4478..3746368 100644
--- a/proc.c
+++ b/proc.c
@@ -12,9 +12,9 @@
#include "options.h"
#include "elf.h"
-struct process *
-open_program(char * filename, pid_t pid) {
- struct process * proc;
+struct process *open_program(char *filename, pid_t pid)
+{
+ struct process *proc;
proc = calloc(sizeof(struct process), 1);
if (!proc) {
perror("malloc");
@@ -22,7 +22,9 @@
}
proc->filename = filename;
proc->breakpoints_enabled = -1;
- if (pid) { proc->pid = pid; }
+ if (pid) {
+ proc->pid = pid;
+ }
breakpoints_init(proc);
proc->next = list_of_processes;
@@ -30,13 +32,14 @@
return proc;
}
-void
-open_pid(pid_t pid, int verbose) {
- struct process * proc;
- char * filename;
+void open_pid(pid_t pid, int verbose)
+{
+ struct process *proc;
+ char *filename;
- if (trace_pid(pid)<0) {
- fprintf(stderr, "Cannot attach to pid %u: %s\n", pid, strerror(errno));
+ if (trace_pid(pid) < 0) {
+ fprintf(stderr, "Cannot attach to pid %u: %s\n", pid,
+ strerror(errno));
return;
}
@@ -45,7 +48,8 @@
#if 0
if (!filename) {
if (verbose) {
- fprintf(stderr, "Cannot trace pid %u: %s\n", pid, strerror(errno));
+ fprintf(stderr, "Cannot trace pid %u: %s\n", pid,
+ strerror(errno));
}
return;
}
diff --git a/process_event.c b/process_event.c
index 9263184..242292e 100644
--- a/process_event.c
+++ b/process_event.c
@@ -20,32 +20,34 @@
#include <sys/ptrace.h>
#endif
-static void process_signal(struct event * event);
-static void process_exit(struct event * event);
-static void process_exit_signal(struct event * event);
-static void process_syscall(struct event * event);
-static void process_sysret(struct event * event);
-static void process_breakpoint(struct event * event);
-static void remove_proc(struct process * proc);
+static void process_signal(struct event *event);
+static void process_exit(struct event *event);
+static void process_exit_signal(struct event *event);
+static void process_syscall(struct event *event);
+static void process_sysret(struct event *event);
+static void process_breakpoint(struct event *event);
+static void remove_proc(struct process *proc);
-static void callstack_push_syscall(struct process * proc, int sysnum);
-static void callstack_push_symfunc(struct process * proc, struct library_symbol * sym);
-static void callstack_pop(struct process * proc);
+static void callstack_push_syscall(struct process *proc, int sysnum);
+static void callstack_push_symfunc(struct process *proc,
+ struct library_symbol *sym);
+static void callstack_pop(struct process *proc);
-static char *
-shortsignal(struct process *proc, int signum) {
- static char * signalent0[] = {
- #include "signalent.h"
+static char *shortsignal(struct process *proc, int signum)
+{
+ static char *signalent0[] = {
+#include "signalent.h"
};
- static char * signalent1[] = {
- #include "signalent1.h"
+ static char *signalent1[] = {
+#include "signalent1.h"
};
static char **signalents[] = { signalent0, signalent1 };
int nsignals[] = { sizeof signalent0 / sizeof signalent0[0],
- sizeof signalent1 / sizeof signalent1[0] };
+ sizeof signalent1 / sizeof signalent1[0]
+ };
if (proc->personality > sizeof signalents / sizeof signalents[0])
- abort ();
+ abort();
if (signum < 0 || signum >= nsignals[proc->personality]) {
return "UNKNOWN_SIGNAL";
} else {
@@ -53,68 +55,78 @@
}
}
-static char *
-sysname(struct process *proc, int sysnum) {
+static char *sysname(struct process *proc, int sysnum)
+{
static char result[128];
- static char * syscalent0[] = {
- #include "syscallent.h"
+ static char *syscalent0[] = {
+#include "syscallent.h"
};
- static char * syscalent1[] = {
- #include "syscallent1.h"
+ static char *syscalent1[] = {
+#include "syscallent1.h"
};
static char **syscalents[] = { syscalent0, syscalent1 };
int nsyscals[] = { sizeof syscalent0 / sizeof syscalent0[0],
- sizeof syscalent1 / sizeof syscalent1[0] };
+ sizeof syscalent1 / sizeof syscalent1[0]
+ };
if (proc->personality > sizeof syscalents / sizeof syscalents[0])
- abort ();
+ abort();
if (sysnum < 0 || sysnum >= nsyscals[proc->personality]) {
sprintf(result, "SYS_%d", sysnum);
return result;
} else {
- sprintf(result, "SYS_%s", syscalents[proc->personality][sysnum]);
+ sprintf(result, "SYS_%s",
+ syscalents[proc->personality][sysnum]);
return result;
}
}
-void
-process_event(struct event * event) {
+void process_event(struct event *event)
+{
switch (event->thing) {
- case LT_EV_NONE:
- debug(1, "event: none");
- return;
- case LT_EV_SIGNAL:
- debug(1, "event: signal (%s [%d])", shortsignal(event->proc, event->e_un.signum), event->e_un.signum);
- process_signal(event);
- return;
- case LT_EV_EXIT:
- debug(1, "event: exit (%d)", event->e_un.ret_val);
- process_exit(event);
- return;
- case LT_EV_EXIT_SIGNAL:
- debug(1, "event: exit signal (%s [%d])", shortsignal(event->proc, event->e_un.signum), event->e_un.signum);
- process_exit_signal(event);
- return;
- case LT_EV_SYSCALL:
- debug(1, "event: syscall (%s [%d])", sysname (event->proc, event->e_un.sysnum), event->e_un.sysnum);
- process_syscall(event);
- return;
- case LT_EV_SYSRET:
- debug(1, "event: sysret (%s [%d])", sysname (event->proc, event->e_un.sysnum), event->e_un.sysnum);
- process_sysret(event);
- return;
- case LT_EV_BREAKPOINT:
- debug(1, "event: breakpoint");
- process_breakpoint(event);
- return;
- default:
- fprintf(stderr, "Error! unknown event?\n");
- exit(1);
+ case LT_EV_NONE:
+ debug(1, "event: none");
+ return;
+ case LT_EV_SIGNAL:
+ debug(1, "event: signal (%s [%d])",
+ shortsignal(event->proc, event->e_un.signum),
+ event->e_un.signum);
+ process_signal(event);
+ return;
+ case LT_EV_EXIT:
+ debug(1, "event: exit (%d)", event->e_un.ret_val);
+ process_exit(event);
+ return;
+ case LT_EV_EXIT_SIGNAL:
+ debug(1, "event: exit signal (%s [%d])",
+ shortsignal(event->proc, event->e_un.signum),
+ event->e_un.signum);
+ process_exit_signal(event);
+ return;
+ case LT_EV_SYSCALL:
+ debug(1, "event: syscall (%s [%d])",
+ sysname(event->proc, event->e_un.sysnum),
+ event->e_un.sysnum);
+ process_syscall(event);
+ return;
+ case LT_EV_SYSRET:
+ debug(1, "event: sysret (%s [%d])",
+ sysname(event->proc, event->e_un.sysnum),
+ event->e_un.sysnum);
+ process_sysret(event);
+ return;
+ case LT_EV_BREAKPOINT:
+ debug(1, "event: breakpoint");
+ process_breakpoint(event);
+ return;
+ default:
+ fprintf(stderr, "Error! unknown event?\n");
+ exit(1);
}
}
-static void
-process_signal(struct event * event) {
+static void process_signal(struct event *event)
+{
if (exiting && event->e_un.signum == SIGSTOP) {
pid_t pid = event->proc->pid;
disable_all_breakpoints(event->proc);
@@ -124,26 +136,27 @@
return;
}
output_line(event->proc, "--- %s (%s) ---",
- shortsignal(event->proc, event->e_un.signum), strsignal(event->e_un.signum));
+ shortsignal(event->proc, event->e_un.signum),
+ strsignal(event->e_un.signum));
continue_after_signal(event->proc->pid, event->e_un.signum);
}
-static void
-process_exit(struct event * event) {
+static void process_exit(struct event *event)
+{
output_line(event->proc, "+++ exited (status %d) +++",
- event->e_un.ret_val);
+ event->e_un.ret_val);
remove_proc(event->proc);
}
-static void
-process_exit_signal(struct event * event) {
+static void process_exit_signal(struct event *event)
+{
output_line(event->proc, "+++ killed by %s +++",
- shortsignal(event->proc, event->e_un.signum));
+ shortsignal(event->proc, event->e_un.signum));
remove_proc(event->proc);
}
-static void
-remove_proc(struct process * proc) {
+static void remove_proc(struct process *proc)
+{
struct process *tmp, *tmp2;
debug(1, "Removing pid %u\n", proc->pid);
@@ -155,8 +168,8 @@
return;
}
tmp = list_of_processes;
- while(tmp->next) {
- if (tmp->next==proc) {
+ while (tmp->next) {
+ if (tmp->next == proc) {
tmp2 = tmp->next;
tmp->next = tmp->next->next;
free(tmp2);
@@ -166,10 +179,11 @@
}
}
-static void
-process_syscall(struct event * event) {
+static void process_syscall(struct event *event)
+{
if (opt_S) {
- output_left(LT_TOF_SYSCALL, event->proc, sysname(event->proc, event->e_un.sysnum));
+ output_left(LT_TOF_SYSCALL, event->proc,
+ sysname(event->proc, event->e_un.sysnum));
}
if (fork_p(event->proc, event->e_un.sysnum)
|| exec_p(event->proc, event->e_un.sysnum)) {
@@ -183,14 +197,14 @@
struct timeval current_time_spent;
-static void
-calc_time_spent(struct process * proc) {
+static void calc_time_spent(struct process *proc)
+{
struct timeval tv;
struct timezone tz;
struct timeval diff;
- struct callstack_element * elem;
+ struct callstack_element *elem;
- elem = & proc->callstack[proc->callstack_depth-1];
+ elem = &proc->callstack[proc->callstack_depth - 1];
gettimeofday(&tv, &tz);
@@ -204,15 +218,16 @@
current_time_spent = diff;
}
-static void
-process_sysret(struct event * event) {
+static void process_sysret(struct event *event)
+{
if (opt_T || opt_c) {
calc_time_spent(event->proc);
}
if (fork_p(event->proc, event->e_un.sysnum)) {
if (opt_f) {
- pid_t child = gimme_arg(LT_TOF_SYSCALLR,event->proc,-1);
- if (child>0) {
+ pid_t child =
+ gimme_arg(LT_TOF_SYSCALLR, event->proc, -1);
+ if (child > 0) {
open_pid(child, 0);
}
}
@@ -220,10 +235,11 @@
}
callstack_pop(event->proc);
if (opt_S) {
- output_right(LT_TOF_SYSCALLR, event->proc, sysname(event->proc, event->e_un.sysnum));
+ output_right(LT_TOF_SYSCALLR, event->proc,
+ sysname(event->proc, event->e_un.sysnum));
}
if (exec_p(event->proc, event->e_un.sysnum)) {
- if (gimme_arg(LT_TOF_SYSCALLR,event->proc,-1)==0) {
+ if (gimme_arg(LT_TOF_SYSCALLR, event->proc, -1) == 0) {
pid_t saved_pid;
event->proc->mask_32bit = 0;
event->proc->personality = 0;
@@ -241,30 +257,33 @@
continue_process(event->proc->pid);
}
-static void
-process_breakpoint(struct event * event) {
- int i,j;
- struct breakpoint *sbp;
+static void process_breakpoint(struct event *event)
+{
+ int i, j;
+ struct breakpoint *sbp;
debug(2, "event: breakpoint (%p)", event->e_un.brk_addr);
if (event->proc->breakpoint_being_enabled) {
/* Reinsert breakpoint */
- continue_enabling_breakpoint(event->proc->pid, event->proc->breakpoint_being_enabled);
+ continue_enabling_breakpoint(event->proc->pid,
+ event->proc->
+ breakpoint_being_enabled);
event->proc->breakpoint_being_enabled = NULL;
return;
}
- for(i=event->proc->callstack_depth-1; i>=0; i--) {
- if (event->e_un.brk_addr == event->proc->callstack[i].return_addr) {
+ for (i = event->proc->callstack_depth - 1; i >= 0; i--) {
+ if (event->e_un.brk_addr ==
+ event->proc->callstack[i].return_addr) {
#ifdef __powerpc__
/*
* PPC HACK! (XXX FIXME TODO)
* The PLT gets modified during the first call,
* so be sure to re-enable the breakpoint.
- */
+ */
unsigned long a;
struct library_symbol *libsym =
- event->proc->callstack[i].c_un.libfunc;
+ event->proc->callstack[i].c_un.libfunc;
void *addr = plt2addr(event->proc, libsym->enter_addr);
if (event->proc->e_machine == EM_PPC) {
@@ -272,20 +291,23 @@
sbp = address2bpstruct(event->proc, addr);
assert(sbp);
- a = ptrace(PTRACE_PEEKTEXT, event->proc->pid, addr);
+ a = ptrace(PTRACE_PEEKTEXT, event->proc->pid,
+ addr);
if (memcmp(&a, break_insn, 4)) {
sbp->enabled--;
- insert_breakpoint(event->proc, addr, libsym);
+ insert_breakpoint(event->proc, addr,
+ libsym);
}
} else {
sbp = libsym->brkpnt;
assert(sbp);
- if (addr != sbp->addr)
- insert_breakpoint(event->proc, addr, libsym);
+ if (addr != sbp->addr)
+ insert_breakpoint(event->proc, addr,
+ libsym);
}
#endif
- for(j=event->proc->callstack_depth-1; j>i; j--) {
+ for (j = event->proc->callstack_depth - 1; j > i; j--) {
callstack_pop(event->proc);
}
if (opt_T || opt_c) {
@@ -294,44 +316,48 @@
callstack_pop(event->proc);
event->proc->return_addr = event->e_un.brk_addr;
output_right(LT_TOF_FUNCTIONR, event->proc,
- event->proc->callstack[i].c_un.libfunc->name);
+ event->proc->callstack[i].c_un.libfunc->
+ name);
continue_after_breakpoint(event->proc,
- address2bpstruct(event->proc, event->e_un.brk_addr));
+ address2bpstruct(event->proc,
+ event->e_un.
+ brk_addr));
return;
}
}
- if ((sbp = address2bpstruct(event->proc, event->e_un.brk_addr)))
- {
- event->proc->stack_pointer = get_stack_pointer(event->proc);
- event->proc->return_addr = get_return_addr(event->proc, event->proc->stack_pointer);
- output_left(LT_TOF_FUNCTION, event->proc, sbp->libsym->name);
- callstack_push_symfunc(event->proc, sbp->libsym);
- if (PLTs_initialized_by_here
- && event->proc->need_to_reinitialize_breakpoints
- && (strcmp(sbp->libsym->name, PLTs_initialized_by_here) == 0))
- reinitialize_breakpoints(event->proc);
-
- continue_after_breakpoint(event->proc, sbp);
- return;
- }
+ if ((sbp = address2bpstruct(event->proc, event->e_un.brk_addr))) {
+ event->proc->stack_pointer = get_stack_pointer(event->proc);
+ event->proc->return_addr =
+ get_return_addr(event->proc, event->proc->stack_pointer);
+ output_left(LT_TOF_FUNCTION, event->proc, sbp->libsym->name);
+ callstack_push_symfunc(event->proc, sbp->libsym);
+ if (PLTs_initialized_by_here
+ && event->proc->need_to_reinitialize_breakpoints
+ && (strcmp(sbp->libsym->name, PLTs_initialized_by_here) ==
+ 0))
+ reinitialize_breakpoints(event->proc);
+
+ continue_after_breakpoint(event->proc, sbp);
+ return;
+ }
output_line(event->proc, "unexpected breakpoint at %p",
- (void *)event->e_un.brk_addr);
+ (void *)event->e_un.brk_addr);
continue_process(event->proc->pid);
}
-static void
-callstack_push_syscall(struct process * proc, int sysnum) {
- struct callstack_element * elem;
+static void callstack_push_syscall(struct process *proc, int sysnum)
+{
+ struct callstack_element *elem;
/* FIXME: not good -- should use dynamic allocation. 19990703 mortene. */
- if (proc->callstack_depth == MAX_CALLDEPTH-1) {
+ if (proc->callstack_depth == MAX_CALLDEPTH - 1) {
fprintf(stderr, "Error: call nesting too deep!\n");
return;
}
- elem = & proc->callstack[proc->callstack_depth];
+ elem = &proc->callstack[proc->callstack_depth];
elem->is_syscall = 1;
elem->c_un.syscall = sysnum;
elem->return_addr = NULL;
@@ -344,16 +370,17 @@
}
static void
-callstack_push_symfunc(struct process * proc, struct library_symbol * sym) {
- struct callstack_element * elem;
+callstack_push_symfunc(struct process *proc, struct library_symbol *sym)
+{
+ struct callstack_element *elem;
/* FIXME: not good -- should use dynamic allocation. 19990703 mortene. */
- if (proc->callstack_depth == MAX_CALLDEPTH-1) {
+ if (proc->callstack_depth == MAX_CALLDEPTH - 1) {
fprintf(stderr, "Error: call nesting too deep!\n");
return;
}
- elem = & proc->callstack[proc->callstack_depth];
+ elem = &proc->callstack[proc->callstack_depth];
elem->is_syscall = 0;
elem->c_un.libfunc = sym;
@@ -367,12 +394,12 @@
}
}
-static void
-callstack_pop(struct process * proc) {
- struct callstack_element * elem;
+static void callstack_pop(struct process *proc)
+{
+ struct callstack_element *elem;
assert(proc->callstack_depth > 0);
- elem = & proc->callstack[proc->callstack_depth-1];
+ elem = &proc->callstack[proc->callstack_depth - 1];
if (!elem->is_syscall) {
delete_breakpoint(proc, elem->return_addr);
}
diff --git a/read_config_file.c b/read_config_file.c
index bdceef5..2c54f44 100644
--- a/read_config_file.c
+++ b/read_config_file.c
@@ -24,50 +24,51 @@
* "addr" ARGTYPE_ADDR
*/
-struct function * list_of_functions = NULL;
+struct function *list_of_functions = NULL;
static struct list_of_pt_t {
- char * name;
+ char *name;
enum arg_type pt;
} list_of_pt[] = {
- { "void", ARGTYPE_VOID },
- { "int", ARGTYPE_INT },
- { "uint", ARGTYPE_UINT },
- { "long", ARGTYPE_LONG },
- { "ulong", ARGTYPE_ULONG },
- { "octal", ARGTYPE_OCTAL },
- { "char", ARGTYPE_CHAR },
- { "addr", ARGTYPE_ADDR },
- { "file", ARGTYPE_FILE },
- { "format", ARGTYPE_FORMAT },
- { "string", ARGTYPE_STRING },
- { "string0",ARGTYPE_STRING0 },
- { "string1",ARGTYPE_STRING1 },
- { "string2",ARGTYPE_STRING2 },
- { "string3",ARGTYPE_STRING3 },
- { "string4",ARGTYPE_STRING4 },
- { "string5",ARGTYPE_STRING5 },
- { NULL, ARGTYPE_UNKNOWN } /* Must finish with NULL */
+ {
+ "void", ARGTYPE_VOID}, {
+ "int", ARGTYPE_INT}, {
+ "uint", ARGTYPE_UINT}, {
+ "long", ARGTYPE_LONG}, {
+ "ulong", ARGTYPE_ULONG}, {
+ "octal", ARGTYPE_OCTAL}, {
+ "char", ARGTYPE_CHAR}, {
+ "addr", ARGTYPE_ADDR}, {
+ "file", ARGTYPE_FILE}, {
+ "format", ARGTYPE_FORMAT}, {
+ "string", ARGTYPE_STRING}, {
+ "string0", ARGTYPE_STRING0}, {
+ "string1", ARGTYPE_STRING1}, {
+ "string2", ARGTYPE_STRING2}, {
+ "string3", ARGTYPE_STRING3}, {
+ "string4", ARGTYPE_STRING4}, {
+ "string5", ARGTYPE_STRING5}, {
+ NULL, ARGTYPE_UNKNOWN} /* Must finish with NULL */
};
-static enum arg_type
-str2type(char ** str) {
- struct list_of_pt_t * tmp = &list_of_pt[0];
+static enum arg_type str2type(char **str)
+{
+ struct list_of_pt_t *tmp = &list_of_pt[0];
- while(tmp->name) {
+ while (tmp->name) {
if (!strncmp(*str, tmp->name, strlen(tmp->name))
- && index(" ,)#", *(*str+strlen(tmp->name)))) {
- *str += strlen(tmp->name);
- return tmp->pt;
+ && index(" ,)#", *(*str + strlen(tmp->name)))) {
+ *str += strlen(tmp->name);
+ return tmp->pt;
}
tmp++;
}
return ARGTYPE_UNKNOWN;
}
-static void
-eat_spaces(char ** str) {
- while(**str==' ') {
+static void eat_spaces(char **str)
+{
+ while (**str == ' ') {
(*str)++;
}
}
@@ -76,22 +77,28 @@
Returns position in string at the left parenthesis which starts the
function's argument signature. Returns NULL on error.
*/
-static char *
-start_of_arg_sig(char * str) {
- char * pos;
+static char *start_of_arg_sig(char *str)
+{
+ char *pos;
int stacked = 0;
- if (!strlen(str)) return NULL;
+ if (!strlen(str))
+ return NULL;
pos = &str[strlen(str)];
do {
pos--;
- if (pos < str) return NULL;
- while ((pos > str) && (*pos != ')') && (*pos != '(')) pos--;
+ if (pos < str)
+ return NULL;
+ while ((pos > str) && (*pos != ')') && (*pos != '('))
+ pos--;
- if (*pos == ')') stacked++;
- else if (*pos == '(') stacked--;
- else return NULL;
+ if (*pos == ')')
+ stacked++;
+ else if (*pos == '(')
+ stacked--;
+ else
+ return NULL;
} while (stacked > 0);
@@ -99,21 +106,21 @@
}
static int line_no;
-static char * filename;
+static char *filename;
-static struct function *
-process_line (char * buf) {
+static struct function *process_line(char *buf)
+{
struct function fun;
- struct function * fun_p;
- char * str = buf;
- char * tmp;
+ struct function *fun_p;
+ char *str = buf;
+ char *tmp;
int i;
line_no++;
debug(3, "Reading line %d of `%s'", line_no, filename);
eat_spaces(&str);
fun.return_type = str2type(&str);
- if (fun.return_type==ARGTYPE_UNKNOWN) {
+ if (fun.return_type == ARGTYPE_UNKNOWN) {
debug(3, " Skipping line %d", line_no);
return NULL;
}
@@ -121,38 +128,41 @@
eat_spaces(&str);
tmp = start_of_arg_sig(str);
if (!tmp) {
- output_line(0, "Syntax error in `%s', line %d", filename, line_no);
+ output_line(0, "Syntax error in `%s', line %d", filename,
+ line_no);
return NULL;
}
*tmp = '\0';
fun.name = strdup(str);
- str = tmp+1;
+ str = tmp + 1;
debug(3, " name = %s", fun.name);
fun.params_right = 0;
- for(i=0; i<MAX_ARGS; i++) {
+ for (i = 0; i < MAX_ARGS; i++) {
eat_spaces(&str);
if (*str == ')') {
break;
}
- if (str[0]=='+') {
+ if (str[0] == '+') {
fun.params_right++;
str++;
} else if (fun.params_right) {
fun.params_right++;
}
fun.arg_types[i] = str2type(&str);
- if (fun.return_type==ARGTYPE_UNKNOWN) {
- output_line(0, "Syntax error in `%s', line %d", filename, line_no);
+ if (fun.return_type == ARGTYPE_UNKNOWN) {
+ output_line(0, "Syntax error in `%s', line %d",
+ filename, line_no);
return NULL;
}
eat_spaces(&str);
- if (*str==',') {
+ if (*str == ',') {
str++;
continue;
- } else if (*str==')') {
+ } else if (*str == ')') {
continue;
} else {
- output_line(0, "Syntax error in `%s', line %d", filename, line_no);
+ output_line(0, "Syntax error in `%s', line %d",
+ filename, line_no);
return NULL;
}
}
@@ -162,9 +172,9 @@
return fun_p;
}
-void
-read_config_file(char * file) {
- FILE * stream;
+void read_config_file(char *file)
+{
+ FILE *stream;
char buf[1024];
filename = file;
@@ -175,9 +185,9 @@
if (!stream) {
return;
}
- line_no=0;
+ line_no = 0;
while (fgets(buf, 1024, stream)) {
- struct function * tmp = process_line(buf);
+ struct function *tmp = process_line(buf);
if (tmp) {
debug(2, "New function: `%s'", tmp->name);
diff --git a/read_config_file.h b/read_config_file.h
index 9230c0a..8000b1c 100644
--- a/read_config_file.h
+++ b/read_config_file.h
@@ -1,2 +1 @@
-extern void read_config_file(char*);
-
+extern void read_config_file(char *);
diff --git a/summary.c b/summary.c
index 2cfe4d6..d2f271b 100644
--- a/summary.c
+++ b/summary.c
@@ -9,16 +9,16 @@
char *name;
int count;
struct timeval tv;
-} * entries = NULL;
+} *entries = NULL;
static int tot_count = 0;
static unsigned long int tot_usecs = 0;
-static void
-fill_struct(void * key, void * value, void * data) {
- struct opt_c_struct * st = (struct opt_c_struct *)value;
+static void fill_struct(void *key, void *value, void *data)
+{
+ struct opt_c_struct *st = (struct opt_c_struct *)value;
- entries = realloc(entries, (num_entries+1)*sizeof(struct entry_st));
+ entries = realloc(entries, (num_entries + 1) * sizeof(struct entry_st));
if (!entries) {
perror("realloc()");
exit(1);
@@ -28,14 +28,14 @@
entries[num_entries].tv = st->tv;
tot_count += st->count;
- tot_usecs += 1000000*st->tv.tv_sec;
+ tot_usecs += 1000000 * st->tv.tv_sec;
tot_usecs += st->tv.tv_usec;
num_entries++;
}
-static int
-compar(const void *a, const void *b) {
+static int compar(const void *a, const void *b)
+{
struct entry_st *en1, *en2;
en1 = (struct entry_st *)a;
@@ -48,8 +48,8 @@
}
}
-void
-show_summary(void) {
+void show_summary(void)
+{
int i;
num_entries = 0;
@@ -60,20 +60,23 @@
qsort(entries, num_entries, sizeof(*entries), compar);
printf("%% time seconds usecs/call calls function\n");
- printf( "------ ----------- ----------- --------- --------------------\n");
- for(i=0; i<num_entries; i++) {
+ printf
+ ("------ ----------- ----------- --------- --------------------\n");
+ for (i = 0; i < num_entries; i++) {
unsigned long long int c;
unsigned long long int p;
- c = 1000000 * (int)entries[i].tv.tv_sec + (int)entries[i].tv.tv_usec;
+ c = 1000000 * (int)entries[i].tv.tv_sec +
+ (int)entries[i].tv.tv_usec;
p = 100000 * c / tot_usecs + 5;
printf("%3lu.%02lu %4d.%06d %11lu %9d %s\n",
- (unsigned long int)(p / 1000),
- (unsigned long int)((p / 10) % 100),
- (int)entries[i].tv.tv_sec, (int)entries[i].tv.tv_usec,
- (unsigned long int)(c / entries[i].count),
- entries[i].count, entries[i].name);
+ (unsigned long int)(p / 1000),
+ (unsigned long int)((p / 10) % 100),
+ (int)entries[i].tv.tv_sec, (int)entries[i].tv.tv_usec,
+ (unsigned long int)(c / entries[i].count),
+ entries[i].count, entries[i].name);
}
- printf("------ ----------- ----------- --------- --------------------\n");
- printf("100.00 %4lu.%06lu %9d total\n",
- tot_usecs / 1000000, tot_usecs % 1000000, tot_count);
+ printf
+ ("------ ----------- ----------- --------- --------------------\n");
+ printf("100.00 %4lu.%06lu %9d total\n", tot_usecs / 1000000,
+ tot_usecs % 1000000, tot_count);
}
diff --git a/sysdeps/linux-gnu/alpha/plt.c b/sysdeps/linux-gnu/alpha/plt.c
index 16ec3d0..30f2093 100644
--- a/sysdeps/linux-gnu/alpha/plt.c
+++ b/sysdeps/linux-gnu/alpha/plt.c
@@ -2,13 +2,12 @@
#include "ltrace.h"
#include "elf.h"
-GElf_Addr
-arch_plt_sym_val (struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+GElf_Addr arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela)
{
- return lte->plt_addr + ndx * 12 + 32;
+ return lte->plt_addr + ndx * 12 + 32;
}
-void * plt2addr(struct process *proc, void ** plt)
+void *plt2addr(struct process *proc, void **plt)
{
- return (void *) plt;
+ return (void *)plt;
}
diff --git a/sysdeps/linux-gnu/alpha/regs.c b/sysdeps/linux-gnu/alpha/regs.c
index c59eee9..fcba535 100644
--- a/sysdeps/linux-gnu/alpha/regs.c
+++ b/sysdeps/linux-gnu/alpha/regs.c
@@ -16,22 +16,22 @@
# define PTRACE_POKEUSER PTRACE_POKEUSR
#endif
-void *
-get_instruction_pointer(struct process * proc) {
- return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 64 /* REG_PC */, 0);
+void *get_instruction_pointer(struct process *proc)
+{
+ return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 64 /* REG_PC */ , 0);
}
-void
-set_instruction_pointer(struct process * proc, void * addr) {
- ptrace(PTRACE_POKEUSER, proc->pid, 64 /* REG_PC */, addr);
+void set_instruction_pointer(struct process *proc, void *addr)
+{
+ ptrace(PTRACE_POKEUSER, proc->pid, 64 /* REG_PC */ , addr);
}
-void *
-get_stack_pointer(struct process * proc) {
- return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 30 /* REG_FP */, 0);
+void *get_stack_pointer(struct process *proc)
+{
+ return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 30 /* REG_FP */ , 0);
}
-void *
-get_return_addr(struct process * proc, void * stack_pointer) {
- return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 26 /* RA */, 0);
+void *get_return_addr(struct process *proc, void *stack_pointer)
+{
+ return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 26 /* RA */ , 0);
}
diff --git a/sysdeps/linux-gnu/alpha/signalent.h b/sysdeps/linux-gnu/alpha/signalent.h
index 2b507e3..c2a6170 100644
--- a/sysdeps/linux-gnu/alpha/signalent.h
+++ b/sysdeps/linux-gnu/alpha/signalent.h
@@ -1,32 +1,32 @@
- "SIG_0", /* 0 */
- "SIGHUP", /* 1 */
- "SIGINT", /* 2 */
- "SIGQUIT", /* 3 */
- "SIGILL", /* 4 */
- "SIGTRAP", /* 5 */
- "SIGABRT", /* 6 */
- "SIGEMT", /* 7 */
- "SIGFPE", /* 8 */
- "SIGKILL", /* 9 */
- "SIGBUS", /* 10 */
- "SIGSEGV", /* 11 */
- "SIGSYS", /* 12 */
- "SIGPIPE", /* 13 */
- "SIGALRM", /* 14 */
- "SIGTERM", /* 15 */
- "SIGURG", /* 16 */
- "SIGSTOP", /* 17 */
- "SIGTSTP", /* 18 */
- "SIGCONT", /* 19 */
- "SIGCHLD", /* 20 */
- "SIGTTIN", /* 21 */
- "SIGTTOU", /* 22 */
- "SIGIO", /* 23 */
- "SIGXCPU", /* 24 */
- "SIGXFSZ", /* 25 */
- "SIGVTALRM", /* 26 */
- "SIGPROF", /* 27 */
- "SIGWINCH", /* 28 */
- "SIGINFO", /* 29 */
- "SIGUSR1", /* 30 */
- "SIGUSR2", /* 31 */
+"SIG_0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGEMT", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGBUS", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGSYS", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGURG", /* 16 */
+ "SIGSTOP", /* 17 */
+ "SIGTSTP", /* 18 */
+ "SIGCONT", /* 19 */
+ "SIGCHLD", /* 20 */
+ "SIGTTIN", /* 21 */
+ "SIGTTOU", /* 22 */
+ "SIGIO", /* 23 */
+ "SIGXCPU", /* 24 */
+ "SIGXFSZ", /* 25 */
+ "SIGVTALRM", /* 26 */
+ "SIGPROF", /* 27 */
+ "SIGWINCH", /* 28 */
+ "SIGINFO", /* 29 */
+ "SIGUSR1", /* 30 */
+ "SIGUSR2", /* 31 */
diff --git a/sysdeps/linux-gnu/alpha/syscallent.h b/sysdeps/linux-gnu/alpha/syscallent.h
index 97256d2..7cacc8c 100644
--- a/sysdeps/linux-gnu/alpha/syscallent.h
+++ b/sysdeps/linux-gnu/alpha/syscallent.h
@@ -1,439 +1,439 @@
- "osf_syscall", /* 0, not implemented */
- "exit", /* 1 */
- "fork", /* 2 */
- "read", /* 3 */
- "write", /* 4 */
- "osf_old_open", /* 5, not implemented */
- "close", /* 6 */
- "osf_wait4", /* 7 */
- "osf_old_creat", /* 8, not implemented */
- "link", /* 9 */
- "unlink", /* 10 */
- "osf_execve", /* 11, not implemented */
- "chdir", /* 12 */
- "fchdir", /* 13 */
- "mknod", /* 14 */
- "chmod", /* 15 */
- "chown", /* 16 */
- "brk", /* 17 */
- "osf_getfsstat", /* 18, not implemented */
- "lseek", /* 19 */
- "getxpid", /* 20 */
- "osf_mount", /* 21 */
- "umount", /* 22 */
- "setuid", /* 23 */
- "getxuid", /* 24 */
- "exec_with_loader", /* 25, not implemented */
- "ptrace", /* 26 */
- "osf_nrecmsg", /* 27, not implemented */
- "osf_nsendmsg", /* 28, not implemented */
- "osf_nrecvfrom", /* 29, not implemented */
- "osf_naccept", /* 30, not implemented */
- "osf_ngetpeername", /* 31, not implemented */
- "osf_ngetsocketname", /* 32, not implemented */
- "access", /* 33 */
- "osf_chflags", /* 34, not implemented */
- "osf_fchflags", /* 35, not implemented */
- "sync", /* 36 */
- "kill", /* 37 */
- "osf_old_stat", /* 38, not implemented */
- "setpgid", /* 39 */
- "osf_old_lstat", /* 40, not implemented */
- "dup", /* 41 */
- "pipe", /* 42 */
- "osf_set_program_attributes", /* 43 */
- "osf_profil", /* 44, not implemented */
- "open", /* 45 */
- "osf_old_sigaction", /* 46, not implemented */
- "getxgid", /* 47 */
- "osf_sigprocmask", /* 48 */
- "osf_getlogin", /* 49, not implemented */
- "osf_setlogin", /* 50, not implemented */
- "acct", /* 51 */
- "sigpending", /* 52 */
- "SYS_53", /* 53 */
- "ioctl", /* 54 */
- "osf_reboot", /* 55, not implemented */
- "osf_revoke", /* 56, not implemented */
- "symlink", /* 57 */
- "readlink", /* 58 */
- "execve", /* 59 */
- "umask", /* 60 */
- "chroot", /* 61 */
- "osf_old_fstat", /* 62, not implemented */
- "getpgrp", /* 63 */
- "getpagesize", /* 64 */
- "osf_mremap", /* 65, not implemented */
- "vfork", /* 66 */
- "stat", /* 67 */
- "lstat", /* 68 */
- "osf_sbrk", /* 69, not implemented */
- "osf_sstk", /* 70, not implemented */
- "mmap", /* 71 */
- "osf_old_vadvise", /* 72, not implemented */
- "munmap", /* 73 */
- "mprotect", /* 74 */
- "madvise", /* 75 */
- "vhangup", /* 76 */
- "osf_kmodcall", /* 77, not implemented */
- "osf_mincore", /* 78, not implemented */
- "getgroups", /* 79 */
- "setgroups", /* 80 */
- "osf_old_getpgrp", /* 81, not implemented */
- "setpgrp", /* 82 */
- "osf_setitimer", /* 83 */
- "osf_old_wait", /* 84, not implemented */
- "osf_table", /* 85, not implemented */
- "osf_getitimer", /* 86 */
- "gethostname", /* 87 */
- "sethostname", /* 88 */
- "getdtablesize", /* 89 */
- "dup2", /* 90 */
- "fstat", /* 91 */
- "fcntl", /* 92 */
- "osf_select", /* 93 */
- "poll", /* 94 */
- "fsync", /* 95 */
- "setpriority", /* 96 */
- "socket", /* 97 */
- "connect", /* 98 */
- "accept", /* 99 */
- "osf_getpriority", /* 100 */
- "send", /* 101 */
- "recv", /* 102 */
- "sigreturn", /* 103 */
- "bind", /* 104 */
- "setsockopt", /* 105 */
- "listen", /* 106 */
- "osf_plock", /* 107, not implemented */
- "osf_old_sigvec", /* 108, not implemented */
- "osf_old_sigblock", /* 109, not implemented */
- "osf_old_sigsetmask", /* 110, not implemented */
- "sigsuspend", /* 111 */
- "sigstack", /* 112 */
- "recvmsg", /* 113 */
- "sendmsg", /* 114 */
- "osf_old_vtrace", /* 115, not implemented */
- "osf_gettimeofday", /* 116 */
- "osf_getrusage", /* 117 */
- "getsockopt", /* 118 */
- "SYS_119", /* 119 */
- "readv", /* 120 */
- "writev", /* 121 */
- "osf_settimeofday", /* 122 */
- "fchown", /* 123 */
- "fchmod", /* 124 */
- "recvfrom", /* 125 */
- "setreuid", /* 126 */
- "setregid", /* 127 */
- "rename", /* 128 */
- "truncate", /* 129 */
- "ftruncate", /* 130 */
- "flock", /* 131 */
- "setgid", /* 132 */
- "sendto", /* 133 */
- "shutdown", /* 134 */
- "socketpair", /* 135 */
- "mkdir", /* 136 */
- "rmdir", /* 137 */
- "osf_utimes", /* 138 */
- "osf_old_sigreturn", /* 139 */
- "osf_adjtime", /* 140, not implemented */
- "getpeername", /* 141 */
- "osf_gethostid", /* 142, not implemented */
- "osf_sethostid", /* 143, not implemented */
- "getrlimit", /* 144 */
- "setrlimit", /* 145 */
- "osf_old_killpg", /* 146, not implemented */
- "setsid", /* 147 */
- "quotactl", /* 148 */
- "osf_oldquota", /* 149, not implemented */
- "getsockname", /* 150 */
- "SYS_151", /* 151 */
- "SYS_152", /* 152 */
- "osf_pid_block", /* 153, not implemented */
- "osf_pid_unblock", /* 154, not implemented */
- "SYS_155", /* 155 */
- "sigaction", /* 156 */
- "osf_sigwaitprim", /* 157, not implemented */
- "osf_nfssvc", /* 158, not implemented */
- "osf_getdirentries", /* 159 */
- "osf_statfs", /* 160 */
- "osf_fstatfs", /* 161 */
- "SYS_162", /* 162 */
- "osf_asynch_daemon", /* 163, not implemented */
- "osf_getfh", /* 164, not implemented */
- "osf_getdomainname", /* 165 */
- "setdomainname", /* 166 */
- "SYS_167", /* 167 */
- "SYS_168", /* 168 */
- "osf_exportfs", /* 169, not implemented */
- "SYS_170", /* 170 */
- "SYS_171", /* 171 */
- "SYS_172", /* 172 */
- "SYS_173", /* 173 */
- "SYS_174", /* 174 */
- "SYS_175", /* 175 */
- "SYS_176", /* 176 */
- "SYS_177", /* 177 */
- "SYS_178", /* 178 */
- "SYS_179", /* 179 */
- "SYS_180", /* 180 */
- "osf_alt_plock", /* 181, not implemented */
- "SYS_182", /* 182 */
- "SYS_183", /* 183 */
- "osf_getmnt", /* 184, not implemented */
- "SYS_185", /* 185 */
- "SYS_186", /* 186 */
- "osf_alt_sigpending", /* 187, not implemented */
- "osf_alt_setsid", /* 188, not implemented */
- "SYS_189", /* 189 */
- "SYS_190", /* 190 */
- "SYS_191", /* 191 */
- "SYS_192", /* 192 */
- "SYS_193", /* 193 */
- "SYS_194", /* 194 */
- "SYS_195", /* 195 */
- "SYS_196", /* 196 */
- "SYS_197", /* 197 */
- "SYS_198", /* 198 */
- "osf_swapon", /* 199 */
- "msgctl", /* 200 */
- "msgget", /* 201 */
- "msgrcv", /* 202 */
- "msgsnd", /* 203 */
- "semctl", /* 204 */
- "semget", /* 205 */
- "semop", /* 206 */
- "osf_utsname", /* 207 */
- "lchown", /* 208 */
- "osf_shmat", /* 209 */
- "shmctl", /* 210 */
- "shmdt", /* 211 */
- "shmget", /* 212 */
- "osf_mvalid", /* 213, not implemented */
- "osf_getaddressconf", /* 214, not implemented */
- "osf_msleep", /* 215, not implemented */
- "osf_mwakeup", /* 216, not implemented */
- "msync", /* 217 */
- "osf_signal", /* 218, not implemented */
- "osf_utc_gettime", /* 219, not implemented */
- "osf_utc_adjtime", /* 220, not implemented */
- "SYS_221", /* 221 */
- "osf_security", /* 222, not implemented */
- "osf_kloadcall", /* 223, not implemented */
- "SYS_224", /* 224 */
- "SYS_225", /* 225 */
- "SYS_226", /* 226 */
- "SYS_227", /* 227 */
- "SYS_228", /* 228 */
- "SYS_229", /* 229 */
- "SYS_230", /* 230 */
- "SYS_231", /* 231 */
- "SYS_232", /* 232 */
- "getpgid", /* 233 */
- "getsid", /* 234 */
- "sigaltstack", /* 235 */
- "osf_waitid", /* 236, not implemented */
- "osf_priocntlset", /* 237, not implemented */
- "osf_sigsendset", /* 238, not implemented */
- "osf_set_speculative", /* 239, not implemented */
- "osf_msfs_syscall", /* 240, not implemented */
- "osf_sysinfo", /* 241 */
- "osf_uadmin", /* 242, not implemented */
- "osf_fuser", /* 243, not implemented */
- "osf_proplist_syscall", /* 244 */
- "osf_ntp_adjtime", /* 245, not implemented */
- "osf_ntp_gettime", /* 246, not implemented */
- "osf_pathconf", /* 247, not implemented */
- "osf_fpathconf", /* 248, not implemented */
- "SYS_249", /* 249 */
- "osf_uswitch", /* 250, not implemented */
- "osf_usleep_thread", /* 251 */
- "osf_audcntl", /* 252, not implemented */
- "osf_audgen", /* 253, not implemented */
- "sysfs", /* 254 */
- "osf_subsysinfo", /* 255, not implemented */
- "osf_getsysinfo", /* 256 */
- "osf_setsysinfo", /* 257 */
- "osf_afs_syscall", /* 258, not implemented */
- "osf_swapctl", /* 259, not implemented */
- "osf_memcntl", /* 260, not implemented */
- "osf_fdatasync", /* 261, not implemented */
- "SYS_262", /* 262 */
- "SYS_263", /* 263 */
- "SYS_264", /* 264 */
- "SYS_265", /* 265 */
- "SYS_266", /* 266 */
- "SYS_267", /* 267 */
- "SYS_268", /* 268 */
- "SYS_269", /* 269 */
- "SYS_270", /* 270 */
- "SYS_271", /* 271 */
- "SYS_272", /* 272 */
- "SYS_273", /* 273 */
- "SYS_274", /* 274 */
- "SYS_275", /* 275 */
- "SYS_276", /* 276 */
- "SYS_277", /* 277 */
- "SYS_278", /* 278 */
- "SYS_279", /* 279 */
- "SYS_280", /* 280 */
- "SYS_281", /* 281 */
- "SYS_282", /* 282 */
- "SYS_283", /* 283 */
- "SYS_284", /* 284 */
- "SYS_285", /* 285 */
- "SYS_286", /* 286 */
- "SYS_287", /* 287 */
- "SYS_288", /* 288 */
- "SYS_289", /* 289 */
- "SYS_290", /* 290 */
- "SYS_291", /* 291 */
- "SYS_292", /* 292 */
- "SYS_293", /* 293 */
- "SYS_294", /* 294 */
- "SYS_295", /* 295 */
- "SYS_296", /* 296 */
- "SYS_297", /* 297 */
- "SYS_298", /* 298 */
- "SYS_299", /* 299 */
- "bdflush", /* 300 */
- "sethae", /* 301 */
- "mount", /* 302 */
- "adjtimex32", /* 303 */
- "swapoff", /* 304 */
- "getdents", /* 305 */
- "create_module", /* 306 */
- "init_module", /* 307 */
- "delete_module", /* 308 */
- "get_kernel_syms", /* 309 */
- "syslog", /* 310 */
- "reboot", /* 311 */
- "clone", /* 312 */
- "uselib", /* 313 */
- "mlock", /* 314 */
- "munlock", /* 315 */
- "mlockall", /* 316 */
- "munlockall", /* 317 */
- "sysinfo", /* 318 */
- "sysctl", /* 319 */
- "idle", /* 320 */
- "oldumount", /* 321 */
- "swapon", /* 322 */
- "times", /* 323 */
- "personality", /* 324 */
- "setfsuid", /* 325 */
- "setfsgid", /* 326 */
- "ustat", /* 327 */
- "statfs", /* 328 */
- "fstatfs", /* 329 */
- "sched_setparam", /* 330 */
- "sched_getparam", /* 331 */
- "sched_setscheduler", /* 332 */
- "sched_getscheduler", /* 333 */
- "sched_yield", /* 334 */
- "sched_get_priority_max", /* 335 */
- "sched_get_priority_min", /* 336 */
- "sched_rr_get_interval", /* 337 */
- "afs_syscall", /* 338 */
- "uname", /* 339 */
- "nanosleep", /* 340 */
- "mremap", /* 341 */
- "nfsservctl", /* 342 */
- "setresuid", /* 343 */
- "getresuid", /* 344 */
- "pciconfig_read", /* 345 */
- "pciconfig_write", /* 346 */
- "query_module", /* 347 */
- "prctl", /* 348 */
- "pread", /* 349 */
- "pwrite", /* 350 */
- "rt_sigreturn", /* 351 */
- "rt_sigaction", /* 352 */
- "rt_sigprocmask", /* 353 */
- "rt_sigpending", /* 354 */
- "rt_sigtimedwait", /* 355 */
- "rt_sigqueueinfo", /* 356 */
- "rt_sigsuspend", /* 357 */
- "select", /* 358 */
- "gettimeofday", /* 359 */
- "settimeofday", /* 360 */
- "getitimer", /* 361 */
- "setitimer", /* 362 */
- "utimes", /* 363 */
- "getrusage", /* 364 */
- "wait4", /* 365 */
- "adjtimex", /* 366 */
- "getcwd", /* 367 */
- "capget", /* 368 */
- "capset", /* 369 */
- "sendfile", /* 370 */
- "setresgid", /* 371 */
- "getresgid", /* 372 */
- "dipc", /* 373, not implemented */
- "pivot_root", /* 374 */
- "mincore", /* 375 */
- "pciconfig_iobase", /* 376 */
- "getdents64", /* 377 */
- "gettid", /* 378 */
- "readahead", /* 379 */
- "SYS_380", /* 380 */
- "tkill", /* 381 */
- "setxattr", /* 382 */
- "lsetxattr", /* 383 */
- "fsetxattr", /* 384 */
- "getxattr", /* 385 */
- "lgetxattr", /* 386 */
- "fgetxattr", /* 387 */
- "listxattr", /* 388 */
- "llistxattr", /* 389 */
- "flistxattr", /* 390 */
- "removexattr", /* 391 */
- "lremovexattr", /* 392 */
- "fremovexattr", /* 393 */
- "futex", /* 394 */
- "sched_setaffinity", /* 395 */
- "sched_getaffinity", /* 396 */
- "tuxcall", /* 397 */
- "io_setup", /* 398 */
- "io_destroy", /* 399 */
- "io_getevents", /* 400 */
- "io_submit", /* 401 */
- "io_cancel", /* 402 */
- "SYS_403", /* 403 */
- "SYS_404", /* 404 */
- "exit_group", /* 405 */
- "lookup_dcookie", /* 406 */
- "epoll_create", /* 407 */
- "epoll_ctl", /* 408 */
- "epoll_wait", /* 409 */
- "remap_file_pages", /* 410 */
- "set_tid_address", /* 411 */
- "restart_syscall", /* 412 */
- "fadvise", /* 413 */
- "timer_create", /* 414 */
- "timer_settime", /* 415 */
- "timer_gettime", /* 416 */
- "timer_getoverrun", /* 417 */
- "timer_delete", /* 418 */
- "clock_settime", /* 419 */
- "clock_gettime", /* 420 */
- "clock_getres", /* 421 */
- "clock_nanosleep", /* 422 */
- "semtimedop", /* 423 */
- "tgkill", /* 424 */
- "stat64", /* 425 */
- "lstat64", /* 426 */
- "fstat64", /* 427 */
- "vserver", /* 428 */
- "mbind", /* 429 */
- "get_mempolicy", /* 430 */
- "set_mempolicy", /* 431 */
- "mq_open", /* 432 */
- "mq_unlink", /* 433 */
- "mq_timedsend", /* 434 */
- "mq_timedreceive", /* 435 */
- "mq_notify", /* 436 */
- "mq_getsetattr", /* 437 */
- "waitid" /* 438 */
+"osf_syscall", /* 0, not implemented */
+ "exit", /* 1 */
+ "fork", /* 2 */
+ "read", /* 3 */
+ "write", /* 4 */
+ "osf_old_open", /* 5, not implemented */
+ "close", /* 6 */
+ "osf_wait4", /* 7 */
+ "osf_old_creat", /* 8, not implemented */
+ "link", /* 9 */
+ "unlink", /* 10 */
+ "osf_execve", /* 11, not implemented */
+ "chdir", /* 12 */
+ "fchdir", /* 13 */
+ "mknod", /* 14 */
+ "chmod", /* 15 */
+ "chown", /* 16 */
+ "brk", /* 17 */
+ "osf_getfsstat", /* 18, not implemented */
+ "lseek", /* 19 */
+ "getxpid", /* 20 */
+ "osf_mount", /* 21 */
+ "umount", /* 22 */
+ "setuid", /* 23 */
+ "getxuid", /* 24 */
+ "exec_with_loader", /* 25, not implemented */
+ "ptrace", /* 26 */
+ "osf_nrecmsg", /* 27, not implemented */
+ "osf_nsendmsg", /* 28, not implemented */
+ "osf_nrecvfrom", /* 29, not implemented */
+ "osf_naccept", /* 30, not implemented */
+ "osf_ngetpeername", /* 31, not implemented */
+ "osf_ngetsocketname", /* 32, not implemented */
+ "access", /* 33 */
+ "osf_chflags", /* 34, not implemented */
+ "osf_fchflags", /* 35, not implemented */
+ "sync", /* 36 */
+ "kill", /* 37 */
+ "osf_old_stat", /* 38, not implemented */
+ "setpgid", /* 39 */
+ "osf_old_lstat", /* 40, not implemented */
+ "dup", /* 41 */
+ "pipe", /* 42 */
+ "osf_set_program_attributes", /* 43 */
+ "osf_profil", /* 44, not implemented */
+ "open", /* 45 */
+ "osf_old_sigaction", /* 46, not implemented */
+ "getxgid", /* 47 */
+ "osf_sigprocmask", /* 48 */
+ "osf_getlogin", /* 49, not implemented */
+ "osf_setlogin", /* 50, not implemented */
+ "acct", /* 51 */
+ "sigpending", /* 52 */
+ "SYS_53", /* 53 */
+ "ioctl", /* 54 */
+ "osf_reboot", /* 55, not implemented */
+ "osf_revoke", /* 56, not implemented */
+ "symlink", /* 57 */
+ "readlink", /* 58 */
+ "execve", /* 59 */
+ "umask", /* 60 */
+ "chroot", /* 61 */
+ "osf_old_fstat", /* 62, not implemented */
+ "getpgrp", /* 63 */
+ "getpagesize", /* 64 */
+ "osf_mremap", /* 65, not implemented */
+ "vfork", /* 66 */
+ "stat", /* 67 */
+ "lstat", /* 68 */
+ "osf_sbrk", /* 69, not implemented */
+ "osf_sstk", /* 70, not implemented */
+ "mmap", /* 71 */
+ "osf_old_vadvise", /* 72, not implemented */
+ "munmap", /* 73 */
+ "mprotect", /* 74 */
+ "madvise", /* 75 */
+ "vhangup", /* 76 */
+ "osf_kmodcall", /* 77, not implemented */
+ "osf_mincore", /* 78, not implemented */
+ "getgroups", /* 79 */
+ "setgroups", /* 80 */
+ "osf_old_getpgrp", /* 81, not implemented */
+ "setpgrp", /* 82 */
+ "osf_setitimer", /* 83 */
+ "osf_old_wait", /* 84, not implemented */
+ "osf_table", /* 85, not implemented */
+ "osf_getitimer", /* 86 */
+ "gethostname", /* 87 */
+ "sethostname", /* 88 */
+ "getdtablesize", /* 89 */
+ "dup2", /* 90 */
+ "fstat", /* 91 */
+ "fcntl", /* 92 */
+ "osf_select", /* 93 */
+ "poll", /* 94 */
+ "fsync", /* 95 */
+ "setpriority", /* 96 */
+ "socket", /* 97 */
+ "connect", /* 98 */
+ "accept", /* 99 */
+ "osf_getpriority", /* 100 */
+ "send", /* 101 */
+ "recv", /* 102 */
+ "sigreturn", /* 103 */
+ "bind", /* 104 */
+ "setsockopt", /* 105 */
+ "listen", /* 106 */
+ "osf_plock", /* 107, not implemented */
+ "osf_old_sigvec", /* 108, not implemented */
+ "osf_old_sigblock", /* 109, not implemented */
+ "osf_old_sigsetmask", /* 110, not implemented */
+ "sigsuspend", /* 111 */
+ "sigstack", /* 112 */
+ "recvmsg", /* 113 */
+ "sendmsg", /* 114 */
+ "osf_old_vtrace", /* 115, not implemented */
+ "osf_gettimeofday", /* 116 */
+ "osf_getrusage", /* 117 */
+ "getsockopt", /* 118 */
+ "SYS_119", /* 119 */
+ "readv", /* 120 */
+ "writev", /* 121 */
+ "osf_settimeofday", /* 122 */
+ "fchown", /* 123 */
+ "fchmod", /* 124 */
+ "recvfrom", /* 125 */
+ "setreuid", /* 126 */
+ "setregid", /* 127 */
+ "rename", /* 128 */
+ "truncate", /* 129 */
+ "ftruncate", /* 130 */
+ "flock", /* 131 */
+ "setgid", /* 132 */
+ "sendto", /* 133 */
+ "shutdown", /* 134 */
+ "socketpair", /* 135 */
+ "mkdir", /* 136 */
+ "rmdir", /* 137 */
+ "osf_utimes", /* 138 */
+ "osf_old_sigreturn", /* 139 */
+ "osf_adjtime", /* 140, not implemented */
+ "getpeername", /* 141 */
+ "osf_gethostid", /* 142, not implemented */
+ "osf_sethostid", /* 143, not implemented */
+ "getrlimit", /* 144 */
+ "setrlimit", /* 145 */
+ "osf_old_killpg", /* 146, not implemented */
+ "setsid", /* 147 */
+ "quotactl", /* 148 */
+ "osf_oldquota", /* 149, not implemented */
+ "getsockname", /* 150 */
+ "SYS_151", /* 151 */
+ "SYS_152", /* 152 */
+ "osf_pid_block", /* 153, not implemented */
+ "osf_pid_unblock", /* 154, not implemented */
+ "SYS_155", /* 155 */
+ "sigaction", /* 156 */
+ "osf_sigwaitprim", /* 157, not implemented */
+ "osf_nfssvc", /* 158, not implemented */
+ "osf_getdirentries", /* 159 */
+ "osf_statfs", /* 160 */
+ "osf_fstatfs", /* 161 */
+ "SYS_162", /* 162 */
+ "osf_asynch_daemon", /* 163, not implemented */
+ "osf_getfh", /* 164, not implemented */
+ "osf_getdomainname", /* 165 */
+ "setdomainname", /* 166 */
+ "SYS_167", /* 167 */
+ "SYS_168", /* 168 */
+ "osf_exportfs", /* 169, not implemented */
+ "SYS_170", /* 170 */
+ "SYS_171", /* 171 */
+ "SYS_172", /* 172 */
+ "SYS_173", /* 173 */
+ "SYS_174", /* 174 */
+ "SYS_175", /* 175 */
+ "SYS_176", /* 176 */
+ "SYS_177", /* 177 */
+ "SYS_178", /* 178 */
+ "SYS_179", /* 179 */
+ "SYS_180", /* 180 */
+ "osf_alt_plock", /* 181, not implemented */
+ "SYS_182", /* 182 */
+ "SYS_183", /* 183 */
+ "osf_getmnt", /* 184, not implemented */
+ "SYS_185", /* 185 */
+ "SYS_186", /* 186 */
+ "osf_alt_sigpending", /* 187, not implemented */
+ "osf_alt_setsid", /* 188, not implemented */
+ "SYS_189", /* 189 */
+ "SYS_190", /* 190 */
+ "SYS_191", /* 191 */
+ "SYS_192", /* 192 */
+ "SYS_193", /* 193 */
+ "SYS_194", /* 194 */
+ "SYS_195", /* 195 */
+ "SYS_196", /* 196 */
+ "SYS_197", /* 197 */
+ "SYS_198", /* 198 */
+ "osf_swapon", /* 199 */
+ "msgctl", /* 200 */
+ "msgget", /* 201 */
+ "msgrcv", /* 202 */
+ "msgsnd", /* 203 */
+ "semctl", /* 204 */
+ "semget", /* 205 */
+ "semop", /* 206 */
+ "osf_utsname", /* 207 */
+ "lchown", /* 208 */
+ "osf_shmat", /* 209 */
+ "shmctl", /* 210 */
+ "shmdt", /* 211 */
+ "shmget", /* 212 */
+ "osf_mvalid", /* 213, not implemented */
+ "osf_getaddressconf", /* 214, not implemented */
+ "osf_msleep", /* 215, not implemented */
+ "osf_mwakeup", /* 216, not implemented */
+ "msync", /* 217 */
+ "osf_signal", /* 218, not implemented */
+ "osf_utc_gettime", /* 219, not implemented */
+ "osf_utc_adjtime", /* 220, not implemented */
+ "SYS_221", /* 221 */
+ "osf_security", /* 222, not implemented */
+ "osf_kloadcall", /* 223, not implemented */
+ "SYS_224", /* 224 */
+ "SYS_225", /* 225 */
+ "SYS_226", /* 226 */
+ "SYS_227", /* 227 */
+ "SYS_228", /* 228 */
+ "SYS_229", /* 229 */
+ "SYS_230", /* 230 */
+ "SYS_231", /* 231 */
+ "SYS_232", /* 232 */
+ "getpgid", /* 233 */
+ "getsid", /* 234 */
+ "sigaltstack", /* 235 */
+ "osf_waitid", /* 236, not implemented */
+ "osf_priocntlset", /* 237, not implemented */
+ "osf_sigsendset", /* 238, not implemented */
+ "osf_set_speculative", /* 239, not implemented */
+ "osf_msfs_syscall", /* 240, not implemented */
+ "osf_sysinfo", /* 241 */
+ "osf_uadmin", /* 242, not implemented */
+ "osf_fuser", /* 243, not implemented */
+ "osf_proplist_syscall", /* 244 */
+ "osf_ntp_adjtime", /* 245, not implemented */
+ "osf_ntp_gettime", /* 246, not implemented */
+ "osf_pathconf", /* 247, not implemented */
+ "osf_fpathconf", /* 248, not implemented */
+ "SYS_249", /* 249 */
+ "osf_uswitch", /* 250, not implemented */
+ "osf_usleep_thread", /* 251 */
+ "osf_audcntl", /* 252, not implemented */
+ "osf_audgen", /* 253, not implemented */
+ "sysfs", /* 254 */
+ "osf_subsysinfo", /* 255, not implemented */
+ "osf_getsysinfo", /* 256 */
+ "osf_setsysinfo", /* 257 */
+ "osf_afs_syscall", /* 258, not implemented */
+ "osf_swapctl", /* 259, not implemented */
+ "osf_memcntl", /* 260, not implemented */
+ "osf_fdatasync", /* 261, not implemented */
+ "SYS_262", /* 262 */
+ "SYS_263", /* 263 */
+ "SYS_264", /* 264 */
+ "SYS_265", /* 265 */
+ "SYS_266", /* 266 */
+ "SYS_267", /* 267 */
+ "SYS_268", /* 268 */
+ "SYS_269", /* 269 */
+ "SYS_270", /* 270 */
+ "SYS_271", /* 271 */
+ "SYS_272", /* 272 */
+ "SYS_273", /* 273 */
+ "SYS_274", /* 274 */
+ "SYS_275", /* 275 */
+ "SYS_276", /* 276 */
+ "SYS_277", /* 277 */
+ "SYS_278", /* 278 */
+ "SYS_279", /* 279 */
+ "SYS_280", /* 280 */
+ "SYS_281", /* 281 */
+ "SYS_282", /* 282 */
+ "SYS_283", /* 283 */
+ "SYS_284", /* 284 */
+ "SYS_285", /* 285 */
+ "SYS_286", /* 286 */
+ "SYS_287", /* 287 */
+ "SYS_288", /* 288 */
+ "SYS_289", /* 289 */
+ "SYS_290", /* 290 */
+ "SYS_291", /* 291 */
+ "SYS_292", /* 292 */
+ "SYS_293", /* 293 */
+ "SYS_294", /* 294 */
+ "SYS_295", /* 295 */
+ "SYS_296", /* 296 */
+ "SYS_297", /* 297 */
+ "SYS_298", /* 298 */
+ "SYS_299", /* 299 */
+ "bdflush", /* 300 */
+ "sethae", /* 301 */
+ "mount", /* 302 */
+ "adjtimex32", /* 303 */
+ "swapoff", /* 304 */
+ "getdents", /* 305 */
+ "create_module", /* 306 */
+ "init_module", /* 307 */
+ "delete_module", /* 308 */
+ "get_kernel_syms", /* 309 */
+ "syslog", /* 310 */
+ "reboot", /* 311 */
+ "clone", /* 312 */
+ "uselib", /* 313 */
+ "mlock", /* 314 */
+ "munlock", /* 315 */
+ "mlockall", /* 316 */
+ "munlockall", /* 317 */
+ "sysinfo", /* 318 */
+ "sysctl", /* 319 */
+ "idle", /* 320 */
+ "oldumount", /* 321 */
+ "swapon", /* 322 */
+ "times", /* 323 */
+ "personality", /* 324 */
+ "setfsuid", /* 325 */
+ "setfsgid", /* 326 */
+ "ustat", /* 327 */
+ "statfs", /* 328 */
+ "fstatfs", /* 329 */
+ "sched_setparam", /* 330 */
+ "sched_getparam", /* 331 */
+ "sched_setscheduler", /* 332 */
+ "sched_getscheduler", /* 333 */
+ "sched_yield", /* 334 */
+ "sched_get_priority_max", /* 335 */
+ "sched_get_priority_min", /* 336 */
+ "sched_rr_get_interval", /* 337 */
+ "afs_syscall", /* 338 */
+ "uname", /* 339 */
+ "nanosleep", /* 340 */
+ "mremap", /* 341 */
+ "nfsservctl", /* 342 */
+ "setresuid", /* 343 */
+ "getresuid", /* 344 */
+ "pciconfig_read", /* 345 */
+ "pciconfig_write", /* 346 */
+ "query_module", /* 347 */
+ "prctl", /* 348 */
+ "pread", /* 349 */
+ "pwrite", /* 350 */
+ "rt_sigreturn", /* 351 */
+ "rt_sigaction", /* 352 */
+ "rt_sigprocmask", /* 353 */
+ "rt_sigpending", /* 354 */
+ "rt_sigtimedwait", /* 355 */
+ "rt_sigqueueinfo", /* 356 */
+ "rt_sigsuspend", /* 357 */
+ "select", /* 358 */
+ "gettimeofday", /* 359 */
+ "settimeofday", /* 360 */
+ "getitimer", /* 361 */
+ "setitimer", /* 362 */
+ "utimes", /* 363 */
+ "getrusage", /* 364 */
+ "wait4", /* 365 */
+ "adjtimex", /* 366 */
+ "getcwd", /* 367 */
+ "capget", /* 368 */
+ "capset", /* 369 */
+ "sendfile", /* 370 */
+ "setresgid", /* 371 */
+ "getresgid", /* 372 */
+ "dipc", /* 373, not implemented */
+ "pivot_root", /* 374 */
+ "mincore", /* 375 */
+ "pciconfig_iobase", /* 376 */
+ "getdents64", /* 377 */
+ "gettid", /* 378 */
+ "readahead", /* 379 */
+ "SYS_380", /* 380 */
+ "tkill", /* 381 */
+ "setxattr", /* 382 */
+ "lsetxattr", /* 383 */
+ "fsetxattr", /* 384 */
+ "getxattr", /* 385 */
+ "lgetxattr", /* 386 */
+ "fgetxattr", /* 387 */
+ "listxattr", /* 388 */
+ "llistxattr", /* 389 */
+ "flistxattr", /* 390 */
+ "removexattr", /* 391 */
+ "lremovexattr", /* 392 */
+ "fremovexattr", /* 393 */
+ "futex", /* 394 */
+ "sched_setaffinity", /* 395 */
+ "sched_getaffinity", /* 396 */
+ "tuxcall", /* 397 */
+ "io_setup", /* 398 */
+ "io_destroy", /* 399 */
+ "io_getevents", /* 400 */
+ "io_submit", /* 401 */
+ "io_cancel", /* 402 */
+ "SYS_403", /* 403 */
+ "SYS_404", /* 404 */
+ "exit_group", /* 405 */
+ "lookup_dcookie", /* 406 */
+ "epoll_create", /* 407 */
+ "epoll_ctl", /* 408 */
+ "epoll_wait", /* 409 */
+ "remap_file_pages", /* 410 */
+ "set_tid_address", /* 411 */
+ "restart_syscall", /* 412 */
+ "fadvise", /* 413 */
+ "timer_create", /* 414 */
+ "timer_settime", /* 415 */
+ "timer_gettime", /* 416 */
+ "timer_getoverrun", /* 417 */
+ "timer_delete", /* 418 */
+ "clock_settime", /* 419 */
+ "clock_gettime", /* 420 */
+ "clock_getres", /* 421 */
+ "clock_nanosleep", /* 422 */
+ "semtimedop", /* 423 */
+ "tgkill", /* 424 */
+ "stat64", /* 425 */
+ "lstat64", /* 426 */
+ "fstat64", /* 427 */
+ "vserver", /* 428 */
+ "mbind", /* 429 */
+ "get_mempolicy", /* 430 */
+ "set_mempolicy", /* 431 */
+ "mq_open", /* 432 */
+ "mq_unlink", /* 433 */
+ "mq_timedsend", /* 434 */
+ "mq_timedreceive", /* 435 */
+ "mq_notify", /* 436 */
+ "mq_getsetattr", /* 437 */
+ "waitid" /* 438 */
diff --git a/sysdeps/linux-gnu/alpha/trace.c b/sysdeps/linux-gnu/alpha/trace.c
index 3d6237c..36a9938 100644
--- a/sysdeps/linux-gnu/alpha/trace.c
+++ b/sysdeps/linux-gnu/alpha/trace.c
@@ -25,45 +25,52 @@
/* Returns 1 if syscall, 2 if sysret, 0 otherwise.
*/
-int
-syscall_p(struct process * proc, int status, int * sysnum) {
- if (WIFSTOPPED(status) && WSTOPSIG(status)==(SIGTRAP | proc->tracesysgood)) {
- char *ip=get_instruction_pointer(proc) - 4;
+int syscall_p(struct process *proc, int status, int *sysnum)
+{
+ if (WIFSTOPPED(status)
+ && WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
+ char *ip = get_instruction_pointer(proc) - 4;
long x = ptrace(PTRACE_PEEKTEXT, proc->pid, ip, 0);
debug(2, "instr: %016lx", x);
- if((x & 0xffffffff) != 0x00000083)
+ if ((x & 0xffffffff) != 0x00000083)
return 0;
- *sysnum = ptrace(PTRACE_PEEKUSER, proc->pid, 0 /* REG_R0 */, 0);
- if (proc->callstack_depth > 0 && proc->callstack[proc->callstack_depth-1].is_syscall) {
+ *sysnum =
+ ptrace(PTRACE_PEEKUSER, proc->pid, 0 /* REG_R0 */ , 0);
+ if (proc->callstack_depth > 0
+ && proc->callstack[proc->callstack_depth - 1].is_syscall) {
return 2;
}
- if (*sysnum>=0 && *sysnum<500) {
+ if (*sysnum >= 0 && *sysnum < 500) {
return 1;
}
}
return 0;
}
-long
-gimme_arg(enum tof type, struct process * proc, int arg_num) {
- if (arg_num==-1) { /* return value */
- return ptrace(PTRACE_PEEKUSER, proc->pid, 0 /* REG_R0 */, 0);
+long gimme_arg(enum tof type, struct process *proc, int arg_num)
+{
+ if (arg_num == -1) { /* return value */
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 0 /* REG_R0 */ , 0);
}
- if (type==LT_TOF_FUNCTION || type==LT_TOF_FUNCTIONR) {
- if(arg_num <= 5)
- return ptrace(PTRACE_PEEKUSER, proc->pid, arg_num + 16 /* REG_A0 */, 0);
+ if (type == LT_TOF_FUNCTION || type == LT_TOF_FUNCTIONR) {
+ if (arg_num <= 5)
+ return ptrace(PTRACE_PEEKUSER, proc->pid,
+ arg_num + 16 /* REG_A0 */ , 0);
else
- return ptrace(PTRACE_PEEKTEXT, proc->pid, proc->stack_pointer+8*(arg_num-6), 0);
- } else if (type==LT_TOF_SYSCALL || type==LT_TOF_SYSCALLR) {
- return ptrace(PTRACE_PEEKUSER, proc->pid, arg_num + 16 /* REG_A0 */, 0);
+ return ptrace(PTRACE_PEEKTEXT, proc->pid,
+ proc->stack_pointer + 8 * (arg_num - 6),
+ 0);
+ } else if (type == LT_TOF_SYSCALL || type == LT_TOF_SYSCALLR) {
+ return ptrace(PTRACE_PEEKUSER, proc->pid,
+ arg_num + 16 /* REG_A0 */ , 0);
} else {
fprintf(stderr, "gimme_arg called with wrong arguments\n");
exit(1);
}
return 0;
}
-
-void save_register_args(enum tof type, struct process * proc)
+
+void save_register_args(enum tof type, struct process *proc)
{
}
diff --git a/sysdeps/linux-gnu/arm/plt.c b/sysdeps/linux-gnu/arm/plt.c
index 51463c5..69e0077 100644
--- a/sysdeps/linux-gnu/arm/plt.c
+++ b/sysdeps/linux-gnu/arm/plt.c
@@ -2,13 +2,12 @@
#include "ltrace.h"
#include "elf.h"
-GElf_Addr
-arch_plt_sym_val (struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+GElf_Addr arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela)
{
- return lte->plt_addr + 20 + ndx * 12;
+ return lte->plt_addr + 20 + ndx * 12;
}
-void * plt2addr(struct process *proc, void ** plt)
+void *plt2addr(struct process *proc, void **plt)
{
- return (void *) plt;
+ return (void *)plt;
}
diff --git a/sysdeps/linux-gnu/arm/regs.c b/sysdeps/linux-gnu/arm/regs.c
index 70ead10..819754f 100644
--- a/sysdeps/linux-gnu/arm/regs.c
+++ b/sysdeps/linux-gnu/arm/regs.c
@@ -20,24 +20,24 @@
#define off_lr 56
#define off_sp 52
-void *
-get_instruction_pointer(struct process * proc) {
+void *get_instruction_pointer(struct process *proc)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, off_pc, 0);
}
-void
-set_instruction_pointer(struct process * proc, void * addr) {
+void set_instruction_pointer(struct process *proc, void *addr)
+{
ptrace(PTRACE_POKEUSER, proc->pid, off_pc, addr);
}
-void *
-get_stack_pointer(struct process * proc) {
+void *get_stack_pointer(struct process *proc)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, off_sp, 0);
}
/* really, this is given the *stack_pointer expecting
* a CISC architecture; in our case, we don't need that */
-void *
-get_return_addr(struct process * proc, void * stack_pointer) {
+void *get_return_addr(struct process *proc, void *stack_pointer)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, off_lr, 0);
}
diff --git a/sysdeps/linux-gnu/arm/signalent.h b/sysdeps/linux-gnu/arm/signalent.h
index 0afb004..2e67e71 100644
--- a/sysdeps/linux-gnu/arm/signalent.h
+++ b/sysdeps/linux-gnu/arm/signalent.h
@@ -1,33 +1,33 @@
- "SIG_0", /* 0 */
- "SIGHUP", /* 1 */
- "SIGINT", /* 2 */
- "SIGQUIT", /* 3 */
- "SIGILL", /* 4 */
- "SIGTRAP", /* 5 */
- "SIGABRT", /* 6 */
- "SIGBUS", /* 7 */
- "SIGFPE", /* 8 */
- "SIGKILL", /* 9 */
- "SIGUSR1", /* 10 */
- "SIGSEGV", /* 11 */
- "SIGUSR2", /* 12 */
- "SIGPIPE", /* 13 */
- "SIGALRM", /* 14 */
- "SIGTERM", /* 15 */
- "SIGSTKFLT", /* 16 */
- "SIGCHLD", /* 17 */
- "SIGCONT", /* 18 */
- "SIGSTOP", /* 19 */
- "SIGTSTP", /* 20 */
- "SIGTTIN", /* 21 */
- "SIGTTOU", /* 22 */
- "SIGURG", /* 23 */
- "SIGXCPU", /* 24 */
- "SIGXFSZ", /* 25 */
- "SIGVTALRM", /* 26 */
- "SIGPROF", /* 27 */
- "SIGWINCH", /* 28 */
- "SIGIO", /* 29 */
- "SIGPWR", /* 30 */
- "SIGSYS", /* 31 */
- "SIGSWI", /* 32 */
+"SIG_0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGBUS", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGUSR1", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGUSR2", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGSTKFLT", /* 16 */
+ "SIGCHLD", /* 17 */
+ "SIGCONT", /* 18 */
+ "SIGSTOP", /* 19 */
+ "SIGTSTP", /* 20 */
+ "SIGTTIN", /* 21 */
+ "SIGTTOU", /* 22 */
+ "SIGURG", /* 23 */
+ "SIGXCPU", /* 24 */
+ "SIGXFSZ", /* 25 */
+ "SIGVTALRM", /* 26 */
+ "SIGPROF", /* 27 */
+ "SIGWINCH", /* 28 */
+ "SIGIO", /* 29 */
+ "SIGPWR", /* 30 */
+ "SIGSYS", /* 31 */
+ "SIGSWI", /* 32 */
diff --git a/sysdeps/linux-gnu/arm/syscallent.h b/sysdeps/linux-gnu/arm/syscallent.h
index d6019a1..84c74b4 100644
--- a/sysdeps/linux-gnu/arm/syscallent.h
+++ b/sysdeps/linux-gnu/arm/syscallent.h
@@ -1,239 +1,239 @@
- "0", /* 0 */
- "exit", /* 1 */
- "fork", /* 2 */
- "read", /* 3 */
- "write", /* 4 */
- "open", /* 5 */
- "close", /* 6 */
- "waitpid", /* 7 */
- "creat", /* 8 */
- "link", /* 9 */
- "unlink", /* 10 */
- "execve", /* 11 */
- "chdir", /* 12 */
- "time", /* 13 */
- "mknod", /* 14 */
- "chmod", /* 15 */
- "lchown", /* 16 */
- "break", /* 17 */
- "18", /* 18 */
- "lseek", /* 19 */
- "getpid", /* 20 */
- "mount", /* 21 */
- "umount", /* 22 */
- "setuid", /* 23 */
- "getuid", /* 24 */
- "stime", /* 25 */
- "ptrace", /* 26 */
- "alarm", /* 27 */
- "28", /* 28 */
- "pause", /* 29 */
- "utime", /* 30 */
- "stty", /* 31 */
- "gtty", /* 32 */
- "access", /* 33 */
- "nice", /* 34 */
- "ftime", /* 35 */
- "sync", /* 36 */
- "kill", /* 37 */
- "rename", /* 38 */
- "mkdir", /* 39 */
- "rmdir", /* 40 */
- "dup", /* 41 */
- "pipe", /* 42 */
- "times", /* 43 */
- "prof", /* 44 */
- "brk", /* 45 */
- "setgid", /* 46 */
- "getgid", /* 47 */
- "signal", /* 48 */
- "geteuid", /* 49 */
- "getegid", /* 50 */
- "acct", /* 51 */
- "umount2", /* 52 */
- "lock", /* 53 */
- "ioctl", /* 54 */
- "fcntl", /* 55 */
- "mpx", /* 56 */
- "setpgid", /* 57 */
- "ulimit", /* 58 */
- "59", /* 59 */
- "umask", /* 60 */
- "chroot", /* 61 */
- "ustat", /* 62 */
- "dup2", /* 63 */
- "getppid", /* 64 */
- "getpgrp", /* 65 */
- "setsid", /* 66 */
- "sigaction", /* 67 */
- "sgetmask", /* 68 */
- "ssetmask", /* 69 */
- "setreuid", /* 70 */
- "setregid", /* 71 */
- "sigsuspend", /* 72 */
- "sigpending", /* 73 */
- "sethostname", /* 74 */
- "setrlimit", /* 75 */
- "getrlimit", /* 76 */
- "getrusage", /* 77 */
- "gettimeofday", /* 78 */
- "settimeofday", /* 79 */
- "getgroups", /* 80 */
- "setgroups", /* 81 */
- "select", /* 82 */
- "symlink", /* 83 */
- "84", /* 84 */
- "readlink", /* 85 */
- "uselib", /* 86 */
- "swapon", /* 87 */
- "reboot", /* 88 */
- "readdir", /* 89 */
- "mmap", /* 90 */
- "munmap", /* 91 */
- "truncate", /* 92 */
- "ftruncate", /* 93 */
- "fchmod", /* 94 */
- "fchown", /* 95 */
- "getpriority", /* 96 */
- "setpriority", /* 97 */
- "profil", /* 98 */
- "statfs", /* 99 */
- "fstatfs", /* 100 */
- "ioperm", /* 101 */
- "socketcall", /* 102 */
- "syslog", /* 103 */
- "setitimer", /* 104 */
- "getitimer", /* 105 */
- "stat", /* 106 */
- "lstat", /* 107 */
- "fstat", /* 108 */
- "109", /* 109 */
- "110", /* 110 */
- "vhangup", /* 111 */
- "idle", /* 112 */
- "syscall", /* 113 */
- "wait4", /* 114 */
- "swapoff", /* 115 */
- "sysinfo", /* 116 */
- "ipc", /* 117 */
- "fsync", /* 118 */
- "sigreturn", /* 119 */
- "clone", /* 120 */
- "setdomainname", /* 121 */
- "uname", /* 122 */
- "modify_ldt", /* 123 */
- "adjtimex", /* 124 */
- "mprotect", /* 125 */
- "sigprocmask", /* 126 */
- "create_module", /* 127 */
- "init_module", /* 128 */
- "delete_module", /* 129 */
- "get_kernel_syms", /* 130 */
- "quotactl", /* 131 */
- "getpgid", /* 132 */
- "fchdir", /* 133 */
- "bdflush", /* 134 */
- "sysfs", /* 135 */
- "personality", /* 136 */
- "afs_syscall", /* 137 */
- "setfsuid", /* 138 */
- "setfsgid", /* 139 */
- "_llseek", /* 140 */
- "getdents", /* 141 */
- "_newselect", /* 142 */
- "flock", /* 143 */
- "msync", /* 144 */
- "readv", /* 145 */
- "writev", /* 146 */
- "getsid", /* 147 */
- "fdatasync", /* 148 */
- "_sysctl", /* 149 */
- "mlock", /* 150 */
- "munlock", /* 151 */
- "mlockall", /* 152 */
- "munlockall", /* 153 */
- "sched_setparam", /* 154 */
- "sched_getparam", /* 155 */
- "sched_setscheduler", /* 156 */
- "sched_getscheduler", /* 157 */
- "sched_yield", /* 158 */
- "sched_get_priority_max", /* 159 */
- "sched_get_priority_min", /* 160 */
- "sched_rr_get_interval", /* 161 */
- "nanosleep", /* 162 */
- "mremap", /* 163 */
- "setresuid", /* 164 */
- "getresuid", /* 165 */
- "vm86", /* 166 */
- "query_module", /* 167 */
- "poll", /* 168 */
- "nfsservctl", /* 169 */
- "setresgid", /* 170 */
- "getresgid", /* 171 */
- "prctl", /* 172 */
- "rt_sigreturn", /* 173 */
- "rt_sigaction", /* 174 */
- "rt_sigprocmask", /* 175 */
- "rt_sigpending", /* 176 */
- "rt_sigtimedwait", /* 177 */
- "rt_sigqueueinfo", /* 178 */
- "rt_sigsuspend", /* 179 */
- "pread", /* 180 */
- "pwrite", /* 181 */
- "chown", /* 182 */
- "getcwd", /* 183 */
- "capget", /* 184 */
- "capset", /* 185 */
- "sigaltstack", /* 186 */
- "sendfile", /* 187 */
- "188", /* 188 */
- "189", /* 189 */
- "vfork", /* 190 */
- "ugetrlimit", /* 191 */
- "mmap2", /* 192 */
- "truncate64", /* 193 */
- "ftruncate64", /* 194 */
- "stat64", /* 195 */
- "lstat64", /* 196 */
- "fstat64", /* 197 */
- "lchown32", /* 198 */
- "getuid32", /* 199 */
- "getgid32", /* 200 */
- "geteuid32", /* 201 */
- "getegid32", /* 202 */
- "setreuid32", /* 203 */
- "setregid32", /* 204 */
- "getgroups32", /* 205 */
- "setgroups32", /* 206 */
- "fchown32", /* 207 */
- "setresuid32", /* 208 */
- "getresuid32", /* 209 */
- "setresgid32", /* 210 */
- "getresgid32", /* 211 */
- "chown32", /* 212 */
- "setuid32", /* 213 */
- "setgid32", /* 214 */
- "setfsuid32", /* 215 */
- "setfsgid32", /* 216 */
- "getdents64", /* 217 */
- "pivot_root", /* 218 */
- "mincore", /* 219 */
- "madvise", /* 220 */
- "fcntl64", /* 221 */
- "222", /* 222 */
- "security", /* 223 */
- "gettid", /* 224 */
- "readahead", /* 225 */
- "setxattr", /* 226 */
- "lsetxattr", /* 227 */
- "fsetxattr", /* 228 */
- "getxattr", /* 229 */
- "lgetxattr", /* 230 */
- "fgetxattr", /* 231 */
- "listxattr", /* 232 */
- "llistxattr", /* 233 */
- "flistxattr", /* 234 */
- "removexattr", /* 235 */
- "lremovexattr", /* 236 */
- "fremovexattr", /* 237 */
- "tkill", /* 238 */
+"0", /* 0 */
+ "exit", /* 1 */
+ "fork", /* 2 */
+ "read", /* 3 */
+ "write", /* 4 */
+ "open", /* 5 */
+ "close", /* 6 */
+ "waitpid", /* 7 */
+ "creat", /* 8 */
+ "link", /* 9 */
+ "unlink", /* 10 */
+ "execve", /* 11 */
+ "chdir", /* 12 */
+ "time", /* 13 */
+ "mknod", /* 14 */
+ "chmod", /* 15 */
+ "lchown", /* 16 */
+ "break", /* 17 */
+ "18", /* 18 */
+ "lseek", /* 19 */
+ "getpid", /* 20 */
+ "mount", /* 21 */
+ "umount", /* 22 */
+ "setuid", /* 23 */
+ "getuid", /* 24 */
+ "stime", /* 25 */
+ "ptrace", /* 26 */
+ "alarm", /* 27 */
+ "28", /* 28 */
+ "pause", /* 29 */
+ "utime", /* 30 */
+ "stty", /* 31 */
+ "gtty", /* 32 */
+ "access", /* 33 */
+ "nice", /* 34 */
+ "ftime", /* 35 */
+ "sync", /* 36 */
+ "kill", /* 37 */
+ "rename", /* 38 */
+ "mkdir", /* 39 */
+ "rmdir", /* 40 */
+ "dup", /* 41 */
+ "pipe", /* 42 */
+ "times", /* 43 */
+ "prof", /* 44 */
+ "brk", /* 45 */
+ "setgid", /* 46 */
+ "getgid", /* 47 */
+ "signal", /* 48 */
+ "geteuid", /* 49 */
+ "getegid", /* 50 */
+ "acct", /* 51 */
+ "umount2", /* 52 */
+ "lock", /* 53 */
+ "ioctl", /* 54 */
+ "fcntl", /* 55 */
+ "mpx", /* 56 */
+ "setpgid", /* 57 */
+ "ulimit", /* 58 */
+ "59", /* 59 */
+ "umask", /* 60 */
+ "chroot", /* 61 */
+ "ustat", /* 62 */
+ "dup2", /* 63 */
+ "getppid", /* 64 */
+ "getpgrp", /* 65 */
+ "setsid", /* 66 */
+ "sigaction", /* 67 */
+ "sgetmask", /* 68 */
+ "ssetmask", /* 69 */
+ "setreuid", /* 70 */
+ "setregid", /* 71 */
+ "sigsuspend", /* 72 */
+ "sigpending", /* 73 */
+ "sethostname", /* 74 */
+ "setrlimit", /* 75 */
+ "getrlimit", /* 76 */
+ "getrusage", /* 77 */
+ "gettimeofday", /* 78 */
+ "settimeofday", /* 79 */
+ "getgroups", /* 80 */
+ "setgroups", /* 81 */
+ "select", /* 82 */
+ "symlink", /* 83 */
+ "84", /* 84 */
+ "readlink", /* 85 */
+ "uselib", /* 86 */
+ "swapon", /* 87 */
+ "reboot", /* 88 */
+ "readdir", /* 89 */
+ "mmap", /* 90 */
+ "munmap", /* 91 */
+ "truncate", /* 92 */
+ "ftruncate", /* 93 */
+ "fchmod", /* 94 */
+ "fchown", /* 95 */
+ "getpriority", /* 96 */
+ "setpriority", /* 97 */
+ "profil", /* 98 */
+ "statfs", /* 99 */
+ "fstatfs", /* 100 */
+ "ioperm", /* 101 */
+ "socketcall", /* 102 */
+ "syslog", /* 103 */
+ "setitimer", /* 104 */
+ "getitimer", /* 105 */
+ "stat", /* 106 */
+ "lstat", /* 107 */
+ "fstat", /* 108 */
+ "109", /* 109 */
+ "110", /* 110 */
+ "vhangup", /* 111 */
+ "idle", /* 112 */
+ "syscall", /* 113 */
+ "wait4", /* 114 */
+ "swapoff", /* 115 */
+ "sysinfo", /* 116 */
+ "ipc", /* 117 */
+ "fsync", /* 118 */
+ "sigreturn", /* 119 */
+ "clone", /* 120 */
+ "setdomainname", /* 121 */
+ "uname", /* 122 */
+ "modify_ldt", /* 123 */
+ "adjtimex", /* 124 */
+ "mprotect", /* 125 */
+ "sigprocmask", /* 126 */
+ "create_module", /* 127 */
+ "init_module", /* 128 */
+ "delete_module", /* 129 */
+ "get_kernel_syms", /* 130 */
+ "quotactl", /* 131 */
+ "getpgid", /* 132 */
+ "fchdir", /* 133 */
+ "bdflush", /* 134 */
+ "sysfs", /* 135 */
+ "personality", /* 136 */
+ "afs_syscall", /* 137 */
+ "setfsuid", /* 138 */
+ "setfsgid", /* 139 */
+ "_llseek", /* 140 */
+ "getdents", /* 141 */
+ "_newselect", /* 142 */
+ "flock", /* 143 */
+ "msync", /* 144 */
+ "readv", /* 145 */
+ "writev", /* 146 */
+ "getsid", /* 147 */
+ "fdatasync", /* 148 */
+ "_sysctl", /* 149 */
+ "mlock", /* 150 */
+ "munlock", /* 151 */
+ "mlockall", /* 152 */
+ "munlockall", /* 153 */
+ "sched_setparam", /* 154 */
+ "sched_getparam", /* 155 */
+ "sched_setscheduler", /* 156 */
+ "sched_getscheduler", /* 157 */
+ "sched_yield", /* 158 */
+ "sched_get_priority_max", /* 159 */
+ "sched_get_priority_min", /* 160 */
+ "sched_rr_get_interval", /* 161 */
+ "nanosleep", /* 162 */
+ "mremap", /* 163 */
+ "setresuid", /* 164 */
+ "getresuid", /* 165 */
+ "vm86", /* 166 */
+ "query_module", /* 167 */
+ "poll", /* 168 */
+ "nfsservctl", /* 169 */
+ "setresgid", /* 170 */
+ "getresgid", /* 171 */
+ "prctl", /* 172 */
+ "rt_sigreturn", /* 173 */
+ "rt_sigaction", /* 174 */
+ "rt_sigprocmask", /* 175 */
+ "rt_sigpending", /* 176 */
+ "rt_sigtimedwait", /* 177 */
+ "rt_sigqueueinfo", /* 178 */
+ "rt_sigsuspend", /* 179 */
+ "pread", /* 180 */
+ "pwrite", /* 181 */
+ "chown", /* 182 */
+ "getcwd", /* 183 */
+ "capget", /* 184 */
+ "capset", /* 185 */
+ "sigaltstack", /* 186 */
+ "sendfile", /* 187 */
+ "188", /* 188 */
+ "189", /* 189 */
+ "vfork", /* 190 */
+ "ugetrlimit", /* 191 */
+ "mmap2", /* 192 */
+ "truncate64", /* 193 */
+ "ftruncate64", /* 194 */
+ "stat64", /* 195 */
+ "lstat64", /* 196 */
+ "fstat64", /* 197 */
+ "lchown32", /* 198 */
+ "getuid32", /* 199 */
+ "getgid32", /* 200 */
+ "geteuid32", /* 201 */
+ "getegid32", /* 202 */
+ "setreuid32", /* 203 */
+ "setregid32", /* 204 */
+ "getgroups32", /* 205 */
+ "setgroups32", /* 206 */
+ "fchown32", /* 207 */
+ "setresuid32", /* 208 */
+ "getresuid32", /* 209 */
+ "setresgid32", /* 210 */
+ "getresgid32", /* 211 */
+ "chown32", /* 212 */
+ "setuid32", /* 213 */
+ "setgid32", /* 214 */
+ "setfsuid32", /* 215 */
+ "setfsgid32", /* 216 */
+ "getdents64", /* 217 */
+ "pivot_root", /* 218 */
+ "mincore", /* 219 */
+ "madvise", /* 220 */
+ "fcntl64", /* 221 */
+ "222", /* 222 */
+ "security", /* 223 */
+ "gettid", /* 224 */
+ "readahead", /* 225 */
+ "setxattr", /* 226 */
+ "lsetxattr", /* 227 */
+ "fsetxattr", /* 228 */
+ "getxattr", /* 229 */
+ "lgetxattr", /* 230 */
+ "fgetxattr", /* 231 */
+ "listxattr", /* 232 */
+ "llistxattr", /* 233 */
+ "flistxattr", /* 234 */
+ "removexattr", /* 235 */
+ "lremovexattr", /* 236 */
+ "fremovexattr", /* 237 */
+ "tkill", /* 238 */
diff --git a/sysdeps/linux-gnu/arm/trace.c b/sysdeps/linux-gnu/arm/trace.c
index 485f0ad..ac5d5d2 100644
--- a/sysdeps/linux-gnu/arm/trace.c
+++ b/sysdeps/linux-gnu/arm/trace.c
@@ -26,47 +26,55 @@
#define off_ip 48
#define off_pc 60
-void
-get_arch_dep(struct process * proc) {
+void get_arch_dep(struct process *proc)
+{
}
/* Returns 1 if syscall, 2 if sysret, 0 otherwise.
*/
-int
-syscall_p(struct process * proc, int status, int * sysnum) {
- if (WIFSTOPPED(status) && WSTOPSIG(status)==(SIGTRAP | proc->tracesysgood)) {
+int syscall_p(struct process *proc, int status, int *sysnum)
+{
+ if (WIFSTOPPED(status)
+ && WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
/* get the user's pc (plus 8) */
int pc = ptrace(PTRACE_PEEKUSER, proc->pid, off_pc, 0);
/* fetch the SWI instruction */
- int insn = ptrace(PTRACE_PEEKTEXT, proc->pid, pc-4, 0) ;
-
+ int insn = ptrace(PTRACE_PEEKTEXT, proc->pid, pc - 4, 0);
+
*sysnum = insn & 0xFFFF;
/* if it is a syscall, return 1 or 2 */
if ((insn & 0xFFFF0000) == 0xef900000) {
- return ptrace(PTRACE_PEEKUSER, proc->pid, off_ip, 0) ? 2 : 1;
+ return ptrace(PTRACE_PEEKUSER, proc->pid, off_ip,
+ 0) ? 2 : 1;
}
}
return 0;
}
-
-long
-gimme_arg(enum tof type, struct process * proc, int arg_num) {
- if (arg_num==-1) { /* return value */
+
+long gimme_arg(enum tof type, struct process *proc, int arg_num)
+{
+ if (arg_num == -1) { /* return value */
return ptrace(PTRACE_PEEKUSER, proc->pid, off_r0, 0);
}
/* deal with the ARM calling conventions */
- if (type==LT_TOF_FUNCTION || type==LT_TOF_FUNCTIONR) {
- if (arg_num<4) {
- return ptrace(PTRACE_PEEKUSER, proc->pid, 4*arg_num, 0);
+ if (type == LT_TOF_FUNCTION || type == LT_TOF_FUNCTIONR) {
+ if (arg_num < 4) {
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * arg_num,
+ 0);
} else {
- return ptrace(PTRACE_PEEKDATA, proc->pid, proc->stack_pointer+4*(arg_num-4), 0);
+ return ptrace(PTRACE_PEEKDATA, proc->pid,
+ proc->stack_pointer + 4 * (arg_num - 4),
+ 0);
}
- } else if (type==LT_TOF_SYSCALL || type==LT_TOF_SYSCALLR) {
- if (arg_num<5) {
- return ptrace(PTRACE_PEEKUSER, proc->pid, 4*arg_num, 0);
+ } else if (type == LT_TOF_SYSCALL || type == LT_TOF_SYSCALLR) {
+ if (arg_num < 5) {
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * arg_num,
+ 0);
} else {
- return ptrace(PTRACE_PEEKDATA, proc->pid, proc->stack_pointer+4*(arg_num-5), 0);
+ return ptrace(PTRACE_PEEKDATA, proc->pid,
+ proc->stack_pointer + 4 * (arg_num - 5),
+ 0);
}
} else {
fprintf(stderr, "gimme_arg called with wrong arguments\n");
@@ -76,6 +84,6 @@
return 0;
}
-void
-save_register_args(enum tof type, struct process * proc) {
+void save_register_args(enum tof type, struct process *proc)
+{
}
diff --git a/sysdeps/linux-gnu/breakpoint.c b/sysdeps/linux-gnu/breakpoint.c
index 712f1a5..afcd4bc 100644
--- a/sysdeps/linux-gnu/breakpoint.c
+++ b/sysdeps/linux-gnu/breakpoint.c
@@ -12,54 +12,62 @@
static unsigned char break_insn[] = BREAKPOINT_VALUE;
#ifdef ARCH_HAVE_ENABLE_BREAKPOINT
-extern void arch_enable_breakpoint(pid_t, struct breakpoint*);
+extern void arch_enable_breakpoint(pid_t, struct breakpoint *);
void enable_breakpoint(pid_t pid, struct breakpoint *sbp)
{
arch_enable_breakpoint(pid, sbp);
}
#else
-void
-enable_breakpoint(pid_t pid, struct breakpoint * sbp) {
- int i,j;
+void enable_breakpoint(pid_t pid, struct breakpoint *sbp)
+{
+ int i, j;
debug(1, "enable_breakpoint(%d,%p)", pid, sbp->addr);
- for(i=0; i < 1+((BREAKPOINT_LENGTH-1)/sizeof(long)); i++) {
- long a = ptrace(PTRACE_PEEKTEXT, pid, sbp->addr + i*sizeof(long), 0);
- for(j=0; j<sizeof(long) && i*sizeof(long)+j < BREAKPOINT_LENGTH; j++) {
- unsigned char * bytes = (unsigned char *)&a;
+ for (i = 0; i < 1 + ((BREAKPOINT_LENGTH - 1) / sizeof(long)); i++) {
+ long a =
+ ptrace(PTRACE_PEEKTEXT, pid, sbp->addr + i * sizeof(long),
+ 0);
+ for (j = 0;
+ j < sizeof(long)
+ && i * sizeof(long) + j < BREAKPOINT_LENGTH; j++) {
+ unsigned char *bytes = (unsigned char *)&a;
- sbp->orig_value[i*sizeof(long)+j] = bytes[+j];
- bytes[j] = break_insn[i*sizeof(long)+j];
+ sbp->orig_value[i * sizeof(long) + j] = bytes[+j];
+ bytes[j] = break_insn[i * sizeof(long) + j];
}
- ptrace(PTRACE_POKETEXT, pid, sbp->addr + i*sizeof(long), a);
+ ptrace(PTRACE_POKETEXT, pid, sbp->addr + i * sizeof(long), a);
}
}
-#endif /* ARCH_HAVE_ENABLE_BREAKPOINT */
+#endif /* ARCH_HAVE_ENABLE_BREAKPOINT */
#ifdef ARCH_HAVE_DISABLE_BREAKPOINT
-extern void arch_disable_breakpoint(pid_t, const struct breakpoint * sbp);
-void
-disable_breakpoint(pid_t pid, const struct breakpoint * sbp) {
+extern void arch_disable_breakpoint(pid_t, const struct breakpoint *sbp);
+void disable_breakpoint(pid_t pid, const struct breakpoint *sbp)
+{
arch_disable_breakpoint(pid, sbp);
}
#else
-void
-disable_breakpoint(pid_t pid, const struct breakpoint * sbp) {
- int i,j;
+void disable_breakpoint(pid_t pid, const struct breakpoint *sbp)
+{
+ int i, j;
- if (opt_d>1) {
+ if (opt_d > 1) {
output_line(0, "disable_breakpoint(%d,%p)", pid, sbp->addr);
}
- for(i=0; i < 1+((BREAKPOINT_LENGTH-1)/sizeof(long)); i++) {
- long a = ptrace(PTRACE_PEEKTEXT, pid, sbp->addr + i*sizeof(long), 0);
- for(j=0; j<sizeof(long) && i*sizeof(long)+j < BREAKPOINT_LENGTH; j++) {
- unsigned char * bytes = (unsigned char *)&a;
+ for (i = 0; i < 1 + ((BREAKPOINT_LENGTH - 1) / sizeof(long)); i++) {
+ long a =
+ ptrace(PTRACE_PEEKTEXT, pid, sbp->addr + i * sizeof(long),
+ 0);
+ for (j = 0;
+ j < sizeof(long)
+ && i * sizeof(long) + j < BREAKPOINT_LENGTH; j++) {
+ unsigned char *bytes = (unsigned char *)&a;
- bytes[j] = sbp->orig_value[i*sizeof(long)+j];
+ bytes[j] = sbp->orig_value[i * sizeof(long) + j];
}
- ptrace(PTRACE_POKETEXT, pid, sbp->addr + i*sizeof(long), a);
+ ptrace(PTRACE_POKETEXT, pid, sbp->addr + i * sizeof(long), a);
}
}
-#endif /* ARCH_HAVE_DISABLE_BREAKPOINT */
+#endif /* ARCH_HAVE_DISABLE_BREAKPOINT */
diff --git a/sysdeps/linux-gnu/i386/plt.c b/sysdeps/linux-gnu/i386/plt.c
index 36d0ecd..3eab56c 100644
--- a/sysdeps/linux-gnu/i386/plt.c
+++ b/sysdeps/linux-gnu/i386/plt.c
@@ -2,13 +2,12 @@
#include "ltrace.h"
#include "elf.h"
-GElf_Addr
-arch_plt_sym_val (struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+GElf_Addr arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela)
{
- return lte->plt_addr + (ndx + 1) * 16;
+ return lte->plt_addr + (ndx + 1) * 16;
}
-void * plt2addr(struct process *proc, void ** plt)
+void *plt2addr(struct process *proc, void **plt)
{
- return (void *) plt;
+ return (void *)plt;
}
diff --git a/sysdeps/linux-gnu/i386/regs.c b/sysdeps/linux-gnu/i386/regs.c
index 75268e9..158fa24 100644
--- a/sysdeps/linux-gnu/i386/regs.c
+++ b/sysdeps/linux-gnu/i386/regs.c
@@ -16,22 +16,22 @@
# define PTRACE_POKEUSER PTRACE_POKEUSR
#endif
-void *
-get_instruction_pointer(struct process * proc) {
- return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 4*EIP, 0);
+void *get_instruction_pointer(struct process *proc)
+{
+ return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 4 * EIP, 0);
}
-void
-set_instruction_pointer(struct process * proc, void * addr) {
- ptrace(PTRACE_POKEUSER, proc->pid, 4*EIP, (long)addr);
+void set_instruction_pointer(struct process *proc, void *addr)
+{
+ ptrace(PTRACE_POKEUSER, proc->pid, 4 * EIP, (long)addr);
}
-void *
-get_stack_pointer(struct process * proc) {
- return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 4*UESP, 0);
+void *get_stack_pointer(struct process *proc)
+{
+ return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 4 * UESP, 0);
}
-void *
-get_return_addr(struct process * proc, void * stack_pointer) {
+void *get_return_addr(struct process *proc, void *stack_pointer)
+{
return (void *)ptrace(PTRACE_PEEKTEXT, proc->pid, stack_pointer, 0);
}
diff --git a/sysdeps/linux-gnu/i386/signalent.h b/sysdeps/linux-gnu/i386/signalent.h
index 5395f82..d58a36c 100644
--- a/sysdeps/linux-gnu/i386/signalent.h
+++ b/sysdeps/linux-gnu/i386/signalent.h
@@ -1,32 +1,32 @@
- "SIG_0", /* 0 */
- "SIGHUP", /* 1 */
- "SIGINT", /* 2 */
- "SIGQUIT", /* 3 */
- "SIGILL", /* 4 */
- "SIGTRAP", /* 5 */
- "SIGABRT", /* 6 */
- "SIGBUS", /* 7 */
- "SIGFPE", /* 8 */
- "SIGKILL", /* 9 */
- "SIGUSR1", /* 10 */
- "SIGSEGV", /* 11 */
- "SIGUSR2", /* 12 */
- "SIGPIPE", /* 13 */
- "SIGALRM", /* 14 */
- "SIGTERM", /* 15 */
- "SIGSTKFLT", /* 16 */
- "SIGCHLD", /* 17 */
- "SIGCONT", /* 18 */
- "SIGSTOP", /* 19 */
- "SIGTSTP", /* 20 */
- "SIGTTIN", /* 21 */
- "SIGTTOU", /* 22 */
- "SIGURG", /* 23 */
- "SIGXCPU", /* 24 */
- "SIGXFSZ", /* 25 */
- "SIGVTALRM", /* 26 */
- "SIGPROF", /* 27 */
- "SIGWINCH", /* 28 */
- "SIGIO", /* 29 */
- "SIGPWR", /* 30 */
- "SIGSYS", /* 31 */
+"SIG_0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGBUS", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGUSR1", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGUSR2", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGSTKFLT", /* 16 */
+ "SIGCHLD", /* 17 */
+ "SIGCONT", /* 18 */
+ "SIGSTOP", /* 19 */
+ "SIGTSTP", /* 20 */
+ "SIGTTIN", /* 21 */
+ "SIGTTOU", /* 22 */
+ "SIGURG", /* 23 */
+ "SIGXCPU", /* 24 */
+ "SIGXFSZ", /* 25 */
+ "SIGVTALRM", /* 26 */
+ "SIGPROF", /* 27 */
+ "SIGWINCH", /* 28 */
+ "SIGIO", /* 29 */
+ "SIGPWR", /* 30 */
+ "SIGSYS", /* 31 */
diff --git a/sysdeps/linux-gnu/i386/syscallent.h b/sysdeps/linux-gnu/i386/syscallent.h
index c4bdae5..3b4020b 100644
--- a/sysdeps/linux-gnu/i386/syscallent.h
+++ b/sysdeps/linux-gnu/i386/syscallent.h
@@ -1,294 +1,294 @@
- "restart_syscall", /* 0 */
- "exit", /* 1 */
- "fork", /* 2 */
- "read", /* 3 */
- "write", /* 4 */
- "open", /* 5 */
- "close", /* 6 */
- "waitpid", /* 7 */
- "creat", /* 8 */
- "link", /* 9 */
- "unlink", /* 10 */
- "execve", /* 11 */
- "chdir", /* 12 */
- "time", /* 13 */
- "mknod", /* 14 */
- "chmod", /* 15 */
- "lchown", /* 16 */
- "break", /* 17 */
- "oldstat", /* 18 */
- "lseek", /* 19 */
- "getpid", /* 20 */
- "mount", /* 21 */
- "umount", /* 22 */
- "setuid", /* 23 */
- "getuid", /* 24 */
- "stime", /* 25 */
- "ptrace", /* 26 */
- "alarm", /* 27 */
- "oldfstat", /* 28 */
- "pause", /* 29 */
- "utime", /* 30 */
- "stty", /* 31 */
- "gtty", /* 32 */
- "access", /* 33 */
- "nice", /* 34 */
- "ftime", /* 35 */
- "sync", /* 36 */
- "kill", /* 37 */
- "rename", /* 38 */
- "mkdir", /* 39 */
- "rmdir", /* 40 */
- "dup", /* 41 */
- "pipe", /* 42 */
- "times", /* 43 */
- "prof", /* 44 */
- "brk", /* 45 */
- "setgid", /* 46 */
- "getgid", /* 47 */
- "signal", /* 48 */
- "geteuid", /* 49 */
- "getegid", /* 50 */
- "acct", /* 51 */
- "umount2", /* 52 */
- "lock", /* 53 */
- "ioctl", /* 54 */
- "fcntl", /* 55 */
- "mpx", /* 56 */
- "setpgid", /* 57 */
- "ulimit", /* 58 */
- "oldolduname", /* 59 */
- "umask", /* 60 */
- "chroot", /* 61 */
- "ustat", /* 62 */
- "dup2", /* 63 */
- "getppid", /* 64 */
- "getpgrp", /* 65 */
- "setsid", /* 66 */
- "sigaction", /* 67 */
- "sgetmask", /* 68 */
- "ssetmask", /* 69 */
- "setreuid", /* 70 */
- "setregid", /* 71 */
- "sigsuspend", /* 72 */
- "sigpending", /* 73 */
- "sethostname", /* 74 */
- "setrlimit", /* 75 */
- "getrlimit", /* 76 */
- "getrusage", /* 77 */
- "gettimeofday", /* 78 */
- "settimeofday", /* 79 */
- "getgroups", /* 80 */
- "setgroups", /* 81 */
- "select", /* 82 */
- "symlink", /* 83 */
- "oldlstat", /* 84 */
- "readlink", /* 85 */
- "uselib", /* 86 */
- "swapon", /* 87 */
- "reboot", /* 88 */
- "readdir", /* 89 */
- "mmap", /* 90 */
- "munmap", /* 91 */
- "truncate", /* 92 */
- "ftruncate", /* 93 */
- "fchmod", /* 94 */
- "fchown", /* 95 */
- "getpriority", /* 96 */
- "setpriority", /* 97 */
- "profil", /* 98 */
- "statfs", /* 99 */
- "fstatfs", /* 100 */
- "ioperm", /* 101 */
- "socketcall", /* 102 */
- "syslog", /* 103 */
- "setitimer", /* 104 */
- "getitimer", /* 105 */
- "stat", /* 106 */
- "lstat", /* 107 */
- "fstat", /* 108 */
- "olduname", /* 109 */
- "iopl", /* 110 */
- "vhangup", /* 111 */
- "idle", /* 112 */
- "vm86old", /* 113 */
- "wait4", /* 114 */
- "swapoff", /* 115 */
- "sysinfo", /* 116 */
- "ipc", /* 117 */
- "fsync", /* 118 */
- "sigreturn", /* 119 */
- "clone", /* 120 */
- "setdomainname", /* 121 */
- "uname", /* 122 */
- "modify_ldt", /* 123 */
- "adjtimex", /* 124 */
- "mprotect", /* 125 */
- "sigprocmask", /* 126 */
- "create_module", /* 127 */
- "init_module", /* 128 */
- "delete_module", /* 129 */
- "get_kernel_syms", /* 130 */
- "quotactl", /* 131 */
- "getpgid", /* 132 */
- "fchdir", /* 133 */
- "bdflush", /* 134 */
- "sysfs", /* 135 */
- "personality", /* 136 */
- "afs_syscall", /* 137 */
- "setfsuid", /* 138 */
- "setfsgid", /* 139 */
- "_llseek", /* 140 */
- "getdents", /* 141 */
- "_newselect", /* 142 */
- "flock", /* 143 */
- "msync", /* 144 */
- "readv", /* 145 */
- "writev", /* 146 */
- "getsid", /* 147 */
- "fdatasync", /* 148 */
- "_sysctl", /* 149 */
- "mlock", /* 150 */
- "munlock", /* 151 */
- "mlockall", /* 152 */
- "munlockall", /* 153 */
- "sched_setparam", /* 154 */
- "sched_getparam", /* 155 */
- "sched_setscheduler", /* 156 */
- "sched_getscheduler", /* 157 */
- "sched_yield", /* 158 */
- "sched_get_priority_max", /* 159 */
- "sched_get_priority_min", /* 160 */
- "sched_rr_get_interval", /* 161 */
- "nanosleep", /* 162 */
- "mremap", /* 163 */
- "setresuid", /* 164 */
- "getresuid", /* 165 */
- "vm86", /* 166 */
- "query_module", /* 167 */
- "poll", /* 168 */
- "nfsservctl", /* 169 */
- "setresgid", /* 170 */
- "getresgid", /* 171 */
- "prctl", /* 172 */
- "rt_sigreturn", /* 173 */
- "rt_sigaction", /* 174 */
- "rt_sigprocmask", /* 175 */
- "rt_sigpending", /* 176 */
- "rt_sigtimedwait", /* 177 */
- "rt_sigqueueinfo", /* 178 */
- "rt_sigsuspend", /* 179 */
- "pread64", /* 180 */
- "pwrite64", /* 181 */
- "chown", /* 182 */
- "getcwd", /* 183 */
- "capget", /* 184 */
- "capset", /* 185 */
- "sigaltstack", /* 186 */
- "sendfile", /* 187 */
- "getpmsg", /* 188 */
- "putpmsg", /* 189 */
- "vfork", /* 190 */
- "ugetrlimit", /* 191 */
- "mmap2", /* 192 */
- "truncate64", /* 193 */
- "ftruncate64", /* 194 */
- "stat64", /* 195 */
- "lstat64", /* 196 */
- "fstat64", /* 197 */
- "lchown32", /* 198 */
- "getuid32", /* 199 */
- "getgid32", /* 200 */
- "geteuid32", /* 201 */
- "getegid32", /* 202 */
- "setreuid32", /* 203 */
- "setregid32", /* 204 */
- "getgroups32", /* 205 */
- "setgroups32", /* 206 */
- "fchown32", /* 207 */
- "setresuid32", /* 208 */
- "getresuid32", /* 209 */
- "setresgid32", /* 210 */
- "getresgid32", /* 211 */
- "chown32", /* 212 */
- "setuid32", /* 213 */
- "setgid32", /* 214 */
- "setfsuid32", /* 215 */
- "setfsgid32", /* 216 */
- "pivot_root", /* 217 */
- "mincore", /* 218 */
- "madvise1", /* 219 */
- "getdents64", /* 220 */
- "fcntl64", /* 221 */
- "222", /* 222 */
- "223", /* 223 */
- "gettid", /* 224 */
- "readahead", /* 225 */
- "setxattr", /* 226 */
- "lsetxattr", /* 227 */
- "fsetxattr", /* 228 */
- "getxattr", /* 229 */
- "lgetxattr", /* 230 */
- "fgetxattr", /* 231 */
- "listxattr", /* 232 */
- "llistxattr", /* 233 */
- "flistxattr", /* 234 */
- "removexattr", /* 235 */
- "lremovexattr", /* 236 */
- "fremovexattr", /* 237 */
- "tkill", /* 238 */
- "sendfile64", /* 239 */
- "futex", /* 240 */
- "sched_setaffinity", /* 241 */
- "sched_getaffinity", /* 242 */
- "set_thread_area", /* 243 */
- "get_thread_area", /* 244 */
- "io_setup", /* 245 */
- "io_destroy", /* 246 */
- "io_getevents", /* 247 */
- "io_submit", /* 248 */
- "io_cancel", /* 249 */
- "fadvise64", /* 250 */
- "251", /* 251 */
- "exit_group", /* 252 */
- "lookup_dcookie", /* 253 */
- "epoll_create", /* 254 */
- "epoll_ctl", /* 255 */
- "epoll_wait", /* 256 */
- "remap_file_pages", /* 257 */
- "set_tid_address", /* 258 */
- "timer_create", /* 259 */
- "timer_settime", /* 260 */
- "timer_gettime", /* 261 */
- "timer_getoverrun", /* 262 */
- "timer_delete", /* 263 */
- "clock_settime", /* 264 */
- "clock_gettime", /* 265 */
- "clock_getres", /* 266 */
- "clock_nanosleep", /* 267 */
- "statfs64", /* 268 */
- "fstatfs64", /* 269 */
- "tgkill", /* 270 */
- "utimes", /* 271 */
- "fadvise64_64", /* 272 */
- "vserver", /* 273 */
- "mbind", /* 274 */
- "get_mempolicy", /* 275 */
- "set_mempolicy", /* 276 */
- "mq_open", /* 277 */
- "mq_unlink", /* 278 */
- "mq_timedsend", /* 279 */
- "mq_timedreceive", /* 280 */
- "mq_notify", /* 281 */
- "mq_getsetattr", /* 282 */
- "kexec_load", /* 283 */
- "waitid", /* 284 */
- "285", /* 285 */
- "add_key", /* 286 */
- "request_key", /* 287 */
- "keyctl", /* 288 */
- "ioprio_set", /* 289 */
- "ioprio_get", /* 290 */
- "inotify_init", /* 291 */
- "inotify_add_watch", /* 292 */
- "inotify_rm_watch", /* 293 */
+"restart_syscall", /* 0 */
+ "exit", /* 1 */
+ "fork", /* 2 */
+ "read", /* 3 */
+ "write", /* 4 */
+ "open", /* 5 */
+ "close", /* 6 */
+ "waitpid", /* 7 */
+ "creat", /* 8 */
+ "link", /* 9 */
+ "unlink", /* 10 */
+ "execve", /* 11 */
+ "chdir", /* 12 */
+ "time", /* 13 */
+ "mknod", /* 14 */
+ "chmod", /* 15 */
+ "lchown", /* 16 */
+ "break", /* 17 */
+ "oldstat", /* 18 */
+ "lseek", /* 19 */
+ "getpid", /* 20 */
+ "mount", /* 21 */
+ "umount", /* 22 */
+ "setuid", /* 23 */
+ "getuid", /* 24 */
+ "stime", /* 25 */
+ "ptrace", /* 26 */
+ "alarm", /* 27 */
+ "oldfstat", /* 28 */
+ "pause", /* 29 */
+ "utime", /* 30 */
+ "stty", /* 31 */
+ "gtty", /* 32 */
+ "access", /* 33 */
+ "nice", /* 34 */
+ "ftime", /* 35 */
+ "sync", /* 36 */
+ "kill", /* 37 */
+ "rename", /* 38 */
+ "mkdir", /* 39 */
+ "rmdir", /* 40 */
+ "dup", /* 41 */
+ "pipe", /* 42 */
+ "times", /* 43 */
+ "prof", /* 44 */
+ "brk", /* 45 */
+ "setgid", /* 46 */
+ "getgid", /* 47 */
+ "signal", /* 48 */
+ "geteuid", /* 49 */
+ "getegid", /* 50 */
+ "acct", /* 51 */
+ "umount2", /* 52 */
+ "lock", /* 53 */
+ "ioctl", /* 54 */
+ "fcntl", /* 55 */
+ "mpx", /* 56 */
+ "setpgid", /* 57 */
+ "ulimit", /* 58 */
+ "oldolduname", /* 59 */
+ "umask", /* 60 */
+ "chroot", /* 61 */
+ "ustat", /* 62 */
+ "dup2", /* 63 */
+ "getppid", /* 64 */
+ "getpgrp", /* 65 */
+ "setsid", /* 66 */
+ "sigaction", /* 67 */
+ "sgetmask", /* 68 */
+ "ssetmask", /* 69 */
+ "setreuid", /* 70 */
+ "setregid", /* 71 */
+ "sigsuspend", /* 72 */
+ "sigpending", /* 73 */
+ "sethostname", /* 74 */
+ "setrlimit", /* 75 */
+ "getrlimit", /* 76 */
+ "getrusage", /* 77 */
+ "gettimeofday", /* 78 */
+ "settimeofday", /* 79 */
+ "getgroups", /* 80 */
+ "setgroups", /* 81 */
+ "select", /* 82 */
+ "symlink", /* 83 */
+ "oldlstat", /* 84 */
+ "readlink", /* 85 */
+ "uselib", /* 86 */
+ "swapon", /* 87 */
+ "reboot", /* 88 */
+ "readdir", /* 89 */
+ "mmap", /* 90 */
+ "munmap", /* 91 */
+ "truncate", /* 92 */
+ "ftruncate", /* 93 */
+ "fchmod", /* 94 */
+ "fchown", /* 95 */
+ "getpriority", /* 96 */
+ "setpriority", /* 97 */
+ "profil", /* 98 */
+ "statfs", /* 99 */
+ "fstatfs", /* 100 */
+ "ioperm", /* 101 */
+ "socketcall", /* 102 */
+ "syslog", /* 103 */
+ "setitimer", /* 104 */
+ "getitimer", /* 105 */
+ "stat", /* 106 */
+ "lstat", /* 107 */
+ "fstat", /* 108 */
+ "olduname", /* 109 */
+ "iopl", /* 110 */
+ "vhangup", /* 111 */
+ "idle", /* 112 */
+ "vm86old", /* 113 */
+ "wait4", /* 114 */
+ "swapoff", /* 115 */
+ "sysinfo", /* 116 */
+ "ipc", /* 117 */
+ "fsync", /* 118 */
+ "sigreturn", /* 119 */
+ "clone", /* 120 */
+ "setdomainname", /* 121 */
+ "uname", /* 122 */
+ "modify_ldt", /* 123 */
+ "adjtimex", /* 124 */
+ "mprotect", /* 125 */
+ "sigprocmask", /* 126 */
+ "create_module", /* 127 */
+ "init_module", /* 128 */
+ "delete_module", /* 129 */
+ "get_kernel_syms", /* 130 */
+ "quotactl", /* 131 */
+ "getpgid", /* 132 */
+ "fchdir", /* 133 */
+ "bdflush", /* 134 */
+ "sysfs", /* 135 */
+ "personality", /* 136 */
+ "afs_syscall", /* 137 */
+ "setfsuid", /* 138 */
+ "setfsgid", /* 139 */
+ "_llseek", /* 140 */
+ "getdents", /* 141 */
+ "_newselect", /* 142 */
+ "flock", /* 143 */
+ "msync", /* 144 */
+ "readv", /* 145 */
+ "writev", /* 146 */
+ "getsid", /* 147 */
+ "fdatasync", /* 148 */
+ "_sysctl", /* 149 */
+ "mlock", /* 150 */
+ "munlock", /* 151 */
+ "mlockall", /* 152 */
+ "munlockall", /* 153 */
+ "sched_setparam", /* 154 */
+ "sched_getparam", /* 155 */
+ "sched_setscheduler", /* 156 */
+ "sched_getscheduler", /* 157 */
+ "sched_yield", /* 158 */
+ "sched_get_priority_max", /* 159 */
+ "sched_get_priority_min", /* 160 */
+ "sched_rr_get_interval", /* 161 */
+ "nanosleep", /* 162 */
+ "mremap", /* 163 */
+ "setresuid", /* 164 */
+ "getresuid", /* 165 */
+ "vm86", /* 166 */
+ "query_module", /* 167 */
+ "poll", /* 168 */
+ "nfsservctl", /* 169 */
+ "setresgid", /* 170 */
+ "getresgid", /* 171 */
+ "prctl", /* 172 */
+ "rt_sigreturn", /* 173 */
+ "rt_sigaction", /* 174 */
+ "rt_sigprocmask", /* 175 */
+ "rt_sigpending", /* 176 */
+ "rt_sigtimedwait", /* 177 */
+ "rt_sigqueueinfo", /* 178 */
+ "rt_sigsuspend", /* 179 */
+ "pread64", /* 180 */
+ "pwrite64", /* 181 */
+ "chown", /* 182 */
+ "getcwd", /* 183 */
+ "capget", /* 184 */
+ "capset", /* 185 */
+ "sigaltstack", /* 186 */
+ "sendfile", /* 187 */
+ "getpmsg", /* 188 */
+ "putpmsg", /* 189 */
+ "vfork", /* 190 */
+ "ugetrlimit", /* 191 */
+ "mmap2", /* 192 */
+ "truncate64", /* 193 */
+ "ftruncate64", /* 194 */
+ "stat64", /* 195 */
+ "lstat64", /* 196 */
+ "fstat64", /* 197 */
+ "lchown32", /* 198 */
+ "getuid32", /* 199 */
+ "getgid32", /* 200 */
+ "geteuid32", /* 201 */
+ "getegid32", /* 202 */
+ "setreuid32", /* 203 */
+ "setregid32", /* 204 */
+ "getgroups32", /* 205 */
+ "setgroups32", /* 206 */
+ "fchown32", /* 207 */
+ "setresuid32", /* 208 */
+ "getresuid32", /* 209 */
+ "setresgid32", /* 210 */
+ "getresgid32", /* 211 */
+ "chown32", /* 212 */
+ "setuid32", /* 213 */
+ "setgid32", /* 214 */
+ "setfsuid32", /* 215 */
+ "setfsgid32", /* 216 */
+ "pivot_root", /* 217 */
+ "mincore", /* 218 */
+ "madvise1", /* 219 */
+ "getdents64", /* 220 */
+ "fcntl64", /* 221 */
+ "222", /* 222 */
+ "223", /* 223 */
+ "gettid", /* 224 */
+ "readahead", /* 225 */
+ "setxattr", /* 226 */
+ "lsetxattr", /* 227 */
+ "fsetxattr", /* 228 */
+ "getxattr", /* 229 */
+ "lgetxattr", /* 230 */
+ "fgetxattr", /* 231 */
+ "listxattr", /* 232 */
+ "llistxattr", /* 233 */
+ "flistxattr", /* 234 */
+ "removexattr", /* 235 */
+ "lremovexattr", /* 236 */
+ "fremovexattr", /* 237 */
+ "tkill", /* 238 */
+ "sendfile64", /* 239 */
+ "futex", /* 240 */
+ "sched_setaffinity", /* 241 */
+ "sched_getaffinity", /* 242 */
+ "set_thread_area", /* 243 */
+ "get_thread_area", /* 244 */
+ "io_setup", /* 245 */
+ "io_destroy", /* 246 */
+ "io_getevents", /* 247 */
+ "io_submit", /* 248 */
+ "io_cancel", /* 249 */
+ "fadvise64", /* 250 */
+ "251", /* 251 */
+ "exit_group", /* 252 */
+ "lookup_dcookie", /* 253 */
+ "epoll_create", /* 254 */
+ "epoll_ctl", /* 255 */
+ "epoll_wait", /* 256 */
+ "remap_file_pages", /* 257 */
+ "set_tid_address", /* 258 */
+ "timer_create", /* 259 */
+ "timer_settime", /* 260 */
+ "timer_gettime", /* 261 */
+ "timer_getoverrun", /* 262 */
+ "timer_delete", /* 263 */
+ "clock_settime", /* 264 */
+ "clock_gettime", /* 265 */
+ "clock_getres", /* 266 */
+ "clock_nanosleep", /* 267 */
+ "statfs64", /* 268 */
+ "fstatfs64", /* 269 */
+ "tgkill", /* 270 */
+ "utimes", /* 271 */
+ "fadvise64_64", /* 272 */
+ "vserver", /* 273 */
+ "mbind", /* 274 */
+ "get_mempolicy", /* 275 */
+ "set_mempolicy", /* 276 */
+ "mq_open", /* 277 */
+ "mq_unlink", /* 278 */
+ "mq_timedsend", /* 279 */
+ "mq_timedreceive", /* 280 */
+ "mq_notify", /* 281 */
+ "mq_getsetattr", /* 282 */
+ "kexec_load", /* 283 */
+ "waitid", /* 284 */
+ "285", /* 285 */
+ "add_key", /* 286 */
+ "request_key", /* 287 */
+ "keyctl", /* 288 */
+ "ioprio_set", /* 289 */
+ "ioprio_get", /* 290 */
+ "inotify_init", /* 291 */
+ "inotify_add_watch", /* 292 */
+ "inotify_rm_watch", /* 293 */
diff --git a/sysdeps/linux-gnu/i386/trace.c b/sysdeps/linux-gnu/i386/trace.c
index b8eff3d..36197d1 100644
--- a/sysdeps/linux-gnu/i386/trace.c
+++ b/sysdeps/linux-gnu/i386/trace.c
@@ -19,51 +19,59 @@
# define PTRACE_POKEUSER PTRACE_POKEUSR
#endif
-void
-get_arch_dep(struct process * proc) {
+void get_arch_dep(struct process *proc)
+{
}
/* Returns 1 if syscall, 2 if sysret, 0 otherwise.
*/
-int
-syscall_p(struct process * proc, int status, int * sysnum) {
- if (WIFSTOPPED(status) && WSTOPSIG(status)==(SIGTRAP | proc->tracesysgood)) {
- *sysnum = ptrace(PTRACE_PEEKUSER, proc->pid, 4*ORIG_EAX, 0);
+int syscall_p(struct process *proc, int status, int *sysnum)
+{
+ if (WIFSTOPPED(status)
+ && WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
+ *sysnum = ptrace(PTRACE_PEEKUSER, proc->pid, 4 * ORIG_EAX, 0);
if (proc->callstack_depth > 0 &&
- proc->callstack[proc->callstack_depth-1].is_syscall) {
+ proc->callstack[proc->callstack_depth - 1].is_syscall) {
return 2;
}
- if (*sysnum>=0) {
+ if (*sysnum >= 0) {
return 1;
}
}
return 0;
}
-long
-gimme_arg(enum tof type, struct process * proc, int arg_num) {
- if (arg_num==-1) { /* return value */
- return ptrace(PTRACE_PEEKUSER, proc->pid, 4*EAX, 0);
+long gimme_arg(enum tof type, struct process *proc, int arg_num)
+{
+ if (arg_num == -1) { /* return value */
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * EAX, 0);
}
- if (type==LT_TOF_FUNCTION || type==LT_TOF_FUNCTIONR) {
- return ptrace(PTRACE_PEEKTEXT, proc->pid, proc->stack_pointer+4*(arg_num+1), 0);
- } else if (type==LT_TOF_SYSCALL || type==LT_TOF_SYSCALLR) {
+ if (type == LT_TOF_FUNCTION || type == LT_TOF_FUNCTIONR) {
+ return ptrace(PTRACE_PEEKTEXT, proc->pid,
+ proc->stack_pointer + 4 * (arg_num + 1), 0);
+ } else if (type == LT_TOF_SYSCALL || type == LT_TOF_SYSCALLR) {
#if 0
- switch(arg_num) {
- case 0: return ptrace(PTRACE_PEEKUSER, proc->pid, 4*EBX, 0);
- case 1: return ptrace(PTRACE_PEEKUSER, proc->pid, 4*ECX, 0);
- case 2: return ptrace(PTRACE_PEEKUSER, proc->pid, 4*EDX, 0);
- case 3: return ptrace(PTRACE_PEEKUSER, proc->pid, 4*ESI, 0);
- case 4: return ptrace(PTRACE_PEEKUSER, proc->pid, 4*EDI, 0);
- default:
- fprintf(stderr, "gimme_arg called with wrong arguments\n");
- exit(2);
+ switch (arg_num) {
+ case 0:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * EBX, 0);
+ case 1:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * ECX, 0);
+ case 2:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * EDX, 0);
+ case 3:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * ESI, 0);
+ case 4:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * EDI, 0);
+ default:
+ fprintf(stderr,
+ "gimme_arg called with wrong arguments\n");
+ exit(2);
}
#else
- return ptrace(PTRACE_PEEKUSER, proc->pid, 4*arg_num, 0);
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * arg_num, 0);
#endif
} else {
fprintf(stderr, "gimme_arg called with wrong arguments\n");
@@ -73,6 +81,6 @@
return 0;
}
-void
-save_register_args(enum tof type, struct process * proc) {
+void save_register_args(enum tof type, struct process *proc)
+{
}
diff --git a/sysdeps/linux-gnu/ia64/breakpoint.c b/sysdeps/linux-gnu/ia64/breakpoint.c
index a1243f6..6d20d18 100644
--- a/sysdeps/linux-gnu/ia64/breakpoint.c
+++ b/sysdeps/linux-gnu/ia64/breakpoint.c
@@ -11,150 +11,140 @@
#include "output.h"
#include "debug.h"
-static long long
-extract_bit_field (char *bundle, int from, int len)
+static long long extract_bit_field(char *bundle, int from, int len)
{
- long long result = 0LL;
- int to = from + len;
- int from_byte = from / 8;
- int to_byte = to / 8;
- unsigned char *b = (unsigned char *) bundle;
- unsigned char c;
- int lshift;
- int i;
+ long long result = 0LL;
+ int to = from + len;
+ int from_byte = from / 8;
+ int to_byte = to / 8;
+ unsigned char *b = (unsigned char *)bundle;
+ unsigned char c;
+ int lshift;
+ int i;
- c = b[from_byte];
- if (from_byte == to_byte)
- c = ((unsigned char) (c << (8 - to % 8))) >> (8 - to % 8);
- result = c >> (from % 8);
- lshift = 8 - (from % 8);
+ c = b[from_byte];
+ if (from_byte == to_byte)
+ c = ((unsigned char)(c << (8 - to % 8))) >> (8 - to % 8);
+ result = c >> (from % 8);
+ lshift = 8 - (from % 8);
- for (i = from_byte+1; i < to_byte; i++)
- {
- result |= ((long long) b[i]) << lshift;
- lshift += 8;
- }
+ for (i = from_byte + 1; i < to_byte; i++) {
+ result |= ((long long)b[i]) << lshift;
+ lshift += 8;
+ }
- if (from_byte < to_byte && (to % 8 != 0))
- {
- c = b[to_byte];
- c = ((unsigned char) (c << (8 - to % 8))) >> (8 - to % 8);
- result |= ((long long) c) << lshift;
- }
+ if (from_byte < to_byte && (to % 8 != 0)) {
+ c = b[to_byte];
+ c = ((unsigned char)(c << (8 - to % 8))) >> (8 - to % 8);
+ result |= ((long long)c) << lshift;
+ }
- return result;
+ return result;
}
/* Replace the specified bits in an instruction bundle */
-static void
-replace_bit_field (char *bundle, long long val, int from, int len)
+static void replace_bit_field(char *bundle, long long val, int from, int len)
{
- int to = from + len;
- int from_byte = from / 8;
- int to_byte = to / 8;
- unsigned char *b = (unsigned char *) bundle;
- unsigned char c;
+ int to = from + len;
+ int from_byte = from / 8;
+ int to_byte = to / 8;
+ unsigned char *b = (unsigned char *)bundle;
+ unsigned char c;
- if (from_byte == to_byte)
- {
- unsigned char left, right;
- c = b[from_byte];
- left = (c >> (to % 8)) << (to % 8);
- right = ((unsigned char) (c << (8 - from % 8))) >> (8 - from % 8);
- c = (unsigned char) (val & 0xff);
- c = (unsigned char) (c << (from % 8 + 8 - to % 8)) >> (8 - to % 8);
- c |= right | left;
- b[from_byte] = c;
- }
- else
- {
- int i;
- c = b[from_byte];
- c = ((unsigned char) (c << (8 - from % 8))) >> (8 - from % 8);
- c = c | (val << (from % 8));
- b[from_byte] = c;
- val >>= 8 - from % 8;
+ if (from_byte == to_byte) {
+ unsigned char left, right;
+ c = b[from_byte];
+ left = (c >> (to % 8)) << (to % 8);
+ right =
+ ((unsigned char)(c << (8 - from % 8))) >> (8 - from % 8);
+ c = (unsigned char)(val & 0xff);
+ c = (unsigned char)(c << (from % 8 + 8 - to % 8)) >> (8 -
+ to % 8);
+ c |= right | left;
+ b[from_byte] = c;
+ } else {
+ int i;
+ c = b[from_byte];
+ c = ((unsigned char)(c << (8 - from % 8))) >> (8 - from % 8);
+ c = c | (val << (from % 8));
+ b[from_byte] = c;
+ val >>= 8 - from % 8;
- for (i = from_byte+1; i < to_byte; i++)
- {
- c = val & 0xff;
- val >>= 8;
- b[i] = c;
- }
+ for (i = from_byte + 1; i < to_byte; i++) {
+ c = val & 0xff;
+ val >>= 8;
+ b[i] = c;
+ }
- if (to % 8 != 0)
- {
- unsigned char cv = (unsigned char) val;
- c = b[to_byte];
- c = c >> (to % 8) << (to % 8);
- c |= ((unsigned char) (cv << (8 - to % 8))) >> (8 - to % 8);
- b[to_byte] = c;
- }
- }
+ if (to % 8 != 0) {
+ unsigned char cv = (unsigned char)val;
+ c = b[to_byte];
+ c = c >> (to % 8) << (to % 8);
+ c |= ((unsigned char)(cv << (8 - to % 8))) >> (8 -
+ to % 8);
+ b[to_byte] = c;
+ }
+ }
}
/* Return the contents of slot N (for N = 0, 1, or 2) in
and instruction bundle */
-static long long
-slotN_contents (char *bundle, int slotnum)
+static long long slotN_contents(char *bundle, int slotnum)
{
- return extract_bit_field (bundle, 5+41*slotnum, 41);
+ return extract_bit_field(bundle, 5 + 41 * slotnum, 41);
}
/* Store an instruction in an instruction bundle */
-static void
-replace_slotN_contents (char *bundle, long long instr, int slotnum)
+static void replace_slotN_contents(char *bundle, long long instr, int slotnum)
{
- replace_bit_field (bundle, instr, 5+41*slotnum, 41);
+ replace_bit_field(bundle, instr, 5 + 41 * slotnum, 41);
}
-typedef enum instruction_type
-{
- A, /* Integer ALU ; I-unit or M-unit */
- I, /* Non-ALU integer; I-unit */
- M, /* Memory ; M-unit */
- F, /* Floating-point ; F-unit */
- B, /* Branch ; B-unit */
- L, /* Extended (L+X) ; I-unit */
- X, /* Extended (L+X) ; I-unit */
- undefined /* undefined or reserved */
+typedef enum instruction_type {
+ A, /* Integer ALU ; I-unit or M-unit */
+ I, /* Non-ALU integer; I-unit */
+ M, /* Memory ; M-unit */
+ F, /* Floating-point ; F-unit */
+ B, /* Branch ; B-unit */
+ L, /* Extended (L+X) ; I-unit */
+ X, /* Extended (L+X) ; I-unit */
+ undefined /* undefined or reserved */
} instruction_type;
-static enum instruction_type template_encoding_table[32][3] =
-{
- { M, I, I }, /* 00 */
- { M, I, I }, /* 01 */
- { M, I, I }, /* 02 */
- { M, I, I }, /* 03 */
- { M, L, X }, /* 04 */
- { M, L, X }, /* 05 */
- { undefined, undefined, undefined }, /* 06 */
- { undefined, undefined, undefined }, /* 07 */
- { M, M, I }, /* 08 */
- { M, M, I }, /* 09 */
- { M, M, I }, /* 0A */
- { M, M, I }, /* 0B */
- { M, F, I }, /* 0C */
- { M, F, I }, /* 0D */
- { M, M, F }, /* 0E */
- { M, M, F }, /* 0F */
- { M, I, B }, /* 10 */
- { M, I, B }, /* 11 */
- { M, B, B }, /* 12 */
- { M, B, B }, /* 13 */
- { undefined, undefined, undefined }, /* 14 */
- { undefined, undefined, undefined }, /* 15 */
- { B, B, B }, /* 16 */
- { B, B, B }, /* 17 */
- { M, M, B }, /* 18 */
- { M, M, B }, /* 19 */
- { undefined, undefined, undefined }, /* 1A */
- { undefined, undefined, undefined }, /* 1B */
- { M, F, B }, /* 1C */
- { M, F, B }, /* 1D */
- { undefined, undefined, undefined }, /* 1E */
- { undefined, undefined, undefined }, /* 1F */
+static enum instruction_type template_encoding_table[32][3] = {
+ {M, I, I}, /* 00 */
+ {M, I, I}, /* 01 */
+ {M, I, I}, /* 02 */
+ {M, I, I}, /* 03 */
+ {M, L, X}, /* 04 */
+ {M, L, X}, /* 05 */
+ {undefined, undefined, undefined}, /* 06 */
+ {undefined, undefined, undefined}, /* 07 */
+ {M, M, I}, /* 08 */
+ {M, M, I}, /* 09 */
+ {M, M, I}, /* 0A */
+ {M, M, I}, /* 0B */
+ {M, F, I}, /* 0C */
+ {M, F, I}, /* 0D */
+ {M, M, F}, /* 0E */
+ {M, M, F}, /* 0F */
+ {M, I, B}, /* 10 */
+ {M, I, B}, /* 11 */
+ {M, B, B}, /* 12 */
+ {M, B, B}, /* 13 */
+ {undefined, undefined, undefined}, /* 14 */
+ {undefined, undefined, undefined}, /* 15 */
+ {B, B, B}, /* 16 */
+ {B, B, B}, /* 17 */
+ {M, M, B}, /* 18 */
+ {M, M, B}, /* 19 */
+ {undefined, undefined, undefined}, /* 1A */
+ {undefined, undefined, undefined}, /* 1B */
+ {M, F, B}, /* 1C */
+ {M, F, B}, /* 1D */
+ {undefined, undefined, undefined}, /* 1E */
+ {undefined, undefined, undefined}, /* 1F */
};
union bundle_t {
@@ -162,45 +152,45 @@
unsigned long ubundle[2];
};
-void
-arch_enable_breakpoint(pid_t pid, struct breakpoint * sbp) {
+void arch_enable_breakpoint(pid_t pid, struct breakpoint *sbp)
+{
unsigned long addr = (unsigned long)sbp->addr;
union bundle_t bundle;
- int slotnum = (int) (addr & 0x0f) & 0x3;
+ int slotnum = (int)(addr & 0x0f) & 0x3;
long long instr;
int template;
debug(1, "Enable Breakpoint at %p)", sbp->addr);
if (slotnum > 2)
- printf("Can't insert breakpoint for slot numbers greater than 2.");
-
+ printf
+ ("Can't insert breakpoint for slot numbers greater than 2.");
+
addr &= ~0x0f;
bundle.ubundle[0] = ptrace(PTRACE_PEEKTEXT, pid, addr, 0);
- bundle.ubundle[1] = ptrace(PTRACE_PEEKTEXT, pid, addr+8, 0);
+ bundle.ubundle[1] = ptrace(PTRACE_PEEKTEXT, pid, addr + 8, 0);
/* Check for L type instruction in 2nd slot, if present then
bump up the slot number to the 3rd slot */
- template = extract_bit_field (bundle.cbundle, 0, 5);
- if (slotnum == 1 && template_encoding_table[template][1] == L)
- {
+ template = extract_bit_field(bundle.cbundle, 0, 5);
+ if (slotnum == 1 && template_encoding_table[template][1] == L) {
slotnum = 2;
}
- instr = slotN_contents (bundle.cbundle, slotnum);
+ instr = slotN_contents(bundle.cbundle, slotnum);
memcpy(sbp->orig_value, &instr, sizeof(instr));
-
- replace_slotN_contents (bundle.cbundle, 0x00002000040LL, slotnum);
+
+ replace_slotN_contents(bundle.cbundle, 0x00002000040LL, slotnum);
ptrace(PTRACE_POKETEXT, pid, addr, bundle.ubundle[0]);
- ptrace(PTRACE_POKETEXT, pid, addr+8, bundle.ubundle[1]);
+ ptrace(PTRACE_POKETEXT, pid, addr + 8, bundle.ubundle[1]);
}
-void
-arch_disable_breakpoint(pid_t pid, const struct breakpoint * sbp) {
+void arch_disable_breakpoint(pid_t pid, const struct breakpoint *sbp)
+{
unsigned long addr = (unsigned long)sbp->addr;
int slotnum = (int)(addr & 0x0f) & 0x3;
@@ -210,13 +200,13 @@
debug(1, "Disable Breakpoint at %p", sbp->addr);
addr &= ~0x0f;
-
+
bundle.ubundle[0] = ptrace(PTRACE_PEEKTEXT, pid, addr, 0);
- bundle.ubundle[1] = ptrace(PTRACE_PEEKTEXT, pid, addr+8, 0);
+ bundle.ubundle[1] = ptrace(PTRACE_PEEKTEXT, pid, addr + 8, 0);
- memcpy (&instr, sbp->orig_value, sizeof(instr));
+ memcpy(&instr, sbp->orig_value, sizeof(instr));
- replace_slotN_contents (bundle.cbundle, instr, slotnum);
+ replace_slotN_contents(bundle.cbundle, instr, slotnum);
ptrace(PTRACE_POKETEXT, pid, addr, bundle.ubundle[0]);
- ptrace(PTRACE_POKETEXT, pid, addr+8, bundle.ubundle[1]);
+ ptrace(PTRACE_POKETEXT, pid, addr + 8, bundle.ubundle[1]);
}
diff --git a/sysdeps/linux-gnu/ia64/plt.c b/sysdeps/linux-gnu/ia64/plt.c
index b4ee017..faa3c0e 100644
--- a/sysdeps/linux-gnu/ia64/plt.c
+++ b/sysdeps/linux-gnu/ia64/plt.c
@@ -4,7 +4,7 @@
#include "debug.h"
/* A bundle is 128 bits */
-#define BUNDLE_SIZE 16
+#define BUNDLE_SIZE 16
/*
@@ -24,24 +24,25 @@
*/
-GElf_Addr
-arch_plt_sym_val (struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+GElf_Addr arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela)
{
/* Find number of entires by removing header and special
* entry, dividing total size by three, since each PLT entry
* will have 3 bundles (1 for inital entry and two for the PLT
* code). */
- int entries = (lte->plt_size - 4*BUNDLE_SIZE) / (3*BUNDLE_SIZE);
+ int entries = (lte->plt_size - 4 * BUNDLE_SIZE) / (3 * BUNDLE_SIZE);
/* Now the point we want to break on is the PLT entry after
* all the header stuff */
- unsigned long addr = lte->plt_addr + (4*BUNDLE_SIZE) + (BUNDLE_SIZE*entries) + (2*ndx*BUNDLE_SIZE);
+ unsigned long addr =
+ lte->plt_addr + (4 * BUNDLE_SIZE) + (BUNDLE_SIZE * entries) +
+ (2 * ndx * BUNDLE_SIZE);
debug(3, "Found PLT %d entry at %lx\n", ndx, addr);
return addr;
}
-void * plt2addr(struct process *proc, void ** plt)
+void *plt2addr(struct process *proc, void **plt)
{
- return (void *) plt;
+ return (void *)plt;
}
diff --git a/sysdeps/linux-gnu/ia64/regs.c b/sysdeps/linux-gnu/ia64/regs.c
index e94c7f3..ef049ff 100644
--- a/sysdeps/linux-gnu/ia64/regs.c
+++ b/sysdeps/linux-gnu/ia64/regs.c
@@ -5,43 +5,44 @@
#include <sys/types.h>
#include <sys/ptrace.h>
-#include <asm/ptrace_offsets.h>
-#include <asm/rse.h>
+#include <asm/ptrace_offsets.h>
+#include <asm/rse.h>
#include <stddef.h>
#include "debug.h"
#include "ltrace.h"
-void *
-get_instruction_pointer(struct process * proc) {
+void *get_instruction_pointer(struct process *proc)
+{
unsigned long ip = ptrace(PTRACE_PEEKUSER, proc->pid, PT_CR_IIP, 0);
- unsigned long slot = (ptrace(PTRACE_PEEKUSER, proc->pid, PT_CR_IPSR, 0) >> 41) & 3;
-
- return (void*)(ip | slot);
+ unsigned long slot =
+ (ptrace(PTRACE_PEEKUSER, proc->pid, PT_CR_IPSR, 0) >> 41) & 3;
+
+ return (void *)(ip | slot);
}
-void
-set_instruction_pointer(struct process * proc, void * addr) {
+void set_instruction_pointer(struct process *proc, void *addr)
+{
unsigned long newip = (unsigned long)addr;
- int slot = (int) addr & 0xf;
+ int slot = (int)addr & 0xf;
unsigned long psr = ptrace(PTRACE_PEEKUSER, proc->pid, PT_CR_IPSR, 0);
-
+
psr &= ~(3UL << 41);
psr |= (unsigned long)(slot & 0x3) << 41;
-
+
newip &= ~0xfUL;
ptrace(PTRACE_POKEUSER, proc->pid, PT_CR_IIP, (long)newip);
ptrace(PTRACE_POKEUSER, proc->pid, PT_CR_IPSR, psr);
}
-void *
-get_stack_pointer(struct process * proc) {
+void *get_stack_pointer(struct process *proc)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, PT_R12, 0);
}
-void *
-get_return_addr(struct process * proc, void * stack_pointer) {
+void *get_return_addr(struct process *proc, void *stack_pointer)
+{
return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, PT_B0, 0);
}
diff --git a/sysdeps/linux-gnu/ia64/signalent.h b/sysdeps/linux-gnu/ia64/signalent.h
index 5395f82..d58a36c 100644
--- a/sysdeps/linux-gnu/ia64/signalent.h
+++ b/sysdeps/linux-gnu/ia64/signalent.h
@@ -1,32 +1,32 @@
- "SIG_0", /* 0 */
- "SIGHUP", /* 1 */
- "SIGINT", /* 2 */
- "SIGQUIT", /* 3 */
- "SIGILL", /* 4 */
- "SIGTRAP", /* 5 */
- "SIGABRT", /* 6 */
- "SIGBUS", /* 7 */
- "SIGFPE", /* 8 */
- "SIGKILL", /* 9 */
- "SIGUSR1", /* 10 */
- "SIGSEGV", /* 11 */
- "SIGUSR2", /* 12 */
- "SIGPIPE", /* 13 */
- "SIGALRM", /* 14 */
- "SIGTERM", /* 15 */
- "SIGSTKFLT", /* 16 */
- "SIGCHLD", /* 17 */
- "SIGCONT", /* 18 */
- "SIGSTOP", /* 19 */
- "SIGTSTP", /* 20 */
- "SIGTTIN", /* 21 */
- "SIGTTOU", /* 22 */
- "SIGURG", /* 23 */
- "SIGXCPU", /* 24 */
- "SIGXFSZ", /* 25 */
- "SIGVTALRM", /* 26 */
- "SIGPROF", /* 27 */
- "SIGWINCH", /* 28 */
- "SIGIO", /* 29 */
- "SIGPWR", /* 30 */
- "SIGSYS", /* 31 */
+"SIG_0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGBUS", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGUSR1", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGUSR2", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGSTKFLT", /* 16 */
+ "SIGCHLD", /* 17 */
+ "SIGCONT", /* 18 */
+ "SIGSTOP", /* 19 */
+ "SIGTSTP", /* 20 */
+ "SIGTTIN", /* 21 */
+ "SIGTTOU", /* 22 */
+ "SIGURG", /* 23 */
+ "SIGXCPU", /* 24 */
+ "SIGXFSZ", /* 25 */
+ "SIGVTALRM", /* 26 */
+ "SIGPROF", /* 27 */
+ "SIGWINCH", /* 28 */
+ "SIGIO", /* 29 */
+ "SIGPWR", /* 30 */
+ "SIGSYS", /* 31 */
diff --git a/sysdeps/linux-gnu/ia64/syscallent.h b/sysdeps/linux-gnu/ia64/syscallent.h
index 88545d4..9b7391b 100644
--- a/sysdeps/linux-gnu/ia64/syscallent.h
+++ b/sysdeps/linux-gnu/ia64/syscallent.h
@@ -1,1280 +1,1280 @@
- "0", /* 0 */
- "1", /* 1 */
- "2", /* 2 */
- "3", /* 3 */
- "4", /* 4 */
- "5", /* 5 */
- "6", /* 6 */
- "7", /* 7 */
- "8", /* 8 */
- "9", /* 9 */
- "10", /* 10 */
- "11", /* 11 */
- "12", /* 12 */
- "13", /* 13 */
- "14", /* 14 */
- "15", /* 15 */
- "16", /* 16 */
- "17", /* 17 */
- "18", /* 18 */
- "19", /* 19 */
- "20", /* 20 */
- "21", /* 21 */
- "22", /* 22 */
- "23", /* 23 */
- "24", /* 24 */
- "25", /* 25 */
- "26", /* 26 */
- "27", /* 27 */
- "28", /* 28 */
- "29", /* 29 */
- "30", /* 30 */
- "31", /* 31 */
- "32", /* 32 */
- "33", /* 33 */
- "34", /* 34 */
- "35", /* 35 */
- "36", /* 36 */
- "37", /* 37 */
- "38", /* 38 */
- "39", /* 39 */
- "40", /* 40 */
- "41", /* 41 */
- "42", /* 42 */
- "43", /* 43 */
- "44", /* 44 */
- "45", /* 45 */
- "46", /* 46 */
- "47", /* 47 */
- "48", /* 48 */
- "49", /* 49 */
- "50", /* 50 */
- "51", /* 51 */
- "52", /* 52 */
- "53", /* 53 */
- "54", /* 54 */
- "55", /* 55 */
- "56", /* 56 */
- "57", /* 57 */
- "58", /* 58 */
- "59", /* 59 */
- "60", /* 60 */
- "61", /* 61 */
- "62", /* 62 */
- "63", /* 63 */
- "64", /* 64 */
- "65", /* 65 */
- "66", /* 66 */
- "67", /* 67 */
- "68", /* 68 */
- "69", /* 69 */
- "70", /* 70 */
- "71", /* 71 */
- "72", /* 72 */
- "73", /* 73 */
- "74", /* 74 */
- "75", /* 75 */
- "76", /* 76 */
- "77", /* 77 */
- "78", /* 78 */
- "79", /* 79 */
- "80", /* 80 */
- "81", /* 81 */
- "82", /* 82 */
- "83", /* 83 */
- "84", /* 84 */
- "85", /* 85 */
- "86", /* 86 */
- "87", /* 87 */
- "88", /* 88 */
- "89", /* 89 */
- "90", /* 90 */
- "91", /* 91 */
- "92", /* 92 */
- "93", /* 93 */
- "94", /* 94 */
- "95", /* 95 */
- "96", /* 96 */
- "97", /* 97 */
- "98", /* 98 */
- "99", /* 99 */
- "100", /* 100 */
- "101", /* 101 */
- "102", /* 102 */
- "103", /* 103 */
- "104", /* 104 */
- "105", /* 105 */
- "106", /* 106 */
- "107", /* 107 */
- "108", /* 108 */
- "109", /* 109 */
- "110", /* 110 */
- "111", /* 111 */
- "112", /* 112 */
- "113", /* 113 */
- "114", /* 114 */
- "115", /* 115 */
- "116", /* 116 */
- "117", /* 117 */
- "118", /* 118 */
- "119", /* 119 */
- "120", /* 120 */
- "121", /* 121 */
- "122", /* 122 */
- "123", /* 123 */
- "124", /* 124 */
- "125", /* 125 */
- "126", /* 126 */
- "127", /* 127 */
- "128", /* 128 */
- "129", /* 129 */
- "130", /* 130 */
- "131", /* 131 */
- "132", /* 132 */
- "133", /* 133 */
- "134", /* 134 */
- "135", /* 135 */
- "136", /* 136 */
- "137", /* 137 */
- "138", /* 138 */
- "139", /* 139 */
- "140", /* 140 */
- "141", /* 141 */
- "142", /* 142 */
- "143", /* 143 */
- "144", /* 144 */
- "145", /* 145 */
- "146", /* 146 */
- "147", /* 147 */
- "148", /* 148 */
- "149", /* 149 */
- "150", /* 150 */
- "151", /* 151 */
- "152", /* 152 */
- "153", /* 153 */
- "154", /* 154 */
- "155", /* 155 */
- "156", /* 156 */
- "157", /* 157 */
- "158", /* 158 */
- "159", /* 159 */
- "160", /* 160 */
- "161", /* 161 */
- "162", /* 162 */
- "163", /* 163 */
- "164", /* 164 */
- "165", /* 165 */
- "166", /* 166 */
- "167", /* 167 */
- "168", /* 168 */
- "169", /* 169 */
- "170", /* 170 */
- "171", /* 171 */
- "172", /* 172 */
- "173", /* 173 */
- "174", /* 174 */
- "175", /* 175 */
- "176", /* 176 */
- "177", /* 177 */
- "178", /* 178 */
- "179", /* 179 */
- "180", /* 180 */
- "181", /* 181 */
- "182", /* 182 */
- "183", /* 183 */
- "184", /* 184 */
- "185", /* 185 */
- "186", /* 186 */
- "187", /* 187 */
- "188", /* 188 */
- "189", /* 189 */
- "190", /* 190 */
- "191", /* 191 */
- "192", /* 192 */
- "193", /* 193 */
- "194", /* 194 */
- "195", /* 195 */
- "196", /* 196 */
- "197", /* 197 */
- "198", /* 198 */
- "199", /* 199 */
- "200", /* 200 */
- "201", /* 201 */
- "202", /* 202 */
- "203", /* 203 */
- "204", /* 204 */
- "205", /* 205 */
- "206", /* 206 */
- "207", /* 207 */
- "208", /* 208 */
- "209", /* 209 */
- "210", /* 210 */
- "211", /* 211 */
- "212", /* 212 */
- "213", /* 213 */
- "214", /* 214 */
- "215", /* 215 */
- "216", /* 216 */
- "217", /* 217 */
- "218", /* 218 */
- "219", /* 219 */
- "220", /* 220 */
- "221", /* 221 */
- "222", /* 222 */
- "223", /* 223 */
- "224", /* 224 */
- "225", /* 225 */
- "226", /* 226 */
- "227", /* 227 */
- "228", /* 228 */
- "229", /* 229 */
- "230", /* 230 */
- "231", /* 231 */
- "232", /* 232 */
- "233", /* 233 */
- "234", /* 234 */
- "235", /* 235 */
- "236", /* 236 */
- "237", /* 237 */
- "238", /* 238 */
- "239", /* 239 */
- "240", /* 240 */
- "241", /* 241 */
- "242", /* 242 */
- "243", /* 243 */
- "244", /* 244 */
- "245", /* 245 */
- "246", /* 246 */
- "247", /* 247 */
- "248", /* 248 */
- "249", /* 249 */
- "250", /* 250 */
- "251", /* 251 */
- "252", /* 252 */
- "253", /* 253 */
- "254", /* 254 */
- "255", /* 255 */
- "256", /* 256 */
- "257", /* 257 */
- "258", /* 258 */
- "259", /* 259 */
- "260", /* 260 */
- "261", /* 261 */
- "262", /* 262 */
- "263", /* 263 */
- "264", /* 264 */
- "265", /* 265 */
- "266", /* 266 */
- "267", /* 267 */
- "268", /* 268 */
- "269", /* 269 */
- "270", /* 270 */
- "271", /* 271 */
- "272", /* 272 */
- "273", /* 273 */
- "274", /* 274 */
- "275", /* 275 */
- "276", /* 276 */
- "277", /* 277 */
- "278", /* 278 */
- "279", /* 279 */
- "280", /* 280 */
- "281", /* 281 */
- "282", /* 282 */
- "283", /* 283 */
- "284", /* 284 */
- "285", /* 285 */
- "286", /* 286 */
- "287", /* 287 */
- "288", /* 288 */
- "289", /* 289 */
- "290", /* 290 */
- "291", /* 291 */
- "292", /* 292 */
- "293", /* 293 */
- "294", /* 294 */
- "295", /* 295 */
- "296", /* 296 */
- "297", /* 297 */
- "298", /* 298 */
- "299", /* 299 */
- "300", /* 300 */
- "301", /* 301 */
- "302", /* 302 */
- "303", /* 303 */
- "304", /* 304 */
- "305", /* 305 */
- "306", /* 306 */
- "307", /* 307 */
- "308", /* 308 */
- "309", /* 309 */
- "310", /* 310 */
- "311", /* 311 */
- "312", /* 312 */
- "313", /* 313 */
- "314", /* 314 */
- "315", /* 315 */
- "316", /* 316 */
- "317", /* 317 */
- "318", /* 318 */
- "319", /* 319 */
- "320", /* 320 */
- "321", /* 321 */
- "322", /* 322 */
- "323", /* 323 */
- "324", /* 324 */
- "325", /* 325 */
- "326", /* 326 */
- "327", /* 327 */
- "328", /* 328 */
- "329", /* 329 */
- "330", /* 330 */
- "331", /* 331 */
- "332", /* 332 */
- "333", /* 333 */
- "334", /* 334 */
- "335", /* 335 */
- "336", /* 336 */
- "337", /* 337 */
- "338", /* 338 */
- "339", /* 339 */
- "340", /* 340 */
- "341", /* 341 */
- "342", /* 342 */
- "343", /* 343 */
- "344", /* 344 */
- "345", /* 345 */
- "346", /* 346 */
- "347", /* 347 */
- "348", /* 348 */
- "349", /* 349 */
- "350", /* 350 */
- "351", /* 351 */
- "352", /* 352 */
- "353", /* 353 */
- "354", /* 354 */
- "355", /* 355 */
- "356", /* 356 */
- "357", /* 357 */
- "358", /* 358 */
- "359", /* 359 */
- "360", /* 360 */
- "361", /* 361 */
- "362", /* 362 */
- "363", /* 363 */
- "364", /* 364 */
- "365", /* 365 */
- "366", /* 366 */
- "367", /* 367 */
- "368", /* 368 */
- "369", /* 369 */
- "370", /* 370 */
- "371", /* 371 */
- "372", /* 372 */
- "373", /* 373 */
- "374", /* 374 */
- "375", /* 375 */
- "376", /* 376 */
- "377", /* 377 */
- "378", /* 378 */
- "379", /* 379 */
- "380", /* 380 */
- "381", /* 381 */
- "382", /* 382 */
- "383", /* 383 */
- "384", /* 384 */
- "385", /* 385 */
- "386", /* 386 */
- "387", /* 387 */
- "388", /* 388 */
- "389", /* 389 */
- "390", /* 390 */
- "391", /* 391 */
- "392", /* 392 */
- "393", /* 393 */
- "394", /* 394 */
- "395", /* 395 */
- "396", /* 396 */
- "397", /* 397 */
- "398", /* 398 */
- "399", /* 399 */
- "400", /* 400 */
- "401", /* 401 */
- "402", /* 402 */
- "403", /* 403 */
- "404", /* 404 */
- "405", /* 405 */
- "406", /* 406 */
- "407", /* 407 */
- "408", /* 408 */
- "409", /* 409 */
- "410", /* 410 */
- "411", /* 411 */
- "412", /* 412 */
- "413", /* 413 */
- "414", /* 414 */
- "415", /* 415 */
- "416", /* 416 */
- "417", /* 417 */
- "418", /* 418 */
- "419", /* 419 */
- "420", /* 420 */
- "421", /* 421 */
- "422", /* 422 */
- "423", /* 423 */
- "424", /* 424 */
- "425", /* 425 */
- "426", /* 426 */
- "427", /* 427 */
- "428", /* 428 */
- "429", /* 429 */
- "430", /* 430 */
- "431", /* 431 */
- "432", /* 432 */
- "433", /* 433 */
- "434", /* 434 */
- "435", /* 435 */
- "436", /* 436 */
- "437", /* 437 */
- "438", /* 438 */
- "439", /* 439 */
- "440", /* 440 */
- "441", /* 441 */
- "442", /* 442 */
- "443", /* 443 */
- "444", /* 444 */
- "445", /* 445 */
- "446", /* 446 */
- "447", /* 447 */
- "448", /* 448 */
- "449", /* 449 */
- "450", /* 450 */
- "451", /* 451 */
- "452", /* 452 */
- "453", /* 453 */
- "454", /* 454 */
- "455", /* 455 */
- "456", /* 456 */
- "457", /* 457 */
- "458", /* 458 */
- "459", /* 459 */
- "460", /* 460 */
- "461", /* 461 */
- "462", /* 462 */
- "463", /* 463 */
- "464", /* 464 */
- "465", /* 465 */
- "466", /* 466 */
- "467", /* 467 */
- "468", /* 468 */
- "469", /* 469 */
- "470", /* 470 */
- "471", /* 471 */
- "472", /* 472 */
- "473", /* 473 */
- "474", /* 474 */
- "475", /* 475 */
- "476", /* 476 */
- "477", /* 477 */
- "478", /* 478 */
- "479", /* 479 */
- "480", /* 480 */
- "481", /* 481 */
- "482", /* 482 */
- "483", /* 483 */
- "484", /* 484 */
- "485", /* 485 */
- "486", /* 486 */
- "487", /* 487 */
- "488", /* 488 */
- "489", /* 489 */
- "490", /* 490 */
- "491", /* 491 */
- "492", /* 492 */
- "493", /* 493 */
- "494", /* 494 */
- "495", /* 495 */
- "496", /* 496 */
- "497", /* 497 */
- "498", /* 498 */
- "499", /* 499 */
- "500", /* 500 */
- "501", /* 501 */
- "502", /* 502 */
- "503", /* 503 */
- "504", /* 504 */
- "505", /* 505 */
- "506", /* 506 */
- "507", /* 507 */
- "508", /* 508 */
- "509", /* 509 */
- "510", /* 510 */
- "511", /* 511 */
- "512", /* 512 */
- "513", /* 513 */
- "514", /* 514 */
- "515", /* 515 */
- "516", /* 516 */
- "517", /* 517 */
- "518", /* 518 */
- "519", /* 519 */
- "520", /* 520 */
- "521", /* 521 */
- "522", /* 522 */
- "523", /* 523 */
- "524", /* 524 */
- "525", /* 525 */
- "526", /* 526 */
- "527", /* 527 */
- "528", /* 528 */
- "529", /* 529 */
- "530", /* 530 */
- "531", /* 531 */
- "532", /* 532 */
- "533", /* 533 */
- "534", /* 534 */
- "535", /* 535 */
- "536", /* 536 */
- "537", /* 537 */
- "538", /* 538 */
- "539", /* 539 */
- "540", /* 540 */
- "541", /* 541 */
- "542", /* 542 */
- "543", /* 543 */
- "544", /* 544 */
- "545", /* 545 */
- "546", /* 546 */
- "547", /* 547 */
- "548", /* 548 */
- "549", /* 549 */
- "550", /* 550 */
- "551", /* 551 */
- "552", /* 552 */
- "553", /* 553 */
- "554", /* 554 */
- "555", /* 555 */
- "556", /* 556 */
- "557", /* 557 */
- "558", /* 558 */
- "559", /* 559 */
- "560", /* 560 */
- "561", /* 561 */
- "562", /* 562 */
- "563", /* 563 */
- "564", /* 564 */
- "565", /* 565 */
- "566", /* 566 */
- "567", /* 567 */
- "568", /* 568 */
- "569", /* 569 */
- "570", /* 570 */
- "571", /* 571 */
- "572", /* 572 */
- "573", /* 573 */
- "574", /* 574 */
- "575", /* 575 */
- "576", /* 576 */
- "577", /* 577 */
- "578", /* 578 */
- "579", /* 579 */
- "580", /* 580 */
- "581", /* 581 */
- "582", /* 582 */
- "583", /* 583 */
- "584", /* 584 */
- "585", /* 585 */
- "586", /* 586 */
- "587", /* 587 */
- "588", /* 588 */
- "589", /* 589 */
- "590", /* 590 */
- "591", /* 591 */
- "592", /* 592 */
- "593", /* 593 */
- "594", /* 594 */
- "595", /* 595 */
- "596", /* 596 */
- "597", /* 597 */
- "598", /* 598 */
- "599", /* 599 */
- "600", /* 600 */
- "601", /* 601 */
- "602", /* 602 */
- "603", /* 603 */
- "604", /* 604 */
- "605", /* 605 */
- "606", /* 606 */
- "607", /* 607 */
- "608", /* 608 */
- "609", /* 609 */
- "610", /* 610 */
- "611", /* 611 */
- "612", /* 612 */
- "613", /* 613 */
- "614", /* 614 */
- "615", /* 615 */
- "616", /* 616 */
- "617", /* 617 */
- "618", /* 618 */
- "619", /* 619 */
- "620", /* 620 */
- "621", /* 621 */
- "622", /* 622 */
- "623", /* 623 */
- "624", /* 624 */
- "625", /* 625 */
- "626", /* 626 */
- "627", /* 627 */
- "628", /* 628 */
- "629", /* 629 */
- "630", /* 630 */
- "631", /* 631 */
- "632", /* 632 */
- "633", /* 633 */
- "634", /* 634 */
- "635", /* 635 */
- "636", /* 636 */
- "637", /* 637 */
- "638", /* 638 */
- "639", /* 639 */
- "640", /* 640 */
- "641", /* 641 */
- "642", /* 642 */
- "643", /* 643 */
- "644", /* 644 */
- "645", /* 645 */
- "646", /* 646 */
- "647", /* 647 */
- "648", /* 648 */
- "649", /* 649 */
- "650", /* 650 */
- "651", /* 651 */
- "652", /* 652 */
- "653", /* 653 */
- "654", /* 654 */
- "655", /* 655 */
- "656", /* 656 */
- "657", /* 657 */
- "658", /* 658 */
- "659", /* 659 */
- "660", /* 660 */
- "661", /* 661 */
- "662", /* 662 */
- "663", /* 663 */
- "664", /* 664 */
- "665", /* 665 */
- "666", /* 666 */
- "667", /* 667 */
- "668", /* 668 */
- "669", /* 669 */
- "670", /* 670 */
- "671", /* 671 */
- "672", /* 672 */
- "673", /* 673 */
- "674", /* 674 */
- "675", /* 675 */
- "676", /* 676 */
- "677", /* 677 */
- "678", /* 678 */
- "679", /* 679 */
- "680", /* 680 */
- "681", /* 681 */
- "682", /* 682 */
- "683", /* 683 */
- "684", /* 684 */
- "685", /* 685 */
- "686", /* 686 */
- "687", /* 687 */
- "688", /* 688 */
- "689", /* 689 */
- "690", /* 690 */
- "691", /* 691 */
- "692", /* 692 */
- "693", /* 693 */
- "694", /* 694 */
- "695", /* 695 */
- "696", /* 696 */
- "697", /* 697 */
- "698", /* 698 */
- "699", /* 699 */
- "700", /* 700 */
- "701", /* 701 */
- "702", /* 702 */
- "703", /* 703 */
- "704", /* 704 */
- "705", /* 705 */
- "706", /* 706 */
- "707", /* 707 */
- "708", /* 708 */
- "709", /* 709 */
- "710", /* 710 */
- "711", /* 711 */
- "712", /* 712 */
- "713", /* 713 */
- "714", /* 714 */
- "715", /* 715 */
- "716", /* 716 */
- "717", /* 717 */
- "718", /* 718 */
- "719", /* 719 */
- "720", /* 720 */
- "721", /* 721 */
- "722", /* 722 */
- "723", /* 723 */
- "724", /* 724 */
- "725", /* 725 */
- "726", /* 726 */
- "727", /* 727 */
- "728", /* 728 */
- "729", /* 729 */
- "730", /* 730 */
- "731", /* 731 */
- "732", /* 732 */
- "733", /* 733 */
- "734", /* 734 */
- "735", /* 735 */
- "736", /* 736 */
- "737", /* 737 */
- "738", /* 738 */
- "739", /* 739 */
- "740", /* 740 */
- "741", /* 741 */
- "742", /* 742 */
- "743", /* 743 */
- "744", /* 744 */
- "745", /* 745 */
- "746", /* 746 */
- "747", /* 747 */
- "748", /* 748 */
- "749", /* 749 */
- "750", /* 750 */
- "751", /* 751 */
- "752", /* 752 */
- "753", /* 753 */
- "754", /* 754 */
- "755", /* 755 */
- "756", /* 756 */
- "757", /* 757 */
- "758", /* 758 */
- "759", /* 759 */
- "760", /* 760 */
- "761", /* 761 */
- "762", /* 762 */
- "763", /* 763 */
- "764", /* 764 */
- "765", /* 765 */
- "766", /* 766 */
- "767", /* 767 */
- "768", /* 768 */
- "769", /* 769 */
- "770", /* 770 */
- "771", /* 771 */
- "772", /* 772 */
- "773", /* 773 */
- "774", /* 774 */
- "775", /* 775 */
- "776", /* 776 */
- "777", /* 777 */
- "778", /* 778 */
- "779", /* 779 */
- "780", /* 780 */
- "781", /* 781 */
- "782", /* 782 */
- "783", /* 783 */
- "784", /* 784 */
- "785", /* 785 */
- "786", /* 786 */
- "787", /* 787 */
- "788", /* 788 */
- "789", /* 789 */
- "790", /* 790 */
- "791", /* 791 */
- "792", /* 792 */
- "793", /* 793 */
- "794", /* 794 */
- "795", /* 795 */
- "796", /* 796 */
- "797", /* 797 */
- "798", /* 798 */
- "799", /* 799 */
- "800", /* 800 */
- "801", /* 801 */
- "802", /* 802 */
- "803", /* 803 */
- "804", /* 804 */
- "805", /* 805 */
- "806", /* 806 */
- "807", /* 807 */
- "808", /* 808 */
- "809", /* 809 */
- "810", /* 810 */
- "811", /* 811 */
- "812", /* 812 */
- "813", /* 813 */
- "814", /* 814 */
- "815", /* 815 */
- "816", /* 816 */
- "817", /* 817 */
- "818", /* 818 */
- "819", /* 819 */
- "820", /* 820 */
- "821", /* 821 */
- "822", /* 822 */
- "823", /* 823 */
- "824", /* 824 */
- "825", /* 825 */
- "826", /* 826 */
- "827", /* 827 */
- "828", /* 828 */
- "829", /* 829 */
- "830", /* 830 */
- "831", /* 831 */
- "832", /* 832 */
- "833", /* 833 */
- "834", /* 834 */
- "835", /* 835 */
- "836", /* 836 */
- "837", /* 837 */
- "838", /* 838 */
- "839", /* 839 */
- "840", /* 840 */
- "841", /* 841 */
- "842", /* 842 */
- "843", /* 843 */
- "844", /* 844 */
- "845", /* 845 */
- "846", /* 846 */
- "847", /* 847 */
- "848", /* 848 */
- "849", /* 849 */
- "850", /* 850 */
- "851", /* 851 */
- "852", /* 852 */
- "853", /* 853 */
- "854", /* 854 */
- "855", /* 855 */
- "856", /* 856 */
- "857", /* 857 */
- "858", /* 858 */
- "859", /* 859 */
- "860", /* 860 */
- "861", /* 861 */
- "862", /* 862 */
- "863", /* 863 */
- "864", /* 864 */
- "865", /* 865 */
- "866", /* 866 */
- "867", /* 867 */
- "868", /* 868 */
- "869", /* 869 */
- "870", /* 870 */
- "871", /* 871 */
- "872", /* 872 */
- "873", /* 873 */
- "874", /* 874 */
- "875", /* 875 */
- "876", /* 876 */
- "877", /* 877 */
- "878", /* 878 */
- "879", /* 879 */
- "880", /* 880 */
- "881", /* 881 */
- "882", /* 882 */
- "883", /* 883 */
- "884", /* 884 */
- "885", /* 885 */
- "886", /* 886 */
- "887", /* 887 */
- "888", /* 888 */
- "889", /* 889 */
- "890", /* 890 */
- "891", /* 891 */
- "892", /* 892 */
- "893", /* 893 */
- "894", /* 894 */
- "895", /* 895 */
- "896", /* 896 */
- "897", /* 897 */
- "898", /* 898 */
- "899", /* 899 */
- "900", /* 900 */
- "901", /* 901 */
- "902", /* 902 */
- "903", /* 903 */
- "904", /* 904 */
- "905", /* 905 */
- "906", /* 906 */
- "907", /* 907 */
- "908", /* 908 */
- "909", /* 909 */
- "910", /* 910 */
- "911", /* 911 */
- "912", /* 912 */
- "913", /* 913 */
- "914", /* 914 */
- "915", /* 915 */
- "916", /* 916 */
- "917", /* 917 */
- "918", /* 918 */
- "919", /* 919 */
- "920", /* 920 */
- "921", /* 921 */
- "922", /* 922 */
- "923", /* 923 */
- "924", /* 924 */
- "925", /* 925 */
- "926", /* 926 */
- "927", /* 927 */
- "928", /* 928 */
- "929", /* 929 */
- "930", /* 930 */
- "931", /* 931 */
- "932", /* 932 */
- "933", /* 933 */
- "934", /* 934 */
- "935", /* 935 */
- "936", /* 936 */
- "937", /* 937 */
- "938", /* 938 */
- "939", /* 939 */
- "940", /* 940 */
- "941", /* 941 */
- "942", /* 942 */
- "943", /* 943 */
- "944", /* 944 */
- "945", /* 945 */
- "946", /* 946 */
- "947", /* 947 */
- "948", /* 948 */
- "949", /* 949 */
- "950", /* 950 */
- "951", /* 951 */
- "952", /* 952 */
- "953", /* 953 */
- "954", /* 954 */
- "955", /* 955 */
- "956", /* 956 */
- "957", /* 957 */
- "958", /* 958 */
- "959", /* 959 */
- "960", /* 960 */
- "961", /* 961 */
- "962", /* 962 */
- "963", /* 963 */
- "964", /* 964 */
- "965", /* 965 */
- "966", /* 966 */
- "967", /* 967 */
- "968", /* 968 */
- "969", /* 969 */
- "970", /* 970 */
- "971", /* 971 */
- "972", /* 972 */
- "973", /* 973 */
- "974", /* 974 */
- "975", /* 975 */
- "976", /* 976 */
- "977", /* 977 */
- "978", /* 978 */
- "979", /* 979 */
- "980", /* 980 */
- "981", /* 981 */
- "982", /* 982 */
- "983", /* 983 */
- "984", /* 984 */
- "985", /* 985 */
- "986", /* 986 */
- "987", /* 987 */
- "988", /* 988 */
- "989", /* 989 */
- "990", /* 990 */
- "991", /* 991 */
- "992", /* 992 */
- "993", /* 993 */
- "994", /* 994 */
- "995", /* 995 */
- "996", /* 996 */
- "997", /* 997 */
- "998", /* 998 */
- "999", /* 999 */
- "1000", /* 1000 */
- "1001", /* 1001 */
- "1002", /* 1002 */
- "1003", /* 1003 */
- "1004", /* 1004 */
- "1005", /* 1005 */
- "1006", /* 1006 */
- "1007", /* 1007 */
- "1008", /* 1008 */
- "1009", /* 1009 */
- "1010", /* 1010 */
- "1011", /* 1011 */
- "1012", /* 1012 */
- "1013", /* 1013 */
- "1014", /* 1014 */
- "1015", /* 1015 */
- "1016", /* 1016 */
- "1017", /* 1017 */
- "1018", /* 1018 */
- "1019", /* 1019 */
- "1020", /* 1020 */
- "1021", /* 1021 */
- "1022", /* 1022 */
- "1023", /* 1023 */
- "ni_syscall", /* 1024 */
- "exit", /* 1025 */
- "read", /* 1026 */
- "write", /* 1027 */
- "open", /* 1028 */
- "close", /* 1029 */
- "creat", /* 1030 */
- "link", /* 1031 */
- "unlink", /* 1032 */
- "execve", /* 1033 */
- "chdir", /* 1034 */
- "fchdir", /* 1035 */
- "utimes", /* 1036 */
- "mknod", /* 1037 */
- "chmod", /* 1038 */
- "chown", /* 1039 */
- "lseek", /* 1040 */
- "getpid", /* 1041 */
- "getppid", /* 1042 */
- "mount", /* 1043 */
- "umount", /* 1044 */
- "setuid", /* 1045 */
- "getuid", /* 1046 */
- "geteuid", /* 1047 */
- "ptrace", /* 1048 */
- "access", /* 1049 */
- "sync", /* 1050 */
- "fsync", /* 1051 */
- "fdatasync", /* 1052 */
- "kill", /* 1053 */
- "rename", /* 1054 */
- "mkdir", /* 1055 */
- "rmdir", /* 1056 */
- "dup", /* 1057 */
- "pipe", /* 1058 */
- "times", /* 1059 */
- "brk", /* 1060 */
- "setgid", /* 1061 */
- "getgid", /* 1062 */
- "getegid", /* 1063 */
- "acct", /* 1064 */
- "ioctl", /* 1065 */
- "fcntl", /* 1066 */
- "umask", /* 1067 */
- "chroot", /* 1068 */
- "ustat", /* 1069 */
- "dup2", /* 1070 */
- "setreuid", /* 1071 */
- "setregid", /* 1072 */
- "getresuid", /* 1073 */
- "setresuid", /* 1074 */
- "getresgid", /* 1075 */
- "setresgid", /* 1076 */
- "getgroups", /* 1077 */
- "setgroups", /* 1078 */
- "getpgid", /* 1079 */
- "setpgid", /* 1080 */
- "setsid", /* 1081 */
- "getsid", /* 1082 */
- "sethostname", /* 1083 */
- "setrlimit", /* 1084 */
- "getrlimit", /* 1085 */
- "getrusage", /* 1086 */
- "gettimeofday", /* 1087 */
- "settimeofday", /* 1088 */
- "select", /* 1089 */
- "poll", /* 1090 */
- "symlink", /* 1091 */
- "readlink", /* 1092 */
- "uselib", /* 1093 */
- "swapon", /* 1094 */
- "swapoff", /* 1095 */
- "reboot", /* 1096 */
- "truncate", /* 1097 */
- "ftruncate", /* 1098 */
- "fchmod", /* 1099 */
- "fchown", /* 1100 */
- "getpriority", /* 1101 */
- "setpriority", /* 1102 */
- "statfs", /* 1103 */
- "fstatfs", /* 1104 */
- "gettid", /* 1105 */
- "semget", /* 1106 */
- "semop", /* 1107 */
- "semctl", /* 1108 */
- "msgget", /* 1109 */
- "msgsnd", /* 1110 */
- "msgrcv", /* 1111 */
- "msgctl", /* 1112 */
- "shmget", /* 1113 */
- "shmat", /* 1114 */
- "shmdt", /* 1115 */
- "shmctl", /* 1116 */
- "syslog", /* 1117 */
- "setitimer", /* 1118 */
- "getitimer", /* 1119 */
- "1120", /* 1120 */
- "1121", /* 1121 */
- "1122", /* 1122 */
- "vhangup", /* 1123 */
- "lchown", /* 1124 */
- "remap_file_pages", /* 1125 */
- "wait4", /* 1126 */
- "sysinfo", /* 1127 */
- "clone", /* 1128 */
- "setdomainname", /* 1129 */
- "uname", /* 1130 */
- "adjtimex", /* 1131 */
- "create_module", /* 1132 */
- "init_module", /* 1133 */
- "delete_module", /* 1134 */
- "get_kernel_syms", /* 1135 */
- "query_module", /* 1136 */
- "quotactl", /* 1137 */
- "bdflush", /* 1138 */
- "sysfs", /* 1139 */
- "personality", /* 1140 */
- "afs_syscall", /* 1141 */
- "setfsuid", /* 1142 */
- "setfsgid", /* 1143 */
- "getdents", /* 1144 */
- "flock", /* 1145 */
- "readv", /* 1146 */
- "writev", /* 1147 */
- "pread64", /* 1148 */
- "pwrite64", /* 1149 */
- "_sysctl", /* 1150 */
- "mmap", /* 1151 */
- "munmap", /* 1152 */
- "mlock", /* 1153 */
- "mlockall", /* 1154 */
- "mprotect", /* 1155 */
- "mremap", /* 1156 */
- "msync", /* 1157 */
- "munlock", /* 1158 */
- "munlockall", /* 1159 */
- "sched_getparam", /* 1160 */
- "sched_setparam", /* 1161 */
- "sched_getscheduler", /* 1162 */
- "sched_setscheduler", /* 1163 */
- "sched_yield", /* 1164 */
- "sched_get_priority_max", /* 1165 */
- "sched_get_priority_min", /* 1166 */
- "sched_rr_get_interval", /* 1167 */
- "nanosleep", /* 1168 */
- "nfsservctl", /* 1169 */
- "prctl", /* 1170 */
- "1171", /* 1171 */
- "mmap2", /* 1172 */
- "pciconfig_read", /* 1173 */
- "pciconfig_write", /* 1174 */
- "perfmonctl", /* 1175 */
- "sigaltstack", /* 1176 */
- "rt_sigaction", /* 1177 */
- "rt_sigpending", /* 1178 */
- "rt_sigprocmask", /* 1179 */
- "rt_sigqueueinfo", /* 1180 */
- "rt_sigreturn", /* 1181 */
- "rt_sigsuspend", /* 1182 */
- "rt_sigtimedwait", /* 1183 */
- "getcwd", /* 1184 */
- "capget", /* 1185 */
- "capset", /* 1186 */
- "sendfile", /* 1187 */
- "getpmsg", /* 1188 */
- "putpmsg", /* 1189 */
- "socket", /* 1190 */
- "bind", /* 1191 */
- "connect", /* 1192 */
- "listen", /* 1193 */
- "accept", /* 1194 */
- "getsockname", /* 1195 */
- "getpeername", /* 1196 */
- "socketpair", /* 1197 */
- "send", /* 1198 */
- "sendto", /* 1199 */
- "recv", /* 1200 */
- "recvfrom", /* 1201 */
- "shutdown", /* 1202 */
- "setsockopt", /* 1203 */
- "getsockopt", /* 1204 */
- "sendmsg", /* 1205 */
- "recvmsg", /* 1206 */
- "pivot_root", /* 1207 */
- "mincore", /* 1208 */
- "madvise", /* 1209 */
- "stat", /* 1210 */
- "lstat", /* 1211 */
- "fstat", /* 1212 */
- "clone2", /* 1213 */
- "getdents64", /* 1214 */
- "getunwind", /* 1215 */
- "readahead", /* 1216 */
- "setxattr", /* 1217 */
- "lsetxattr", /* 1218 */
- "fsetxattr", /* 1219 */
- "getxattr", /* 1220 */
- "lgetxattr", /* 1221 */
- "fgetxattr", /* 1222 */
- "listxattr", /* 1223 */
- "llistxattr", /* 1224 */
- "flistxattr", /* 1225 */
- "removexattr", /* 1226 */
- "lremovexattr", /* 1227 */
- "fremovexattr", /* 1228 */
- "tkill", /* 1229 */
- "futex", /* 1230 */
- "sched_setaffinity", /* 1231 */
- "sched_getaffinity", /* 1232 */
- "set_tid_address", /* 1233 */
- "fadvise64", /* 1234 */
- "tgkill", /* 1235 */
- "exit_group", /* 1236 */
- "lookup_dcookie", /* 1237 */
- "io_setup", /* 1238 */
- "io_destroy", /* 1239 */
- "io_getevents", /* 1240 */
- "io_submit", /* 1241 */
- "io_cancel", /* 1242 */
- "epoll_create", /* 1243 */
- "epoll_ctl", /* 1244 */
- "epoll_wait", /* 1245 */
- "restart_syscall", /* 1246 */
- "semtimedop", /* 1247 */
- "timer_create", /* 1248 */
- "timer_settime", /* 1249 */
- "timer_gettime", /* 1250 */
- "timer_getoverrun", /* 1251 */
- "timer_delete", /* 1252 */
- "clock_settime", /* 1253 */
- "clock_gettime", /* 1254 */
- "clock_getres", /* 1255 */
- "clock_nanosleep", /* 1256 */
- "fstatfs64", /* 1257 */
- "statfs64", /* 1258 */
- "mbind", /* 1259 */
- "get_mempolicy", /* 1260 */
- "set_mempolicy", /* 1261 */
- "mq_open", /* 1262 */
- "mq_unlink", /* 1263 */
- "mq_timedsend", /* 1264 */
- "mq_timedreceive", /* 1265 */
- "mq_notify", /* 1266 */
- "mq_getsetattr", /* 1267 */
- "kexec_load", /* 1268 */
- "vserver", /* 1269 */
- "waitid", /* 1270 */
- "add_key", /* 1271 */
- "request_key", /* 1272 */
- "keyctl", /* 1273 */
- "ioprio_set", /* 1274 */
- "ioprio_get", /* 1275 */
- "set_zone_reclaim", /* 1276 */
- "inotify_init", /* 1277 */
- "inotify_add_watch", /* 1278 */
- "inotify_rm_watch", /* 1279 */
+"0", /* 0 */
+ "1", /* 1 */
+ "2", /* 2 */
+ "3", /* 3 */
+ "4", /* 4 */
+ "5", /* 5 */
+ "6", /* 6 */
+ "7", /* 7 */
+ "8", /* 8 */
+ "9", /* 9 */
+ "10", /* 10 */
+ "11", /* 11 */
+ "12", /* 12 */
+ "13", /* 13 */
+ "14", /* 14 */
+ "15", /* 15 */
+ "16", /* 16 */
+ "17", /* 17 */
+ "18", /* 18 */
+ "19", /* 19 */
+ "20", /* 20 */
+ "21", /* 21 */
+ "22", /* 22 */
+ "23", /* 23 */
+ "24", /* 24 */
+ "25", /* 25 */
+ "26", /* 26 */
+ "27", /* 27 */
+ "28", /* 28 */
+ "29", /* 29 */
+ "30", /* 30 */
+ "31", /* 31 */
+ "32", /* 32 */
+ "33", /* 33 */
+ "34", /* 34 */
+ "35", /* 35 */
+ "36", /* 36 */
+ "37", /* 37 */
+ "38", /* 38 */
+ "39", /* 39 */
+ "40", /* 40 */
+ "41", /* 41 */
+ "42", /* 42 */
+ "43", /* 43 */
+ "44", /* 44 */
+ "45", /* 45 */
+ "46", /* 46 */
+ "47", /* 47 */
+ "48", /* 48 */
+ "49", /* 49 */
+ "50", /* 50 */
+ "51", /* 51 */
+ "52", /* 52 */
+ "53", /* 53 */
+ "54", /* 54 */
+ "55", /* 55 */
+ "56", /* 56 */
+ "57", /* 57 */
+ "58", /* 58 */
+ "59", /* 59 */
+ "60", /* 60 */
+ "61", /* 61 */
+ "62", /* 62 */
+ "63", /* 63 */
+ "64", /* 64 */
+ "65", /* 65 */
+ "66", /* 66 */
+ "67", /* 67 */
+ "68", /* 68 */
+ "69", /* 69 */
+ "70", /* 70 */
+ "71", /* 71 */
+ "72", /* 72 */
+ "73", /* 73 */
+ "74", /* 74 */
+ "75", /* 75 */
+ "76", /* 76 */
+ "77", /* 77 */
+ "78", /* 78 */
+ "79", /* 79 */
+ "80", /* 80 */
+ "81", /* 81 */
+ "82", /* 82 */
+ "83", /* 83 */
+ "84", /* 84 */
+ "85", /* 85 */
+ "86", /* 86 */
+ "87", /* 87 */
+ "88", /* 88 */
+ "89", /* 89 */
+ "90", /* 90 */
+ "91", /* 91 */
+ "92", /* 92 */
+ "93", /* 93 */
+ "94", /* 94 */
+ "95", /* 95 */
+ "96", /* 96 */
+ "97", /* 97 */
+ "98", /* 98 */
+ "99", /* 99 */
+ "100", /* 100 */
+ "101", /* 101 */
+ "102", /* 102 */
+ "103", /* 103 */
+ "104", /* 104 */
+ "105", /* 105 */
+ "106", /* 106 */
+ "107", /* 107 */
+ "108", /* 108 */
+ "109", /* 109 */
+ "110", /* 110 */
+ "111", /* 111 */
+ "112", /* 112 */
+ "113", /* 113 */
+ "114", /* 114 */
+ "115", /* 115 */
+ "116", /* 116 */
+ "117", /* 117 */
+ "118", /* 118 */
+ "119", /* 119 */
+ "120", /* 120 */
+ "121", /* 121 */
+ "122", /* 122 */
+ "123", /* 123 */
+ "124", /* 124 */
+ "125", /* 125 */
+ "126", /* 126 */
+ "127", /* 127 */
+ "128", /* 128 */
+ "129", /* 129 */
+ "130", /* 130 */
+ "131", /* 131 */
+ "132", /* 132 */
+ "133", /* 133 */
+ "134", /* 134 */
+ "135", /* 135 */
+ "136", /* 136 */
+ "137", /* 137 */
+ "138", /* 138 */
+ "139", /* 139 */
+ "140", /* 140 */
+ "141", /* 141 */
+ "142", /* 142 */
+ "143", /* 143 */
+ "144", /* 144 */
+ "145", /* 145 */
+ "146", /* 146 */
+ "147", /* 147 */
+ "148", /* 148 */
+ "149", /* 149 */
+ "150", /* 150 */
+ "151", /* 151 */
+ "152", /* 152 */
+ "153", /* 153 */
+ "154", /* 154 */
+ "155", /* 155 */
+ "156", /* 156 */
+ "157", /* 157 */
+ "158", /* 158 */
+ "159", /* 159 */
+ "160", /* 160 */
+ "161", /* 161 */
+ "162", /* 162 */
+ "163", /* 163 */
+ "164", /* 164 */
+ "165", /* 165 */
+ "166", /* 166 */
+ "167", /* 167 */
+ "168", /* 168 */
+ "169", /* 169 */
+ "170", /* 170 */
+ "171", /* 171 */
+ "172", /* 172 */
+ "173", /* 173 */
+ "174", /* 174 */
+ "175", /* 175 */
+ "176", /* 176 */
+ "177", /* 177 */
+ "178", /* 178 */
+ "179", /* 179 */
+ "180", /* 180 */
+ "181", /* 181 */
+ "182", /* 182 */
+ "183", /* 183 */
+ "184", /* 184 */
+ "185", /* 185 */
+ "186", /* 186 */
+ "187", /* 187 */
+ "188", /* 188 */
+ "189", /* 189 */
+ "190", /* 190 */
+ "191", /* 191 */
+ "192", /* 192 */
+ "193", /* 193 */
+ "194", /* 194 */
+ "195", /* 195 */
+ "196", /* 196 */
+ "197", /* 197 */
+ "198", /* 198 */
+ "199", /* 199 */
+ "200", /* 200 */
+ "201", /* 201 */
+ "202", /* 202 */
+ "203", /* 203 */
+ "204", /* 204 */
+ "205", /* 205 */
+ "206", /* 206 */
+ "207", /* 207 */
+ "208", /* 208 */
+ "209", /* 209 */
+ "210", /* 210 */
+ "211", /* 211 */
+ "212", /* 212 */
+ "213", /* 213 */
+ "214", /* 214 */
+ "215", /* 215 */
+ "216", /* 216 */
+ "217", /* 217 */
+ "218", /* 218 */
+ "219", /* 219 */
+ "220", /* 220 */
+ "221", /* 221 */
+ "222", /* 222 */
+ "223", /* 223 */
+ "224", /* 224 */
+ "225", /* 225 */
+ "226", /* 226 */
+ "227", /* 227 */
+ "228", /* 228 */
+ "229", /* 229 */
+ "230", /* 230 */
+ "231", /* 231 */
+ "232", /* 232 */
+ "233", /* 233 */
+ "234", /* 234 */
+ "235", /* 235 */
+ "236", /* 236 */
+ "237", /* 237 */
+ "238", /* 238 */
+ "239", /* 239 */
+ "240", /* 240 */
+ "241", /* 241 */
+ "242", /* 242 */
+ "243", /* 243 */
+ "244", /* 244 */
+ "245", /* 245 */
+ "246", /* 246 */
+ "247", /* 247 */
+ "248", /* 248 */
+ "249", /* 249 */
+ "250", /* 250 */
+ "251", /* 251 */
+ "252", /* 252 */
+ "253", /* 253 */
+ "254", /* 254 */
+ "255", /* 255 */
+ "256", /* 256 */
+ "257", /* 257 */
+ "258", /* 258 */
+ "259", /* 259 */
+ "260", /* 260 */
+ "261", /* 261 */
+ "262", /* 262 */
+ "263", /* 263 */
+ "264", /* 264 */
+ "265", /* 265 */
+ "266", /* 266 */
+ "267", /* 267 */
+ "268", /* 268 */
+ "269", /* 269 */
+ "270", /* 270 */
+ "271", /* 271 */
+ "272", /* 272 */
+ "273", /* 273 */
+ "274", /* 274 */
+ "275", /* 275 */
+ "276", /* 276 */
+ "277", /* 277 */
+ "278", /* 278 */
+ "279", /* 279 */
+ "280", /* 280 */
+ "281", /* 281 */
+ "282", /* 282 */
+ "283", /* 283 */
+ "284", /* 284 */
+ "285", /* 285 */
+ "286", /* 286 */
+ "287", /* 287 */
+ "288", /* 288 */
+ "289", /* 289 */
+ "290", /* 290 */
+ "291", /* 291 */
+ "292", /* 292 */
+ "293", /* 293 */
+ "294", /* 294 */
+ "295", /* 295 */
+ "296", /* 296 */
+ "297", /* 297 */
+ "298", /* 298 */
+ "299", /* 299 */
+ "300", /* 300 */
+ "301", /* 301 */
+ "302", /* 302 */
+ "303", /* 303 */
+ "304", /* 304 */
+ "305", /* 305 */
+ "306", /* 306 */
+ "307", /* 307 */
+ "308", /* 308 */
+ "309", /* 309 */
+ "310", /* 310 */
+ "311", /* 311 */
+ "312", /* 312 */
+ "313", /* 313 */
+ "314", /* 314 */
+ "315", /* 315 */
+ "316", /* 316 */
+ "317", /* 317 */
+ "318", /* 318 */
+ "319", /* 319 */
+ "320", /* 320 */
+ "321", /* 321 */
+ "322", /* 322 */
+ "323", /* 323 */
+ "324", /* 324 */
+ "325", /* 325 */
+ "326", /* 326 */
+ "327", /* 327 */
+ "328", /* 328 */
+ "329", /* 329 */
+ "330", /* 330 */
+ "331", /* 331 */
+ "332", /* 332 */
+ "333", /* 333 */
+ "334", /* 334 */
+ "335", /* 335 */
+ "336", /* 336 */
+ "337", /* 337 */
+ "338", /* 338 */
+ "339", /* 339 */
+ "340", /* 340 */
+ "341", /* 341 */
+ "342", /* 342 */
+ "343", /* 343 */
+ "344", /* 344 */
+ "345", /* 345 */
+ "346", /* 346 */
+ "347", /* 347 */
+ "348", /* 348 */
+ "349", /* 349 */
+ "350", /* 350 */
+ "351", /* 351 */
+ "352", /* 352 */
+ "353", /* 353 */
+ "354", /* 354 */
+ "355", /* 355 */
+ "356", /* 356 */
+ "357", /* 357 */
+ "358", /* 358 */
+ "359", /* 359 */
+ "360", /* 360 */
+ "361", /* 361 */
+ "362", /* 362 */
+ "363", /* 363 */
+ "364", /* 364 */
+ "365", /* 365 */
+ "366", /* 366 */
+ "367", /* 367 */
+ "368", /* 368 */
+ "369", /* 369 */
+ "370", /* 370 */
+ "371", /* 371 */
+ "372", /* 372 */
+ "373", /* 373 */
+ "374", /* 374 */
+ "375", /* 375 */
+ "376", /* 376 */
+ "377", /* 377 */
+ "378", /* 378 */
+ "379", /* 379 */
+ "380", /* 380 */
+ "381", /* 381 */
+ "382", /* 382 */
+ "383", /* 383 */
+ "384", /* 384 */
+ "385", /* 385 */
+ "386", /* 386 */
+ "387", /* 387 */
+ "388", /* 388 */
+ "389", /* 389 */
+ "390", /* 390 */
+ "391", /* 391 */
+ "392", /* 392 */
+ "393", /* 393 */
+ "394", /* 394 */
+ "395", /* 395 */
+ "396", /* 396 */
+ "397", /* 397 */
+ "398", /* 398 */
+ "399", /* 399 */
+ "400", /* 400 */
+ "401", /* 401 */
+ "402", /* 402 */
+ "403", /* 403 */
+ "404", /* 404 */
+ "405", /* 405 */
+ "406", /* 406 */
+ "407", /* 407 */
+ "408", /* 408 */
+ "409", /* 409 */
+ "410", /* 410 */
+ "411", /* 411 */
+ "412", /* 412 */
+ "413", /* 413 */
+ "414", /* 414 */
+ "415", /* 415 */
+ "416", /* 416 */
+ "417", /* 417 */
+ "418", /* 418 */
+ "419", /* 419 */
+ "420", /* 420 */
+ "421", /* 421 */
+ "422", /* 422 */
+ "423", /* 423 */
+ "424", /* 424 */
+ "425", /* 425 */
+ "426", /* 426 */
+ "427", /* 427 */
+ "428", /* 428 */
+ "429", /* 429 */
+ "430", /* 430 */
+ "431", /* 431 */
+ "432", /* 432 */
+ "433", /* 433 */
+ "434", /* 434 */
+ "435", /* 435 */
+ "436", /* 436 */
+ "437", /* 437 */
+ "438", /* 438 */
+ "439", /* 439 */
+ "440", /* 440 */
+ "441", /* 441 */
+ "442", /* 442 */
+ "443", /* 443 */
+ "444", /* 444 */
+ "445", /* 445 */
+ "446", /* 446 */
+ "447", /* 447 */
+ "448", /* 448 */
+ "449", /* 449 */
+ "450", /* 450 */
+ "451", /* 451 */
+ "452", /* 452 */
+ "453", /* 453 */
+ "454", /* 454 */
+ "455", /* 455 */
+ "456", /* 456 */
+ "457", /* 457 */
+ "458", /* 458 */
+ "459", /* 459 */
+ "460", /* 460 */
+ "461", /* 461 */
+ "462", /* 462 */
+ "463", /* 463 */
+ "464", /* 464 */
+ "465", /* 465 */
+ "466", /* 466 */
+ "467", /* 467 */
+ "468", /* 468 */
+ "469", /* 469 */
+ "470", /* 470 */
+ "471", /* 471 */
+ "472", /* 472 */
+ "473", /* 473 */
+ "474", /* 474 */
+ "475", /* 475 */
+ "476", /* 476 */
+ "477", /* 477 */
+ "478", /* 478 */
+ "479", /* 479 */
+ "480", /* 480 */
+ "481", /* 481 */
+ "482", /* 482 */
+ "483", /* 483 */
+ "484", /* 484 */
+ "485", /* 485 */
+ "486", /* 486 */
+ "487", /* 487 */
+ "488", /* 488 */
+ "489", /* 489 */
+ "490", /* 490 */
+ "491", /* 491 */
+ "492", /* 492 */
+ "493", /* 493 */
+ "494", /* 494 */
+ "495", /* 495 */
+ "496", /* 496 */
+ "497", /* 497 */
+ "498", /* 498 */
+ "499", /* 499 */
+ "500", /* 500 */
+ "501", /* 501 */
+ "502", /* 502 */
+ "503", /* 503 */
+ "504", /* 504 */
+ "505", /* 505 */
+ "506", /* 506 */
+ "507", /* 507 */
+ "508", /* 508 */
+ "509", /* 509 */
+ "510", /* 510 */
+ "511", /* 511 */
+ "512", /* 512 */
+ "513", /* 513 */
+ "514", /* 514 */
+ "515", /* 515 */
+ "516", /* 516 */
+ "517", /* 517 */
+ "518", /* 518 */
+ "519", /* 519 */
+ "520", /* 520 */
+ "521", /* 521 */
+ "522", /* 522 */
+ "523", /* 523 */
+ "524", /* 524 */
+ "525", /* 525 */
+ "526", /* 526 */
+ "527", /* 527 */
+ "528", /* 528 */
+ "529", /* 529 */
+ "530", /* 530 */
+ "531", /* 531 */
+ "532", /* 532 */
+ "533", /* 533 */
+ "534", /* 534 */
+ "535", /* 535 */
+ "536", /* 536 */
+ "537", /* 537 */
+ "538", /* 538 */
+ "539", /* 539 */
+ "540", /* 540 */
+ "541", /* 541 */
+ "542", /* 542 */
+ "543", /* 543 */
+ "544", /* 544 */
+ "545", /* 545 */
+ "546", /* 546 */
+ "547", /* 547 */
+ "548", /* 548 */
+ "549", /* 549 */
+ "550", /* 550 */
+ "551", /* 551 */
+ "552", /* 552 */
+ "553", /* 553 */
+ "554", /* 554 */
+ "555", /* 555 */
+ "556", /* 556 */
+ "557", /* 557 */
+ "558", /* 558 */
+ "559", /* 559 */
+ "560", /* 560 */
+ "561", /* 561 */
+ "562", /* 562 */
+ "563", /* 563 */
+ "564", /* 564 */
+ "565", /* 565 */
+ "566", /* 566 */
+ "567", /* 567 */
+ "568", /* 568 */
+ "569", /* 569 */
+ "570", /* 570 */
+ "571", /* 571 */
+ "572", /* 572 */
+ "573", /* 573 */
+ "574", /* 574 */
+ "575", /* 575 */
+ "576", /* 576 */
+ "577", /* 577 */
+ "578", /* 578 */
+ "579", /* 579 */
+ "580", /* 580 */
+ "581", /* 581 */
+ "582", /* 582 */
+ "583", /* 583 */
+ "584", /* 584 */
+ "585", /* 585 */
+ "586", /* 586 */
+ "587", /* 587 */
+ "588", /* 588 */
+ "589", /* 589 */
+ "590", /* 590 */
+ "591", /* 591 */
+ "592", /* 592 */
+ "593", /* 593 */
+ "594", /* 594 */
+ "595", /* 595 */
+ "596", /* 596 */
+ "597", /* 597 */
+ "598", /* 598 */
+ "599", /* 599 */
+ "600", /* 600 */
+ "601", /* 601 */
+ "602", /* 602 */
+ "603", /* 603 */
+ "604", /* 604 */
+ "605", /* 605 */
+ "606", /* 606 */
+ "607", /* 607 */
+ "608", /* 608 */
+ "609", /* 609 */
+ "610", /* 610 */
+ "611", /* 611 */
+ "612", /* 612 */
+ "613", /* 613 */
+ "614", /* 614 */
+ "615", /* 615 */
+ "616", /* 616 */
+ "617", /* 617 */
+ "618", /* 618 */
+ "619", /* 619 */
+ "620", /* 620 */
+ "621", /* 621 */
+ "622", /* 622 */
+ "623", /* 623 */
+ "624", /* 624 */
+ "625", /* 625 */
+ "626", /* 626 */
+ "627", /* 627 */
+ "628", /* 628 */
+ "629", /* 629 */
+ "630", /* 630 */
+ "631", /* 631 */
+ "632", /* 632 */
+ "633", /* 633 */
+ "634", /* 634 */
+ "635", /* 635 */
+ "636", /* 636 */
+ "637", /* 637 */
+ "638", /* 638 */
+ "639", /* 639 */
+ "640", /* 640 */
+ "641", /* 641 */
+ "642", /* 642 */
+ "643", /* 643 */
+ "644", /* 644 */
+ "645", /* 645 */
+ "646", /* 646 */
+ "647", /* 647 */
+ "648", /* 648 */
+ "649", /* 649 */
+ "650", /* 650 */
+ "651", /* 651 */
+ "652", /* 652 */
+ "653", /* 653 */
+ "654", /* 654 */
+ "655", /* 655 */
+ "656", /* 656 */
+ "657", /* 657 */
+ "658", /* 658 */
+ "659", /* 659 */
+ "660", /* 660 */
+ "661", /* 661 */
+ "662", /* 662 */
+ "663", /* 663 */
+ "664", /* 664 */
+ "665", /* 665 */
+ "666", /* 666 */
+ "667", /* 667 */
+ "668", /* 668 */
+ "669", /* 669 */
+ "670", /* 670 */
+ "671", /* 671 */
+ "672", /* 672 */
+ "673", /* 673 */
+ "674", /* 674 */
+ "675", /* 675 */
+ "676", /* 676 */
+ "677", /* 677 */
+ "678", /* 678 */
+ "679", /* 679 */
+ "680", /* 680 */
+ "681", /* 681 */
+ "682", /* 682 */
+ "683", /* 683 */
+ "684", /* 684 */
+ "685", /* 685 */
+ "686", /* 686 */
+ "687", /* 687 */
+ "688", /* 688 */
+ "689", /* 689 */
+ "690", /* 690 */
+ "691", /* 691 */
+ "692", /* 692 */
+ "693", /* 693 */
+ "694", /* 694 */
+ "695", /* 695 */
+ "696", /* 696 */
+ "697", /* 697 */
+ "698", /* 698 */
+ "699", /* 699 */
+ "700", /* 700 */
+ "701", /* 701 */
+ "702", /* 702 */
+ "703", /* 703 */
+ "704", /* 704 */
+ "705", /* 705 */
+ "706", /* 706 */
+ "707", /* 707 */
+ "708", /* 708 */
+ "709", /* 709 */
+ "710", /* 710 */
+ "711", /* 711 */
+ "712", /* 712 */
+ "713", /* 713 */
+ "714", /* 714 */
+ "715", /* 715 */
+ "716", /* 716 */
+ "717", /* 717 */
+ "718", /* 718 */
+ "719", /* 719 */
+ "720", /* 720 */
+ "721", /* 721 */
+ "722", /* 722 */
+ "723", /* 723 */
+ "724", /* 724 */
+ "725", /* 725 */
+ "726", /* 726 */
+ "727", /* 727 */
+ "728", /* 728 */
+ "729", /* 729 */
+ "730", /* 730 */
+ "731", /* 731 */
+ "732", /* 732 */
+ "733", /* 733 */
+ "734", /* 734 */
+ "735", /* 735 */
+ "736", /* 736 */
+ "737", /* 737 */
+ "738", /* 738 */
+ "739", /* 739 */
+ "740", /* 740 */
+ "741", /* 741 */
+ "742", /* 742 */
+ "743", /* 743 */
+ "744", /* 744 */
+ "745", /* 745 */
+ "746", /* 746 */
+ "747", /* 747 */
+ "748", /* 748 */
+ "749", /* 749 */
+ "750", /* 750 */
+ "751", /* 751 */
+ "752", /* 752 */
+ "753", /* 753 */
+ "754", /* 754 */
+ "755", /* 755 */
+ "756", /* 756 */
+ "757", /* 757 */
+ "758", /* 758 */
+ "759", /* 759 */
+ "760", /* 760 */
+ "761", /* 761 */
+ "762", /* 762 */
+ "763", /* 763 */
+ "764", /* 764 */
+ "765", /* 765 */
+ "766", /* 766 */
+ "767", /* 767 */
+ "768", /* 768 */
+ "769", /* 769 */
+ "770", /* 770 */
+ "771", /* 771 */
+ "772", /* 772 */
+ "773", /* 773 */
+ "774", /* 774 */
+ "775", /* 775 */
+ "776", /* 776 */
+ "777", /* 777 */
+ "778", /* 778 */
+ "779", /* 779 */
+ "780", /* 780 */
+ "781", /* 781 */
+ "782", /* 782 */
+ "783", /* 783 */
+ "784", /* 784 */
+ "785", /* 785 */
+ "786", /* 786 */
+ "787", /* 787 */
+ "788", /* 788 */
+ "789", /* 789 */
+ "790", /* 790 */
+ "791", /* 791 */
+ "792", /* 792 */
+ "793", /* 793 */
+ "794", /* 794 */
+ "795", /* 795 */
+ "796", /* 796 */
+ "797", /* 797 */
+ "798", /* 798 */
+ "799", /* 799 */
+ "800", /* 800 */
+ "801", /* 801 */
+ "802", /* 802 */
+ "803", /* 803 */
+ "804", /* 804 */
+ "805", /* 805 */
+ "806", /* 806 */
+ "807", /* 807 */
+ "808", /* 808 */
+ "809", /* 809 */
+ "810", /* 810 */
+ "811", /* 811 */
+ "812", /* 812 */
+ "813", /* 813 */
+ "814", /* 814 */
+ "815", /* 815 */
+ "816", /* 816 */
+ "817", /* 817 */
+ "818", /* 818 */
+ "819", /* 819 */
+ "820", /* 820 */
+ "821", /* 821 */
+ "822", /* 822 */
+ "823", /* 823 */
+ "824", /* 824 */
+ "825", /* 825 */
+ "826", /* 826 */
+ "827", /* 827 */
+ "828", /* 828 */
+ "829", /* 829 */
+ "830", /* 830 */
+ "831", /* 831 */
+ "832", /* 832 */
+ "833", /* 833 */
+ "834", /* 834 */
+ "835", /* 835 */
+ "836", /* 836 */
+ "837", /* 837 */
+ "838", /* 838 */
+ "839", /* 839 */
+ "840", /* 840 */
+ "841", /* 841 */
+ "842", /* 842 */
+ "843", /* 843 */
+ "844", /* 844 */
+ "845", /* 845 */
+ "846", /* 846 */
+ "847", /* 847 */
+ "848", /* 848 */
+ "849", /* 849 */
+ "850", /* 850 */
+ "851", /* 851 */
+ "852", /* 852 */
+ "853", /* 853 */
+ "854", /* 854 */
+ "855", /* 855 */
+ "856", /* 856 */
+ "857", /* 857 */
+ "858", /* 858 */
+ "859", /* 859 */
+ "860", /* 860 */
+ "861", /* 861 */
+ "862", /* 862 */
+ "863", /* 863 */
+ "864", /* 864 */
+ "865", /* 865 */
+ "866", /* 866 */
+ "867", /* 867 */
+ "868", /* 868 */
+ "869", /* 869 */
+ "870", /* 870 */
+ "871", /* 871 */
+ "872", /* 872 */
+ "873", /* 873 */
+ "874", /* 874 */
+ "875", /* 875 */
+ "876", /* 876 */
+ "877", /* 877 */
+ "878", /* 878 */
+ "879", /* 879 */
+ "880", /* 880 */
+ "881", /* 881 */
+ "882", /* 882 */
+ "883", /* 883 */
+ "884", /* 884 */
+ "885", /* 885 */
+ "886", /* 886 */
+ "887", /* 887 */
+ "888", /* 888 */
+ "889", /* 889 */
+ "890", /* 890 */
+ "891", /* 891 */
+ "892", /* 892 */
+ "893", /* 893 */
+ "894", /* 894 */
+ "895", /* 895 */
+ "896", /* 896 */
+ "897", /* 897 */
+ "898", /* 898 */
+ "899", /* 899 */
+ "900", /* 900 */
+ "901", /* 901 */
+ "902", /* 902 */
+ "903", /* 903 */
+ "904", /* 904 */
+ "905", /* 905 */
+ "906", /* 906 */
+ "907", /* 907 */
+ "908", /* 908 */
+ "909", /* 909 */
+ "910", /* 910 */
+ "911", /* 911 */
+ "912", /* 912 */
+ "913", /* 913 */
+ "914", /* 914 */
+ "915", /* 915 */
+ "916", /* 916 */
+ "917", /* 917 */
+ "918", /* 918 */
+ "919", /* 919 */
+ "920", /* 920 */
+ "921", /* 921 */
+ "922", /* 922 */
+ "923", /* 923 */
+ "924", /* 924 */
+ "925", /* 925 */
+ "926", /* 926 */
+ "927", /* 927 */
+ "928", /* 928 */
+ "929", /* 929 */
+ "930", /* 930 */
+ "931", /* 931 */
+ "932", /* 932 */
+ "933", /* 933 */
+ "934", /* 934 */
+ "935", /* 935 */
+ "936", /* 936 */
+ "937", /* 937 */
+ "938", /* 938 */
+ "939", /* 939 */
+ "940", /* 940 */
+ "941", /* 941 */
+ "942", /* 942 */
+ "943", /* 943 */
+ "944", /* 944 */
+ "945", /* 945 */
+ "946", /* 946 */
+ "947", /* 947 */
+ "948", /* 948 */
+ "949", /* 949 */
+ "950", /* 950 */
+ "951", /* 951 */
+ "952", /* 952 */
+ "953", /* 953 */
+ "954", /* 954 */
+ "955", /* 955 */
+ "956", /* 956 */
+ "957", /* 957 */
+ "958", /* 958 */
+ "959", /* 959 */
+ "960", /* 960 */
+ "961", /* 961 */
+ "962", /* 962 */
+ "963", /* 963 */
+ "964", /* 964 */
+ "965", /* 965 */
+ "966", /* 966 */
+ "967", /* 967 */
+ "968", /* 968 */
+ "969", /* 969 */
+ "970", /* 970 */
+ "971", /* 971 */
+ "972", /* 972 */
+ "973", /* 973 */
+ "974", /* 974 */
+ "975", /* 975 */
+ "976", /* 976 */
+ "977", /* 977 */
+ "978", /* 978 */
+ "979", /* 979 */
+ "980", /* 980 */
+ "981", /* 981 */
+ "982", /* 982 */
+ "983", /* 983 */
+ "984", /* 984 */
+ "985", /* 985 */
+ "986", /* 986 */
+ "987", /* 987 */
+ "988", /* 988 */
+ "989", /* 989 */
+ "990", /* 990 */
+ "991", /* 991 */
+ "992", /* 992 */
+ "993", /* 993 */
+ "994", /* 994 */
+ "995", /* 995 */
+ "996", /* 996 */
+ "997", /* 997 */
+ "998", /* 998 */
+ "999", /* 999 */
+ "1000", /* 1000 */
+ "1001", /* 1001 */
+ "1002", /* 1002 */
+ "1003", /* 1003 */
+ "1004", /* 1004 */
+ "1005", /* 1005 */
+ "1006", /* 1006 */
+ "1007", /* 1007 */
+ "1008", /* 1008 */
+ "1009", /* 1009 */
+ "1010", /* 1010 */
+ "1011", /* 1011 */
+ "1012", /* 1012 */
+ "1013", /* 1013 */
+ "1014", /* 1014 */
+ "1015", /* 1015 */
+ "1016", /* 1016 */
+ "1017", /* 1017 */
+ "1018", /* 1018 */
+ "1019", /* 1019 */
+ "1020", /* 1020 */
+ "1021", /* 1021 */
+ "1022", /* 1022 */
+ "1023", /* 1023 */
+ "ni_syscall", /* 1024 */
+ "exit", /* 1025 */
+ "read", /* 1026 */
+ "write", /* 1027 */
+ "open", /* 1028 */
+ "close", /* 1029 */
+ "creat", /* 1030 */
+ "link", /* 1031 */
+ "unlink", /* 1032 */
+ "execve", /* 1033 */
+ "chdir", /* 1034 */
+ "fchdir", /* 1035 */
+ "utimes", /* 1036 */
+ "mknod", /* 1037 */
+ "chmod", /* 1038 */
+ "chown", /* 1039 */
+ "lseek", /* 1040 */
+ "getpid", /* 1041 */
+ "getppid", /* 1042 */
+ "mount", /* 1043 */
+ "umount", /* 1044 */
+ "setuid", /* 1045 */
+ "getuid", /* 1046 */
+ "geteuid", /* 1047 */
+ "ptrace", /* 1048 */
+ "access", /* 1049 */
+ "sync", /* 1050 */
+ "fsync", /* 1051 */
+ "fdatasync", /* 1052 */
+ "kill", /* 1053 */
+ "rename", /* 1054 */
+ "mkdir", /* 1055 */
+ "rmdir", /* 1056 */
+ "dup", /* 1057 */
+ "pipe", /* 1058 */
+ "times", /* 1059 */
+ "brk", /* 1060 */
+ "setgid", /* 1061 */
+ "getgid", /* 1062 */
+ "getegid", /* 1063 */
+ "acct", /* 1064 */
+ "ioctl", /* 1065 */
+ "fcntl", /* 1066 */
+ "umask", /* 1067 */
+ "chroot", /* 1068 */
+ "ustat", /* 1069 */
+ "dup2", /* 1070 */
+ "setreuid", /* 1071 */
+ "setregid", /* 1072 */
+ "getresuid", /* 1073 */
+ "setresuid", /* 1074 */
+ "getresgid", /* 1075 */
+ "setresgid", /* 1076 */
+ "getgroups", /* 1077 */
+ "setgroups", /* 1078 */
+ "getpgid", /* 1079 */
+ "setpgid", /* 1080 */
+ "setsid", /* 1081 */
+ "getsid", /* 1082 */
+ "sethostname", /* 1083 */
+ "setrlimit", /* 1084 */
+ "getrlimit", /* 1085 */
+ "getrusage", /* 1086 */
+ "gettimeofday", /* 1087 */
+ "settimeofday", /* 1088 */
+ "select", /* 1089 */
+ "poll", /* 1090 */
+ "symlink", /* 1091 */
+ "readlink", /* 1092 */
+ "uselib", /* 1093 */
+ "swapon", /* 1094 */
+ "swapoff", /* 1095 */
+ "reboot", /* 1096 */
+ "truncate", /* 1097 */
+ "ftruncate", /* 1098 */
+ "fchmod", /* 1099 */
+ "fchown", /* 1100 */
+ "getpriority", /* 1101 */
+ "setpriority", /* 1102 */
+ "statfs", /* 1103 */
+ "fstatfs", /* 1104 */
+ "gettid", /* 1105 */
+ "semget", /* 1106 */
+ "semop", /* 1107 */
+ "semctl", /* 1108 */
+ "msgget", /* 1109 */
+ "msgsnd", /* 1110 */
+ "msgrcv", /* 1111 */
+ "msgctl", /* 1112 */
+ "shmget", /* 1113 */
+ "shmat", /* 1114 */
+ "shmdt", /* 1115 */
+ "shmctl", /* 1116 */
+ "syslog", /* 1117 */
+ "setitimer", /* 1118 */
+ "getitimer", /* 1119 */
+ "1120", /* 1120 */
+ "1121", /* 1121 */
+ "1122", /* 1122 */
+ "vhangup", /* 1123 */
+ "lchown", /* 1124 */
+ "remap_file_pages", /* 1125 */
+ "wait4", /* 1126 */
+ "sysinfo", /* 1127 */
+ "clone", /* 1128 */
+ "setdomainname", /* 1129 */
+ "uname", /* 1130 */
+ "adjtimex", /* 1131 */
+ "create_module", /* 1132 */
+ "init_module", /* 1133 */
+ "delete_module", /* 1134 */
+ "get_kernel_syms", /* 1135 */
+ "query_module", /* 1136 */
+ "quotactl", /* 1137 */
+ "bdflush", /* 1138 */
+ "sysfs", /* 1139 */
+ "personality", /* 1140 */
+ "afs_syscall", /* 1141 */
+ "setfsuid", /* 1142 */
+ "setfsgid", /* 1143 */
+ "getdents", /* 1144 */
+ "flock", /* 1145 */
+ "readv", /* 1146 */
+ "writev", /* 1147 */
+ "pread64", /* 1148 */
+ "pwrite64", /* 1149 */
+ "_sysctl", /* 1150 */
+ "mmap", /* 1151 */
+ "munmap", /* 1152 */
+ "mlock", /* 1153 */
+ "mlockall", /* 1154 */
+ "mprotect", /* 1155 */
+ "mremap", /* 1156 */
+ "msync", /* 1157 */
+ "munlock", /* 1158 */
+ "munlockall", /* 1159 */
+ "sched_getparam", /* 1160 */
+ "sched_setparam", /* 1161 */
+ "sched_getscheduler", /* 1162 */
+ "sched_setscheduler", /* 1163 */
+ "sched_yield", /* 1164 */
+ "sched_get_priority_max", /* 1165 */
+ "sched_get_priority_min", /* 1166 */
+ "sched_rr_get_interval", /* 1167 */
+ "nanosleep", /* 1168 */
+ "nfsservctl", /* 1169 */
+ "prctl", /* 1170 */
+ "1171", /* 1171 */
+ "mmap2", /* 1172 */
+ "pciconfig_read", /* 1173 */
+ "pciconfig_write", /* 1174 */
+ "perfmonctl", /* 1175 */
+ "sigaltstack", /* 1176 */
+ "rt_sigaction", /* 1177 */
+ "rt_sigpending", /* 1178 */
+ "rt_sigprocmask", /* 1179 */
+ "rt_sigqueueinfo", /* 1180 */
+ "rt_sigreturn", /* 1181 */
+ "rt_sigsuspend", /* 1182 */
+ "rt_sigtimedwait", /* 1183 */
+ "getcwd", /* 1184 */
+ "capget", /* 1185 */
+ "capset", /* 1186 */
+ "sendfile", /* 1187 */
+ "getpmsg", /* 1188 */
+ "putpmsg", /* 1189 */
+ "socket", /* 1190 */
+ "bind", /* 1191 */
+ "connect", /* 1192 */
+ "listen", /* 1193 */
+ "accept", /* 1194 */
+ "getsockname", /* 1195 */
+ "getpeername", /* 1196 */
+ "socketpair", /* 1197 */
+ "send", /* 1198 */
+ "sendto", /* 1199 */
+ "recv", /* 1200 */
+ "recvfrom", /* 1201 */
+ "shutdown", /* 1202 */
+ "setsockopt", /* 1203 */
+ "getsockopt", /* 1204 */
+ "sendmsg", /* 1205 */
+ "recvmsg", /* 1206 */
+ "pivot_root", /* 1207 */
+ "mincore", /* 1208 */
+ "madvise", /* 1209 */
+ "stat", /* 1210 */
+ "lstat", /* 1211 */
+ "fstat", /* 1212 */
+ "clone2", /* 1213 */
+ "getdents64", /* 1214 */
+ "getunwind", /* 1215 */
+ "readahead", /* 1216 */
+ "setxattr", /* 1217 */
+ "lsetxattr", /* 1218 */
+ "fsetxattr", /* 1219 */
+ "getxattr", /* 1220 */
+ "lgetxattr", /* 1221 */
+ "fgetxattr", /* 1222 */
+ "listxattr", /* 1223 */
+ "llistxattr", /* 1224 */
+ "flistxattr", /* 1225 */
+ "removexattr", /* 1226 */
+ "lremovexattr", /* 1227 */
+ "fremovexattr", /* 1228 */
+ "tkill", /* 1229 */
+ "futex", /* 1230 */
+ "sched_setaffinity", /* 1231 */
+ "sched_getaffinity", /* 1232 */
+ "set_tid_address", /* 1233 */
+ "fadvise64", /* 1234 */
+ "tgkill", /* 1235 */
+ "exit_group", /* 1236 */
+ "lookup_dcookie", /* 1237 */
+ "io_setup", /* 1238 */
+ "io_destroy", /* 1239 */
+ "io_getevents", /* 1240 */
+ "io_submit", /* 1241 */
+ "io_cancel", /* 1242 */
+ "epoll_create", /* 1243 */
+ "epoll_ctl", /* 1244 */
+ "epoll_wait", /* 1245 */
+ "restart_syscall", /* 1246 */
+ "semtimedop", /* 1247 */
+ "timer_create", /* 1248 */
+ "timer_settime", /* 1249 */
+ "timer_gettime", /* 1250 */
+ "timer_getoverrun", /* 1251 */
+ "timer_delete", /* 1252 */
+ "clock_settime", /* 1253 */
+ "clock_gettime", /* 1254 */
+ "clock_getres", /* 1255 */
+ "clock_nanosleep", /* 1256 */
+ "fstatfs64", /* 1257 */
+ "statfs64", /* 1258 */
+ "mbind", /* 1259 */
+ "get_mempolicy", /* 1260 */
+ "set_mempolicy", /* 1261 */
+ "mq_open", /* 1262 */
+ "mq_unlink", /* 1263 */
+ "mq_timedsend", /* 1264 */
+ "mq_timedreceive", /* 1265 */
+ "mq_notify", /* 1266 */
+ "mq_getsetattr", /* 1267 */
+ "kexec_load", /* 1268 */
+ "vserver", /* 1269 */
+ "waitid", /* 1270 */
+ "add_key", /* 1271 */
+ "request_key", /* 1272 */
+ "keyctl", /* 1273 */
+ "ioprio_set", /* 1274 */
+ "ioprio_get", /* 1275 */
+ "set_zone_reclaim", /* 1276 */
+ "inotify_init", /* 1277 */
+ "inotify_add_watch", /* 1278 */
+ "inotify_rm_watch", /* 1279 */
diff --git a/sysdeps/linux-gnu/ia64/trace.c b/sysdeps/linux-gnu/ia64/trace.c
index 7fa6c1e..dd7ceb2 100644
--- a/sysdeps/linux-gnu/ia64/trace.c
+++ b/sysdeps/linux-gnu/ia64/trace.c
@@ -17,32 +17,37 @@
/* What we think of as a bundle, ptrace thinks of it as two unsigned
* longs */
union bundle_t {
- /* An IA64 instruction bundle has a 5 bit header describing the
- * type of bundle, then 3 41 bit instructions
- */
+ /* An IA64 instruction bundle has a 5 bit header describing the
+ * type of bundle, then 3 41 bit instructions
+ */
struct {
struct {
- unsigned long template : 5 ;
- unsigned long slot0 : 41;
- unsigned long bot_slot1 : 18;
+ unsigned long template:5;
+ unsigned long slot0:41;
+ unsigned long bot_slot1:18;
} word0;
struct {
- unsigned long top_slot1 : 23;
- unsigned long slot2 : 41;
+ unsigned long top_slot1:23;
+ unsigned long slot2:41;
} word1;
} bitmap;
unsigned long code[2];
};
-int
-syscall_p(struct process * proc, int status, int * sysnum) {
+int syscall_p(struct process *proc, int status, int *sysnum)
+{
- if (WIFSTOPPED(status) && WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
- unsigned long slot = (ptrace (PTRACE_PEEKUSER, proc->pid, PT_CR_IPSR, 0) >> 41) & 0x3;
- unsigned long ip = ptrace(PTRACE_PEEKUSER, proc->pid, PT_CR_IIP, 0);
+ if (WIFSTOPPED(status)
+ && WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
+ unsigned long slot =
+ (ptrace(PTRACE_PEEKUSER, proc->pid, PT_CR_IPSR, 0) >> 41) &
+ 0x3;
+ unsigned long ip =
+ ptrace(PTRACE_PEEKUSER, proc->pid, PT_CR_IIP, 0);
/* r15 holds the system call number */
- unsigned long r15 = ptrace (PTRACE_PEEKUSER, proc->pid, PT_R15, 0);
+ unsigned long r15 =
+ ptrace(PTRACE_PEEKUSER, proc->pid, PT_R15, 0);
unsigned long insn;
union bundle_t bundle;
@@ -54,8 +59,8 @@
*/
if (slot == 0)
ip = ip - 16;
- bundle.code[0] = ptrace (PTRACE_PEEKTEXT, proc->pid, ip, 0);
- bundle.code[1] = ptrace (PTRACE_PEEKTEXT, proc->pid, ip+8, 0);
+ bundle.code[0] = ptrace(PTRACE_PEEKTEXT, proc->pid, ip, 0);
+ bundle.code[1] = ptrace(PTRACE_PEEKTEXT, proc->pid, ip + 8, 0);
unsigned long bot = 0UL | bundle.bitmap.word0.bot_slot1;
unsigned long top = 0UL | bundle.bitmap.word1.top_slot1;
@@ -71,7 +76,7 @@
break;
case 2:
/* make sure we're shifting about longs */
- insn = 0UL | bot | (top << 18UL);
+ insn = 0UL | bot | (top << 18UL);
break;
default:
printf("Ummm, can't find instruction slot?\n");
@@ -90,7 +95,8 @@
if (insn == 0x1000000000 || insn == 0x1ffffffffff) {
*sysnum = r15;
if (proc->callstack_depth > 0 &&
- proc->callstack[proc->callstack_depth-1].is_syscall) {
+ proc->callstack[proc->callstack_depth -
+ 1].is_syscall) {
return 2;
}
return 1;
@@ -99,42 +105,49 @@
return 0;
}
-long
-gimme_arg(enum tof type, struct process * proc, int arg_num) {
-
+long gimme_arg(enum tof type, struct process *proc, int arg_num)
+{
+
unsigned long bsp, cfm;
- bsp = ptrace (PTRACE_PEEKUSER, proc->pid, PT_AR_BSP, 0);
+ bsp = ptrace(PTRACE_PEEKUSER, proc->pid, PT_AR_BSP, 0);
cfm = ptrace(PTRACE_PEEKUSER, proc->pid, PT_CFM, 0);
- if (arg_num==-1) /* return value */
- return ptrace (PTRACE_PEEKUSER, proc->pid, PT_R8, 0);
-
+ if (arg_num == -1) /* return value */
+ return ptrace(PTRACE_PEEKUSER, proc->pid, PT_R8, 0);
+
/* First 8 arguments are passed in registers on the register
* stack, the following arguments are passed on the stack
* after a 16 byte scratch area
*/
- if (type==LT_TOF_FUNCTION || LT_TOF_FUNCTIONR) {
+ if (type == LT_TOF_FUNCTION || LT_TOF_FUNCTIONR) {
if (arg_num < 8)
- return ptrace (PTRACE_PEEKDATA, proc->pid, (long)ia64_rse_skip_regs((long*)bsp, -cfm+arg_num), 0);
+ return ptrace(PTRACE_PEEKDATA, proc->pid,
+ (long)ia64_rse_skip_regs((long *)bsp,
+ -cfm + arg_num),
+ 0);
else {
- unsigned long sp = ptrace (PTRACE_PEEKUSER, proc->pid, PT_R12, 0) + 16;
- return ptrace (PTRACE_PEEKDATA, proc->pid, sp + (8*(arg_num - 8)));
+ unsigned long sp =
+ ptrace(PTRACE_PEEKUSER, proc->pid, PT_R12, 0) + 16;
+ return ptrace(PTRACE_PEEKDATA, proc->pid,
+ sp + (8 * (arg_num - 8)));
}
}
-
- if (type==LT_TOF_SYSCALL || LT_TOF_SYSCALLR )
- return ptrace (PTRACE_PEEKDATA, proc->pid, (long)ia64_rse_skip_regs((long *) bsp, arg_num), 0);
+
+ if (type == LT_TOF_SYSCALL || LT_TOF_SYSCALLR)
+ return ptrace(PTRACE_PEEKDATA, proc->pid,
+ (long)ia64_rse_skip_regs((long *)bsp, arg_num),
+ 0);
/* error if we get here */
fprintf(stderr, "gimme_arg called with wrong arguments\n");
exit(1);
}
-void
-save_register_args(enum tof type, struct process * proc) {
+void save_register_args(enum tof type, struct process *proc)
+{
}
-void
-get_arch_dep(struct process * proc) {
+void get_arch_dep(struct process *proc)
+{
}
diff --git a/sysdeps/linux-gnu/m68k/plt.c b/sysdeps/linux-gnu/m68k/plt.c
index 54cc920..f1af366 100644
--- a/sysdeps/linux-gnu/m68k/plt.c
+++ b/sysdeps/linux-gnu/m68k/plt.c
@@ -2,14 +2,13 @@
#include "ltrace.h"
#include "elf.h"
-GElf_Addr
-arch_plt_sym_val (struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+GElf_Addr arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela)
{
- return lte->plt_addr + (ndx + 1)
- * ((lte->ehdr.e_flags & EF_CPU32) ? 24 : 12);
+ return lte->plt_addr + (ndx + 1)
+ * ((lte->ehdr.e_flags & EF_CPU32) ? 24 : 12);
}
-void * plt2addr(struct process *proc, void ** plt)
+void *plt2addr(struct process *proc, void **plt)
{
- return (void *) plt;
+ return (void *)plt;
}
diff --git a/sysdeps/linux-gnu/m68k/regs.c b/sysdeps/linux-gnu/m68k/regs.c
index 187cef5..d953d28 100644
--- a/sysdeps/linux-gnu/m68k/regs.c
+++ b/sysdeps/linux-gnu/m68k/regs.c
@@ -16,22 +16,22 @@
# define PTRACE_POKEUSER PTRACE_POKEUSR
#endif
-void *
-get_instruction_pointer(struct process * proc) {
- return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 4*PT_PC, 0);
+void *get_instruction_pointer(struct process *proc)
+{
+ return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 4 * PT_PC, 0);
}
-void
-set_instruction_pointer(struct process * proc, void * addr) {
- ptrace(PTRACE_POKEUSER, proc->pid, 4*PT_PC, addr);
+void set_instruction_pointer(struct process *proc, void *addr)
+{
+ ptrace(PTRACE_POKEUSER, proc->pid, 4 * PT_PC, addr);
}
-void *
-get_stack_pointer(struct process * proc) {
- return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 4*PT_USP, 0);
+void *get_stack_pointer(struct process *proc)
+{
+ return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, 4 * PT_USP, 0);
}
-void *
-get_return_addr(struct process * proc, void * stack_pointer) {
+void *get_return_addr(struct process *proc, void *stack_pointer)
+{
return (void *)ptrace(PTRACE_PEEKTEXT, proc->pid, stack_pointer, 0);
}
diff --git a/sysdeps/linux-gnu/m68k/signalent.h b/sysdeps/linux-gnu/m68k/signalent.h
index 5395f82..d58a36c 100644
--- a/sysdeps/linux-gnu/m68k/signalent.h
+++ b/sysdeps/linux-gnu/m68k/signalent.h
@@ -1,32 +1,32 @@
- "SIG_0", /* 0 */
- "SIGHUP", /* 1 */
- "SIGINT", /* 2 */
- "SIGQUIT", /* 3 */
- "SIGILL", /* 4 */
- "SIGTRAP", /* 5 */
- "SIGABRT", /* 6 */
- "SIGBUS", /* 7 */
- "SIGFPE", /* 8 */
- "SIGKILL", /* 9 */
- "SIGUSR1", /* 10 */
- "SIGSEGV", /* 11 */
- "SIGUSR2", /* 12 */
- "SIGPIPE", /* 13 */
- "SIGALRM", /* 14 */
- "SIGTERM", /* 15 */
- "SIGSTKFLT", /* 16 */
- "SIGCHLD", /* 17 */
- "SIGCONT", /* 18 */
- "SIGSTOP", /* 19 */
- "SIGTSTP", /* 20 */
- "SIGTTIN", /* 21 */
- "SIGTTOU", /* 22 */
- "SIGURG", /* 23 */
- "SIGXCPU", /* 24 */
- "SIGXFSZ", /* 25 */
- "SIGVTALRM", /* 26 */
- "SIGPROF", /* 27 */
- "SIGWINCH", /* 28 */
- "SIGIO", /* 29 */
- "SIGPWR", /* 30 */
- "SIGSYS", /* 31 */
+"SIG_0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGBUS", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGUSR1", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGUSR2", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGSTKFLT", /* 16 */
+ "SIGCHLD", /* 17 */
+ "SIGCONT", /* 18 */
+ "SIGSTOP", /* 19 */
+ "SIGTSTP", /* 20 */
+ "SIGTTIN", /* 21 */
+ "SIGTTOU", /* 22 */
+ "SIGURG", /* 23 */
+ "SIGXCPU", /* 24 */
+ "SIGXFSZ", /* 25 */
+ "SIGVTALRM", /* 26 */
+ "SIGPROF", /* 27 */
+ "SIGWINCH", /* 28 */
+ "SIGIO", /* 29 */
+ "SIGPWR", /* 30 */
+ "SIGSYS", /* 31 */
diff --git a/sysdeps/linux-gnu/m68k/syscallent.h b/sysdeps/linux-gnu/m68k/syscallent.h
index faef969..b303358 100644
--- a/sysdeps/linux-gnu/m68k/syscallent.h
+++ b/sysdeps/linux-gnu/m68k/syscallent.h
@@ -1,235 +1,235 @@
- "0", /* 0 */
- "exit", /* 1 */
- "fork", /* 2 */
- "read", /* 3 */
- "write", /* 4 */
- "open", /* 5 */
- "close", /* 6 */
- "waitpid", /* 7 */
- "creat", /* 8 */
- "link", /* 9 */
- "unlink", /* 10 */
- "execve", /* 11 */
- "chdir", /* 12 */
- "time", /* 13 */
- "mknod", /* 14 */
- "chmod", /* 15 */
- "chown", /* 16 */
- "break", /* 17 */
- "oldstat", /* 18 */
- "lseek", /* 19 */
- "getpid", /* 20 */
- "mount", /* 21 */
- "umount", /* 22 */
- "setuid", /* 23 */
- "getuid", /* 24 */
- "stime", /* 25 */
- "ptrace", /* 26 */
- "alarm", /* 27 */
- "oldfstat", /* 28 */
- "pause", /* 29 */
- "utime", /* 30 */
- "stty", /* 31 */
- "gtty", /* 32 */
- "access", /* 33 */
- "nice", /* 34 */
- "ftime", /* 35 */
- "sync", /* 36 */
- "kill", /* 37 */
- "rename", /* 38 */
- "mkdir", /* 39 */
- "rmdir", /* 40 */
- "dup", /* 41 */
- "pipe", /* 42 */
- "times", /* 43 */
- "prof", /* 44 */
- "brk", /* 45 */
- "setgid", /* 46 */
- "getgid", /* 47 */
- "signal", /* 48 */
- "geteuid", /* 49 */
- "getegid", /* 50 */
- "acct", /* 51 */
- "umount2", /* 52 */
- "lock", /* 53 */
- "ioctl", /* 54 */
- "fcntl", /* 55 */
- "mpx", /* 56 */
- "setpgid", /* 57 */
- "ulimit", /* 58 */
- "oldolduname", /* 59 */
- "umask", /* 60 */
- "chroot", /* 61 */
- "ustat", /* 62 */
- "dup2", /* 63 */
- "getppid", /* 64 */
- "getpgrp", /* 65 */
- "setsid", /* 66 */
- "sigaction", /* 67 */
- "sgetmask", /* 68 */
- "ssetmask", /* 69 */
- "setreuid", /* 70 */
- "setregid", /* 71 */
- "sigsuspend", /* 72 */
- "sigpending", /* 73 */
- "sethostname", /* 74 */
- "setrlimit", /* 75 */
- "getrlimit", /* 76 */
- "getrusage", /* 77 */
- "gettimeofday", /* 78 */
- "settimeofday", /* 79 */
- "getgroups", /* 80 */
- "setgroups", /* 81 */
- "select", /* 82 */
- "symlink", /* 83 */
- "oldlstat", /* 84 */
- "readlink", /* 85 */
- "uselib", /* 86 */
- "swapon", /* 87 */
- "reboot", /* 88 */
- "readdir", /* 89 */
- "mmap", /* 90 */
- "munmap", /* 91 */
- "truncate", /* 92 */
- "ftruncate", /* 93 */
- "fchmod", /* 94 */
- "fchown", /* 95 */
- "getpriority", /* 96 */
- "setpriority", /* 97 */
- "profil", /* 98 */
- "statfs", /* 99 */
- "fstatfs", /* 100 */
- "ioperm", /* 101 */
- "socketcall", /* 102 */
- "syslog", /* 103 */
- "setitimer", /* 104 */
- "getitimer", /* 105 */
- "stat", /* 106 */
- "lstat", /* 107 */
- "fstat", /* 108 */
- "olduname", /* 109 */
- "110", /* 110 */
- "vhangup", /* 111 */
- "112", /* 112 */
- "113", /* 113 */
- "wait4", /* 114 */
- "swapoff", /* 115 */
- "sysinfo", /* 116 */
- "ipc", /* 117 */
- "fsync", /* 118 */
- "sigreturn", /* 119 */
- "clone", /* 120 */
- "setdomainname", /* 121 */
- "uname", /* 122 */
- "cacheflush", /* 123 */
- "adjtimex", /* 124 */
- "mprotect", /* 125 */
- "sigprocmask", /* 126 */
- "create_module", /* 127 */
- "init_module", /* 128 */
- "delete_module", /* 129 */
- "get_kernel_syms", /* 130 */
- "quotactl", /* 131 */
- "getpgid", /* 132 */
- "fchdir", /* 133 */
- "bdflush", /* 134 */
- "sysfs", /* 135 */
- "personality", /* 136 */
- "afs_syscall", /* 137 */
- "setfsuid", /* 138 */
- "setfsgid", /* 139 */
- "_llseek", /* 140 */
- "getdents", /* 141 */
- "_newselect", /* 142 */
- "flock", /* 143 */
- "msync", /* 144 */
- "readv", /* 145 */
- "writev", /* 146 */
- "getsid", /* 147 */
- "fdatasync", /* 148 */
- "_sysctl", /* 149 */
- "mlock", /* 150 */
- "munlock", /* 151 */
- "mlockall", /* 152 */
- "munlockall", /* 153 */
- "sched_setparam", /* 154 */
- "sched_getparam", /* 155 */
- "sched_setscheduler", /* 156 */
- "sched_getscheduler", /* 157 */
- "sched_yield", /* 158 */
- "sched_get_priority_max", /* 159 */
- "sched_get_priority_min", /* 160 */
- "sched_rr_get_interval", /* 161 */
- "nanosleep", /* 162 */
- "mremap", /* 163 */
- "setresuid", /* 164 */
- "getresuid", /* 165 */
- "getpagesize", /* 166 */
- "query_module", /* 167 */
- "poll", /* 168 */
- "nfsservctl", /* 169 */
- "setresgid", /* 170 */
- "getresgid", /* 171 */
- "prctl", /* 172 */
- "rt_sigreturn", /* 173 */
- "rt_sigaction", /* 174 */
- "rt_sigprocmask", /* 175 */
- "rt_sigpending", /* 176 */
- "rt_sigtimedwait", /* 177 */
- "rt_sigqueueinfo", /* 178 */
- "rt_sigsuspend", /* 179 */
- "pread", /* 180 */
- "pwrite", /* 181 */
- "lchown", /* 182 */
- "getcwd", /* 183 */
- "capget", /* 184 */
- "capset", /* 185 */
- "sigaltstack", /* 186 */
- "sendfile", /* 187 */
- "getpmsg", /* 188 */
- "putpmsg", /* 189 */
- "vfork", /* 190 */
- "ugetrlimit", /* 191 */
- "mmap2", /* 192 */
- "truncate64", /* 193 */
- "ftruncate64", /* 194 */
- "stat64", /* 195 */
- "lstat64", /* 196 */
- "fstat64", /* 197 */
- "chown32", /* 198 */
- "getuid32", /* 199 */
- "getgid32", /* 200 */
- "geteuid32", /* 201 */
- "getegid32", /* 202 */
- "setreuid32", /* 203 */
- "setregid32", /* 204 */
- "getgroups32", /* 205 */
- "setgroups32", /* 206 */
- "fchown32", /* 207 */
- "setresuid32", /* 208 */
- "getresuid32", /* 209 */
- "setresgid32", /* 210 */
- "getresgid32", /* 211 */
- "lchown32", /* 212 */
- "setuid32", /* 213 */
- "setgid32", /* 214 */
- "setfsuid32", /* 215 */
- "setfsgid32", /* 216 */
- "pivot_root", /* 217 */
- "218", /* 218 */
- "219", /* 219 */
- "getdents64", /* 220 */
- "gettid", /* 221 */
- "tkill", /* 222 */
- "setxattr", /* 223 */
- "lsetxattr", /* 224 */
- "fsetxattr", /* 225 */
- "getxattr", /* 226 */
- "lgetxattr", /* 227 */
- "fgetxattr", /* 228 */
- "listxattr", /* 229 */
- "llistxattr", /* 230 */
- "flistxattr", /* 231 */
- "removexattr", /* 232 */
- "lremovexattr", /* 233 */
- "fremovexattr", /* 234 */
+"0", /* 0 */
+ "exit", /* 1 */
+ "fork", /* 2 */
+ "read", /* 3 */
+ "write", /* 4 */
+ "open", /* 5 */
+ "close", /* 6 */
+ "waitpid", /* 7 */
+ "creat", /* 8 */
+ "link", /* 9 */
+ "unlink", /* 10 */
+ "execve", /* 11 */
+ "chdir", /* 12 */
+ "time", /* 13 */
+ "mknod", /* 14 */
+ "chmod", /* 15 */
+ "chown", /* 16 */
+ "break", /* 17 */
+ "oldstat", /* 18 */
+ "lseek", /* 19 */
+ "getpid", /* 20 */
+ "mount", /* 21 */
+ "umount", /* 22 */
+ "setuid", /* 23 */
+ "getuid", /* 24 */
+ "stime", /* 25 */
+ "ptrace", /* 26 */
+ "alarm", /* 27 */
+ "oldfstat", /* 28 */
+ "pause", /* 29 */
+ "utime", /* 30 */
+ "stty", /* 31 */
+ "gtty", /* 32 */
+ "access", /* 33 */
+ "nice", /* 34 */
+ "ftime", /* 35 */
+ "sync", /* 36 */
+ "kill", /* 37 */
+ "rename", /* 38 */
+ "mkdir", /* 39 */
+ "rmdir", /* 40 */
+ "dup", /* 41 */
+ "pipe", /* 42 */
+ "times", /* 43 */
+ "prof", /* 44 */
+ "brk", /* 45 */
+ "setgid", /* 46 */
+ "getgid", /* 47 */
+ "signal", /* 48 */
+ "geteuid", /* 49 */
+ "getegid", /* 50 */
+ "acct", /* 51 */
+ "umount2", /* 52 */
+ "lock", /* 53 */
+ "ioctl", /* 54 */
+ "fcntl", /* 55 */
+ "mpx", /* 56 */
+ "setpgid", /* 57 */
+ "ulimit", /* 58 */
+ "oldolduname", /* 59 */
+ "umask", /* 60 */
+ "chroot", /* 61 */
+ "ustat", /* 62 */
+ "dup2", /* 63 */
+ "getppid", /* 64 */
+ "getpgrp", /* 65 */
+ "setsid", /* 66 */
+ "sigaction", /* 67 */
+ "sgetmask", /* 68 */
+ "ssetmask", /* 69 */
+ "setreuid", /* 70 */
+ "setregid", /* 71 */
+ "sigsuspend", /* 72 */
+ "sigpending", /* 73 */
+ "sethostname", /* 74 */
+ "setrlimit", /* 75 */
+ "getrlimit", /* 76 */
+ "getrusage", /* 77 */
+ "gettimeofday", /* 78 */
+ "settimeofday", /* 79 */
+ "getgroups", /* 80 */
+ "setgroups", /* 81 */
+ "select", /* 82 */
+ "symlink", /* 83 */
+ "oldlstat", /* 84 */
+ "readlink", /* 85 */
+ "uselib", /* 86 */
+ "swapon", /* 87 */
+ "reboot", /* 88 */
+ "readdir", /* 89 */
+ "mmap", /* 90 */
+ "munmap", /* 91 */
+ "truncate", /* 92 */
+ "ftruncate", /* 93 */
+ "fchmod", /* 94 */
+ "fchown", /* 95 */
+ "getpriority", /* 96 */
+ "setpriority", /* 97 */
+ "profil", /* 98 */
+ "statfs", /* 99 */
+ "fstatfs", /* 100 */
+ "ioperm", /* 101 */
+ "socketcall", /* 102 */
+ "syslog", /* 103 */
+ "setitimer", /* 104 */
+ "getitimer", /* 105 */
+ "stat", /* 106 */
+ "lstat", /* 107 */
+ "fstat", /* 108 */
+ "olduname", /* 109 */
+ "110", /* 110 */
+ "vhangup", /* 111 */
+ "112", /* 112 */
+ "113", /* 113 */
+ "wait4", /* 114 */
+ "swapoff", /* 115 */
+ "sysinfo", /* 116 */
+ "ipc", /* 117 */
+ "fsync", /* 118 */
+ "sigreturn", /* 119 */
+ "clone", /* 120 */
+ "setdomainname", /* 121 */
+ "uname", /* 122 */
+ "cacheflush", /* 123 */
+ "adjtimex", /* 124 */
+ "mprotect", /* 125 */
+ "sigprocmask", /* 126 */
+ "create_module", /* 127 */
+ "init_module", /* 128 */
+ "delete_module", /* 129 */
+ "get_kernel_syms", /* 130 */
+ "quotactl", /* 131 */
+ "getpgid", /* 132 */
+ "fchdir", /* 133 */
+ "bdflush", /* 134 */
+ "sysfs", /* 135 */
+ "personality", /* 136 */
+ "afs_syscall", /* 137 */
+ "setfsuid", /* 138 */
+ "setfsgid", /* 139 */
+ "_llseek", /* 140 */
+ "getdents", /* 141 */
+ "_newselect", /* 142 */
+ "flock", /* 143 */
+ "msync", /* 144 */
+ "readv", /* 145 */
+ "writev", /* 146 */
+ "getsid", /* 147 */
+ "fdatasync", /* 148 */
+ "_sysctl", /* 149 */
+ "mlock", /* 150 */
+ "munlock", /* 151 */
+ "mlockall", /* 152 */
+ "munlockall", /* 153 */
+ "sched_setparam", /* 154 */
+ "sched_getparam", /* 155 */
+ "sched_setscheduler", /* 156 */
+ "sched_getscheduler", /* 157 */
+ "sched_yield", /* 158 */
+ "sched_get_priority_max", /* 159 */
+ "sched_get_priority_min", /* 160 */
+ "sched_rr_get_interval", /* 161 */
+ "nanosleep", /* 162 */
+ "mremap", /* 163 */
+ "setresuid", /* 164 */
+ "getresuid", /* 165 */
+ "getpagesize", /* 166 */
+ "query_module", /* 167 */
+ "poll", /* 168 */
+ "nfsservctl", /* 169 */
+ "setresgid", /* 170 */
+ "getresgid", /* 171 */
+ "prctl", /* 172 */
+ "rt_sigreturn", /* 173 */
+ "rt_sigaction", /* 174 */
+ "rt_sigprocmask", /* 175 */
+ "rt_sigpending", /* 176 */
+ "rt_sigtimedwait", /* 177 */
+ "rt_sigqueueinfo", /* 178 */
+ "rt_sigsuspend", /* 179 */
+ "pread", /* 180 */
+ "pwrite", /* 181 */
+ "lchown", /* 182 */
+ "getcwd", /* 183 */
+ "capget", /* 184 */
+ "capset", /* 185 */
+ "sigaltstack", /* 186 */
+ "sendfile", /* 187 */
+ "getpmsg", /* 188 */
+ "putpmsg", /* 189 */
+ "vfork", /* 190 */
+ "ugetrlimit", /* 191 */
+ "mmap2", /* 192 */
+ "truncate64", /* 193 */
+ "ftruncate64", /* 194 */
+ "stat64", /* 195 */
+ "lstat64", /* 196 */
+ "fstat64", /* 197 */
+ "chown32", /* 198 */
+ "getuid32", /* 199 */
+ "getgid32", /* 200 */
+ "geteuid32", /* 201 */
+ "getegid32", /* 202 */
+ "setreuid32", /* 203 */
+ "setregid32", /* 204 */
+ "getgroups32", /* 205 */
+ "setgroups32", /* 206 */
+ "fchown32", /* 207 */
+ "setresuid32", /* 208 */
+ "getresuid32", /* 209 */
+ "setresgid32", /* 210 */
+ "getresgid32", /* 211 */
+ "lchown32", /* 212 */
+ "setuid32", /* 213 */
+ "setgid32", /* 214 */
+ "setfsuid32", /* 215 */
+ "setfsgid32", /* 216 */
+ "pivot_root", /* 217 */
+ "218", /* 218 */
+ "219", /* 219 */
+ "getdents64", /* 220 */
+ "gettid", /* 221 */
+ "tkill", /* 222 */
+ "setxattr", /* 223 */
+ "lsetxattr", /* 224 */
+ "fsetxattr", /* 225 */
+ "getxattr", /* 226 */
+ "lgetxattr", /* 227 */
+ "fgetxattr", /* 228 */
+ "listxattr", /* 229 */
+ "llistxattr", /* 230 */
+ "flistxattr", /* 231 */
+ "removexattr", /* 232 */
+ "lremovexattr", /* 233 */
+ "fremovexattr", /* 234 */
diff --git a/sysdeps/linux-gnu/m68k/trace.c b/sysdeps/linux-gnu/m68k/trace.c
index fac5fbe..0329b0a 100644
--- a/sysdeps/linux-gnu/m68k/trace.c
+++ b/sysdeps/linux-gnu/m68k/trace.c
@@ -18,24 +18,27 @@
# define PTRACE_POKEUSER PTRACE_POKEUSR
#endif
-void
-get_arch_dep(struct process * proc) {
+void get_arch_dep(struct process *proc)
+{
}
/* Returns 1 if syscall, 2 if sysret, 0 otherwise.
*/
-int
-syscall_p(struct process * proc, int status, int * sysnum) {
+int syscall_p(struct process *proc, int status, int *sysnum)
+{
int depth;
- if (WIFSTOPPED(status) && WSTOPSIG(status)==(SIGTRAP | proc->tracesysgood)) {
- *sysnum = ptrace(PTRACE_PEEKUSER, proc->pid, 4*PT_ORIG_D0, 0);
- if (*sysnum == -1) return 0;
- if (*sysnum>=0) {
+ if (WIFSTOPPED(status)
+ && WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
+ *sysnum = ptrace(PTRACE_PEEKUSER, proc->pid, 4 * PT_ORIG_D0, 0);
+ if (*sysnum == -1)
+ return 0;
+ if (*sysnum >= 0) {
depth = proc->callstack_depth;
- if (depth>0 &&
- proc->callstack[depth-1].is_syscall &&
- proc->callstack[depth-1].c_un.syscall==*sysnum) {
+ if (depth > 0 &&
+ proc->callstack[depth - 1].is_syscall &&
+ proc->callstack[depth - 1].c_un.syscall ==
+ *sysnum) {
return 2;
} else {
return 1;
@@ -45,29 +48,36 @@
return 0;
}
-long
-gimme_arg(enum tof type, struct process * proc, int arg_num) {
- if (arg_num==-1) { /* return value */
- return ptrace(PTRACE_PEEKUSER, proc->pid, 4*PT_D0, 0);
+long gimme_arg(enum tof type, struct process *proc, int arg_num)
+{
+ if (arg_num == -1) { /* return value */
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * PT_D0, 0);
}
- if (type==LT_TOF_FUNCTION || type==LT_TOF_FUNCTIONR) {
- return ptrace(PTRACE_PEEKTEXT, proc->pid, proc->stack_pointer+4*(arg_num+1), 0);
- } else if (type==LT_TOF_SYSCALL || type==LT_TOF_SYSCALLR) {
+ if (type == LT_TOF_FUNCTION || type == LT_TOF_FUNCTIONR) {
+ return ptrace(PTRACE_PEEKTEXT, proc->pid,
+ proc->stack_pointer + 4 * (arg_num + 1), 0);
+ } else if (type == LT_TOF_SYSCALL || type == LT_TOF_SYSCALLR) {
#if 0
- switch(arg_num) {
- case 0: return ptrace(PTRACE_PEEKUSER, proc->pid, 4*PT_D1, 0);
- case 1: return ptrace(PTRACE_PEEKUSER, proc->pid, 4*PT_D2, 0);
- case 2: return ptrace(PTRACE_PEEKUSER, proc->pid, 4*PT_D3, 0);
- case 3: return ptrace(PTRACE_PEEKUSER, proc->pid, 4*PT_D4, 0);
- case 4: return ptrace(PTRACE_PEEKUSER, proc->pid, 4*PT_D5, 0);
- default:
- fprintf(stderr, "gimme_arg called with wrong arguments\n");
- exit(2);
+ switch (arg_num) {
+ case 0:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * PT_D1, 0);
+ case 1:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * PT_D2, 0);
+ case 2:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * PT_D3, 0);
+ case 3:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * PT_D4, 0);
+ case 4:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * PT_D5, 0);
+ default:
+ fprintf(stderr,
+ "gimme_arg called with wrong arguments\n");
+ exit(2);
}
#else
/* That hack works on m68k, too */
- return ptrace(PTRACE_PEEKUSER, proc->pid, 4*arg_num, 0);
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * arg_num, 0);
#endif
} else {
fprintf(stderr, "gimme_arg called with wrong arguments\n");
@@ -77,6 +87,6 @@
return 0;
}
-void
-save_register_args(enum tof type, struct process * proc) {
+void save_register_args(enum tof type, struct process *proc)
+{
}
diff --git a/sysdeps/linux-gnu/ppc/plt.c b/sysdeps/linux-gnu/ppc/plt.c
index c85ea92..36c713b 100644
--- a/sysdeps/linux-gnu/ppc/plt.c
+++ b/sysdeps/linux-gnu/ppc/plt.c
@@ -5,38 +5,36 @@
#include "ptrace.h"
#include "options.h"
-GElf_Addr
-arch_plt_sym_val (struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+GElf_Addr arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela)
{
- return rela->r_offset;
+ return rela->r_offset;
}
-void * plt2addr(struct process *proc, void ** plt)
+void *plt2addr(struct process *proc, void **plt)
{
- long addr;
+ long addr;
- debug(3, 0);
+ debug(3, 0);
- if (proc->e_machine == EM_PPC || plt == 0)
- return (void *)plt;
+ if (proc->e_machine == EM_PPC || plt == 0)
+ return (void *)plt;
- if (proc->pid == 0)
- return (void *)0;
+ if (proc->pid == 0)
+ return (void *)0;
- // On a PowerPC-64 system, a plt is three 64-bit words: the first is the
- // 64-bit address of the routine. Before the PLT has been initialized, this
- // will be 0x0. In fact, the symbol table won't have the plt's address even.
- // Ater the PLT has been initialized, but before it has been resolved, the
- // first word will be the address of the function in the dynamic linker that
- // will reslove the PLT. After the PLT is resolved, this will will be the
- // address of the routine whose symbol is in the symbol table.
+ // On a PowerPC-64 system, a plt is three 64-bit words: the first is the
+ // 64-bit address of the routine. Before the PLT has been initialized, this
+ // will be 0x0. In fact, the symbol table won't have the plt's address even.
+ // Ater the PLT has been initialized, but before it has been resolved, the
+ // first word will be the address of the function in the dynamic linker that
+ // will reslove the PLT. After the PLT is resolved, this will will be the
+ // address of the routine whose symbol is in the symbol table.
- addr = ptrace(PTRACE_PEEKTEXT, proc->pid, plt);
+ addr = ptrace(PTRACE_PEEKTEXT, proc->pid, plt);
- if (opt_d >= 3) {
- xinfdump(proc->pid, plt, sizeof(void*)*3);
- }
+ if (opt_d >= 3) {
+ xinfdump(proc->pid, plt, sizeof(void *) * 3);
+ }
- return (void *)addr;
+ return (void *)addr;
}
-
diff --git a/sysdeps/linux-gnu/ppc/regs.c b/sysdeps/linux-gnu/ppc/regs.c
index a14e8d6..08aa594 100644
--- a/sysdeps/linux-gnu/ppc/regs.c
+++ b/sysdeps/linux-gnu/ppc/regs.c
@@ -16,22 +16,25 @@
# define PTRACE_POKEUSER PTRACE_POKEUSR
#endif
-void *
-get_instruction_pointer(struct process * proc) {
- return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, sizeof(long)*PT_NIP, 0);
+void *get_instruction_pointer(struct process *proc)
+{
+ return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, sizeof(long) * PT_NIP,
+ 0);
}
-void
-set_instruction_pointer(struct process * proc, void * addr) {
- ptrace(PTRACE_POKEUSER, proc->pid, sizeof(long)*PT_NIP, addr);
+void set_instruction_pointer(struct process *proc, void *addr)
+{
+ ptrace(PTRACE_POKEUSER, proc->pid, sizeof(long) * PT_NIP, addr);
}
-void *
-get_stack_pointer(struct process * proc) {
- return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, sizeof(long)*PT_R1, 0);
+void *get_stack_pointer(struct process *proc)
+{
+ return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, sizeof(long) * PT_R1,
+ 0);
}
-void *
-get_return_addr(struct process * proc, void * stack_pointer) {
- return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, sizeof(long)*PT_LNK, 0);
+void *get_return_addr(struct process *proc, void *stack_pointer)
+{
+ return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, sizeof(long) * PT_LNK,
+ 0);
}
diff --git a/sysdeps/linux-gnu/ppc/signalent.h b/sysdeps/linux-gnu/ppc/signalent.h
index 5395f82..d58a36c 100644
--- a/sysdeps/linux-gnu/ppc/signalent.h
+++ b/sysdeps/linux-gnu/ppc/signalent.h
@@ -1,32 +1,32 @@
- "SIG_0", /* 0 */
- "SIGHUP", /* 1 */
- "SIGINT", /* 2 */
- "SIGQUIT", /* 3 */
- "SIGILL", /* 4 */
- "SIGTRAP", /* 5 */
- "SIGABRT", /* 6 */
- "SIGBUS", /* 7 */
- "SIGFPE", /* 8 */
- "SIGKILL", /* 9 */
- "SIGUSR1", /* 10 */
- "SIGSEGV", /* 11 */
- "SIGUSR2", /* 12 */
- "SIGPIPE", /* 13 */
- "SIGALRM", /* 14 */
- "SIGTERM", /* 15 */
- "SIGSTKFLT", /* 16 */
- "SIGCHLD", /* 17 */
- "SIGCONT", /* 18 */
- "SIGSTOP", /* 19 */
- "SIGTSTP", /* 20 */
- "SIGTTIN", /* 21 */
- "SIGTTOU", /* 22 */
- "SIGURG", /* 23 */
- "SIGXCPU", /* 24 */
- "SIGXFSZ", /* 25 */
- "SIGVTALRM", /* 26 */
- "SIGPROF", /* 27 */
- "SIGWINCH", /* 28 */
- "SIGIO", /* 29 */
- "SIGPWR", /* 30 */
- "SIGSYS", /* 31 */
+"SIG_0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGBUS", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGUSR1", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGUSR2", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGSTKFLT", /* 16 */
+ "SIGCHLD", /* 17 */
+ "SIGCONT", /* 18 */
+ "SIGSTOP", /* 19 */
+ "SIGTSTP", /* 20 */
+ "SIGTTIN", /* 21 */
+ "SIGTTOU", /* 22 */
+ "SIGURG", /* 23 */
+ "SIGXCPU", /* 24 */
+ "SIGXFSZ", /* 25 */
+ "SIGVTALRM", /* 26 */
+ "SIGPROF", /* 27 */
+ "SIGWINCH", /* 28 */
+ "SIGIO", /* 29 */
+ "SIGPWR", /* 30 */
+ "SIGSYS", /* 31 */
diff --git a/sysdeps/linux-gnu/ppc/syscallent.h b/sysdeps/linux-gnu/ppc/syscallent.h
index 205fc4a..5ce5739 100644
--- a/sysdeps/linux-gnu/ppc/syscallent.h
+++ b/sysdeps/linux-gnu/ppc/syscallent.h
@@ -1,272 +1,272 @@
- "0", /* 0 */
- "exit", /* 1 */
- "fork", /* 2 */
- "read", /* 3 */
- "write", /* 4 */
- "open", /* 5 */
- "close", /* 6 */
- "waitpid", /* 7 */
- "creat", /* 8 */
- "link", /* 9 */
- "unlink", /* 10 */
- "execve", /* 11 */
- "chdir", /* 12 */
- "time", /* 13 */
- "mknod", /* 14 */
- "chmod", /* 15 */
- "lchown", /* 16 */
- "break", /* 17 */
- "oldstat", /* 18 */
- "lseek", /* 19 */
- "getpid", /* 20 */
- "mount", /* 21 */
- "umount", /* 22 */
- "setuid", /* 23 */
- "getuid", /* 24 */
- "stime", /* 25 */
- "ptrace", /* 26 */
- "alarm", /* 27 */
- "oldfstat", /* 28 */
- "pause", /* 29 */
- "utime", /* 30 */
- "stty", /* 31 */
- "gtty", /* 32 */
- "access", /* 33 */
- "nice", /* 34 */
- "ftime", /* 35 */
- "sync", /* 36 */
- "kill", /* 37 */
- "rename", /* 38 */
- "mkdir", /* 39 */
- "rmdir", /* 40 */
- "dup", /* 41 */
- "pipe", /* 42 */
- "times", /* 43 */
- "prof", /* 44 */
- "brk", /* 45 */
- "setgid", /* 46 */
- "getgid", /* 47 */
- "signal", /* 48 */
- "geteuid", /* 49 */
- "getegid", /* 50 */
- "acct", /* 51 */
- "umount2", /* 52 */
- "lock", /* 53 */
- "ioctl", /* 54 */
- "fcntl", /* 55 */
- "mpx", /* 56 */
- "setpgid", /* 57 */
- "ulimit", /* 58 */
- "oldolduname", /* 59 */
- "umask", /* 60 */
- "chroot", /* 61 */
- "ustat", /* 62 */
- "dup2", /* 63 */
- "getppid", /* 64 */
- "getpgrp", /* 65 */
- "setsid", /* 66 */
- "sigaction", /* 67 */
- "sgetmask", /* 68 */
- "ssetmask", /* 69 */
- "setreuid", /* 70 */
- "setregid", /* 71 */
- "sigsuspend", /* 72 */
- "sigpending", /* 73 */
- "sethostname", /* 74 */
- "setrlimit", /* 75 */
- "getrlimit", /* 76 */
- "getrusage", /* 77 */
- "gettimeofday", /* 78 */
- "settimeofday", /* 79 */
- "getgroups", /* 80 */
- "setgroups", /* 81 */
- "select", /* 82 */
- "symlink", /* 83 */
- "oldlstat", /* 84 */
- "readlink", /* 85 */
- "uselib", /* 86 */
- "swapon", /* 87 */
- "reboot", /* 88 */
- "readdir", /* 89 */
- "mmap", /* 90 */
- "munmap", /* 91 */
- "truncate", /* 92 */
- "ftruncate", /* 93 */
- "fchmod", /* 94 */
- "fchown", /* 95 */
- "getpriority", /* 96 */
- "setpriority", /* 97 */
- "profil", /* 98 */
- "statfs", /* 99 */
- "fstatfs", /* 100 */
- "ioperm", /* 101 */
- "socketcall", /* 102 */
- "syslog", /* 103 */
- "setitimer", /* 104 */
- "getitimer", /* 105 */
- "stat", /* 106 */
- "lstat", /* 107 */
- "fstat", /* 108 */
- "olduname", /* 109 */
- "iopl", /* 110 */
- "vhangup", /* 111 */
- "idle", /* 112 */
- "vm86", /* 113 */
- "wait4", /* 114 */
- "swapoff", /* 115 */
- "sysinfo", /* 116 */
- "ipc", /* 117 */
- "fsync", /* 118 */
- "sigreturn", /* 119 */
- "clone", /* 120 */
- "setdomainname", /* 121 */
- "uname", /* 122 */
- "modify_ldt", /* 123 */
- "adjtimex", /* 124 */
- "mprotect", /* 125 */
- "sigprocmask", /* 126 */
- "create_module", /* 127 */
- "init_module", /* 128 */
- "delete_module", /* 129 */
- "get_kernel_syms", /* 130 */
- "quotactl", /* 131 */
- "getpgid", /* 132 */
- "fchdir", /* 133 */
- "bdflush", /* 134 */
- "sysfs", /* 135 */
- "personality", /* 136 */
- "afs_syscall", /* 137 */
- "setfsuid", /* 138 */
- "setfsgid", /* 139 */
- "_llseek", /* 140 */
- "getdents", /* 141 */
- "_newselect", /* 142 */
- "flock", /* 143 */
- "msync", /* 144 */
- "readv", /* 145 */
- "writev", /* 146 */
- "getsid", /* 147 */
- "fdatasync", /* 148 */
- "_sysctl", /* 149 */
- "mlock", /* 150 */
- "munlock", /* 151 */
- "mlockall", /* 152 */
- "munlockall", /* 153 */
- "sched_setparam", /* 154 */
- "sched_getparam", /* 155 */
- "sched_setscheduler", /* 156 */
- "sched_getscheduler", /* 157 */
- "sched_yield", /* 158 */
- "sched_get_priority_max", /* 159 */
- "sched_get_priority_min", /* 160 */
- "sched_rr_get_interval", /* 161 */
- "nanosleep", /* 162 */
- "mremap", /* 163 */
- "setresuid", /* 164 */
- "getresuid", /* 165 */
- "query_module", /* 166 */
- "poll", /* 167 */
- "nfsservctl", /* 168 */
- "setresgid", /* 169 */
- "getresgid", /* 170 */
- "prctl", /* 171 */
- "rt_sigreturn", /* 172 */
- "rt_sigaction", /* 173 */
- "rt_sigprocmask", /* 174 */
- "rt_sigpending", /* 175 */
- "rt_sigtimedwait", /* 176 */
- "rt_sigqueueinfo", /* 177 */
- "rt_sigsuspend", /* 178 */
- "pread", /* 179 */
- "pwrite", /* 180 */
- "chown", /* 181 */
- "getcwd", /* 182 */
- "capget", /* 183 */
- "capset", /* 184 */
- "sigaltstack", /* 185 */
- "sendfile", /* 186 */
- "getpmsg", /* 187 */
- "putpmsg", /* 188 */
- "vfork", /* 189 */
- "ugetrlimit", /* 190 */
- "readahead", /* 191 */
- "mmap2", /* 192 */
- "truncate64", /* 193 */
- "ftruncate64", /* 194 */
- "stat64", /* 195 */
- "lstat64", /* 196 */
- "fstat64", /* 197 */
- "pciconfig_read", /* 198 */
- "pciconfig_write", /* 199 */
- "pciconfig_iobase", /* 200 */
- "multiplexer", /* 201 */
- "getdents64", /* 202 */
- "pivot_root", /* 203 */
- "fcntl64", /* 204 */
- "madvise", /* 205 */
- "mincore", /* 206 */
- "gettid", /* 207 */
- "tkill", /* 208 */
- "setxattr", /* 209 */
- "lsetxattr", /* 210 */
- "fsetxattr", /* 211 */
- "getxattr", /* 212 */
- "lgetxattr", /* 213 */
- "fgetxattr", /* 214 */
- "listxattr", /* 215 */
- "llistxattr", /* 216 */
- "flistxattr", /* 217 */
- "removexattr", /* 218 */
- "lremovexattr", /* 219 */
- "fremovexattr", /* 220 */
- "futex", /* 221 */
- "sched_setaffinity", /* 222 */
- "sched_getaffinity", /* 223 */
- "224", /* 224 */
- "tuxcall", /* 225 */
- "sendfile64", /* 226 */
- "io_setup", /* 227 */
- "io_destroy", /* 228 */
- "io_getevents", /* 229 */
- "io_submit", /* 230 */
- "io_cancel", /* 231 */
- "set_tid_address", /* 232 */
- "fadvise64", /* 233 */
- "exit_group", /* 234 */
- "lookup_dcookie", /* 235 */
- "epoll_create", /* 236 */
- "epoll_ctl", /* 237 */
- "epoll_wait", /* 238 */
- "remap_file_pages", /* 239 */
- "timer_create", /* 240 */
- "timer_settime", /* 241 */
- "timer_gettime", /* 242 */
- "timer_getoverrun", /* 243 */
- "timer_delete", /* 244 */
- "clock_settime", /* 245 */
- "clock_gettime", /* 246 */
- "clock_getres", /* 247 */
- "clock_nanosleep", /* 248 */
- "swapcontext", /* 249 */
- "tgkill", /* 250 */
- "utimes", /* 251 */
- "statfs64", /* 252 */
- "fstatfs64", /* 253 */
- "fadvise64_64", /* 254 */
- "rtas", /* 255 */
- "mq_open", /* 262 */
- "mq_unlink", /* 263 */
- "mq_timedsend", /* 264 */
- "mq_timedreceive", /* 265 */
- "mq_notify", /* 266 */
- "mq_getsetattr", /* 267 */
- "kexec_load", /* 268 */
- "add_key", /* 269 */
- "request_key", /* 270 */
- "keyctl", /* 271 */
- "waitid", /* 272 */
- "ioprio_set", /* 273 */
- "ioprio_get", /* 274 */
- "inotify_init", /* 275 */
- "inotify_add_watch", /* 276 */
- "inotify_rm_watch", /* 277 */
+"0", /* 0 */
+ "exit", /* 1 */
+ "fork", /* 2 */
+ "read", /* 3 */
+ "write", /* 4 */
+ "open", /* 5 */
+ "close", /* 6 */
+ "waitpid", /* 7 */
+ "creat", /* 8 */
+ "link", /* 9 */
+ "unlink", /* 10 */
+ "execve", /* 11 */
+ "chdir", /* 12 */
+ "time", /* 13 */
+ "mknod", /* 14 */
+ "chmod", /* 15 */
+ "lchown", /* 16 */
+ "break", /* 17 */
+ "oldstat", /* 18 */
+ "lseek", /* 19 */
+ "getpid", /* 20 */
+ "mount", /* 21 */
+ "umount", /* 22 */
+ "setuid", /* 23 */
+ "getuid", /* 24 */
+ "stime", /* 25 */
+ "ptrace", /* 26 */
+ "alarm", /* 27 */
+ "oldfstat", /* 28 */
+ "pause", /* 29 */
+ "utime", /* 30 */
+ "stty", /* 31 */
+ "gtty", /* 32 */
+ "access", /* 33 */
+ "nice", /* 34 */
+ "ftime", /* 35 */
+ "sync", /* 36 */
+ "kill", /* 37 */
+ "rename", /* 38 */
+ "mkdir", /* 39 */
+ "rmdir", /* 40 */
+ "dup", /* 41 */
+ "pipe", /* 42 */
+ "times", /* 43 */
+ "prof", /* 44 */
+ "brk", /* 45 */
+ "setgid", /* 46 */
+ "getgid", /* 47 */
+ "signal", /* 48 */
+ "geteuid", /* 49 */
+ "getegid", /* 50 */
+ "acct", /* 51 */
+ "umount2", /* 52 */
+ "lock", /* 53 */
+ "ioctl", /* 54 */
+ "fcntl", /* 55 */
+ "mpx", /* 56 */
+ "setpgid", /* 57 */
+ "ulimit", /* 58 */
+ "oldolduname", /* 59 */
+ "umask", /* 60 */
+ "chroot", /* 61 */
+ "ustat", /* 62 */
+ "dup2", /* 63 */
+ "getppid", /* 64 */
+ "getpgrp", /* 65 */
+ "setsid", /* 66 */
+ "sigaction", /* 67 */
+ "sgetmask", /* 68 */
+ "ssetmask", /* 69 */
+ "setreuid", /* 70 */
+ "setregid", /* 71 */
+ "sigsuspend", /* 72 */
+ "sigpending", /* 73 */
+ "sethostname", /* 74 */
+ "setrlimit", /* 75 */
+ "getrlimit", /* 76 */
+ "getrusage", /* 77 */
+ "gettimeofday", /* 78 */
+ "settimeofday", /* 79 */
+ "getgroups", /* 80 */
+ "setgroups", /* 81 */
+ "select", /* 82 */
+ "symlink", /* 83 */
+ "oldlstat", /* 84 */
+ "readlink", /* 85 */
+ "uselib", /* 86 */
+ "swapon", /* 87 */
+ "reboot", /* 88 */
+ "readdir", /* 89 */
+ "mmap", /* 90 */
+ "munmap", /* 91 */
+ "truncate", /* 92 */
+ "ftruncate", /* 93 */
+ "fchmod", /* 94 */
+ "fchown", /* 95 */
+ "getpriority", /* 96 */
+ "setpriority", /* 97 */
+ "profil", /* 98 */
+ "statfs", /* 99 */
+ "fstatfs", /* 100 */
+ "ioperm", /* 101 */
+ "socketcall", /* 102 */
+ "syslog", /* 103 */
+ "setitimer", /* 104 */
+ "getitimer", /* 105 */
+ "stat", /* 106 */
+ "lstat", /* 107 */
+ "fstat", /* 108 */
+ "olduname", /* 109 */
+ "iopl", /* 110 */
+ "vhangup", /* 111 */
+ "idle", /* 112 */
+ "vm86", /* 113 */
+ "wait4", /* 114 */
+ "swapoff", /* 115 */
+ "sysinfo", /* 116 */
+ "ipc", /* 117 */
+ "fsync", /* 118 */
+ "sigreturn", /* 119 */
+ "clone", /* 120 */
+ "setdomainname", /* 121 */
+ "uname", /* 122 */
+ "modify_ldt", /* 123 */
+ "adjtimex", /* 124 */
+ "mprotect", /* 125 */
+ "sigprocmask", /* 126 */
+ "create_module", /* 127 */
+ "init_module", /* 128 */
+ "delete_module", /* 129 */
+ "get_kernel_syms", /* 130 */
+ "quotactl", /* 131 */
+ "getpgid", /* 132 */
+ "fchdir", /* 133 */
+ "bdflush", /* 134 */
+ "sysfs", /* 135 */
+ "personality", /* 136 */
+ "afs_syscall", /* 137 */
+ "setfsuid", /* 138 */
+ "setfsgid", /* 139 */
+ "_llseek", /* 140 */
+ "getdents", /* 141 */
+ "_newselect", /* 142 */
+ "flock", /* 143 */
+ "msync", /* 144 */
+ "readv", /* 145 */
+ "writev", /* 146 */
+ "getsid", /* 147 */
+ "fdatasync", /* 148 */
+ "_sysctl", /* 149 */
+ "mlock", /* 150 */
+ "munlock", /* 151 */
+ "mlockall", /* 152 */
+ "munlockall", /* 153 */
+ "sched_setparam", /* 154 */
+ "sched_getparam", /* 155 */
+ "sched_setscheduler", /* 156 */
+ "sched_getscheduler", /* 157 */
+ "sched_yield", /* 158 */
+ "sched_get_priority_max", /* 159 */
+ "sched_get_priority_min", /* 160 */
+ "sched_rr_get_interval", /* 161 */
+ "nanosleep", /* 162 */
+ "mremap", /* 163 */
+ "setresuid", /* 164 */
+ "getresuid", /* 165 */
+ "query_module", /* 166 */
+ "poll", /* 167 */
+ "nfsservctl", /* 168 */
+ "setresgid", /* 169 */
+ "getresgid", /* 170 */
+ "prctl", /* 171 */
+ "rt_sigreturn", /* 172 */
+ "rt_sigaction", /* 173 */
+ "rt_sigprocmask", /* 174 */
+ "rt_sigpending", /* 175 */
+ "rt_sigtimedwait", /* 176 */
+ "rt_sigqueueinfo", /* 177 */
+ "rt_sigsuspend", /* 178 */
+ "pread", /* 179 */
+ "pwrite", /* 180 */
+ "chown", /* 181 */
+ "getcwd", /* 182 */
+ "capget", /* 183 */
+ "capset", /* 184 */
+ "sigaltstack", /* 185 */
+ "sendfile", /* 186 */
+ "getpmsg", /* 187 */
+ "putpmsg", /* 188 */
+ "vfork", /* 189 */
+ "ugetrlimit", /* 190 */
+ "readahead", /* 191 */
+ "mmap2", /* 192 */
+ "truncate64", /* 193 */
+ "ftruncate64", /* 194 */
+ "stat64", /* 195 */
+ "lstat64", /* 196 */
+ "fstat64", /* 197 */
+ "pciconfig_read", /* 198 */
+ "pciconfig_write", /* 199 */
+ "pciconfig_iobase", /* 200 */
+ "multiplexer", /* 201 */
+ "getdents64", /* 202 */
+ "pivot_root", /* 203 */
+ "fcntl64", /* 204 */
+ "madvise", /* 205 */
+ "mincore", /* 206 */
+ "gettid", /* 207 */
+ "tkill", /* 208 */
+ "setxattr", /* 209 */
+ "lsetxattr", /* 210 */
+ "fsetxattr", /* 211 */
+ "getxattr", /* 212 */
+ "lgetxattr", /* 213 */
+ "fgetxattr", /* 214 */
+ "listxattr", /* 215 */
+ "llistxattr", /* 216 */
+ "flistxattr", /* 217 */
+ "removexattr", /* 218 */
+ "lremovexattr", /* 219 */
+ "fremovexattr", /* 220 */
+ "futex", /* 221 */
+ "sched_setaffinity", /* 222 */
+ "sched_getaffinity", /* 223 */
+ "224", /* 224 */
+ "tuxcall", /* 225 */
+ "sendfile64", /* 226 */
+ "io_setup", /* 227 */
+ "io_destroy", /* 228 */
+ "io_getevents", /* 229 */
+ "io_submit", /* 230 */
+ "io_cancel", /* 231 */
+ "set_tid_address", /* 232 */
+ "fadvise64", /* 233 */
+ "exit_group", /* 234 */
+ "lookup_dcookie", /* 235 */
+ "epoll_create", /* 236 */
+ "epoll_ctl", /* 237 */
+ "epoll_wait", /* 238 */
+ "remap_file_pages", /* 239 */
+ "timer_create", /* 240 */
+ "timer_settime", /* 241 */
+ "timer_gettime", /* 242 */
+ "timer_getoverrun", /* 243 */
+ "timer_delete", /* 244 */
+ "clock_settime", /* 245 */
+ "clock_gettime", /* 246 */
+ "clock_getres", /* 247 */
+ "clock_nanosleep", /* 248 */
+ "swapcontext", /* 249 */
+ "tgkill", /* 250 */
+ "utimes", /* 251 */
+ "statfs64", /* 252 */
+ "fstatfs64", /* 253 */
+ "fadvise64_64", /* 254 */
+ "rtas", /* 255 */
+ "mq_open", /* 262 */
+ "mq_unlink", /* 263 */
+ "mq_timedsend", /* 264 */
+ "mq_timedreceive", /* 265 */
+ "mq_notify", /* 266 */
+ "mq_getsetattr", /* 267 */
+ "kexec_load", /* 268 */
+ "add_key", /* 269 */
+ "request_key", /* 270 */
+ "keyctl", /* 271 */
+ "waitid", /* 272 */
+ "ioprio_set", /* 273 */
+ "ioprio_get", /* 274 */
+ "inotify_init", /* 275 */
+ "inotify_add_watch", /* 276 */
+ "inotify_rm_watch", /* 277 */
diff --git a/sysdeps/linux-gnu/ppc/trace.c b/sysdeps/linux-gnu/ppc/trace.c
index f31fb35..c726889 100644
--- a/sysdeps/linux-gnu/ppc/trace.c
+++ b/sysdeps/linux-gnu/ppc/trace.c
@@ -22,27 +22,32 @@
void get_arch_dep(struct process *proc)
{
#ifdef __powerpc64__
- if (proc->arch_ptr)
- return;
- proc->mask_32bit = (proc->e_machine == EM_PPC);
- proc->arch_ptr = (void *) 1;
+ if (proc->arch_ptr)
+ return;
+ proc->mask_32bit = (proc->e_machine == EM_PPC);
+ proc->arch_ptr = (void *)1;
#endif
}
-
/* Returns 1 if syscall, 2 if sysret, 0 otherwise.
*/
#define SYSCALL_INSN 0x44000002
-int
-syscall_p(struct process * proc, int status, int * sysnum) {
- if (WIFSTOPPED(status) && WSTOPSIG(status)==(SIGTRAP | proc->tracesysgood)) {
+int syscall_p(struct process *proc, int status, int *sysnum)
+{
+ if (WIFSTOPPED(status)
+ && WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
long pc = (long)get_instruction_pointer(proc);
- int insn = (int)ptrace(PTRACE_PEEKTEXT, proc->pid, pc-sizeof(long), 0);
+ int insn =
+ (int)ptrace(PTRACE_PEEKTEXT, proc->pid, pc - sizeof(long),
+ 0);
if (insn == SYSCALL_INSN) {
- *sysnum = (int)ptrace(PTRACE_PEEKUSER, proc->pid, sizeof(long)*PT_R0, 0);
- if (proc->callstack_depth > 0 &&
- proc->callstack[proc->callstack_depth-1].is_syscall) {
+ *sysnum =
+ (int)ptrace(PTRACE_PEEKUSER, proc->pid,
+ sizeof(long) * PT_R0, 0);
+ if (proc->callstack_depth > 0
+ && proc->callstack[proc->callstack_depth -
+ 1].is_syscall) {
return 2;
}
return 1;
@@ -51,18 +56,21 @@
return 0;
}
-long
-gimme_arg(enum tof type, struct process * proc, int arg_num) {
- if (arg_num==-1) { /* return value */
- return ptrace(PTRACE_PEEKUSER, proc->pid, sizeof(long)*PT_R3, 0);
+long gimme_arg(enum tof type, struct process *proc, int arg_num)
+{
+ if (arg_num == -1) { /* return value */
+ return ptrace(PTRACE_PEEKUSER, proc->pid, sizeof(long) * PT_R3,
+ 0);
} else if (arg_num < 8) {
- return ptrace(PTRACE_PEEKUSER, proc->pid, sizeof(long)*(arg_num+PT_R3), 0);
+ return ptrace(PTRACE_PEEKUSER, proc->pid,
+ sizeof(long) * (arg_num + PT_R3), 0);
} else {
- return ptrace(PTRACE_PEEKDATA, proc->pid, proc->stack_pointer+8*(arg_num-8), 0);
+ return ptrace(PTRACE_PEEKDATA, proc->pid,
+ proc->stack_pointer + 8 * (arg_num - 8), 0);
}
return 0;
}
-void
-save_register_args(enum tof type, struct process * proc) {
+void save_register_args(enum tof type, struct process *proc)
+{
}
diff --git a/sysdeps/linux-gnu/proc.c b/sysdeps/linux-gnu/proc.c
index a5c18f6..201fb6d 100644
--- a/sysdeps/linux-gnu/proc.c
+++ b/sysdeps/linux-gnu/proc.c
@@ -13,21 +13,21 @@
* have a bit delay
*/
-#define MAX_DELAY 100000 /* 100000 microseconds = 0.1 seconds */
+#define MAX_DELAY 100000 /* 100000 microseconds = 0.1 seconds */
/*
* Returns a file name corresponding to a running pid
*/
-char *
-pid2name(pid_t pid) {
+char *pid2name(pid_t pid)
+{
char proc_exe[1024];
if (!kill(pid, 0)) {
- int delay=0;
+ int delay = 0;
sprintf(proc_exe, "/proc/%d/exe", pid);
- while(delay<MAX_DELAY) {
+ while (delay < MAX_DELAY) {
if (!access(proc_exe, F_OK)) {
return strdup(proc_exe);
}
diff --git a/sysdeps/linux-gnu/s390/plt.c b/sysdeps/linux-gnu/s390/plt.c
index 99c524d..888c285 100644
--- a/sysdeps/linux-gnu/s390/plt.c
+++ b/sysdeps/linux-gnu/s390/plt.c
@@ -2,14 +2,12 @@
#include "ltrace.h"
#include "elf.h"
-GElf_Addr
-arch_plt_sym_val (struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+GElf_Addr arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela)
{
- return lte->plt_addr + (ndx + 1) * 32;
+ return lte->plt_addr + (ndx + 1) * 32;
}
-
-void * plt2addr(struct process *proc, void ** plt)
+void *plt2addr(struct process *proc, void **plt)
{
- return (void *) plt;
+ return (void *)plt;
}
diff --git a/sysdeps/linux-gnu/s390/regs.c b/sysdeps/linux-gnu/s390/regs.c
index 3f14115..29f9514 100644
--- a/sysdeps/linux-gnu/s390/regs.c
+++ b/sysdeps/linux-gnu/s390/regs.c
@@ -28,41 +28,41 @@
#define PSW_MASK 0x7fffffff
#endif
-void *
-get_instruction_pointer(struct process * proc) {
+void *get_instruction_pointer(struct process *proc)
+{
long ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_PSWADDR, 0) & PSW_MASK;
#ifdef __s390x__
if (proc->mask_32bit)
ret &= PSW_MASK31;
#endif
- return (void *) ret;
+ return (void *)ret;
}
-void
-set_instruction_pointer(struct process * proc, void * addr) {
+void set_instruction_pointer(struct process *proc, void *addr)
+{
#ifdef __s390x__
if (proc->mask_32bit)
- addr = (void *) ((long) addr & PSW_MASK31);
+ addr = (void *)((long)addr & PSW_MASK31);
#endif
ptrace(PTRACE_POKEUSER, proc->pid, PT_PSWADDR, addr);
}
-void *
-get_stack_pointer(struct process * proc) {
+void *get_stack_pointer(struct process *proc)
+{
long ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_GPR15, 0) & PSW_MASK;
#ifdef __s390x__
if (proc->mask_32bit)
ret &= PSW_MASK31;
#endif
- return (void *) ret;
+ return (void *)ret;
}
-void *
-get_return_addr(struct process * proc, void * stack_pointer) {
+void *get_return_addr(struct process *proc, void *stack_pointer)
+{
long ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_GPR14, 0) & PSW_MASK;
#ifdef __s390x__
if (proc->mask_32bit)
ret &= PSW_MASK31;
#endif
- return (void *) ret;
+ return (void *)ret;
}
diff --git a/sysdeps/linux-gnu/s390/signalent.h b/sysdeps/linux-gnu/s390/signalent.h
index 714d56d..35b74f1 100644
--- a/sysdeps/linux-gnu/s390/signalent.h
+++ b/sysdeps/linux-gnu/s390/signalent.h
@@ -1,33 +1,33 @@
- "SIG_0", /* 0 */
- "SIGHUP", /* 1 */
- "SIGINT", /* 2 */
- "SIGQUIT", /* 3 */
- "SIGILL", /* 4 */
- "SIGTRAP", /* 5 */
- "SIGABRT", /* 6 */
- "SIGBUS", /* 7 */
- "SIGFPE", /* 8 */
- "SIGKILL", /* 9 */
- "SIGUSR1", /* 10 */
- "SIGSEGV", /* 11 */
- "SIGUSR2", /* 12 */
- "SIGPIPE", /* 13 */
- "SIGALRM", /* 14 */
- "SIGTERM", /* 15 */
- "SIGSTKFLT", /* 16 */
- "SIGCHLD", /* 17 */
- "SIGCONT", /* 18 */
- "SIGSTOP", /* 19 */
- "SIGTSTP", /* 20 */
- "SIGTTIN", /* 21 */
- "SIGTTOU", /* 22 */
- "SIGURG", /* 23 */
- "SIGXCPU", /* 24 */
- "SIGXFSZ", /* 25 */
- "SIGVTALRM", /* 26 */
- "SIGPROF", /* 27 */
- "SIGWINCH", /* 28 */
- "SIGIO", /* 29 */
- "SIGPWR", /* 30 */
- "SIGUNUSED", /* 31 */
- "SIGRTMIN", /* 32 */
+"SIG_0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGBUS", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGUSR1", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGUSR2", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGSTKFLT", /* 16 */
+ "SIGCHLD", /* 17 */
+ "SIGCONT", /* 18 */
+ "SIGSTOP", /* 19 */
+ "SIGTSTP", /* 20 */
+ "SIGTTIN", /* 21 */
+ "SIGTTOU", /* 22 */
+ "SIGURG", /* 23 */
+ "SIGXCPU", /* 24 */
+ "SIGXFSZ", /* 25 */
+ "SIGVTALRM", /* 26 */
+ "SIGPROF", /* 27 */
+ "SIGWINCH", /* 28 */
+ "SIGIO", /* 29 */
+ "SIGPWR", /* 30 */
+ "SIGUNUSED", /* 31 */
+ "SIGRTMIN", /* 32 */
diff --git a/sysdeps/linux-gnu/s390/syscalls31.h b/sysdeps/linux-gnu/s390/syscalls31.h
index 6f5876b..e49fdde 100644
--- a/sysdeps/linux-gnu/s390/syscalls31.h
+++ b/sysdeps/linux-gnu/s390/syscalls31.h
@@ -1,287 +1,283 @@
-"0",
-"exit",
-"fork",
-"read",
-"write",
-"open",
-"close",
-"7",
-"creat",
-"link",
-"unlink",
-"execve",
-"chdir",
-"time",
-"mknod",
-"chmod",
-"lchown16",
-"17",
-"18",
-"lseek",
-"getpid",
-"mount",
-"oldumount",
-"setuid16",
-"getuid16",
-"stime",
-"ptrace",
-"alarm",
-"28",
-"pause",
-"utime",
-"31",
-"32",
-"access",
-"nice",
-"35",
-"sync",
-"kill",
-"rename",
-"mkdir",
-"rmdir",
-"dup",
-"pipe",
-"times",
-"44",
-"brk",
-"setgid16",
-"getgid16",
-"signal",
-"geteuid16",
-"getegid16",
-"acct",
-"umount",
-"53",
-"ioctl",
-"fcntl",
-"56",
-"setpgid",
-"58",
-"59",
-"umask",
-"chroot",
-"ustat",
-"dup2",
-"getppid",
-"getpgrp",
-"setsid",
-"sigaction",
-"68",
-"69",
-"setreuid16",
-"setregid16",
-"sigsuspend",
-"sigpending",
-"sethostname",
-"setrlimit",
-"old_getrlimit",
-"getrusage",
-"gettimeofday",
-"settimeofday",
-"getgroups16",
-"setgroups16",
-"82",
-"symlink",
-"84",
-"readlink",
-"uselib",
-"swapon",
-"reboot",
-"89",
-"old_mmap",
-"munmap",
-"truncate",
-"ftruncate",
-"fchmod",
-"fchown16",
-"getpriority",
-"setpriority",
-"98",
-"statfs",
-"fstatfs",
-"101",
-"socketcall",
-"syslog",
-"setitimer",
-"getitimer",
-"newstat",
-"newlstat",
-"newfstat",
-"109",
-"lookup_dcookie",
-"vhangup",
-"112",
-"113",
-"wait4",
-"swapoff",
-"sysinfo",
-"ipc",
-"fsync",
-"sigreturn",
-"clone",
-"setdomainname",
-"newuname",
-"123",
-"adjtimex",
-"mprotect",
-"sigprocmask",
-"127",
-"init_module",
-"delete_module",
-"130",
-"quotactl",
-"getpgid",
-"fchdir",
-"bdflush",
-"sysfs",
-"personality",
-"137",
-"setfsuid16",
-"setfsgid16",
-"llseek",
-"getdents",
-"select",
-"flock",
-"msync",
-"readv",
-"writev",
-"getsid",
-"fdatasync",
-"sysctl",
-"mlock",
-"munlock",
-"mlockall",
-"munlockall",
-"sched_setparam",
-"sched_getparam",
-"sched_setscheduler",
-"sched_getscheduler",
-"sched_yield",
-"sched_get_priority_max",
-"sched_get_priority_min",
-"sched_rr_get_interval",
-"nanosleep",
-"mremap",
-"setresuid16",
-"getresuid16",
-"166",
-"167",
-"poll",
-"nfsservctl",
-"setresgid16",
-"getresgid16",
-"prctl",
-"rt_sigreturn",
-"rt_sigaction",
-"rt_sigprocmask",
-"rt_sigpending",
-"rt_sigtimedwait",
-"rt_sigqueueinfo",
-"rt_sigsuspend",
-"pread64",
-"pwrite64",
-"chown16",
-"getcwd",
-"capget",
-"capset",
-"sigaltstack",
-"sendfile",
-"188",
-"189",
-"vfork",
-"getrlimit",
-"mmap2",
-"truncate64",
-"ftruncate64",
-"stat64",
-"lstat64",
-"fstat64",
-"lchown",
-"getuid",
-"getgid",
-"geteuid",
-"getegid",
-"setreuid",
-"setregid",
-"getgroups",
-"setgroups",
-"fchown",
-"setresuid",
-"getresuid",
-"setresgid",
-"getresgid",
-"chown",
-"setuid",
-"setgid",
-"setfsuid",
-"setfsgid",
-"pivot_root",
-"mincore",
-"madvise",
-"getdents64",
-"fcntl64",
-"readahead",
-"sendfile64",
-"setxattr",
-"lsetxattr",
-"fsetxattr",
-"getxattr",
-"lgetxattr",
-"fgetxattr",
-"listxattr",
-"llistxattr",
-"flistxattr",
-"removexattr",
-"lremovexattr",
-"fremovexattr",
-"gettid",
-"tkill",
-"futex",
-"sched_setaffinity",
-"sched_getaffinity",
-"tgkill",
-"242",
-"io_setup",
-"io_destroy",
-"io_getevents",
-"io_submit",
-"io_cancel",
-"exit_group",
-"epoll_create",
-"epoll_ctl",
-"epoll_wait",
-"set_tid_address",
-"fadvise64",
-"timer_create",
-"timer_settime",
-"timer_gettime",
-"timer_getoverrun",
-"timer_delete",
-"clock_settime",
-"clock_gettime",
-"clock_getres",
-"clock_nanosleep",
-"263",
-"fadvise64_64",
-"statfs64",
-"fstatfs64",
-"remap_file_pages",
-"268",
-"269",
-"270",
-"mq_open",
-"mq_unlink",
-"mq_timedsend",
-"mq_timedreceive",
-"mq_notify",
-"mq_getsetattr",
-"kexec_load",
-"add_key",
-"request_key",
-"keyctl",
-"waitid",
-"ioprio_set",
-"ioprio_get",
-"inotify_init",
-"inotify_add_watch",
-"inotify_rm_watch",
+"0", "exit",
+ "fork",
+ "read",
+ "write",
+ "open",
+ "close",
+ "7",
+ "creat",
+ "link",
+ "unlink",
+ "execve",
+ "chdir",
+ "time",
+ "mknod",
+ "chmod",
+ "lchown16",
+ "17",
+ "18",
+ "lseek",
+ "getpid",
+ "mount",
+ "oldumount",
+ "setuid16",
+ "getuid16",
+ "stime",
+ "ptrace",
+ "alarm",
+ "28",
+ "pause",
+ "utime",
+ "31",
+ "32",
+ "access",
+ "nice",
+ "35",
+ "sync",
+ "kill",
+ "rename",
+ "mkdir",
+ "rmdir",
+ "dup",
+ "pipe",
+ "times",
+ "44",
+ "brk",
+ "setgid16",
+ "getgid16",
+ "signal",
+ "geteuid16",
+ "getegid16",
+ "acct",
+ "umount",
+ "53",
+ "ioctl",
+ "fcntl",
+ "56",
+ "setpgid",
+ "58",
+ "59",
+ "umask",
+ "chroot",
+ "ustat",
+ "dup2",
+ "getppid",
+ "getpgrp",
+ "setsid",
+ "sigaction",
+ "68",
+ "69",
+ "setreuid16",
+ "setregid16",
+ "sigsuspend",
+ "sigpending",
+ "sethostname",
+ "setrlimit",
+ "old_getrlimit",
+ "getrusage",
+ "gettimeofday",
+ "settimeofday",
+ "getgroups16",
+ "setgroups16",
+ "82",
+ "symlink",
+ "84",
+ "readlink",
+ "uselib",
+ "swapon",
+ "reboot",
+ "89",
+ "old_mmap",
+ "munmap",
+ "truncate",
+ "ftruncate",
+ "fchmod",
+ "fchown16",
+ "getpriority",
+ "setpriority",
+ "98",
+ "statfs",
+ "fstatfs",
+ "101",
+ "socketcall",
+ "syslog",
+ "setitimer",
+ "getitimer",
+ "newstat",
+ "newlstat",
+ "newfstat",
+ "109",
+ "lookup_dcookie",
+ "vhangup",
+ "112",
+ "113",
+ "wait4",
+ "swapoff",
+ "sysinfo",
+ "ipc",
+ "fsync",
+ "sigreturn",
+ "clone",
+ "setdomainname",
+ "newuname",
+ "123",
+ "adjtimex",
+ "mprotect",
+ "sigprocmask",
+ "127",
+ "init_module",
+ "delete_module",
+ "130",
+ "quotactl",
+ "getpgid",
+ "fchdir",
+ "bdflush",
+ "sysfs",
+ "personality",
+ "137",
+ "setfsuid16",
+ "setfsgid16",
+ "llseek",
+ "getdents",
+ "select",
+ "flock",
+ "msync",
+ "readv",
+ "writev",
+ "getsid",
+ "fdatasync",
+ "sysctl",
+ "mlock",
+ "munlock",
+ "mlockall",
+ "munlockall",
+ "sched_setparam",
+ "sched_getparam",
+ "sched_setscheduler",
+ "sched_getscheduler",
+ "sched_yield",
+ "sched_get_priority_max",
+ "sched_get_priority_min",
+ "sched_rr_get_interval",
+ "nanosleep",
+ "mremap",
+ "setresuid16",
+ "getresuid16",
+ "166",
+ "167",
+ "poll",
+ "nfsservctl",
+ "setresgid16",
+ "getresgid16",
+ "prctl",
+ "rt_sigreturn",
+ "rt_sigaction",
+ "rt_sigprocmask",
+ "rt_sigpending",
+ "rt_sigtimedwait",
+ "rt_sigqueueinfo",
+ "rt_sigsuspend",
+ "pread64",
+ "pwrite64",
+ "chown16",
+ "getcwd",
+ "capget",
+ "capset",
+ "sigaltstack",
+ "sendfile",
+ "188",
+ "189",
+ "vfork",
+ "getrlimit",
+ "mmap2",
+ "truncate64",
+ "ftruncate64",
+ "stat64",
+ "lstat64",
+ "fstat64",
+ "lchown",
+ "getuid",
+ "getgid",
+ "geteuid",
+ "getegid",
+ "setreuid",
+ "setregid",
+ "getgroups",
+ "setgroups",
+ "fchown",
+ "setresuid",
+ "getresuid",
+ "setresgid",
+ "getresgid",
+ "chown",
+ "setuid",
+ "setgid",
+ "setfsuid",
+ "setfsgid",
+ "pivot_root",
+ "mincore",
+ "madvise",
+ "getdents64",
+ "fcntl64",
+ "readahead",
+ "sendfile64",
+ "setxattr",
+ "lsetxattr",
+ "fsetxattr",
+ "getxattr",
+ "lgetxattr",
+ "fgetxattr",
+ "listxattr",
+ "llistxattr",
+ "flistxattr",
+ "removexattr",
+ "lremovexattr",
+ "fremovexattr",
+ "gettid",
+ "tkill",
+ "futex",
+ "sched_setaffinity",
+ "sched_getaffinity",
+ "tgkill",
+ "242",
+ "io_setup",
+ "io_destroy",
+ "io_getevents",
+ "io_submit",
+ "io_cancel",
+ "exit_group",
+ "epoll_create",
+ "epoll_ctl",
+ "epoll_wait",
+ "set_tid_address",
+ "fadvise64",
+ "timer_create",
+ "timer_settime",
+ "timer_gettime",
+ "timer_getoverrun",
+ "timer_delete",
+ "clock_settime",
+ "clock_gettime",
+ "clock_getres",
+ "clock_nanosleep",
+ "263",
+ "fadvise64_64",
+ "statfs64",
+ "fstatfs64",
+ "remap_file_pages",
+ "268",
+ "269",
+ "270",
+ "mq_open",
+ "mq_unlink",
+ "mq_timedsend",
+ "mq_timedreceive",
+ "mq_notify",
+ "mq_getsetattr",
+ "kexec_load",
+ "add_key",
+ "request_key",
+ "keyctl",
+ "waitid",
+ "ioprio_set",
+ "ioprio_get", "inotify_init", "inotify_add_watch", "inotify_rm_watch",
diff --git a/sysdeps/linux-gnu/s390/syscalls64.h b/sysdeps/linux-gnu/s390/syscalls64.h
index 8d48c71..2834129 100644
--- a/sysdeps/linux-gnu/s390/syscalls64.h
+++ b/sysdeps/linux-gnu/s390/syscalls64.h
@@ -1,287 +1,283 @@
-"0",
-"exit",
-"fork",
-"read",
-"write",
-"open",
-"close",
-"7",
-"creat",
-"link",
-"unlink",
-"execve",
-"chdir",
-"13",
-"mknod",
-"chmod",
-"16",
-"17",
-"18",
-"lseek",
-"getpid",
-"mount",
-"oldumount",
-"23",
-"24",
-"25",
-"ptrace",
-"alarm",
-"28",
-"pause",
-"utime",
-"31",
-"32",
-"access",
-"nice",
-"35",
-"sync",
-"kill",
-"rename",
-"mkdir",
-"rmdir",
-"dup",
-"pipe",
-"times",
-"44",
-"brk",
-"46",
-"47",
-"signal",
-"49",
-"50",
-"acct",
-"umount",
-"53",
-"ioctl",
-"fcntl",
-"56",
-"setpgid",
-"58",
-"59",
-"umask",
-"chroot",
-"ustat",
-"dup2",
-"getppid",
-"getpgrp",
-"setsid",
-"sigaction",
-"68",
-"69",
-"70",
-"71",
-"sigsuspend",
-"sigpending",
-"sethostname",
-"setrlimit",
-"getrlimit",
-"getrusage",
-"gettimeofday",
-"settimeofday",
-"80",
-"81",
-"82",
-"symlink",
-"84",
-"readlink",
-"uselib",
-"swapon",
-"reboot",
-"89",
-"old_mmap",
-"munmap",
-"truncate",
-"ftruncate",
-"fchmod",
-"95",
-"getpriority",
-"setpriority",
-"98",
-"statfs",
-"fstatfs",
-"101",
-"socketcall",
-"syslog",
-"setitimer",
-"getitimer",
-"newstat",
-"newlstat",
-"newfstat",
-"109",
-"lookup_dcookie",
-"vhangup",
-"112",
-"113",
-"wait4",
-"swapoff",
-"sysinfo",
-"ipc",
-"fsync",
-"sigreturn",
-"clone",
-"setdomainname",
-"newuname",
-"123",
-"adjtimex",
-"mprotect",
-"sigprocmask",
-"127",
-"init_module",
-"delete_module",
-"130",
-"quotactl",
-"getpgid",
-"fchdir",
-"bdflush",
-"sysfs",
-"personality",
-"137",
-"138",
-"139",
-"llseek",
-"getdents",
-"select",
-"flock",
-"msync",
-"readv",
-"writev",
-"getsid",
-"fdatasync",
-"sysctl",
-"mlock",
-"munlock",
-"mlockall",
-"munlockall",
-"sched_setparam",
-"sched_getparam",
-"sched_setscheduler",
-"sched_getscheduler",
-"sched_yield",
-"sched_get_priority_max",
-"sched_get_priority_min",
-"sched_rr_get_interval",
-"nanosleep",
-"mremap",
-"164",
-"165",
-"166",
-"167",
-"poll",
-"nfsservctl",
-"170",
-"171",
-"prctl",
-"rt_sigreturn",
-"rt_sigaction",
-"rt_sigprocmask",
-"rt_sigpending",
-"rt_sigtimedwait",
-"rt_sigqueueinfo",
-"rt_sigsuspend",
-"pread64",
-"pwrite64",
-"182",
-"getcwd",
-"capget",
-"capset",
-"sigaltstack",
-"sendfile64",
-"188",
-"189",
-"vfork",
-"getrlimit",
-"mmap2",
-"193",
-"194",
-"195",
-"196",
-"197",
-"lchown",
-"getuid",
-"getgid",
-"geteuid",
-"getegid",
-"setreuid",
-"setregid",
-"getgroups",
-"setgroups",
-"fchown",
-"setresuid",
-"getresuid",
-"setresgid",
-"getresgid",
-"chown",
-"setuid",
-"setgid",
-"setfsuid",
-"setfsgid",
-"pivot_root",
-"mincore",
-"madvise",
-"getdents64",
-"221",
-"readahead",
-"223",
-"setxattr",
-"lsetxattr",
-"fsetxattr",
-"getxattr",
-"lgetxattr",
-"fgetxattr",
-"listxattr",
-"llistxattr",
-"flistxattr",
-"removexattr",
-"lremovexattr",
-"fremovexattr",
-"gettid",
-"tkill",
-"futex",
-"sched_setaffinity",
-"sched_getaffinity",
-"tgkill",
-"242",
-"io_setup",
-"io_destroy",
-"io_getevents",
-"io_submit",
-"io_cancel",
-"exit_group",
-"epoll_create",
-"epoll_ctl",
-"epoll_wait",
-"set_tid_address",
-"fadvise64_64",
-"timer_create",
-"timer_settime",
-"timer_gettime",
-"timer_getoverrun",
-"timer_delete",
-"clock_settime",
-"clock_gettime",
-"clock_getres",
-"clock_nanosleep",
-"263",
-"264",
-"statfs64",
-"fstatfs64",
-"remap_file_pages",
-"268",
-"269",
-"270",
-"mq_open",
-"mq_unlink",
-"mq_timedsend",
-"mq_timedreceive",
-"mq_notify",
-"mq_getsetattr",
-"kexec_load",
-"add_key",
-"request_key",
-"keyctl",
-"waitid",
-"ioprio_set",
-"ioprio_get",
-"inotify_init",
-"inotify_add_watch",
-"inotify_rm_watch",
+"0", "exit",
+ "fork",
+ "read",
+ "write",
+ "open",
+ "close",
+ "7",
+ "creat",
+ "link",
+ "unlink",
+ "execve",
+ "chdir",
+ "13",
+ "mknod",
+ "chmod",
+ "16",
+ "17",
+ "18",
+ "lseek",
+ "getpid",
+ "mount",
+ "oldumount",
+ "23",
+ "24",
+ "25",
+ "ptrace",
+ "alarm",
+ "28",
+ "pause",
+ "utime",
+ "31",
+ "32",
+ "access",
+ "nice",
+ "35",
+ "sync",
+ "kill",
+ "rename",
+ "mkdir",
+ "rmdir",
+ "dup",
+ "pipe",
+ "times",
+ "44",
+ "brk",
+ "46",
+ "47",
+ "signal",
+ "49",
+ "50",
+ "acct",
+ "umount",
+ "53",
+ "ioctl",
+ "fcntl",
+ "56",
+ "setpgid",
+ "58",
+ "59",
+ "umask",
+ "chroot",
+ "ustat",
+ "dup2",
+ "getppid",
+ "getpgrp",
+ "setsid",
+ "sigaction",
+ "68",
+ "69",
+ "70",
+ "71",
+ "sigsuspend",
+ "sigpending",
+ "sethostname",
+ "setrlimit",
+ "getrlimit",
+ "getrusage",
+ "gettimeofday",
+ "settimeofday",
+ "80",
+ "81",
+ "82",
+ "symlink",
+ "84",
+ "readlink",
+ "uselib",
+ "swapon",
+ "reboot",
+ "89",
+ "old_mmap",
+ "munmap",
+ "truncate",
+ "ftruncate",
+ "fchmod",
+ "95",
+ "getpriority",
+ "setpriority",
+ "98",
+ "statfs",
+ "fstatfs",
+ "101",
+ "socketcall",
+ "syslog",
+ "setitimer",
+ "getitimer",
+ "newstat",
+ "newlstat",
+ "newfstat",
+ "109",
+ "lookup_dcookie",
+ "vhangup",
+ "112",
+ "113",
+ "wait4",
+ "swapoff",
+ "sysinfo",
+ "ipc",
+ "fsync",
+ "sigreturn",
+ "clone",
+ "setdomainname",
+ "newuname",
+ "123",
+ "adjtimex",
+ "mprotect",
+ "sigprocmask",
+ "127",
+ "init_module",
+ "delete_module",
+ "130",
+ "quotactl",
+ "getpgid",
+ "fchdir",
+ "bdflush",
+ "sysfs",
+ "personality",
+ "137",
+ "138",
+ "139",
+ "llseek",
+ "getdents",
+ "select",
+ "flock",
+ "msync",
+ "readv",
+ "writev",
+ "getsid",
+ "fdatasync",
+ "sysctl",
+ "mlock",
+ "munlock",
+ "mlockall",
+ "munlockall",
+ "sched_setparam",
+ "sched_getparam",
+ "sched_setscheduler",
+ "sched_getscheduler",
+ "sched_yield",
+ "sched_get_priority_max",
+ "sched_get_priority_min",
+ "sched_rr_get_interval",
+ "nanosleep",
+ "mremap",
+ "164",
+ "165",
+ "166",
+ "167",
+ "poll",
+ "nfsservctl",
+ "170",
+ "171",
+ "prctl",
+ "rt_sigreturn",
+ "rt_sigaction",
+ "rt_sigprocmask",
+ "rt_sigpending",
+ "rt_sigtimedwait",
+ "rt_sigqueueinfo",
+ "rt_sigsuspend",
+ "pread64",
+ "pwrite64",
+ "182",
+ "getcwd",
+ "capget",
+ "capset",
+ "sigaltstack",
+ "sendfile64",
+ "188",
+ "189",
+ "vfork",
+ "getrlimit",
+ "mmap2",
+ "193",
+ "194",
+ "195",
+ "196",
+ "197",
+ "lchown",
+ "getuid",
+ "getgid",
+ "geteuid",
+ "getegid",
+ "setreuid",
+ "setregid",
+ "getgroups",
+ "setgroups",
+ "fchown",
+ "setresuid",
+ "getresuid",
+ "setresgid",
+ "getresgid",
+ "chown",
+ "setuid",
+ "setgid",
+ "setfsuid",
+ "setfsgid",
+ "pivot_root",
+ "mincore",
+ "madvise",
+ "getdents64",
+ "221",
+ "readahead",
+ "223",
+ "setxattr",
+ "lsetxattr",
+ "fsetxattr",
+ "getxattr",
+ "lgetxattr",
+ "fgetxattr",
+ "listxattr",
+ "llistxattr",
+ "flistxattr",
+ "removexattr",
+ "lremovexattr",
+ "fremovexattr",
+ "gettid",
+ "tkill",
+ "futex",
+ "sched_setaffinity",
+ "sched_getaffinity",
+ "tgkill",
+ "242",
+ "io_setup",
+ "io_destroy",
+ "io_getevents",
+ "io_submit",
+ "io_cancel",
+ "exit_group",
+ "epoll_create",
+ "epoll_ctl",
+ "epoll_wait",
+ "set_tid_address",
+ "fadvise64_64",
+ "timer_create",
+ "timer_settime",
+ "timer_gettime",
+ "timer_getoverrun",
+ "timer_delete",
+ "clock_settime",
+ "clock_gettime",
+ "clock_getres",
+ "clock_nanosleep",
+ "263",
+ "264",
+ "statfs64",
+ "fstatfs64",
+ "remap_file_pages",
+ "268",
+ "269",
+ "270",
+ "mq_open",
+ "mq_unlink",
+ "mq_timedsend",
+ "mq_timedreceive",
+ "mq_notify",
+ "mq_getsetattr",
+ "kexec_load",
+ "add_key",
+ "request_key",
+ "keyctl",
+ "waitid",
+ "ioprio_set",
+ "ioprio_get", "inotify_init", "inotify_add_watch", "inotify_rm_watch",
diff --git a/sysdeps/linux-gnu/s390/trace.c b/sysdeps/linux-gnu/s390/trace.c
index e0e55a4..7da28f1 100644
--- a/sysdeps/linux-gnu/s390/trace.c
+++ b/sysdeps/linux-gnu/s390/trace.c
@@ -29,8 +29,8 @@
# define PTRACE_POKEUSER PTRACE_POKEUSR
#endif
-void
-get_arch_dep(struct process * proc) {
+void get_arch_dep(struct process *proc)
+{
#ifdef __s390x__
unsigned long psw;
@@ -44,22 +44,24 @@
proc->personality = 1;
}
- proc->arch_ptr = (void *) 1;
+ proc->arch_ptr = (void *)1;
#endif
}
/* Returns 1 if syscall, 2 if sysret, 0 otherwise.
*/
-int
-syscall_p(struct process * proc, int status, int * sysnum) {
+int syscall_p(struct process *proc, int status, int *sysnum)
+{
long pc, opcode, offset_reg, scno, tmp;
void *svc_addr;
- int gpr_offset[16] = {PT_GPR0, PT_GPR1, PT_ORIGGPR2, PT_GPR3,
- PT_GPR4, PT_GPR5, PT_GPR6, PT_GPR7,
- PT_GPR8, PT_GPR9, PT_GPR10, PT_GPR11,
- PT_GPR12, PT_GPR13, PT_GPR14, PT_GPR15};
+ int gpr_offset[16] = { PT_GPR0, PT_GPR1, PT_ORIGGPR2, PT_GPR3,
+ PT_GPR4, PT_GPR5, PT_GPR6, PT_GPR7,
+ PT_GPR8, PT_GPR9, PT_GPR10, PT_GPR11,
+ PT_GPR12, PT_GPR13, PT_GPR14, PT_GPR15
+ };
- if (WIFSTOPPED(status) && WSTOPSIG(status)==(SIGTRAP | proc->tracesysgood)) {
+ if (WIFSTOPPED(status)
+ && WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
/*
* If we have PTRACE_O_TRACESYSGOOD and we have the new style
@@ -72,9 +74,12 @@
if (proc->tracesysgood) {
/* System call was encountered... */
if (proc->callstack_depth > 0 &&
- proc->callstack[proc->callstack_depth-1].is_syscall) {
+ proc->callstack[proc->callstack_depth -
+ 1].is_syscall) {
/* syscall exit */
- *sysnum = proc->callstack[proc->callstack_depth-1].c_un.syscall;
+ *sysnum =
+ proc->callstack[proc->callstack_depth -
+ 1].c_un.syscall;
return 2;
} else {
/* syscall enter */
@@ -82,7 +87,7 @@
return 1;
}
}
-
+
/*
* At least one of the two requirements mentioned above is not
* met. Therefore the fun part starts here:
@@ -96,19 +101,17 @@
pc = ptrace(PTRACE_PEEKUSER, proc->pid, PT_PSWADDR, 0);
opcode = ptrace(PTRACE_PEEKTEXT, proc->pid,
- (char *)(pc-sizeof(long)),0);
+ (char *)(pc - sizeof(long)), 0);
if ((opcode & 0xffff) == 0x0001) {
/* Breakpoint */
return 0;
- }
- else if ((opcode & 0xff00) == 0x0a00) {
+ } else if ((opcode & 0xff00) == 0x0a00) {
/* SVC opcode */
scno = opcode & 0xff;
- }
- else if ((opcode & 0xff000000) == 0x44000000) {
+ } else if ((opcode & 0xff000000) == 0x44000000) {
/* Instruction decoding of EXECUTE... */
- svc_addr = (void *) (opcode & 0xfff);
+ svc_addr = (void *)(opcode & 0xfff);
offset_reg = (opcode & 0x000f0000) >> 16;
if (offset_reg)
@@ -136,8 +139,7 @@
gpr_offset[offset_reg], 0);
scno = (scno | tmp) & 0xff;
- }
- else {
+ } else {
/* No opcode related to syscall handling */
return 0;
}
@@ -149,7 +151,7 @@
/* System call was encountered... */
if (proc->callstack_depth > 0 &&
- proc->callstack[proc->callstack_depth-1].is_syscall) {
+ proc->callstack[proc->callstack_depth - 1].is_syscall) {
return 2;
} else {
return 1;
@@ -159,27 +161,32 @@
return 0;
}
-long
-gimme_arg(enum tof type, struct process * proc, int arg_num) {
+long gimme_arg(enum tof type, struct process *proc, int arg_num)
+{
long ret;
- switch(arg_num) {
- case -1: /* return value */
- ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_GPR2, 0);
- break;
- case 0: ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_ORIGGPR2, 0);
- break;
- case 1: ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_GPR3, 0);
- break;
- case 2: ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_GPR4, 0);
- break;
- case 3: ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_GPR5, 0);
- break;
- case 4: ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_GPR6, 0);
- break;
- default:
- fprintf(stderr, "gimme_arg called with wrong arguments\n");
- exit(2);
+ switch (arg_num) {
+ case -1: /* return value */
+ ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_GPR2, 0);
+ break;
+ case 0:
+ ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_ORIGGPR2, 0);
+ break;
+ case 1:
+ ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_GPR3, 0);
+ break;
+ case 2:
+ ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_GPR4, 0);
+ break;
+ case 3:
+ ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_GPR5, 0);
+ break;
+ case 4:
+ ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_GPR6, 0);
+ break;
+ default:
+ fprintf(stderr, "gimme_arg called with wrong arguments\n");
+ exit(2);
}
#ifdef __s390x__
if (proc->mask_32bit)
@@ -188,6 +195,6 @@
return ret;
}
-void
-save_register_args(enum tof type, struct process * proc) {
+void save_register_args(enum tof type, struct process *proc)
+{
}
diff --git a/sysdeps/linux-gnu/sparc/plt.c b/sysdeps/linux-gnu/sparc/plt.c
index e39bb58..68343b9 100644
--- a/sysdeps/linux-gnu/sparc/plt.c
+++ b/sysdeps/linux-gnu/sparc/plt.c
@@ -2,13 +2,12 @@
#include "ltrace.h"
#include "elf.h"
-GElf_Addr
-arch_plt_sym_val (struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+GElf_Addr arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela)
{
- return rela->r_offset + 4;
+ return rela->r_offset + 4;
}
-void * plt2addr(struct process *proc, void ** plt)
+void *plt2addr(struct process *proc, void **plt)
{
- return (void *) plt;
+ return (void *)plt;
}
diff --git a/sysdeps/linux-gnu/sparc/regs.c b/sysdeps/linux-gnu/sparc/regs.c
index 78efec3..1f2861a 100644
--- a/sysdeps/linux-gnu/sparc/regs.c
+++ b/sysdeps/linux-gnu/sparc/regs.c
@@ -6,32 +6,32 @@
#include "ptrace.h"
#include "ltrace.h"
-void *
-get_instruction_pointer(struct process * proc) {
- proc_archdep *a = (proc_archdep *)(proc->arch_ptr);
+void *get_instruction_pointer(struct process *proc)
+{
+ proc_archdep *a = (proc_archdep *) (proc->arch_ptr);
if (a->valid)
return (void *)a->regs.r_pc;
return (void *)-1;
}
-void
-set_instruction_pointer(struct process * proc, void * addr) {
- proc_archdep *a = (proc_archdep *)(proc->arch_ptr);
+void set_instruction_pointer(struct process *proc, void *addr)
+{
+ proc_archdep *a = (proc_archdep *) (proc->arch_ptr);
if (a->valid)
a->regs.r_pc = (long)addr;
}
-void *
-get_stack_pointer(struct process * proc) {
- proc_archdep *a = (proc_archdep *)(proc->arch_ptr);
+void *get_stack_pointer(struct process *proc)
+{
+ proc_archdep *a = (proc_archdep *) (proc->arch_ptr);
if (a->valid)
return (void *)a->regs.r_o6;
return (void *)-1;
}
-void *
-get_return_addr(struct process * proc, void * stack_pointer) {
- proc_archdep *a = (proc_archdep *)(proc->arch_ptr);
+void *get_return_addr(struct process *proc, void *stack_pointer)
+{
+ proc_archdep *a = (proc_archdep *) (proc->arch_ptr);
unsigned int t;
if (!a->valid)
return (void *)-1;
diff --git a/sysdeps/linux-gnu/sparc/signalent.h b/sysdeps/linux-gnu/sparc/signalent.h
index 53baf5b..d30f69e 100644
--- a/sysdeps/linux-gnu/sparc/signalent.h
+++ b/sysdeps/linux-gnu/sparc/signalent.h
@@ -1,32 +1,32 @@
- "SIG_0", /* 0 */
- "SIGHUP", /* 1 */
- "SIGINT", /* 2 */
- "SIGQUIT", /* 3 */
- "SIGILL", /* 4 */
- "SIGTRAP", /* 5 */
- "SIGABRT", /* 6 */
- "SIGEMT", /* 7 */
- "SIGFPE", /* 8 */
- "SIGKILL", /* 9 */
- "SIGBUS", /* 10 */
- "SIGSEGV", /* 11 */
- "SIGSYS", /* 12 */
- "SIGPIPE", /* 13 */
- "SIGALRM", /* 14 */
- "SIGTERM", /* 15 */
- "SIGURG", /* 16 */
- "SIGSTOP", /* 17 */
- "SIGTSTP", /* 18 */
- "SIGCONT", /* 19 */
- "SIGCHLD", /* 20 */
- "SIGTTIN", /* 21 */
- "SIGTTOU", /* 22 */
- "SIGIO", /* 23 */
- "SIGXCPU", /* 24 */
- "SIGXFSZ", /* 25 */
- "SIGVTALRM", /* 26 */
- "SIGPROF", /* 27 */
- "SIGWINCH", /* 28 */
- "SIGLOST", /* 29 */
- "SIGUSR1", /* 30 */
- "SIGUSR2", /* 31 */
+"SIG_0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGEMT", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGBUS", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGSYS", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGURG", /* 16 */
+ "SIGSTOP", /* 17 */
+ "SIGTSTP", /* 18 */
+ "SIGCONT", /* 19 */
+ "SIGCHLD", /* 20 */
+ "SIGTTIN", /* 21 */
+ "SIGTTOU", /* 22 */
+ "SIGIO", /* 23 */
+ "SIGXCPU", /* 24 */
+ "SIGXFSZ", /* 25 */
+ "SIGVTALRM", /* 26 */
+ "SIGPROF", /* 27 */
+ "SIGWINCH", /* 28 */
+ "SIGLOST", /* 29 */
+ "SIGUSR1", /* 30 */
+ "SIGUSR2", /* 31 */
diff --git a/sysdeps/linux-gnu/sparc/syscallent.h b/sysdeps/linux-gnu/sparc/syscallent.h
index 3b6f7fe..96eeec9 100644
--- a/sysdeps/linux-gnu/sparc/syscallent.h
+++ b/sysdeps/linux-gnu/sparc/syscallent.h
@@ -1,284 +1,284 @@
- "0", /* 0 */
- "exit", /* 1 */
- "fork", /* 2 */
- "read", /* 3 */
- "write", /* 4 */
- "open", /* 5 */
- "close", /* 6 */
- "wait4", /* 7 */
- "creat", /* 8 */
- "link", /* 9 */
- "unlink", /* 10 */
- "execv", /* 11 */
- "chdir", /* 12 */
- "chown", /* 13 */
- "mknod", /* 14 */
- "chmod", /* 15 */
- "lchown", /* 16 */
- "brk", /* 17 */
- "perfctr", /* 18 */
- "lseek", /* 19 */
- "getpid", /* 20 */
- "capget", /* 21 */
- "capset", /* 22 */
- "setuid", /* 23 */
- "getuid", /* 24 */
- "25", /* 25 */
- "ptrace", /* 26 */
- "alarm", /* 27 */
- "sigaltstack", /* 28 */
- "pause", /* 29 */
- "utime", /* 30 */
- "lchown32", /* 31 */
- "fchown32", /* 32 */
- "access", /* 33 */
- "nice", /* 34 */
- "chown32", /* 35 */
- "sync", /* 36 */
- "kill", /* 37 */
- "stat", /* 38 */
- "sendfile", /* 39 */
- "lstat", /* 40 */
- "dup", /* 41 */
- "pipe", /* 42 */
- "times", /* 43 */
- "getuid32", /* 44 */
- "umount2", /* 45 */
- "setgid", /* 46 */
- "getgid", /* 47 */
- "signal", /* 48 */
- "geteuid", /* 49 */
- "getegid", /* 50 */
- "acct", /* 51 */
- "memory_ordering", /* 52 */
- "getgid32", /* 53 */
- "ioctl", /* 54 */
- "reboot", /* 55 */
- "mmap2", /* 56 */
- "symlink", /* 57 */
- "readlink", /* 58 */
- "execve", /* 59 */
- "umask", /* 60 */
- "chroot", /* 61 */
- "fstat", /* 62 */
- "fstat64", /* 63 */
- "getpagesize", /* 64 */
- "msync", /* 65 */
- "vfork", /* 66 */
- "pread64", /* 67 */
- "pwrite64", /* 68 */
- "geteuid32", /* 69 */
- "getegid32", /* 70 */
- "mmap", /* 71 */
- "setreuid32", /* 72 */
- "munmap", /* 73 */
- "mprotect", /* 74 */
- "madvise", /* 75 */
- "vhangup", /* 76 */
- "truncate64", /* 77 */
- "mincore", /* 78 */
- "getgroups", /* 79 */
- "setgroups", /* 80 */
- "getpgrp", /* 81 */
- "setgroups32", /* 82 */
- "setitimer", /* 83 */
- "ftruncate64", /* 84 */
- "swapon", /* 85 */
- "getitimer", /* 86 */
- "setuid32", /* 87 */
- "sethostname", /* 88 */
- "setgid32", /* 89 */
- "dup2", /* 90 */
- "setfsuid32", /* 91 */
- "fcntl", /* 92 */
- "select", /* 93 */
- "setfsgid32", /* 94 */
- "fsync", /* 95 */
- "setpriority", /* 96 */
- "socket", /* 97 */
- "connect", /* 98 */
- "accept", /* 99 */
- "getpriority", /* 100 */
- "rt_sigreturn", /* 101 */
- "rt_sigaction", /* 102 */
- "rt_sigprocmask", /* 103 */
- "rt_sigpending", /* 104 */
- "rt_sigtimedwait", /* 105 */
- "rt_sigqueueinfo", /* 106 */
- "rt_sigsuspend", /* 107 */
- "setresuid32", /* 108 */
- "getresuid32", /* 109 */
- "setresgid32", /* 110 */
- "getresgid32", /* 111 */
- "setregid32", /* 112 */
- "recvmsg", /* 113 */
- "sendmsg", /* 114 */
- "getgroups32", /* 115 */
- "gettimeofday", /* 116 */
- "getrusage", /* 117 */
- "getsockopt", /* 118 */
- "getcwd", /* 119 */
- "readv", /* 120 */
- "writev", /* 121 */
- "settimeofday", /* 122 */
- "fchown", /* 123 */
- "fchmod", /* 124 */
- "recvfrom", /* 125 */
- "setreuid", /* 126 */
- "setregid", /* 127 */
- "rename", /* 128 */
- "truncate", /* 129 */
- "ftruncate", /* 130 */
- "flock", /* 131 */
- "lstat64", /* 132 */
- "sendto", /* 133 */
- "shutdown", /* 134 */
- "socketpair", /* 135 */
- "mkdir", /* 136 */
- "rmdir", /* 137 */
- "utimes", /* 138 */
- "stat64", /* 139 */
- "sendfile64", /* 140 */
- "getpeername", /* 141 */
- "futex", /* 142 */
- "gettid", /* 143 */
- "getrlimit", /* 144 */
- "setrlimit", /* 145 */
- "pivot_root", /* 146 */
- "prctl", /* 147 */
- "pciconfig_read", /* 148 */
- "pciconfig_write", /* 149 */
- "getsockname", /* 150 */
- "inotify_init", /* 151 */
- "inotify_add_watch", /* 152 */
- "poll", /* 153 */
- "getdents64", /* 154 */
- "fcntl64", /* 155 */
- "inotify_rm_watch", /* 156 */
- "statfs", /* 157 */
- "fstatfs", /* 158 */
- "umount", /* 159 */
- "sched_set_affinity", /* 160 */
- "sched_get_affinity", /* 161 */
- "getdomainname", /* 162 */
- "setdomainname", /* 163 */
- "utrap_install", /* 164 */
- "quotactl", /* 165 */
- "set_tid_address", /* 166 */
- "mount", /* 167 */
- "ustat", /* 168 */
- "setxattr", /* 169 */
- "lsetxattr", /* 170 */
- "fsetxattr", /* 171 */
- "getxattr", /* 172 */
- "lgetxattr", /* 173 */
- "getdents", /* 174 */
- "setsid", /* 175 */
- "fchdir", /* 176 */
- "fgetxattr", /* 177 */
- "listxattr", /* 178 */
- "llistxattr", /* 179 */
- "flistxattr", /* 180 */
- "removexattr", /* 181 */
- "lremovexattr", /* 182 */
- "sigpending", /* 183 */
- "query_module", /* 184 */
- "setpgid", /* 185 */
- "fremovexattr", /* 186 */
- "tkill", /* 187 */
- "exit_group", /* 188 */
- "uname", /* 189 */
- "init_module", /* 190 */
- "personality", /* 191 */
- "remap_file_pages", /* 192 */
- "epoll_create", /* 193 */
- "epoll_ctl", /* 194 */
- "epoll_wait", /* 195 */
- "ioprio_set", /* 196 */
- "getppid", /* 197 */
- "sigaction", /* 198 */
- "sgetmask", /* 199 */
- "ssetmask", /* 200 */
- "sigsuspend", /* 201 */
- "oldlstat", /* 202 */
- "uselib", /* 203 */
- "readdir", /* 204 */
- "readahead", /* 205 */
- "socketcall", /* 206 */
- "syslog", /* 207 */
- "lookup_dcookie", /* 208 */
- "fadvise64", /* 209 */
- "fadvise64_64", /* 210 */
- "tgkill", /* 211 */
- "waitpid", /* 212 */
- "swapoff", /* 213 */
- "sysinfo", /* 214 */
- "ipc", /* 215 */
- "sigreturn", /* 216 */
- "clone", /* 217 */
- "ioprio_get", /* 218 */
- "adjtimex", /* 219 */
- "sigprocmask", /* 220 */
- "create_module", /* 221 */
- "delete_module", /* 222 */
- "get_kernel_syms", /* 223 */
- "getpgid", /* 224 */
- "bdflush", /* 225 */
- "sysfs", /* 226 */
- "afs_syscall", /* 227 */
- "setfsuid", /* 228 */
- "setfsgid", /* 229 */
- "_newselect", /* 230 */
- "time", /* 231 */
- "232", /* 232 */
- "stime", /* 233 */
- "statfs64", /* 234 */
- "fstatfs64", /* 235 */
- "_llseek", /* 236 */
- "mlock", /* 237 */
- "munlock", /* 238 */
- "mlockall", /* 239 */
- "munlockall", /* 240 */
- "sched_setparam", /* 241 */
- "sched_getparam", /* 242 */
- "sched_setscheduler", /* 243 */
- "sched_getscheduler", /* 244 */
- "sched_yield", /* 245 */
- "sched_get_priority_max", /* 246 */
- "sched_get_priority_min", /* 247 */
- "sched_rr_get_interval", /* 248 */
- "nanosleep", /* 249 */
- "mremap", /* 250 */
- "_sysctl", /* 251 */
- "getsid", /* 252 */
- "fdatasync", /* 253 */
- "nfsservctl", /* 254 */
- "aplib", /* 255 */
- "clock_settime", /* 256 */
- "clock_gettime", /* 257 */
- "clock_getres", /* 258 */
- "clock_nanosleep", /* 259 */
- "sched_getaffinity", /* 260 */
- "sched_setaffinity", /* 261 */
- "timer_settime", /* 262 */
- "timer_gettime", /* 263 */
- "timer_getoverrun", /* 264 */
- "timer_delete", /* 265 */
- "timer_create", /* 266 */
- "vserver", /* 267 */
- "io_setup", /* 268 */
- "io_destroy", /* 269 */
- "io_submit", /* 270 */
- "io_cancel", /* 271 */
- "io_getevents", /* 272 */
- "mq_open", /* 273 */
- "mq_unlink", /* 274 */
- "mq_timedsend", /* 275 */
- "mq_timedreceive", /* 276 */
- "mq_notify", /* 277 */
- "mq_getsetattr", /* 278 */
- "waitid", /* 279 */
- "setaltroot", /* 280 */
- "add_key", /* 281 */
- "request_key", /* 282 */
- "keyctl", /* 283 */
+"0", /* 0 */
+ "exit", /* 1 */
+ "fork", /* 2 */
+ "read", /* 3 */
+ "write", /* 4 */
+ "open", /* 5 */
+ "close", /* 6 */
+ "wait4", /* 7 */
+ "creat", /* 8 */
+ "link", /* 9 */
+ "unlink", /* 10 */
+ "execv", /* 11 */
+ "chdir", /* 12 */
+ "chown", /* 13 */
+ "mknod", /* 14 */
+ "chmod", /* 15 */
+ "lchown", /* 16 */
+ "brk", /* 17 */
+ "perfctr", /* 18 */
+ "lseek", /* 19 */
+ "getpid", /* 20 */
+ "capget", /* 21 */
+ "capset", /* 22 */
+ "setuid", /* 23 */
+ "getuid", /* 24 */
+ "25", /* 25 */
+ "ptrace", /* 26 */
+ "alarm", /* 27 */
+ "sigaltstack", /* 28 */
+ "pause", /* 29 */
+ "utime", /* 30 */
+ "lchown32", /* 31 */
+ "fchown32", /* 32 */
+ "access", /* 33 */
+ "nice", /* 34 */
+ "chown32", /* 35 */
+ "sync", /* 36 */
+ "kill", /* 37 */
+ "stat", /* 38 */
+ "sendfile", /* 39 */
+ "lstat", /* 40 */
+ "dup", /* 41 */
+ "pipe", /* 42 */
+ "times", /* 43 */
+ "getuid32", /* 44 */
+ "umount2", /* 45 */
+ "setgid", /* 46 */
+ "getgid", /* 47 */
+ "signal", /* 48 */
+ "geteuid", /* 49 */
+ "getegid", /* 50 */
+ "acct", /* 51 */
+ "memory_ordering", /* 52 */
+ "getgid32", /* 53 */
+ "ioctl", /* 54 */
+ "reboot", /* 55 */
+ "mmap2", /* 56 */
+ "symlink", /* 57 */
+ "readlink", /* 58 */
+ "execve", /* 59 */
+ "umask", /* 60 */
+ "chroot", /* 61 */
+ "fstat", /* 62 */
+ "fstat64", /* 63 */
+ "getpagesize", /* 64 */
+ "msync", /* 65 */
+ "vfork", /* 66 */
+ "pread64", /* 67 */
+ "pwrite64", /* 68 */
+ "geteuid32", /* 69 */
+ "getegid32", /* 70 */
+ "mmap", /* 71 */
+ "setreuid32", /* 72 */
+ "munmap", /* 73 */
+ "mprotect", /* 74 */
+ "madvise", /* 75 */
+ "vhangup", /* 76 */
+ "truncate64", /* 77 */
+ "mincore", /* 78 */
+ "getgroups", /* 79 */
+ "setgroups", /* 80 */
+ "getpgrp", /* 81 */
+ "setgroups32", /* 82 */
+ "setitimer", /* 83 */
+ "ftruncate64", /* 84 */
+ "swapon", /* 85 */
+ "getitimer", /* 86 */
+ "setuid32", /* 87 */
+ "sethostname", /* 88 */
+ "setgid32", /* 89 */
+ "dup2", /* 90 */
+ "setfsuid32", /* 91 */
+ "fcntl", /* 92 */
+ "select", /* 93 */
+ "setfsgid32", /* 94 */
+ "fsync", /* 95 */
+ "setpriority", /* 96 */
+ "socket", /* 97 */
+ "connect", /* 98 */
+ "accept", /* 99 */
+ "getpriority", /* 100 */
+ "rt_sigreturn", /* 101 */
+ "rt_sigaction", /* 102 */
+ "rt_sigprocmask", /* 103 */
+ "rt_sigpending", /* 104 */
+ "rt_sigtimedwait", /* 105 */
+ "rt_sigqueueinfo", /* 106 */
+ "rt_sigsuspend", /* 107 */
+ "setresuid32", /* 108 */
+ "getresuid32", /* 109 */
+ "setresgid32", /* 110 */
+ "getresgid32", /* 111 */
+ "setregid32", /* 112 */
+ "recvmsg", /* 113 */
+ "sendmsg", /* 114 */
+ "getgroups32", /* 115 */
+ "gettimeofday", /* 116 */
+ "getrusage", /* 117 */
+ "getsockopt", /* 118 */
+ "getcwd", /* 119 */
+ "readv", /* 120 */
+ "writev", /* 121 */
+ "settimeofday", /* 122 */
+ "fchown", /* 123 */
+ "fchmod", /* 124 */
+ "recvfrom", /* 125 */
+ "setreuid", /* 126 */
+ "setregid", /* 127 */
+ "rename", /* 128 */
+ "truncate", /* 129 */
+ "ftruncate", /* 130 */
+ "flock", /* 131 */
+ "lstat64", /* 132 */
+ "sendto", /* 133 */
+ "shutdown", /* 134 */
+ "socketpair", /* 135 */
+ "mkdir", /* 136 */
+ "rmdir", /* 137 */
+ "utimes", /* 138 */
+ "stat64", /* 139 */
+ "sendfile64", /* 140 */
+ "getpeername", /* 141 */
+ "futex", /* 142 */
+ "gettid", /* 143 */
+ "getrlimit", /* 144 */
+ "setrlimit", /* 145 */
+ "pivot_root", /* 146 */
+ "prctl", /* 147 */
+ "pciconfig_read", /* 148 */
+ "pciconfig_write", /* 149 */
+ "getsockname", /* 150 */
+ "inotify_init", /* 151 */
+ "inotify_add_watch", /* 152 */
+ "poll", /* 153 */
+ "getdents64", /* 154 */
+ "fcntl64", /* 155 */
+ "inotify_rm_watch", /* 156 */
+ "statfs", /* 157 */
+ "fstatfs", /* 158 */
+ "umount", /* 159 */
+ "sched_set_affinity", /* 160 */
+ "sched_get_affinity", /* 161 */
+ "getdomainname", /* 162 */
+ "setdomainname", /* 163 */
+ "utrap_install", /* 164 */
+ "quotactl", /* 165 */
+ "set_tid_address", /* 166 */
+ "mount", /* 167 */
+ "ustat", /* 168 */
+ "setxattr", /* 169 */
+ "lsetxattr", /* 170 */
+ "fsetxattr", /* 171 */
+ "getxattr", /* 172 */
+ "lgetxattr", /* 173 */
+ "getdents", /* 174 */
+ "setsid", /* 175 */
+ "fchdir", /* 176 */
+ "fgetxattr", /* 177 */
+ "listxattr", /* 178 */
+ "llistxattr", /* 179 */
+ "flistxattr", /* 180 */
+ "removexattr", /* 181 */
+ "lremovexattr", /* 182 */
+ "sigpending", /* 183 */
+ "query_module", /* 184 */
+ "setpgid", /* 185 */
+ "fremovexattr", /* 186 */
+ "tkill", /* 187 */
+ "exit_group", /* 188 */
+ "uname", /* 189 */
+ "init_module", /* 190 */
+ "personality", /* 191 */
+ "remap_file_pages", /* 192 */
+ "epoll_create", /* 193 */
+ "epoll_ctl", /* 194 */
+ "epoll_wait", /* 195 */
+ "ioprio_set", /* 196 */
+ "getppid", /* 197 */
+ "sigaction", /* 198 */
+ "sgetmask", /* 199 */
+ "ssetmask", /* 200 */
+ "sigsuspend", /* 201 */
+ "oldlstat", /* 202 */
+ "uselib", /* 203 */
+ "readdir", /* 204 */
+ "readahead", /* 205 */
+ "socketcall", /* 206 */
+ "syslog", /* 207 */
+ "lookup_dcookie", /* 208 */
+ "fadvise64", /* 209 */
+ "fadvise64_64", /* 210 */
+ "tgkill", /* 211 */
+ "waitpid", /* 212 */
+ "swapoff", /* 213 */
+ "sysinfo", /* 214 */
+ "ipc", /* 215 */
+ "sigreturn", /* 216 */
+ "clone", /* 217 */
+ "ioprio_get", /* 218 */
+ "adjtimex", /* 219 */
+ "sigprocmask", /* 220 */
+ "create_module", /* 221 */
+ "delete_module", /* 222 */
+ "get_kernel_syms", /* 223 */
+ "getpgid", /* 224 */
+ "bdflush", /* 225 */
+ "sysfs", /* 226 */
+ "afs_syscall", /* 227 */
+ "setfsuid", /* 228 */
+ "setfsgid", /* 229 */
+ "_newselect", /* 230 */
+ "time", /* 231 */
+ "232", /* 232 */
+ "stime", /* 233 */
+ "statfs64", /* 234 */
+ "fstatfs64", /* 235 */
+ "_llseek", /* 236 */
+ "mlock", /* 237 */
+ "munlock", /* 238 */
+ "mlockall", /* 239 */
+ "munlockall", /* 240 */
+ "sched_setparam", /* 241 */
+ "sched_getparam", /* 242 */
+ "sched_setscheduler", /* 243 */
+ "sched_getscheduler", /* 244 */
+ "sched_yield", /* 245 */
+ "sched_get_priority_max", /* 246 */
+ "sched_get_priority_min", /* 247 */
+ "sched_rr_get_interval", /* 248 */
+ "nanosleep", /* 249 */
+ "mremap", /* 250 */
+ "_sysctl", /* 251 */
+ "getsid", /* 252 */
+ "fdatasync", /* 253 */
+ "nfsservctl", /* 254 */
+ "aplib", /* 255 */
+ "clock_settime", /* 256 */
+ "clock_gettime", /* 257 */
+ "clock_getres", /* 258 */
+ "clock_nanosleep", /* 259 */
+ "sched_getaffinity", /* 260 */
+ "sched_setaffinity", /* 261 */
+ "timer_settime", /* 262 */
+ "timer_gettime", /* 263 */
+ "timer_getoverrun", /* 264 */
+ "timer_delete", /* 265 */
+ "timer_create", /* 266 */
+ "vserver", /* 267 */
+ "io_setup", /* 268 */
+ "io_destroy", /* 269 */
+ "io_submit", /* 270 */
+ "io_cancel", /* 271 */
+ "io_getevents", /* 272 */
+ "mq_open", /* 273 */
+ "mq_unlink", /* 274 */
+ "mq_timedsend", /* 275 */
+ "mq_timedreceive", /* 276 */
+ "mq_notify", /* 277 */
+ "mq_getsetattr", /* 278 */
+ "waitid", /* 279 */
+ "setaltroot", /* 280 */
+ "add_key", /* 281 */
+ "request_key", /* 282 */
+ "keyctl", /* 283 */
diff --git a/sysdeps/linux-gnu/sparc/trace.c b/sysdeps/linux-gnu/sparc/trace.c
index c39de44..5f0b629 100644
--- a/sysdeps/linux-gnu/sparc/trace.c
+++ b/sysdeps/linux-gnu/sparc/trace.c
@@ -18,8 +18,8 @@
proc_archdep *a;
if (!proc->arch_ptr)
proc->arch_ptr = (void *)malloc(sizeof(proc_archdep));
- a = (proc_archdep *)(proc->arch_ptr);
- a->valid = (ptrace (PTRACE_GETREGS, proc->pid, &a->regs, 0) >= 0);
+ a = (proc_archdep *) (proc->arch_ptr);
+ a->valid = (ptrace(PTRACE_GETREGS, proc->pid, &a->regs, 0) >= 0);
}
/* Returns syscall number if `pid' stopped because of a syscall.
@@ -27,16 +27,20 @@
*/
int syscall_p(struct process *proc, int status, int *sysnum)
{
- if (WIFSTOPPED(status) && WSTOPSIG(status)==(SIGTRAP | proc->tracesysgood)) {
+ if (WIFSTOPPED(status)
+ && WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
void *ip = get_instruction_pointer(proc);
unsigned int insn;
- if (ip == (void *)-1) return 0;
+ if (ip == (void *)-1)
+ return 0;
insn = ptrace(PTRACE_PEEKTEXT, proc->pid, ip, 0);
if ((insn & 0xc1f8007f) == 0x81d00010) {
- *sysnum = ((proc_archdep *)proc->arch_ptr)->regs.r_g1;
- if ((proc->callstack_depth > 0) && proc->callstack[proc->callstack_depth-1].is_syscall) {
+ *sysnum = ((proc_archdep *) proc->arch_ptr)->regs.r_g1;
+ if ((proc->callstack_depth > 0)
+ && proc->callstack[proc->callstack_depth -
+ 1].is_syscall) {
return 2;
- } else if(*sysnum>=0) {
+ } else if (*sysnum >= 0) {
return 1;
}
}
@@ -44,23 +48,24 @@
return 0;
}
-long gimme_arg(enum tof type, struct process * proc, int arg_num)
+long gimme_arg(enum tof type, struct process *proc, int arg_num)
{
- proc_archdep * a = (proc_archdep *)proc->arch_ptr;
+ proc_archdep *a = (proc_archdep *) proc->arch_ptr;
if (!a->valid) {
fprintf(stderr, "Could not get child registers\n");
exit(1);
}
- if (arg_num==-1) /* return value */
+ if (arg_num == -1) /* return value */
return a->regs.r_o0;
- if (type==LT_TOF_FUNCTION || type==LT_TOF_SYSCALL || arg_num >= 6) {
+ if (type == LT_TOF_FUNCTION || type == LT_TOF_SYSCALL || arg_num >= 6) {
if (arg_num < 6)
return ((int *)&a->regs.r_o0)[arg_num];
- return ptrace(PTRACE_PEEKTEXT, proc->pid, proc->stack_pointer+64*(arg_num + 1));
- } else if (type==LT_TOF_FUNCTIONR)
+ return ptrace(PTRACE_PEEKTEXT, proc->pid,
+ proc->stack_pointer + 64 * (arg_num + 1));
+ } else if (type == LT_TOF_FUNCTIONR)
return a->func_arg[arg_num];
- else if (type==LT_TOF_SYSCALLR)
+ else if (type == LT_TOF_SYSCALLR)
return a->sysc_arg[arg_num];
else {
fprintf(stderr, "gimme_arg called with wrong arguments\n");
@@ -69,9 +74,9 @@
return 0;
}
-void save_register_args(enum tof type, struct process * proc)
+void save_register_args(enum tof type, struct process *proc)
{
- proc_archdep * a = (proc_archdep *)proc->arch_ptr;
+ proc_archdep *a = (proc_archdep *) proc->arch_ptr;
if (a->valid) {
if (type == LT_TOF_FUNCTION)
memcpy(a->func_arg, &a->regs.r_o0, sizeof(a->func_arg));
diff --git a/sysdeps/linux-gnu/trace.c b/sysdeps/linux-gnu/trace.c
index cbcce4d..cc7b1b9 100644
--- a/sysdeps/linux-gnu/trace.c
+++ b/sysdeps/linux-gnu/trace.c
@@ -12,35 +12,35 @@
#include "sysdep.h"
static int fork_exec_syscalls[][5] = {
-{
+ {
#ifdef __NR_fork
- __NR_fork,
+ __NR_fork,
#else
- -1,
+ -1,
#endif
#ifdef __NR_clone
- __NR_clone,
+ __NR_clone,
#else
- -1,
+ -1,
#endif
#ifdef __NR_clone2
- __NR_clone2,
+ __NR_clone2,
#else
- -1,
+ -1,
#endif
#ifdef __NR_vfork
- __NR_vfork,
+ __NR_vfork,
#else
- -1,
+ -1,
#endif
#ifdef __NR_execve
- __NR_execve,
+ __NR_execve,
#else
- -1,
+ -1,
#endif
-}
+ }
#ifdef FORK_EXEC_SYSCALLS
-FORK_EXEC_SYSCALLS
+ FORK_EXEC_SYSCALLS
#endif
};
@@ -48,13 +48,13 @@
* (ie, with fork() or clone())
* Returns 0 otherwise.
*/
-int
-fork_p(struct process * proc, int sysnum) {
+int fork_p(struct process *proc, int sysnum)
+{
int i;
if (proc->personality
- >= sizeof fork_exec_syscalls / sizeof (fork_exec_syscalls [0]))
- return 0;
- for (i = 0; i < sizeof (fork_exec_syscalls[0]) / sizeof (int) - 1; ++i)
+ >= sizeof fork_exec_syscalls / sizeof(fork_exec_syscalls[0]))
+ return 0;
+ for (i = 0; i < sizeof(fork_exec_syscalls[0]) / sizeof(int) - 1; ++i)
if (sysnum == fork_exec_syscalls[proc->personality][i])
return 1;
return 0;
@@ -62,44 +62,44 @@
/* Returns 1 if the sysnum may make the process exec other program
*/
-int
-exec_p(struct process * proc, int sysnum) {
+int exec_p(struct process *proc, int sysnum)
+{
int i;
if (proc->personality
- >= sizeof fork_exec_syscalls / sizeof (fork_exec_syscalls [0]))
- return 0;
- i = sizeof (fork_exec_syscalls[0]) / sizeof (int) - 1;
+ >= sizeof fork_exec_syscalls / sizeof(fork_exec_syscalls[0]))
+ return 0;
+ i = sizeof(fork_exec_syscalls[0]) / sizeof(int) - 1;
if (sysnum == fork_exec_syscalls[proc->personality][i])
return 1;
return 0;
}
-void
-trace_me(void) {
- if (ptrace(PTRACE_TRACEME, 0, 1, 0)<0) {
+void trace_me(void)
+{
+ if (ptrace(PTRACE_TRACEME, 0, 1, 0) < 0) {
perror("PTRACE_TRACEME");
exit(1);
}
}
-int
-trace_pid(pid_t pid) {
+int trace_pid(pid_t pid)
+{
if (ptrace(PTRACE_ATTACH, pid, 1, 0) < 0) {
return -1;
}
return 0;
}
-void
-trace_set_options(struct process * proc, pid_t pid) {
+void trace_set_options(struct process *proc, pid_t pid)
+{
#ifndef PTRACE_SETOPTIONS
- #define PTRACE_SETOPTIONS 0x4200
+#define PTRACE_SETOPTIONS 0x4200
#endif
#ifndef PTRACE_OLDSETOPTIONS
- #define PTRACE_OLDSETOPTIONS 21
+#define PTRACE_OLDSETOPTIONS 21
#endif
#ifndef PTRACE_O_TRACESYSGOOD
- #define PTRACE_O_TRACESYSGOOD 0x00000001
+#define PTRACE_O_TRACESYSGOOD 0x00000001
#endif
if (proc->tracesysgood & 0x80)
return;
@@ -111,31 +111,32 @@
proc->tracesysgood |= 0x80;
}
-void
-untrace_pid(pid_t pid) {
+void untrace_pid(pid_t pid)
+{
ptrace(PTRACE_DETACH, pid, 1, 0);
}
-void
-continue_after_signal(pid_t pid, int signum) {
+void continue_after_signal(pid_t pid, int signum)
+{
/* We should always trace syscalls to be able to control fork(), clone(), execve()... */
ptrace(PTRACE_SYSCALL, pid, 0, signum);
}
-void
-continue_process(pid_t pid) {
+void continue_process(pid_t pid)
+{
continue_after_signal(pid, 0);
}
-void
-continue_enabling_breakpoint(pid_t pid, struct breakpoint * sbp) {
+void continue_enabling_breakpoint(pid_t pid, struct breakpoint *sbp)
+{
enable_breakpoint(pid, sbp);
continue_process(pid);
}
-void
-continue_after_breakpoint(struct process *proc, struct breakpoint * sbp) {
- if (sbp->enabled) disable_breakpoint(proc->pid, sbp);
+void continue_after_breakpoint(struct process *proc, struct breakpoint *sbp)
+{
+ if (sbp->enabled)
+ disable_breakpoint(proc->pid, sbp);
set_instruction_pointer(proc, sbp->addr);
if (sbp->enabled == 0) {
continue_process(proc->pid);
@@ -150,24 +151,27 @@
}
}
-int
-umovestr(struct process * proc, void * addr, int len, void * laddr) {
- union { long a; char c[sizeof(long)]; } a;
+int umovestr(struct process *proc, void *addr, int len, void *laddr)
+{
+ union {
+ long a;
+ char c[sizeof(long)];
+ } a;
int i;
- int offset=0;
+ int offset = 0;
- 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) {
- *(char *)(laddr+offset+i) = a.c[i];
+ 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) {
+ *(char *)(laddr + offset + i) = a.c[i];
} else {
- *(char *)(laddr+offset+i) = '\0';
+ *(char *)(laddr + offset + i) = '\0';
return 0;
}
}
offset += sizeof(long);
}
- *(char *)(laddr+offset) = '\0';
+ *(char *)(laddr + offset) = '\0';
return 0;
}
diff --git a/sysdeps/linux-gnu/x86_64/plt.c b/sysdeps/linux-gnu/x86_64/plt.c
index 36d0ecd..3eab56c 100644
--- a/sysdeps/linux-gnu/x86_64/plt.c
+++ b/sysdeps/linux-gnu/x86_64/plt.c
@@ -2,13 +2,12 @@
#include "ltrace.h"
#include "elf.h"
-GElf_Addr
-arch_plt_sym_val (struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+GElf_Addr arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela)
{
- return lte->plt_addr + (ndx + 1) * 16;
+ return lte->plt_addr + (ndx + 1) * 16;
}
-void * plt2addr(struct process *proc, void ** plt)
+void *plt2addr(struct process *proc, void **plt)
{
- return (void *) plt;
+ return (void *)plt;
}
diff --git a/sysdeps/linux-gnu/x86_64/regs.c b/sysdeps/linux-gnu/x86_64/regs.c
index 29160b3..160f08f 100644
--- a/sysdeps/linux-gnu/x86_64/regs.c
+++ b/sysdeps/linux-gnu/x86_64/regs.c
@@ -16,31 +16,31 @@
# define PTRACE_POKEUSER PTRACE_POKEUSR
#endif
-void *
-get_instruction_pointer(struct process * proc) {
- long int ret = ptrace(PTRACE_PEEKUSER, proc->pid, 8*RIP, 0);
+void *get_instruction_pointer(struct process *proc)
+{
+ long int ret = ptrace(PTRACE_PEEKUSER, proc->pid, 8 * RIP, 0);
if (proc->mask_32bit)
ret &= 0xffffffff;
return (void *)ret;
}
-void
-set_instruction_pointer(struct process * proc, void * addr) {
+void set_instruction_pointer(struct process *proc, void *addr)
+{
if (proc->mask_32bit)
- addr = (void *)((long int) addr & 0xffffffff);
- ptrace(PTRACE_POKEUSER, proc->pid, 8*RIP, addr);
+ addr = (void *)((long int)addr & 0xffffffff);
+ ptrace(PTRACE_POKEUSER, proc->pid, 8 * RIP, addr);
}
-void *
-get_stack_pointer(struct process * proc) {
- long int ret = ptrace(PTRACE_PEEKUSER, proc->pid, 8*RSP, 0);
+void *get_stack_pointer(struct process *proc)
+{
+ long int ret = ptrace(PTRACE_PEEKUSER, proc->pid, 8 * RSP, 0);
if (proc->mask_32bit)
ret &= 0xffffffff;
return (void *)ret;
}
-void *
-get_return_addr(struct process * proc, void * stack_pointer) {
+void *get_return_addr(struct process *proc, void *stack_pointer)
+{
unsigned long int ret;
ret = ptrace(PTRACE_PEEKTEXT, proc->pid, stack_pointer, 0);
if (proc->mask_32bit)
diff --git a/sysdeps/linux-gnu/x86_64/signalent.h b/sysdeps/linux-gnu/x86_64/signalent.h
index 5395f82..d58a36c 100644
--- a/sysdeps/linux-gnu/x86_64/signalent.h
+++ b/sysdeps/linux-gnu/x86_64/signalent.h
@@ -1,32 +1,32 @@
- "SIG_0", /* 0 */
- "SIGHUP", /* 1 */
- "SIGINT", /* 2 */
- "SIGQUIT", /* 3 */
- "SIGILL", /* 4 */
- "SIGTRAP", /* 5 */
- "SIGABRT", /* 6 */
- "SIGBUS", /* 7 */
- "SIGFPE", /* 8 */
- "SIGKILL", /* 9 */
- "SIGUSR1", /* 10 */
- "SIGSEGV", /* 11 */
- "SIGUSR2", /* 12 */
- "SIGPIPE", /* 13 */
- "SIGALRM", /* 14 */
- "SIGTERM", /* 15 */
- "SIGSTKFLT", /* 16 */
- "SIGCHLD", /* 17 */
- "SIGCONT", /* 18 */
- "SIGSTOP", /* 19 */
- "SIGTSTP", /* 20 */
- "SIGTTIN", /* 21 */
- "SIGTTOU", /* 22 */
- "SIGURG", /* 23 */
- "SIGXCPU", /* 24 */
- "SIGXFSZ", /* 25 */
- "SIGVTALRM", /* 26 */
- "SIGPROF", /* 27 */
- "SIGWINCH", /* 28 */
- "SIGIO", /* 29 */
- "SIGPWR", /* 30 */
- "SIGSYS", /* 31 */
+"SIG_0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGBUS", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGUSR1", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGUSR2", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGSTKFLT", /* 16 */
+ "SIGCHLD", /* 17 */
+ "SIGCONT", /* 18 */
+ "SIGSTOP", /* 19 */
+ "SIGTSTP", /* 20 */
+ "SIGTTIN", /* 21 */
+ "SIGTTOU", /* 22 */
+ "SIGURG", /* 23 */
+ "SIGXCPU", /* 24 */
+ "SIGXFSZ", /* 25 */
+ "SIGVTALRM", /* 26 */
+ "SIGPROF", /* 27 */
+ "SIGWINCH", /* 28 */
+ "SIGIO", /* 29 */
+ "SIGPWR", /* 30 */
+ "SIGSYS", /* 31 */
diff --git a/sysdeps/linux-gnu/x86_64/syscallent.h b/sysdeps/linux-gnu/x86_64/syscallent.h
index e98f98c..5e5f88a 100644
--- a/sysdeps/linux-gnu/x86_64/syscallent.h
+++ b/sysdeps/linux-gnu/x86_64/syscallent.h
@@ -1,256 +1,256 @@
- "read", /* 0 */
- "write", /* 1 */
- "open", /* 2 */
- "close", /* 3 */
- "stat", /* 4 */
- "fstat", /* 5 */
- "lstat", /* 6 */
- "poll", /* 7 */
- "lseek", /* 8 */
- "mmap", /* 9 */
- "mprotect", /* 10 */
- "munmap", /* 11 */
- "brk", /* 12 */
- "rt_sigaction", /* 13 */
- "rt_sigprocmask", /* 14 */
- "rt_sigreturn", /* 15 */
- "ioctl", /* 16 */
- "pread", /* 17 */
- "pwrite", /* 18 */
- "readv", /* 19 */
- "writev", /* 20 */
- "access", /* 21 */
- "pipe", /* 22 */
- "select", /* 23 */
- "sched_yield", /* 24 */
- "mremap", /* 25 */
- "msync", /* 26 */
- "mincore", /* 27 */
- "madvise", /* 28 */
- "shmget", /* 29 */
- "shmat", /* 30 */
- "shmctl", /* 31 */
- "dup", /* 32 */
- "dup2", /* 33 */
- "pause", /* 34 */
- "nanosleep", /* 35 */
- "getitimer", /* 36 */
- "alarm", /* 37 */
- "setitimer", /* 38 */
- "getpid", /* 39 */
- "sendfile", /* 40 */
- "socket", /* 41 */
- "connect", /* 42 */
- "accept", /* 43 */
- "sendto", /* 44 */
- "recvfrom", /* 45 */
- "sendmsg", /* 46 */
- "recvmsg", /* 47 */
- "shutdown", /* 48 */
- "bind", /* 49 */
- "listen", /* 50 */
- "getsockname", /* 51 */
- "getpeername", /* 52 */
- "socketpair", /* 53 */
- "setsockopt", /* 54 */
- "getsockopt", /* 55 */
- "clone", /* 56 */
- "fork", /* 57 */
- "vfork", /* 58 */
- "execve", /* 59 */
- "exit", /* 60 */
- "wait4", /* 61 */
- "kill", /* 62 */
- "uname", /* 63 */
- "semget", /* 64 */
- "semop", /* 65 */
- "semctl", /* 66 */
- "shmdt", /* 67 */
- "msgget", /* 68 */
- "msgsnd", /* 69 */
- "msgrcv", /* 70 */
- "msgctl", /* 71 */
- "fcntl", /* 72 */
- "flock", /* 73 */
- "fsync", /* 74 */
- "fdatasync", /* 75 */
- "truncate", /* 76 */
- "ftruncate", /* 77 */
- "getdents", /* 78 */
- "getcwd", /* 79 */
- "chdir", /* 80 */
- "fchdir", /* 81 */
- "rename", /* 82 */
- "mkdir", /* 83 */
- "rmdir", /* 84 */
- "creat", /* 85 */
- "link", /* 86 */
- "unlink", /* 87 */
- "symlink", /* 88 */
- "readlink", /* 89 */
- "chmod", /* 90 */
- "fchmod", /* 91 */
- "chown", /* 92 */
- "fchown", /* 93 */
- "lchown", /* 94 */
- "umask", /* 95 */
- "gettimeofday", /* 96 */
- "getrlimit", /* 97 */
- "getrusage", /* 98 */
- "sysinfo", /* 99 */
- "times", /* 100 */
- "ptrace", /* 101 */
- "getuid", /* 102 */
- "syslog", /* 103 */
- "getgid", /* 104 */
- "setuid", /* 105 */
- "setgid", /* 106 */
- "geteuid", /* 107 */
- "getegid", /* 108 */
- "setpgid", /* 109 */
- "getppid", /* 110 */
- "getpgrp", /* 111 */
- "setsid", /* 112 */
- "setreuid", /* 113 */
- "setregid", /* 114 */
- "getgroups", /* 115 */
- "setgroups", /* 116 */
- "setresuid", /* 117 */
- "getresuid", /* 118 */
- "setresgid", /* 119 */
- "getresgid", /* 120 */
- "getpgid", /* 121 */
- "setfsuid", /* 122 */
- "setfsgid", /* 123 */
- "getsid", /* 124 */
- "capget", /* 125 */
- "capset", /* 126 */
- "rt_sigpending", /* 127 */
- "rt_sigtimedwait", /* 128 */
- "rt_sigqueueinfo", /* 129 */
- "rt_sigsuspend", /* 130 */
- "sigaltstack", /* 131 */
- "utime", /* 132 */
- "mknod", /* 133 */
- "uselib", /* 134 */
- "personality", /* 135 */
- "ustat", /* 136 */
- "statfs", /* 137 */
- "fstatfs", /* 138 */
- "sysfs", /* 139 */
- "getpriority", /* 140 */
- "setpriority", /* 141 */
- "sched_setparam", /* 142 */
- "sched_getparam", /* 143 */
- "sched_setscheduler", /* 144 */
- "sched_getscheduler", /* 145 */
- "sched_get_priority_max", /* 146 */
- "sched_get_priority_min", /* 147 */
- "sched_rr_get_interval", /* 148 */
- "mlock", /* 149 */
- "munlock", /* 150 */
- "mlockall", /* 151 */
- "munlockall", /* 152 */
- "vhangup", /* 153 */
- "modify_ldt", /* 154 */
- "pivot_root", /* 155 */
- "_sysctl", /* 156 */
- "prctl", /* 157 */
- "arch_prctl", /* 158 */
- "adjtimex", /* 159 */
- "setrlimit", /* 160 */
- "chroot", /* 161 */
- "sync", /* 162 */
- "acct", /* 163 */
- "settimeofday", /* 164 */
- "mount", /* 165 */
- "umount2", /* 166 */
- "swapon", /* 167 */
- "swapoff", /* 168 */
- "reboot", /* 169 */
- "sethostname", /* 170 */
- "setdomainname", /* 171 */
- "iopl", /* 172 */
- "ioperm", /* 173 */
- "create_module", /* 174 */
- "init_module", /* 175 */
- "delete_module", /* 176 */
- "get_kernel_syms", /* 177 */
- "query_module", /* 178 */
- "quotactl", /* 179 */
- "nfsservctl", /* 180 */
- "getpmsg", /* 181 */
- "putpmsg", /* 182 */
- "afs_syscall", /* 183 */
- "tuxcall", /* 184 */
- "security", /* 185 */
- "gettid", /* 186 */
- "readahead", /* 187 */
- "setxattr", /* 188 */
- "lsetxattr", /* 189 */
- "fsetxattr", /* 190 */
- "getxattr", /* 191 */
- "lgetxattr", /* 192 */
- "fgetxattr", /* 193 */
- "listxattr", /* 194 */
- "llistxattr", /* 195 */
- "flistxattr", /* 196 */
- "removexattr", /* 197 */
- "lremovexattr", /* 198 */
- "fremovexattr", /* 199 */
- "tkill", /* 200 */
- "time", /* 201 */
- "futex", /* 202 */
- "sched_setaffinity", /* 203 */
- "sched_getaffinity", /* 204 */
- "set_thread_area", /* 205 */
- "io_setup", /* 206 */
- "io_destroy", /* 207 */
- "io_getevents", /* 208 */
- "io_submit", /* 209 */
- "io_cancel", /* 210 */
- "get_thread_area", /* 211 */
- "lookup_dcookie", /* 212 */
- "epoll_create", /* 213 */
- "epoll_ctl", /* 214 */
- "epoll_wait", /* 215 */
- "remap_file_pages", /* 216 */
- "getdents64", /* 217 */
- "set_tid_address", /* 218 */
- "restart_syscall", /* 219 */
- "semtimedop", /* 220 */
- "fadvise64", /* 221 */
- "timer_create", /* 222 */
- "timer_settime", /* 223 */
- "timer_gettime", /* 224 */
- "timer_getoverrun", /* 225 */
- "timer_delete", /* 226 */
- "clock_settime", /* 227 */
- "clock_gettime", /* 228 */
- "clock_getres", /* 229 */
- "clock_nanosleep", /* 230 */
- "exit_group", /* 231 */
- "epoll_wait", /* 232 */
- "epoll_ctl", /* 233 */
- "tgkill", /* 234 */
- "utimes", /* 235 */
- "vserver", /* 236 */
- "mbind", /* 237 */
- "set_mempolicy", /* 238 */
- "get_mempolicy", /* 239 */
- "mq_open", /* 240 */
- "mq_unlink", /* 241 */
- "mq_timedsend", /* 242 */
- "mq_timedreceive", /* 243 */
- "mq_notify", /* 244 */
- "mq_getsetattr", /* 245 */
- "kexec_load", /* 246 */
- "waitid", /* 247 */
- "add_key", /* 248 */
- "request_key", /* 249 */
- "keyctl", /* 250 */
- "ioprio_set", /* 251 */
- "ioprio_get", /* 252 */
- "inotify_init", /* 253 */
- "inotify_add_watch", /* 254 */
- "inotify_rm_watch", /* 255 */
+"read", /* 0 */
+ "write", /* 1 */
+ "open", /* 2 */
+ "close", /* 3 */
+ "stat", /* 4 */
+ "fstat", /* 5 */
+ "lstat", /* 6 */
+ "poll", /* 7 */
+ "lseek", /* 8 */
+ "mmap", /* 9 */
+ "mprotect", /* 10 */
+ "munmap", /* 11 */
+ "brk", /* 12 */
+ "rt_sigaction", /* 13 */
+ "rt_sigprocmask", /* 14 */
+ "rt_sigreturn", /* 15 */
+ "ioctl", /* 16 */
+ "pread", /* 17 */
+ "pwrite", /* 18 */
+ "readv", /* 19 */
+ "writev", /* 20 */
+ "access", /* 21 */
+ "pipe", /* 22 */
+ "select", /* 23 */
+ "sched_yield", /* 24 */
+ "mremap", /* 25 */
+ "msync", /* 26 */
+ "mincore", /* 27 */
+ "madvise", /* 28 */
+ "shmget", /* 29 */
+ "shmat", /* 30 */
+ "shmctl", /* 31 */
+ "dup", /* 32 */
+ "dup2", /* 33 */
+ "pause", /* 34 */
+ "nanosleep", /* 35 */
+ "getitimer", /* 36 */
+ "alarm", /* 37 */
+ "setitimer", /* 38 */
+ "getpid", /* 39 */
+ "sendfile", /* 40 */
+ "socket", /* 41 */
+ "connect", /* 42 */
+ "accept", /* 43 */
+ "sendto", /* 44 */
+ "recvfrom", /* 45 */
+ "sendmsg", /* 46 */
+ "recvmsg", /* 47 */
+ "shutdown", /* 48 */
+ "bind", /* 49 */
+ "listen", /* 50 */
+ "getsockname", /* 51 */
+ "getpeername", /* 52 */
+ "socketpair", /* 53 */
+ "setsockopt", /* 54 */
+ "getsockopt", /* 55 */
+ "clone", /* 56 */
+ "fork", /* 57 */
+ "vfork", /* 58 */
+ "execve", /* 59 */
+ "exit", /* 60 */
+ "wait4", /* 61 */
+ "kill", /* 62 */
+ "uname", /* 63 */
+ "semget", /* 64 */
+ "semop", /* 65 */
+ "semctl", /* 66 */
+ "shmdt", /* 67 */
+ "msgget", /* 68 */
+ "msgsnd", /* 69 */
+ "msgrcv", /* 70 */
+ "msgctl", /* 71 */
+ "fcntl", /* 72 */
+ "flock", /* 73 */
+ "fsync", /* 74 */
+ "fdatasync", /* 75 */
+ "truncate", /* 76 */
+ "ftruncate", /* 77 */
+ "getdents", /* 78 */
+ "getcwd", /* 79 */
+ "chdir", /* 80 */
+ "fchdir", /* 81 */
+ "rename", /* 82 */
+ "mkdir", /* 83 */
+ "rmdir", /* 84 */
+ "creat", /* 85 */
+ "link", /* 86 */
+ "unlink", /* 87 */
+ "symlink", /* 88 */
+ "readlink", /* 89 */
+ "chmod", /* 90 */
+ "fchmod", /* 91 */
+ "chown", /* 92 */
+ "fchown", /* 93 */
+ "lchown", /* 94 */
+ "umask", /* 95 */
+ "gettimeofday", /* 96 */
+ "getrlimit", /* 97 */
+ "getrusage", /* 98 */
+ "sysinfo", /* 99 */
+ "times", /* 100 */
+ "ptrace", /* 101 */
+ "getuid", /* 102 */
+ "syslog", /* 103 */
+ "getgid", /* 104 */
+ "setuid", /* 105 */
+ "setgid", /* 106 */
+ "geteuid", /* 107 */
+ "getegid", /* 108 */
+ "setpgid", /* 109 */
+ "getppid", /* 110 */
+ "getpgrp", /* 111 */
+ "setsid", /* 112 */
+ "setreuid", /* 113 */
+ "setregid", /* 114 */
+ "getgroups", /* 115 */
+ "setgroups", /* 116 */
+ "setresuid", /* 117 */
+ "getresuid", /* 118 */
+ "setresgid", /* 119 */
+ "getresgid", /* 120 */
+ "getpgid", /* 121 */
+ "setfsuid", /* 122 */
+ "setfsgid", /* 123 */
+ "getsid", /* 124 */
+ "capget", /* 125 */
+ "capset", /* 126 */
+ "rt_sigpending", /* 127 */
+ "rt_sigtimedwait", /* 128 */
+ "rt_sigqueueinfo", /* 129 */
+ "rt_sigsuspend", /* 130 */
+ "sigaltstack", /* 131 */
+ "utime", /* 132 */
+ "mknod", /* 133 */
+ "uselib", /* 134 */
+ "personality", /* 135 */
+ "ustat", /* 136 */
+ "statfs", /* 137 */
+ "fstatfs", /* 138 */
+ "sysfs", /* 139 */
+ "getpriority", /* 140 */
+ "setpriority", /* 141 */
+ "sched_setparam", /* 142 */
+ "sched_getparam", /* 143 */
+ "sched_setscheduler", /* 144 */
+ "sched_getscheduler", /* 145 */
+ "sched_get_priority_max", /* 146 */
+ "sched_get_priority_min", /* 147 */
+ "sched_rr_get_interval", /* 148 */
+ "mlock", /* 149 */
+ "munlock", /* 150 */
+ "mlockall", /* 151 */
+ "munlockall", /* 152 */
+ "vhangup", /* 153 */
+ "modify_ldt", /* 154 */
+ "pivot_root", /* 155 */
+ "_sysctl", /* 156 */
+ "prctl", /* 157 */
+ "arch_prctl", /* 158 */
+ "adjtimex", /* 159 */
+ "setrlimit", /* 160 */
+ "chroot", /* 161 */
+ "sync", /* 162 */
+ "acct", /* 163 */
+ "settimeofday", /* 164 */
+ "mount", /* 165 */
+ "umount2", /* 166 */
+ "swapon", /* 167 */
+ "swapoff", /* 168 */
+ "reboot", /* 169 */
+ "sethostname", /* 170 */
+ "setdomainname", /* 171 */
+ "iopl", /* 172 */
+ "ioperm", /* 173 */
+ "create_module", /* 174 */
+ "init_module", /* 175 */
+ "delete_module", /* 176 */
+ "get_kernel_syms", /* 177 */
+ "query_module", /* 178 */
+ "quotactl", /* 179 */
+ "nfsservctl", /* 180 */
+ "getpmsg", /* 181 */
+ "putpmsg", /* 182 */
+ "afs_syscall", /* 183 */
+ "tuxcall", /* 184 */
+ "security", /* 185 */
+ "gettid", /* 186 */
+ "readahead", /* 187 */
+ "setxattr", /* 188 */
+ "lsetxattr", /* 189 */
+ "fsetxattr", /* 190 */
+ "getxattr", /* 191 */
+ "lgetxattr", /* 192 */
+ "fgetxattr", /* 193 */
+ "listxattr", /* 194 */
+ "llistxattr", /* 195 */
+ "flistxattr", /* 196 */
+ "removexattr", /* 197 */
+ "lremovexattr", /* 198 */
+ "fremovexattr", /* 199 */
+ "tkill", /* 200 */
+ "time", /* 201 */
+ "futex", /* 202 */
+ "sched_setaffinity", /* 203 */
+ "sched_getaffinity", /* 204 */
+ "set_thread_area", /* 205 */
+ "io_setup", /* 206 */
+ "io_destroy", /* 207 */
+ "io_getevents", /* 208 */
+ "io_submit", /* 209 */
+ "io_cancel", /* 210 */
+ "get_thread_area", /* 211 */
+ "lookup_dcookie", /* 212 */
+ "epoll_create", /* 213 */
+ "epoll_ctl", /* 214 */
+ "epoll_wait", /* 215 */
+ "remap_file_pages", /* 216 */
+ "getdents64", /* 217 */
+ "set_tid_address", /* 218 */
+ "restart_syscall", /* 219 */
+ "semtimedop", /* 220 */
+ "fadvise64", /* 221 */
+ "timer_create", /* 222 */
+ "timer_settime", /* 223 */
+ "timer_gettime", /* 224 */
+ "timer_getoverrun", /* 225 */
+ "timer_delete", /* 226 */
+ "clock_settime", /* 227 */
+ "clock_gettime", /* 228 */
+ "clock_getres", /* 229 */
+ "clock_nanosleep", /* 230 */
+ "exit_group", /* 231 */
+ "epoll_wait", /* 232 */
+ "epoll_ctl", /* 233 */
+ "tgkill", /* 234 */
+ "utimes", /* 235 */
+ "vserver", /* 236 */
+ "mbind", /* 237 */
+ "set_mempolicy", /* 238 */
+ "get_mempolicy", /* 239 */
+ "mq_open", /* 240 */
+ "mq_unlink", /* 241 */
+ "mq_timedsend", /* 242 */
+ "mq_timedreceive", /* 243 */
+ "mq_notify", /* 244 */
+ "mq_getsetattr", /* 245 */
+ "kexec_load", /* 246 */
+ "waitid", /* 247 */
+ "add_key", /* 248 */
+ "request_key", /* 249 */
+ "keyctl", /* 250 */
+ "ioprio_set", /* 251 */
+ "ioprio_get", /* 252 */
+ "inotify_init", /* 253 */
+ "inotify_add_watch", /* 254 */
+ "inotify_rm_watch", /* 255 */
diff --git a/sysdeps/linux-gnu/x86_64/trace.c b/sysdeps/linux-gnu/x86_64/trace.c
index f08583d..c03043b 100644
--- a/sysdeps/linux-gnu/x86_64/trace.c
+++ b/sysdeps/linux-gnu/x86_64/trace.c
@@ -24,27 +24,28 @@
unsigned long cs;
if (proc->arch_ptr)
return;
- cs = ptrace(PTRACE_PEEKUSER, proc->pid, 8*CS, 0);
+ cs = ptrace(PTRACE_PEEKUSER, proc->pid, 8 * CS, 0);
if (cs == 0x23) {
proc->mask_32bit = 1;
proc->personality = 1;
}
- proc->arch_ptr = (void *) 1;
+ proc->arch_ptr = (void *)1;
}
/* Returns 1 if syscall, 2 if sysret, 0 otherwise.
*/
-int
-syscall_p(struct process * proc, int status, int * sysnum) {
- if (WIFSTOPPED(status) && WSTOPSIG(status)==(SIGTRAP | proc->tracesysgood)) {
- *sysnum = ptrace(PTRACE_PEEKUSER, proc->pid, 8*ORIG_RAX, 0);
+int syscall_p(struct process *proc, int status, int *sysnum)
+{
+ if (WIFSTOPPED(status)
+ && WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
+ *sysnum = ptrace(PTRACE_PEEKUSER, proc->pid, 8 * ORIG_RAX, 0);
if (proc->callstack_depth > 0 &&
- proc->callstack[proc->callstack_depth-1].is_syscall) {
+ proc->callstack[proc->callstack_depth - 1].is_syscall) {
return 2;
}
- if (*sysnum>=0) {
+ if (*sysnum >= 0) {
return 1;
}
}
@@ -52,62 +53,85 @@
}
static unsigned int
-gimme_arg32(enum tof type, struct process * proc, int arg_num) {
- if (arg_num==-1) { /* return value */
- return ptrace(PTRACE_PEEKUSER, proc->pid, 8*RAX, 0);
+gimme_arg32(enum tof type, struct process *proc, int arg_num)
+{
+ if (arg_num == -1) { /* return value */
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * RAX, 0);
}
- if (type==LT_TOF_FUNCTION || type==LT_TOF_FUNCTIONR) {
- return ptrace(PTRACE_PEEKTEXT, proc->pid, proc->stack_pointer+4*(arg_num+1), 0);
- } else if (type==LT_TOF_SYSCALL || type==LT_TOF_SYSCALLR) {
- switch(arg_num) {
- case 0: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*RBX, 0);
- case 1: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*RCX, 0);
- case 2: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*RDX, 0);
- case 3: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*RSI, 0);
- case 4: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*RDI, 0);
- case 5: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*RBP, 0);
- default:
- fprintf(stderr, "gimme_arg32 called with wrong arguments\n");
- exit(2);
+ if (type == LT_TOF_FUNCTION || type == LT_TOF_FUNCTIONR) {
+ return ptrace(PTRACE_PEEKTEXT, proc->pid,
+ proc->stack_pointer + 4 * (arg_num + 1), 0);
+ } else if (type == LT_TOF_SYSCALL || type == LT_TOF_SYSCALLR) {
+ switch (arg_num) {
+ case 0:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * RBX, 0);
+ case 1:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * RCX, 0);
+ case 2:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * RDX, 0);
+ case 3:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * RSI, 0);
+ case 4:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * RDI, 0);
+ case 5:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * RBP, 0);
+ default:
+ fprintf(stderr,
+ "gimme_arg32 called with wrong arguments\n");
+ exit(2);
}
}
fprintf(stderr, "gimme_arg called with wrong arguments\n");
exit(1);
}
-long
-gimme_arg(enum tof type, struct process * proc, int arg_num) {
+long gimme_arg(enum tof type, struct process *proc, int arg_num)
+{
if (proc->mask_32bit)
return (unsigned int)gimme_arg32(type, proc, arg_num);
- if (arg_num==-1) { /* return value */
- return ptrace(PTRACE_PEEKUSER, proc->pid, 8*RAX, 0);
+ if (arg_num == -1) { /* return value */
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * RAX, 0);
}
- if (type==LT_TOF_FUNCTION || type==LT_TOF_FUNCTIONR) {
- switch(arg_num) {
- case 0: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*RDI, 0);
- case 1: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*RSI, 0);
- case 2: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*RDX, 0);
- case 3: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*RCX, 0);
- case 4: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*R8, 0);
- case 5: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*R9, 0);
- default:
- return ptrace(PTRACE_PEEKTEXT, proc->pid,
- proc->stack_pointer + 8 * (arg_num - 6 + 1), 0);
+ if (type == LT_TOF_FUNCTION || type == LT_TOF_FUNCTIONR) {
+ switch (arg_num) {
+ case 0:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * RDI, 0);
+ case 1:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * RSI, 0);
+ case 2:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * RDX, 0);
+ case 3:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * RCX, 0);
+ case 4:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * R8, 0);
+ case 5:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * R9, 0);
+ default:
+ return ptrace(PTRACE_PEEKTEXT, proc->pid,
+ proc->stack_pointer + 8 * (arg_num - 6 +
+ 1), 0);
}
- } else if (type==LT_TOF_SYSCALL || LT_TOF_SYSCALLR) {
- switch(arg_num) {
- case 0: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*RDI, 0);
- case 1: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*RSI, 0);
- case 2: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*RDX, 0);
- case 3: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*R10, 0);
- case 4: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*R8, 0);
- case 5: return ptrace(PTRACE_PEEKUSER, proc->pid, 8*R9, 0);
- default:
- fprintf(stderr, "gimme_arg called with wrong arguments\n");
- exit(2);
+ } else if (type == LT_TOF_SYSCALL || LT_TOF_SYSCALLR) {
+ switch (arg_num) {
+ case 0:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * RDI, 0);
+ case 1:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * RSI, 0);
+ case 2:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * RDX, 0);
+ case 3:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * R10, 0);
+ case 4:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * R8, 0);
+ case 5:
+ return ptrace(PTRACE_PEEKUSER, proc->pid, 8 * R9, 0);
+ default:
+ fprintf(stderr,
+ "gimme_arg called with wrong arguments\n");
+ exit(2);
}
} else {
fprintf(stderr, "gimme_arg called with wrong arguments\n");
@@ -117,6 +141,6 @@
return 0;
}
-void save_register_args(enum tof type, struct process * proc)
+void save_register_args(enum tof type, struct process *proc)
{
}
diff --git a/wait_for_something.c b/wait_for_something.c
index 077c08f..1192c78 100644
--- a/wait_for_something.c
+++ b/wait_for_something.c
@@ -18,10 +18,10 @@
/* This should also update `current_process' */
-static struct process * pid2proc(int pid);
+static struct process *pid2proc(int pid);
-struct event *
-wait_for_something(void) {
+struct event *wait_for_something(void)
+{
pid_t pid;
int status;
int tmp;
@@ -31,11 +31,11 @@
exit(0);
}
pid = wait(&status);
- if (pid==-1) {
- if (errno==ECHILD) {
+ if (pid == -1) {
+ if (errno == ECHILD) {
debug(1, "No more children");
exit(0);
- } else if (errno==EINTR) {
+ } else if (errno == EINTR) {
debug(1, "wait received EINTR ?");
event.thing = LT_EV_NONE;
return &event;
@@ -59,15 +59,18 @@
return &event;
}
if (opt_i) {
- event.proc->instruction_pointer = get_instruction_pointer(event.proc);
+ event.proc->instruction_pointer =
+ get_instruction_pointer(event.proc);
}
- switch(syscall_p(event.proc, status, &tmp)) {
- case 1: event.thing = LT_EV_SYSCALL;
- event.e_un.sysnum = tmp;
- return &event;
- case 2: event.thing = LT_EV_SYSRET;
- event.e_un.sysnum = tmp;
- return &event;
+ switch (syscall_p(event.proc, status, &tmp)) {
+ case 1:
+ event.thing = LT_EV_SYSCALL;
+ event.e_un.sysnum = tmp;
+ return &event;
+ case 2:
+ event.thing = LT_EV_SYSRET;
+ event.e_un.sysnum = tmp;
+ return &event;
}
if (WIFEXITED(status)) {
event.thing = LT_EV_EXIT;
@@ -91,18 +94,20 @@
}
event.thing = LT_EV_BREAKPOINT;
if (!event.proc->instruction_pointer) {
- event.proc->instruction_pointer = get_instruction_pointer(event.proc);
+ event.proc->instruction_pointer =
+ get_instruction_pointer(event.proc);
}
- event.e_un.brk_addr = event.proc->instruction_pointer - DECR_PC_AFTER_BREAK;
+ event.e_un.brk_addr =
+ event.proc->instruction_pointer - DECR_PC_AFTER_BREAK;
return &event;
}
-static struct process *
-pid2proc(pid_t pid) {
- struct process * tmp;
+static struct process *pid2proc(pid_t pid)
+{
+ struct process *tmp;
tmp = list_of_processes;
- while(tmp) {
+ while (tmp) {
if (pid == tmp->pid) {
return tmp;
}