From patchwork Thu Jul 28 13:37:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 107256 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 636DAB6F18 for ; Thu, 28 Jul 2011 23:38:50 +1000 (EST) Received: from localhost ([::1]:53421 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmQnU-0006FC-1I for incoming@patchwork.ozlabs.org; Thu, 28 Jul 2011 09:38:44 -0400 Received: from eggs.gnu.org ([140.186.70.92]:55419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmQn4-0005Hc-UI for qemu-devel@nongnu.org; Thu, 28 Jul 2011 09:38:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QmQn3-0008PC-I7 for qemu-devel@nongnu.org; Thu, 28 Jul 2011 09:38:18 -0400 Received: from moutng.kundenserver.de ([212.227.17.10]:61431) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmQn3-0008P4-0Z for qemu-devel@nongnu.org; Thu, 28 Jul 2011 09:38:17 -0400 Received: from aspire-one.lan (dynamic-adsl-78-14-106-154.clienti.tiscali.it [78.14.106.154]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0LcmTH-1REIpb1Qoh-00jOh9; Thu, 28 Jul 2011 15:38:08 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 28 Jul 2011 15:37:56 +0200 Message-Id: <1311860276-24690-5-git-send-email-Laurent@Vivier.EU> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1311860276-24690-1-git-send-email-Laurent@Vivier.EU> References: <1311860276-24690-1-git-send-email-Laurent@Vivier.EU> X-Provags-ID: V02:K0:mKp1WfulZ1492xHNAgPFTEIh1fongnlSxD6lSRyhlhn p4hij+W6tBVIDQElRTMXnvxD+ZsDczXbMdqYDP8bTKSCkpATn1 ViI0BQN5pjYojdIAT67J3nTzmbEAmQt+ceDp5N9PZaFWUVwF1J Jl0I3IOO1HhwSdvFQRiFusfaHdzPWE5ayiz9F+cGB8Exj8vH0o ZSrfiUlp5dgCrZe0zrdnCzCEuo/O0hLK7qBN3ZTO3Y= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.17.10 Cc: Riku Voipio , Laurent Vivier Subject: [Qemu-devel] [PATCH 4/4] linux-user: define new environment variables X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- linux-user/main.c | 11 ++++++++--- qemu-doc.texi | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 7180cee..ff1720b 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,9 @@ 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")); + } optind = 1; for(;;) { diff --git a/qemu-doc.texi b/qemu-doc.texi index 47e1991..330f9d0 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2285,6 +2285,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