qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-commits] [COMMIT 74d753a] linux-user: strace now handles guest


From: Anthony Liguori
Subject: Re: [Qemu-commits] [COMMIT 74d753a] linux-user: strace now handles guest stringscorrectly [v2]
Date: Tue, 16 Jun 2009 20:19:23 -0500
User-agent: Thunderbird 2.0.0.21 (X11/20090320)

malc wrote:
On Tue, 16 Jun 2009, Anthony Liguori wrote:

From: Mika Westerberg <address@hidden>

- to not to break strace with GUEST_BASE is set:
- Strace now can load and print guest strings correctly.
- Added printing support for commonly used flags in some syscalls
  (e.g open, creat, mmap etc.)

v2:
- fix strace.c build on etch
- add futex print to strace

Signed-off-by: Mika Westerberg <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>

diff --git a/linux-user/strace.c b/linux-user/strace.c
index b4caffe..5ea9acb 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -6,6 +6,9 @@
 #include <sys/shm.h>
 #include <sys/select.h>
 #include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/mman.h>
+#include <linux/futex.h>

On my system the above line causes gcc to emit:

In file included from /home/malc/x/rcs/git/qemu/linux-user/strace.c:12:
/usr/include/linux/futex.h:48: error: field `__user' has incomplete type
/usr/include/linux/futex.h:48: error: syntax error before '*' token
/usr/include/linux/futex.h:63: error: field `list' has incomplete type
/usr/include/linux/futex.h:83: error: field `__user' has incomplete type
/usr/include/linux/futex.h:83: error: syntax error before '*' token
make[1]: *** [strace.o] Error 1

Following fixes it, but i wonder if there's better way:

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 5ea9acb..8c3dbd6 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -1,3 +1,4 @@
+#define __user
 #include <stdio.h>
 #include <errno.h>
 #include <sys/ipc.h>

[..snip..]

We had the same problem with usb-linux.c. It's broken system headers, the __user stuff is supposed to get removed as part of the headers installation.

It builds fine on my system (Fedora 10).

I'm not against adding the __user define though. Wouldn't be a bad idea to put it in the global CFLAGS either.

--
Regards,

Anthony Liguori





reply via email to

[Prev in Thread] Current Thread [Next in Thread]