summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2014-06-05 14:37:04 +0000
committerDmitry V. Levin <ldv@altlinux.org>2014-06-05 15:42:05 +0000
commite4113974893293c82f177fe4195cac0a5b70465a (patch)
treee8d38fc0fd622dedbc3fbdfa90cbc7ac0d26c432
parent6e7ba0d8fe2fc31ea852a7fb7f380c22c2a9bdd2 (diff)
downloadstrace-e4113974893293c82f177fe4195cac0a5b70465a.tar.gz
unwind: fix build on 32-bit architectures
Fix compilation warnings in unwind.c on 32-bit architectures. On some architectures getuid is actually getuid32, so change the test to use getpid instead of getuid. * unwind.c (STACK_ENTRY_SYMBOL_FMT): Explicitly cast function_off_set to unsigned long. (queue_put_error): Change the 3rd argument's type to unsigned long. * tests/stack-fcall.c (f1): Use getpid instead of getuid. * tests/strace-k.test: Likewise.
-rw-r--r--tests/stack-fcall.c2
-rwxr-xr-xtests/strace-k.test4
-rw-r--r--unwind.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/tests/stack-fcall.c b/tests/stack-fcall.c
index 04339b185..1c66fefa7 100644
--- a/tests/stack-fcall.c
+++ b/tests/stack-fcall.c
@@ -5,7 +5,7 @@
int f1(int i)
{
- static uid_t (* volatile g)(void) = getuid;
+ static pid_t (* volatile g)(void) = getpid;
return g() + i;
}
diff --git a/tests/strace-k.test b/tests/strace-k.test
index 329f30248..3845c8cef 100755
--- a/tests/strace-k.test
+++ b/tests/strace-k.test
@@ -17,13 +17,13 @@ check_prog tr
$STRACE -h | grep '^-k' > /dev/null ||
skip_ 'strace -k is not available'
-args="-e getuid -k ./stack-fcall"
+args="-e getpid -k ./stack-fcall"
$STRACE $args > $LOG 2>&1 || {
cat $LOG
fail_ "$STRACE $args failed"
}
-expected='getuid f1 f0 main '
+expected='getpid f1 f0 main '
result=$(sed -n '1,/(main+0x[a-f0-9]\+) .*/ s/^.*(\([^+]\+\)+0x[a-f0-9]\+) .*/\1/p' $LOG |
tr '\n' ' ')
diff --git a/unwind.c b/unwind.c
index 797a287a8..21f2a4818 100644
--- a/unwind.c
+++ b/unwind.c
@@ -403,7 +403,7 @@ ret:
" > %s(%s+0x%lx) [0x%lx]\n", \
binary_filename, \
symbol_name, \
- function_off_set, \
+ (unsigned long) function_off_set, \
true_offset
#define STACK_ENTRY_NOSYMBOL_FMT \
" > %s() [0x%lx]\n", \
@@ -523,7 +523,7 @@ queue_put_call(void *queue,
static void
queue_put_error(void *queue,
const char *error,
- unw_word_t ip)
+ unsigned long ip)
{
queue_put(queue, NULL, NULL, 0, ip, error);
}