qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Riku Voipio <riku.voipio@iki.fi>, Laurent Vivier <Laurent@Vivier.EU>
Subject: [Qemu-devel] [PATCH 4/4] linux-user: define new environment variables
Date: Sun, 18 Sep 2011 11:37:10 +0200	[thread overview]
Message-ID: <1316338630-9625-5-git-send-email-laurent@vivier.eu> (raw)
In-Reply-To: <1316338630-9625-1-git-send-email-laurent@vivier.eu>

From: Laurent Vivier <Laurent@Vivier.EU>

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 <Laurent@Vivier.EU>
---
 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 40d76b4..9d161c4 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2822,8 +2822,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"
@@ -2879,7 +2881,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 = &regs1;
     struct image_info info1, *info = &info1;
     struct linux_binprm bprm;
@@ -2926,6 +2928,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.
+@item QEMU_DEBUG=options
+Activate log. Use same options as '-d' options.
+@item QEMU_GDB=port
+Wait gdb connection to port.
 @end table
 
 @node Other binaries
-- 
1.7.1

  parent reply	other threads:[~2011-09-18  9:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-18  9:37 [Qemu-devel] [PATCH 0/4] Set of patches for chrooted environment Laurent Vivier
2011-09-18  9:37 ` [Qemu-devel] [PATCH 1/4] linux-user: define default cpu model in configure instead of linux-user/main.c Laurent Vivier
2011-09-18  9:37 ` [Qemu-devel] [PATCH 2/4] linux-user: specify the cpu model during configure Laurent Vivier
2011-09-18  9:37 ` [Qemu-devel] [PATCH 3/4] linux-user,m68k: display default cpu Laurent Vivier
2011-09-18  9:37 ` Laurent Vivier [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-07-28 13:37 [Qemu-devel] [PATCH 0/4] Set of patches for chrooted environment Laurent Vivier
2011-07-28 13:37 ` [Qemu-devel] [PATCH 4/4] linux-user: define new environment variables Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1316338630-9625-5-git-send-email-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).