From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2IdJOGROcmNNVBgAWB0awg (envelope-from ) for ; Mon, 14 Nov 2022 09:19:16 -0500 Received: by simark.ca (Postfix, from userid 112) id E2E5E1E124; Mon, 14 Nov 2022 09:19:16 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=k1p8nDOf; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 6F20D1E0D3 for ; Mon, 14 Nov 2022 09:19:16 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CA1433858C2D for ; Mon, 14 Nov 2022 14:19:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA1433858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668435554; bh=3YYdjeEYbc0RRt7Y7as2j7lrPpqPmaALHtakwH9CtvU=; h=Date:Subject:To:References:Cc:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=k1p8nDOfrEJaJkOpeCWt6OEjXX18XUHIpIoG4lZEil3vRLe9u3KA/RCW/Lbf1+H7c LOhy9/KiDXEifUFkaF0JsF6qilPpdmIyygpOM5Ou8GQmho3Eq2yYJ9brdQZyj1NwwL hG5Xc49vBnlPqHzLfy//v3EJ7ZkPfupTXcaNxECs= Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id CEA503858D1E for ; Mon, 14 Nov 2022 14:18:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CEA503858D1E Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1163C22340; Mon, 14 Nov 2022 14:18:53 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E114A13A92; Mon, 14 Nov 2022 14:18:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id bfVQNUxOcmPKZgAAMHmgww (envelope-from ); Mon, 14 Nov 2022 14:18:52 +0000 Message-ID: Date: Mon, 14 Nov 2022 15:18:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v2] gdb: make "start" breakpoint inferior-specific Content-Language: en-US To: Simon Marchi , Simon Marchi , gdb-patches@sourceware.org References: <691c5a58-68ae-5fe9-2f3d-34fb7af69ad0@palves.net> <20221108212008.1792090-1-simon.marchi@efficios.com> <1c02e882-c19e-483e-e50c-634fbe282988@suse.de> <4c7b3e65-08a6-913a-8e0f-8d3812bbd005@efficios.com> <5d4c4f03-4aa5-cf36-cb4d-cf8293f247a1@suse.de> <2c61909c-f5d9-2a69-bbd0-a05a0c39f5f0@suse.de> <0a9685a1-805b-2212-9464-e5278ec05279@simark.ca> Cc: Pedro Alves In-Reply-To: <0a9685a1-805b-2212-9464-e5278ec05279@simark.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 11/14/22 14:19, Simon Marchi wrote: > > > On 11/14/22 06:29, Tom de Vries wrote: >> On 11/11/22 20:03, Simon Marchi via Gdb-patches wrote: >>>> I'm not sure if this is a better solution: it's more intrusive. >>> Ah, that would be good too.  We wouldn't have to bake in the knowledge >>> of which languages use which operator.  But I'm also a bit scared of >>> other unintended consequences when looking up the main symbol, as I see >>> the current_language is involved in some places.  To be safe, I'll just >>> go with my naive patch.  Thanks for the suggestion. >> >> FWIW, I've just stumbled onto language unknown, and realized that strictly speaking we've got a regression because we used to have: >> ... >> $ gdb -q -batch a.out -ex "set language unknown" -ex start >> Temporary breakpoint 1 at 0x40050b: file /home/vries/hello.c, line 6. >> >> Temporary breakpoint 1, main () at /home/vries/hello.c:6 >> 6         printf ("hello\n"); >> Warning: the current language does not match this frame. >> $ >> ... >> but now we have: >> ... >> $ gdb -q -batch a.out -ex "set language unknown" -ex start >> expression parsing not implemented for language "Unknown" >> $ >> ... >> >> I don't really care about this, I thought I just mention it. > > Huh... > > What is "set language unknown" useful for, generally speaking? If > debugging something in a language GDB doesn't know about, I think it > will fall back to minimal. Could we just not expose the "unknown" > language to the user? Yeah, interestingly it also doesn't show up in the help: ... $ gdb (gdb) help set language Set the current source language. The currently understood settings are: local or auto Automatic setting based on source file c Use the C language objective-c Use the Objective-C language c++ Use the C++ language d Use the D language go Use the Go language fortran Use the Fortran language modula-2 Use the Modula-2 language asm Use the Assembly language pascal Use the Pascal language opencl Use the OpenCL C language rust Use the Rust language minimal Use the Minimal language ada Use the Ada language ... Though that may have been an oversight, I'm not sure. Looking through the testsuite, there are a few uses: ... $ find gdb/testsuite/ -type f | xargs grep "set lang.*unknown" gdb/testsuite/gdb.base/parse_number.exp:gdb_test_no_output "set language unknown" gdb/testsuite/gdb.base/langs.exp: gdb_test_no_output "set language unknown" gdb/testsuite/gdb.base/default.exp:gdb_test "set language" "Requires an argument. Valid arguments are auto, local, unknown, ada, asm, c, c.., d, fortran, go, minimal, modula-2, objective-c, opencl, pascal, rust." gdb/testsuite/gdb.cp/demangle.exp: gdb_test_no_output "set language unknown" ... But I think removing it from the set language command, and replacing it with "maint set language unknown" should be ok. Thanks, - Tom Thanks, - Tom