[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 006/111] linux-user: define new environment variable
From: |
Bryce Lanham |
Subject: |
[Qemu-devel] [PATCH 006/111] linux-user: define new environment variables |
Date: |
Wed, 17 Aug 2011 15:46:11 -0500 |
From: Laurent Vivier <address@hidden>
QEMU_GDB=port allows to define gdb server port to wait on.
QEMU_DEBUG=options allows to activate log file (like -d options)
Signed-off-by: Laurent Vivier <address@hidden>
---
linux-user/main.c | 14 +++++++++++---
qemu-doc.texi | 4 ++++
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index 68b5681..62aa983 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2815,8 +2815,10 @@ static void usage(void)
"-strace log system calls\n"
"\n"
"Environment variables:\n"
- "QEMU_STRACE Print system calls and arguments similar to
the\n"
- " 'strace' program. Enable by setting to any
value.\n"
+ "QEMU_STRACE Print system calls and arguments similar to
the\n"
+ " 'strace' program. Enable by setting to any
value.\n"
+ "QEMU_DEBUG=options Activate log. Use same options as '-d'
options\n"
+ "QEMU_GDB=port Wait gdb connection to port\n"
"You can use -E and -U options to set/unset environment variables\n"
"for target process. It is possible to provide several variables\n"
"by repeating the option. For example:\n"
@@ -2872,7 +2874,7 @@ int main(int argc, char **argv, char **envp)
const char *filename;
const char *cpu_model;
const char *log_file = DEBUG_LOGFILE;
- const char *log_mask = NULL;
+ const char *log_mask = getenv("QEMU_DEBUG");
struct target_pt_regs regs1, *regs = ®s1;
struct image_info info1, *info = &info1;
struct linux_binprm bprm;
@@ -2919,6 +2921,12 @@ int main(int argc, char **argv, char **envp)
#if defined(cpudef_setup)
cpudef_setup(); /* parse cpu definitions in target config file (TBD) */
#endif
+ if (getenv("QEMU_GDB")) {
+ gdbstub_port = atoi(getenv("QEMU_GDB"));
+ }
+ /* don't propagate QEMU_DEBUG and _GDB to children */
+ unsetenv("QEMU_DEBUG");
+ unsetenv("QEMU_GDB");
optind = 1;
for(;;) {
diff --git a/qemu-doc.texi b/qemu-doc.texi
index 31199f6..2193463 100644
--- a/qemu-doc.texi
+++ b/qemu-doc.texi
@@ -2293,6 +2293,10 @@ space emulator hasn't implemented ptrace). At the
moment this is
incomplete. All system calls that don't have a specific argument
format are printed with information for six arguments. Many
flag-style arguments don't have decoders and will show up as numbers.
address@hidden QEMU_DEBUG=options
+Activate log. Use same options as '-d' options.
address@hidden QEMU_GDB=port
+Wait gdb connection to port.
@end table
@node Other binaries
--
1.7.2.3
- [Qemu-devel] [RFC][PATCH 000/111] QEMU m68k core additions, Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 001/111] linux-user: Signals processing is not thread-safe., Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 002/111] linux-user: add qemu-wrapper, Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 003/111] linux-user: define default cpu model in configure instead of linux-user/main.c, Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 004/111] linux-user: specify the cpu model during configure, Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 006/111] linux-user: define new environment variables,
Bryce Lanham <=
- [Qemu-devel] [PATCH 007/111] linux-user: define a script to set binfmt using debian flavored tools, Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 008/111] linux-user: define default cpu model in configure instead of linux-user/main.c, Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 009/111] m68k: add tcg_gen_debug_insn_start(), Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 005/111] linux-user,m68k: display default cpu, Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 010/111] m68k: define m680x0 CPUs and features, Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 011/111] m68k: add missing accessing modes for some instructions., Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 013/111] m68k: add Scc instruction with memory operand., Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 012/111] m68k: add Motorola 680x0 family common instructions., Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 015/111] m68k: modify movem instruction to manage word, Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 016/111] m68k: add 64bit divide., Bryce Lanham, 2011/08/17