From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway20.websitewelcome.com (gateway20.websitewelcome.com [192.185.60.19]) by sourceware.org (Postfix) with ESMTPS id A8D0F3857C41 for ; Fri, 24 Jul 2020 20:18:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A8D0F3857C41 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 9816F400ED23B for ; Fri, 24 Jul 2020 13:56:47 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id z49Yj868hhKYqz49YjDDL7; Fri, 24 Jul 2020 15:18:48 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Jt/l6q/rbNwEA8IFcIpbrGu/aRFFx6muOEirDfbkjBg=; b=HjfqAhJ0X18GSZcRzHO1k7PoUU 9Pow9mj8RntHXOCqsYdO71Faw+qglVEaLk/kooxlU5jD31uNvpPIgtW6kQlZPZr/SSPBMncFVuhYA yDEQr1JqMVZYlz1dT5V+XMlkU; Received: from 174-16-104-48.hlrn.qwest.net ([174.16.104.48]:40258 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jz49X-000GuF-Sg; Fri, 24 Jul 2020 14:18:47 -0600 From: Tom Tromey To: Andrew Burgess Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] Demangle function names when disassembling References: <20200723161043.2191184-1-tromey@adacore.com> <20200724090819.GN853475@embecosm.com> X-Attribution: Tom Date: Fri, 24 Jul 2020 14:18:47 -0600 In-Reply-To: <20200724090819.GN853475@embecosm.com> (Andrew Burgess's message of "Fri, 24 Jul 2020 10:08:19 +0100") Message-ID: <87eep0bra0.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 174.16.104.48 X-Source-L: No X-Exim-ID: 1jz49X-000GuF-Sg X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 174-16-104-48.hlrn.qwest.net (murgatroyd) [174.16.104.48]:40258 X-Source-Auth: tom+tromey.com X-Email-Count: 7 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3024.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_ABUSEAT, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP, URIBL_CSS, URIBL_CSS_A autolearn=no 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: Fri, 24 Jul 2020 20:18:50 -0000 Andrew> It turns out that the bug that originally caused GDB to display Andrew> demangled names only applied for some languages, Ada, didn't have Andrew> this issue, and so has always displayed the mangled names. Ada is special here ... but I am not sure there's a very good reason for it. I've been meaning for a while to see if this difference can be removed. Mostly, I think this amounts to demangling Ada names during symbol reading. Andrew> So my initial thought was, lets make 'set print asm-demangle' be on by Andrew> default. Then we've still fixed the bug in GDB (about storing the Andrew> mangled vs demangled symbols), but the behaviour of GDB doesn't Andrew> actually change (vs 9.x release). It seems like we could still do this. Andrew> First, and maybe the smallest problem, boolean variables have the Andrew> "feature" that a user can just type 'set print asm-demangle', which is Andrew> equivalent to 'set print asm-demangle on'. However, this doesn't work Andrew> for auto-booleans, in that case you must type 'set print asm-demangle Andrew> on'. I think we could just safely ignore this. I wasn't even aware of this feature; and anyway it's easy to work around; and finally nobody has added a asm-demangle setting in 10 years or so due to the bug. Andrew> If I flip the default for 'asm-demangle' on the grounds that I don't Andrew> think we should suddenly change GDB's behaviour then this would only Andrew> be for C++, for Ada I would be suddenly changing the default. I think this is probably fine as well. I think it makes sense for the option to do what the documentation says it will do. Users, if they notice this, can change the setting. Yet another option would be to change my patch up-thread to use "demangle" for the header rather than "asm-demangle". I tend to think that would be more confusing, but I figured I'd mention it. I looked into the history of "asm-demangle", but it seems to predate the sourceware import. Andrew> [...] in some places 'asm_demangle' is completely Andrew> independent, and in other places 'asm_demangle' actually overrides Andrew> 'demangle' rather than deferring to it. Bleah. Can / should we fix this. There's also "set demangle-style", which is both obsolete and inherently broken. It should be removed. Andrew> + if (asm_demangle == AUTO_BOOLEAN_AUTO) Andrew> + fprintf_filtered (file, Andrew> + _("Demangling of C++/ObjC names in disassembly " We should probably use this opportunity to drop the C++/ObjC text, since this applies to any language with mangling. Tom