From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id B94783857813 for ; Wed, 14 Jul 2021 04:55:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B94783857813 X-ASG-Debug-ID: 1626238521-0c856e6cd51c9e4b0001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id D4TmpXuZbjj4xTCL (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 14 Jul 2021 00:55:21 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.localdomain (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) by smtp.ebox.ca (Postfix) with ESMTP id 04DB6441B21; Wed, 14 Jul 2021 00:55:21 -0400 (EDT) From: Simon Marchi X-Barracuda-RBL-IP: 192.222.157.6 X-Barracuda-Effective-Source-IP: 192-222-157-6.qc.cable.ebox.net[192.222.157.6] X-Barracuda-Apparent-Source-IP: 192.222.157.6 To: gdb-patches@sourceware.org Subject: [PATCH 00/16] Bunch of commands related cleanups Date: Wed, 14 Jul 2021 00:55:04 -0400 X-ASG-Orig-Subj: [PATCH 00/16] Bunch of commands related cleanups Message-Id: <20210714045520.1623120-1-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1626238521 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 5392 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.91193 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, KAM_DMARC_QUARANTINE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jul 2021 04:55:24 -0000 While making a patch for bug 28085 [1], I put my hands in the command code, and noticed a lot of potential cleanups to make the code simpler more robust. My patch queue started to get a bit long, so here's a mixed bag of patches that I think are improvements on their own right. The last patch of the series is the biggest and most risky one, it makes string settings use an std::string variable, instead of a `char *`. It's quite a big change, but I think it makes things easier going forward. Other than that, there are some cleanups in tests, removal of unneeded fields / declarations, adding of C++-y getters / setters, etc. This was regtested on Ubuntu 20.04 with the unix and native-extended-gdbserver boards. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=28085 Simon Marchi (16): gdb/testsuite: split gdb.python/py-parameter.exp in procs gdb.base/setshow.exp: use save_vars to save/restore gdb_prompt gdb.base/setshow.exp: split in procs gdb.base/setshow.exp: fix duplicate test name gdb: un-share set_inferior_cwd declaration gdb: remove inferior::{argc,argv} gdb: add setter/getter for inferior arguments gdb: add setter/getter for inferior cwd gdb: make inferior::m_args an std::string gdb: make inferior::m_cwd an std::string gdb: make inferior::m_terminal an std::string gdb: rename cfunc to simple_func gdb: remove cmd_list_element::function::sfunc gdb/testsuite: test get/set value of unregistered Guile parameter gdb: make cmd_list_element var an optional union gdb: make string-like set show commands use std::string variable gdb/auto-load.c | 48 +- gdb/breakpoint.c | 28 +- gdb/breakpoint.h | 2 +- gdb/build-id.c | 4 +- gdb/cli/cli-cmds.c | 59 +- gdb/cli/cli-decode.c | 223 ++++--- gdb/cli/cli-decode.h | 57 +- gdb/cli/cli-dump.c | 2 +- gdb/cli/cli-logging.c | 23 +- gdb/cli/cli-option.c | 9 +- gdb/cli/cli-option.h | 4 +- gdb/cli/cli-setshow.c | 101 ++- gdb/command.h | 79 +-- gdb/compile/compile.c | 46 +- gdb/corefile.c | 17 +- gdb/defs.h | 4 +- gdb/disasm.c | 11 +- gdb/disasm.h | 2 +- gdb/dwarf2/dwz.c | 2 +- gdb/dwarf2/index-cache.c | 10 +- gdb/dwarf2/read.c | 10 +- gdb/elf-none-tdep.c | 6 +- gdb/event-top.c | 12 +- gdb/fbsd-tdep.c | 6 +- gdb/fork-child.c | 7 +- gdb/guile/scm-cmd.c | 3 +- gdb/guile/scm-param.c | 168 ++++- gdb/infcmd.c | 103 +-- gdb/inferior.c | 11 +- gdb/inferior.h | 78 ++- gdb/inflow.c | 46 +- gdb/linux-tdep.c | 7 +- gdb/linux-thread-db.c | 17 +- gdb/main.c | 17 +- gdb/maint-test-options.c | 11 +- gdb/maint-test-settings.c | 8 +- gdb/mi/mi-cmd-env.c | 27 +- gdb/nat/fork-inferior.c | 15 +- gdb/proc-api.c | 5 +- gdb/procfs.c | 10 +- gdb/python/py-cmd.c | 3 +- gdb/python/py-param.c | 48 +- gdb/python/python-internal.h | 2 +- gdb/python/python.c | 32 +- gdb/remote-sim.c | 7 +- gdb/remote.c | 21 +- gdb/serial.c | 8 +- gdb/solib.c | 20 +- gdb/source.c | 66 +- gdb/source.h | 5 +- gdb/stack.c | 22 +- gdb/symfile.c | 49 +- gdb/symtab.c | 46 +- gdb/target-descriptions.c | 2 +- gdb/target.c | 4 +- gdb/terminal.h | 2 +- gdb/testsuite/gdb.base/setshow.exp | 734 +++++++++++++--------- gdb/testsuite/gdb.guile/scm-parameter.exp | 8 + gdb/testsuite/gdb.python/py-parameter.exp | 237 ++++--- gdb/top.c | 112 ++-- gdb/top.h | 2 +- gdb/tracepoint.c | 47 +- gdb/tracepoint.h | 2 +- gdb/tui/tui-layout.c | 3 +- gdb/windows-nat.c | 2 +- gdbserver/inferiors.cc | 18 +- gdbserver/inferiors.h | 4 + gdbserver/server.cc | 6 +- gdbsupport/common-inferior.h | 9 +- 69 files changed, 1559 insertions(+), 1260 deletions(-) -- 2.32.0