From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17361 invoked by alias); 20 Sep 2012 22:02:22 -0000 Received: (qmail 17282 invoked by uid 22791); 20 Sep 2012 22:02:16 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-ee0-f73.google.com (HELO mail-ee0-f73.google.com) (74.125.83.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Sep 2012 22:01:58 +0000 Received: by eeil10 with SMTP id l10so80786eei.0 for ; Thu, 20 Sep 2012 15:01:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:message-id:to:subject:from:x-gm-message-state; bh=sDZvSSFxc+apczJYwaRxKus4gbw+P3WCrFRjZB2j5I8=; b=IjCkXul0nF3zdgvLwM6qJSLmwntv/eUkzM1+JYavPd0FezV7kEltkx9QQpCU8WT27w rcT4JWTzTfNKexVd3VPGFYbtLKfbpT0XokKvH4iDmMNhNlP0GoNKpEZGZoyauR3CSwgW eJfDZ5GvzsosuaL3+b4sz6MfUYkHCQQIzRwsh3+hskbExjX/AviYe5/qGflFRC5X8lRR 24LKqVIL565q4Z0aag52Zw0rCplmv9qCQCU60QMLfw83ZAgiEmWVTfwOTQgm4SQWZ/hI yHskvdc4Cttny1gCBXrr/7YCjauIwamhibgNp6uYESC4I90jthbmt7c//5pI/6j2UxKt wq4w== Received: by 10.180.82.226 with SMTP id l2mr6485wiy.1.1348178516900; Thu, 20 Sep 2012 15:01:56 -0700 (PDT) Received: by 10.180.82.226 with SMTP id l2mr6480wiy.1.1348178516811; Thu, 20 Sep 2012 15:01:56 -0700 (PDT) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id cx9si707130wib.0.2012.09.20.15.01.56 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 20 Sep 2012 15:01:56 -0700 (PDT) Received: from ruffy2.mtv.corp.google.com (ruffy2.mtv.corp.google.com [172.18.110.129]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id E6891200057 for ; Thu, 20 Sep 2012 15:01:55 -0700 (PDT) Date: Thu, 20 Sep 2012 22:02:00 -0000 Message-Id: To: gdb-patches@sourceware.org Subject: [RFC] New option -nh: disable loading ~/.gdbinit From: dje@google.com X-Gm-Message-State: ALoCoQn4chlFtsk8vrGgkWvlEpE/JaoMz5QXMt6Z606Y50iRKaUkqiaG9If5cCXUrKL2cxX2EqbmBk0cqKp6GV3wzox9NaH9QFoGy/xD4q2dg5orTONGvYYdf9Z1mVSG74gEtQc/E52wBDUPXIkOjOFRKsRnaGIpIkybWweOQfMQQig6MmJIYBdQOZnEEevuXg6c1k3xs3NL98dCDGScBCP9a0SRba+qWRb7PqwepdZUpS7L/wmik/s= X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-09/txt/msg00415.txt.bz2 Hi. When running tests (not necessarily tests in gdb/testsuite!) with a gdb with a non-trivial system.gdbinit, it is useful to be able disable loading ~/.gdbinit. system.gdbinit is still necessary, it provides necessary functionality. One *could* run the tests with -nx -x /path/to/system.gdbinit, but the path to system.gdbinit is not necessarily easy to obtain. Instead, I'd like to add this option: -nh. Sound ok? [I'll submit a full patch with docs if approved.] 2012-09-20 Doug Evans New option -nh: inhibit loading of ~/.gdbinit. * main.c (captured_main): Recognize and process -nh. Index: main.c =================================================================== RCS file: /cvs/src/src/gdb/main.c,v retrieving revision 1.113 diff -u -p -r1.113 main.c --- main.c 29 Aug 2012 19:17:16 -0000 1.113 +++ main.c 20 Sep 2012 21:51:20 -0000 @@ -273,6 +273,7 @@ captured_main (void *data) char **argv = context->argv; static int quiet = 0; static int set_args = 0; + static int inhibit_home_gdbinit = 0; /* Pointers to various arguments from command line. */ char *symarg = NULL; @@ -415,6 +416,7 @@ captured_main (void *data) {"quiet", no_argument, &quiet, 1}, {"q", no_argument, &quiet, 1}, {"silent", no_argument, &quiet, 1}, + {"nh", no_argument, &inhibit_home_gdbinit, 1}, {"nx", no_argument, &inhibit_gdbinit, 1}, {"n", no_argument, &inhibit_gdbinit, 1}, {"batch-silent", no_argument, 0, 'B'}, @@ -845,7 +847,7 @@ captured_main (void *data) global parameters, which are independent of what file you are debugging or what directory you are in. */ - if (home_gdbinit && !inhibit_gdbinit) + if (home_gdbinit && !inhibit_gdbinit && !inhibit_home_gdbinit) catch_command_errors (source_script, home_gdbinit, 0, RETURN_MASK_ALL); /* Process '-ix' and '-iex' options early. */