From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19609 invoked by alias); 9 Apr 2013 17:53:38 -0000 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 Received: (qmail 19600 invoked by uid 89); 9 Apr 2013 17:53:38 -0000 X-Spam-SWARE-Status: No, score=-6.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD,TW_DB,TW_XD autolearn=ham version=3.3.1 Received: from mail-vc0-f172.google.com (HELO mail-vc0-f172.google.com) (209.85.220.172) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 09 Apr 2013 17:53:37 +0000 Received: by mail-vc0-f172.google.com with SMTP id gd11so2962474vcb.31 for ; Tue, 09 Apr 2013 10:53:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:x-gm-message-state; bh=g1X+uKj3mEyq+OQAvZFtNuFsptRqC8eTDl8WWo7u3tY=; b=prGNUBFdb2Qa3tt3D2Wxr6NdtDPCwFpX27gCUA6+gJvXV8aopqb1beZvxIPUivPhxD qkAw0LFnbKKjnceReKYqoqUF4vVPX2WE58kjMPECCCbUWbokt+T7f4zgeaj46qYTp0on a6ybQ6b1o3kG488KHWdKcFIVqVQ5DMNVnYaaWOeU2KV3TfroF5ke+L1uLD01tIRDKOCb JcX5DIc2EJumB+L5WYM0DR+3YfOMlRRVzNvyNqpmq2+XwgRto7+b0o1+XXAJ5Mx58OEm YPLF2b4TwK+FeaPJGPTFpWt/j5w5P116RBvNdHnAPvtMREGYqhG1kpPwytqzTNvCJj3b UAvw== MIME-Version: 1.0 X-Received: by 10.52.91.212 with SMTP id cg20mr17577931vdb.63.1365530015554; Tue, 09 Apr 2013 10:53:35 -0700 (PDT) Received: by 10.220.123.70 with HTTP; Tue, 9 Apr 2013 10:53:35 -0700 (PDT) In-Reply-To: <83txnfa9m7.fsf@gnu.org> References: <83r4jaynqq.fsf@gnu.org> <514B4AC3.1090103@redhat.com> <83zjxwy4ux.fsf@gnu.org> <20130321191051.GF5447@adacore.com> <83r4j8y1kh.fsf@gnu.org> <20130321203919.GG5447@adacore.com> <87r4j8zd0k.fsf@fleche.redhat.com> <83ehf85u7x.fsf@gnu.org> <83wqsbadfe.fsf@gnu.org> <20836.17485.525118.795474@ruffy2.mtv.corp.google.com> <83txnfa9m7.fsf@gnu.org> Date: Tue, 09 Apr 2013 23:33:00 -0000 Message-ID: Subject: Re: [PATCH] Display configuration details in --help From: Doug Evans To: Eli Zaretskii Cc: Tom Tromey , Joel Brobecker , Pedro Alves , gdb-patches Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQloSvUOFXnjpO1BSH+h80YUDzspteSwUAEYqkFbBioTvtK3q54wjUrSbGNifpmtyg3eZ1iZtmqTJ8hf/rXkSVFaJZs8sX7EOjgJQjcf8UNcKLNl06QKFcROxpXJCQ95IlxZSf9DIRec6waorbI3VvZyCDTXSXF0NIcL/ma+gxFg9H7Siy2COQzHgOYPqtRqrGg/yJaWaCyz++quo6epRsN1GaCidg== X-SW-Source: 2013-04/txt/msg00250.txt.bz2 On Tue, Apr 9, 2013 at 10:37 AM, Eli Zaretskii wrote: >> I have a bit of a phobia of adding more lines to gdb's initial output. >> It's too long already IMO. [I realize there's -q.] >> I'm not objecting per se. Just wondering how critical this is. > > It's not critical. But then neither is this: > > GNU gdb (GDB) 7.5.1 > Copyright (C) 2012 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show copying" > and "show warranty" for details. ^^^^^^^^^^^^^^^^^^ > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > So I thought we should be consistent here, and offer the same for this > line: > > This GDB was configured as "i686-pc-mingw32". > > I'm okay with not adding that, but can someone explain why it is > different from advertising "show copying" and "show warranty"? Should > we remove those two as well? I need to check, but I think(!) the "show copying" and "show warranty" are required by GNU standards. >> > +/* Print the details of GDB build-time configuration. */ >> > +void >> > +print_gdb_configuration (struct ui_file *stream) >> > +{ >> > + fprintf_filtered (stream, _("\ >> > +This GDB was configured as follows:\n\ >> > + configure --host=%s --target=%s\n\ >> > +"), host_name, target_name); >> > + fprintf_filtered (stream, _("\ >> > + --with-auto-load-dir=%s\n\ >> > + --with-auto-load-safe-path=%s\n\ >> > +"), AUTO_LOAD_DIR, AUTO_LOAD_SAFE_PATH); >> > +#if HAVE_LIBEXPAT >> > + fprintf_filtered (stream, _("\ >> > + --with-expat\n\ >> > +")); >> > +#else >> > + fprintf_filtered (stream, _("\ >> > + --without-expat\n\ >> > +")); >> > +#endif >> >> If we've already discussed this, please ignore, but ... :-) >> I'd prefer one line per fprintf instead of three. > > Sorry, I'm not following: what 3 lines? Can you show how would you > like the code be reformatted? fprintf_filtered (stream, _(" -with-expat\n")); // assuming 2 space indentation >> Also, is there something driving the choice of indenting 13 spaces in? > > It lines up to the right of "configure", below the first option: > > This GDB is configured as follows: > configure --host=i686-pc-mingw32 --target=i686-pc-mingw32 > --with-auto-load-dir=$debugdir:$datadir/auto-load > --with-auto-load-safe-path=$debugdir:$datadir/auto-load > --with-expat > --with-gdb-datadir=d:/usr/share/gdb (relocatable) > --with-jit-reader-dir=d:/usr/lib/gdb (relocatable) > --without-libunwind-ia64 > --with-lzma > --with-python=d:/usr/Python26 (relocatable) > --with-separate-debug-dir=d:/usr/lib/debug (relocatable) > --with-system-gdbinit=d:/usr/etc/gdbinit (relocatable) > --with-zlib > >> How about 2 or 4? >> For consistency with print_gdb_help I'd go with 2. > > print_gdb_help displays a different information, so I see no need for > consistency here. But I won't argue if others think like you do. One could parameterize the indentation. Just a suggestion. e.g. fprintf_filtered ("%s--with-foo", indent); // or some such [yes, I left off _()] >> > fputs_unfiltered (_("\ >> > --version Print version information and then exit.\n\ >> > + --configuration Print details about GDB configuration and then exit.\n\ >> > -w Use a window interface.\n\ >> > --write Set writing into executable and core files.\n\ >> > --xdb XDB compatibility mode.\n\ >> >> The options here are (mostly) sorted alphabetically. > > Except where they aren't: > > --args Arguments after executable-file are passed to inferior > -b BAUDRATE Set serial port baud rate used for remote debugging. > --batch Exit after processing options. > --batch-silent As for --batch, but suppress all gdb stdout output. > >>> --return-child-result > GDB exit code will be the child's exit code. > --cd=DIR Change current directory to DIR. > --command=FILE, -x Execute GDB commands from FILE. > >>> --eval-command=COMMAND, -ex > Execute a single GDB command. > May be used multiple times and in conjunction > with --command. > >>> --init-command=FILE, -ix Like -x but execute it before loading inferior. > >>> --init-eval-command=COMMAND, -iex Like -ex but before loading inferior. > >>> --core=COREFILE Analyze the core dump COREFILE. > >>> --pid=PID Attach to running process PID. > --dbx DBX compatibility mode. > --directory=DIR Search for source files in DIR. > --epoch Output information used by epoch emacs-GDB interface. > --exec=EXECFILE Use EXECFILE as the executable. > --fullname Output information used by emacs-GDB interface. > --help Print this message. > --interpreter=INTERP > Select a specific interpreter / user interface > -l TIMEOUT Set timeout in seconds for remote debugging. > --nw Do not use a window interface. > --nx Do not read .gdbinit file. > --quiet Do not print version number on startup. > --readnow Fully read symbol files on first access. > --se=FILE Use FILE as symbol file and executable file. > --symbols=SYMFILE Read symbols from SYMFILE. > --tty=TTY Use TTY for input/output by the program being debugged. > --version Print version information and then exit. > -w Use a window interface. > --write Set writing into executable and core files. > --xdb XDB compatibility mode. > > Again, I'm not really wedded to the place where I inserted the new > option, but please tell me near which 'c' option to put it instead ;-). Right after --command works for me.