umovelong was always returning the full value read in ptrace'd process
memory (eg long) even if the type was not a long (eg int).
This patch add handling for at least int case.
[ found out with parameters test case on x86_64 as int is 32bit and long
64bit ]
Signed-off-by: Arnaud Patard <[email protected]>
---
sysdeps/linux-gnu/trace.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/sysdeps/linux-gnu/trace.c b/sysdeps/linux-gnu/trace.c
index 6ac302a..75d0d55 100644
--- a/sysdeps/linux-gnu/trace.c
+++ b/sysdeps/linux-gnu/trace.c
@@ -55,6 +55,14 @@ umovelong (Process *proc, void *addr, long *result, arg_type_info *info) {
return -errno;
*result = pointed_to;
+ if (info) {
+ switch(info->type) {
+ case ARGTYPE_INT:
+ *result &= 0x00000000ffffffffUL;
+ default:
+ break;
+ };
+ }
return 0;
}
#endif
_______________________________________________
Ltrace-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/ltrace-devel