From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id AA00E3955421 for ; Tue, 18 May 2021 13:44:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AA00E3955421 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wr1-x42a.google.com with SMTP id x8so10283351wrq.9 for ; Tue, 18 May 2021 06:44:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=PJNeQaruUrKgHVAAGzizvFTGnHowEhfdrBam4ohis8E=; b=hhGB8EFBJiT7d0fJTcsHIQvkMn6RMFSFhA5xSUTl+v3xNg+G27erLhuw+BU6ha9COa pjnlNaHQxkqbg3PAUxbcQ7ONjeF6PBEfNGkUq+nsDJzE5zNzyLR1UvmDYS8dGnkpp9aP 5Olcc7nDD+iWI0AIRjt0W0YJYSLSdaACX6a2X7n+/QrsBEWEd/LOx2QRr5FhKLhncXcf 4M4QbLiNjZDnjzrWSOeYOVDN/7mTJzmn48ecCD9Bsy/hNXMazIidVGTGfASkIoHQ8Ywq I68JxYdybGgkckYYLf15pLfqEG/dtocAxzRCHCDI9h6ERXH/hCR97YyC3lfjX7v5PT6F ygmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=PJNeQaruUrKgHVAAGzizvFTGnHowEhfdrBam4ohis8E=; b=ku1uEQRpYUbedKN8DfzzJMu9RUo5FMmXXzrNfJf5zrMoYx1z4zJE0OmhVNChat0sEh mD4RPA+zL34AQs6Fs8GGPPbDd+NoQXk64kla9Nzujy3K44y3k08NZpPxIX/ZBeMOdPUn ZpvmNkezL3fQSG9h40MgbaFpp1xJoEoCHPHkJ8E8RQzHHKxVietlpWbFa6/4rRongXjJ LCshYAebE6VCXnYdD529p3gZu+mTX+DICKXrTzywGjpgvlTYzCad/E+zTTv+43mamYpT avf1hkhq2bXr+JPM+WS6cQ5LHnCgq2cyZKM5f5J5LMhfDNb7veN1oJorcLgxn8VvJCEq XmtQ== X-Gm-Message-State: AOAM531UGrR3UNuwYEGIHIYsZ4kK/frYtVMmPCQ9wdswBl9ckuYwG7Yw bqHUN0Y2LCNxdEcN3vcHETRIYw== X-Google-Smtp-Source: ABdhPJx7SJqGpLlp9EWuAb9oE42E0CRC1XgSE1A6neZtfzv6wg89Tb9DTFMMpha6DFZeu5SM0km9Jg== X-Received: by 2002:adf:dc8a:: with SMTP id r10mr2720611wrj.119.1621345459809; Tue, 18 May 2021 06:44:19 -0700 (PDT) Received: from localhost (host109-151-46-70.range109-151.btcentralplus.com. [109.151.46.70]) by smtp.gmail.com with ESMTPSA id u9sm18383428wmc.38.2021.05.18.06.44.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 06:44:19 -0700 (PDT) Date: Tue, 18 May 2021 14:44:18 +0100 From: Andrew Burgess To: Marco Barisione Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 0/4] Fix crash in "set python" and small cleanups Message-ID: <20210518134418.GR3067949@embecosm.com> References: <20210518110740.9517-1-mbarisione@undo.io> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210518110740.9517-1-mbarisione@undo.io> X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 14:42:43 up 15 days, 2:37, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Tue, 18 May 2021 13:44:22 -0000 * Marco Barisione via Gdb-patches [2021-05-18 12:07:36 +0100]: > I noticed by chance that the "set python" command with no arguments > causes a segfault. This is due to a trivial mistake, the prefix command > meant to be "show python" is added to the list of set commands, and the > "set python" one is added to the list of show commands. > > I didn't add a specific test because what's the chance of "set python" > regressing? Don't we know the answer to that is 100% - it's currently regressed, right? > I tried writing a self test instead (like the ones in > gdb/unittests/command-def-selftests.c), but I couldn't figure out how to > detect this problem in a generic way. Any idea? Or it this patch > OK without a test? I don't have any suggestions for a self test, but writing a "normal" test should be pretty easy, personally, I'd just do that. Thanks, Andrew > > This patch series also includes some cleanups which came up from the > work on the main fix. > > Marco Barisione (4): > gdb: Add an overloaded ui_out::text accepting a const std::string & > gdb: Pass std::strings to ui_out::field_string () where convenient > gdb: Fix crash in cmd_show_list () if the prefix doesn't contain "show > " > gdb: Add "set|show python" commands to the correct list > > gdb/ada-lang.c | 4 ++-- > gdb/break-catch-sig.c | 2 +- > gdb/break-catch-throw.c | 2 +- > gdb/cli/cli-setshow.c | 32 ++++++++++++++++++++++++-------- > gdb/disasm.c | 2 +- > gdb/infcmd.c | 2 +- > gdb/inferior.c | 2 +- > gdb/linux-thread-db.c | 2 +- > gdb/mi/mi-cmd-var.c | 22 +++++++++++----------- > gdb/mi/mi-main.c | 14 +++++++------- > gdb/osdata.c | 3 +-- > gdb/probe.c | 5 ++--- > gdb/python/python.c | 4 ++-- > gdb/source.c | 2 +- > gdb/target-connection.c | 2 +- > gdb/thread.c | 5 ++--- > gdb/tracepoint.c | 4 ++-- > gdb/ui-out.c | 11 +++++++++-- > gdb/ui-out.h | 4 +++- > 19 files changed, 73 insertions(+), 51 deletions(-) > > -- > 2.28.0 >