From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id I2zSJJdLZ2APVQAAWB0awg (envelope-from ) for ; Fri, 02 Apr 2021 12:51:35 -0400 Received: by simark.ca (Postfix, from userid 112) id 882961EF62; Fri, 2 Apr 2021 12:51:35 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 BDEC61EE0E for ; Fri, 2 Apr 2021 12:51:34 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2A6233858D33; Fri, 2 Apr 2021 16:51:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A6233858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1617382294; bh=TiNV2pn0PZV38NUwdjmEtmYhZD90SUrV/5Dm1Z/twFg=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=aBvhLsemllrlsZDQSItr4mGIKVPZsFLCCk7md22d4drE/VfOMt/A/V/u3ZA6ssN+a NWa1Tb6aNiV0D1+kh54ByOPz5KdYu1O01OuUShpCib079STCI945xdMtMvlyTySJyJ aShErmQIDlqz5RuqmvYYvWcIGyor0V3WjgjD0tsw= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id D54963858D33 for ; Fri, 2 Apr 2021 16:51:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D54963858D33 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 132GpODO001850 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 2 Apr 2021 12:51:29 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 132GpODO001850 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 47D081EE0E; Fri, 2 Apr 2021 12:51:24 -0400 (EDT) Subject: Re: [PATCH 1/2] gdb: Allow address space qualifier parsing in C++. To: "Willgerodt, Felix" , Tom Tromey , Felix Willgerodt via Gdb-patches References: <20210326142609.245016-1-felix.willgerodt@intel.com> <20210326142609.245016-2-felix.willgerodt@intel.com> <878s61ooph.fsf@tromey.com> Message-ID: <9fb100c8-7c2b-8270-39b4-fb007110d55b@polymtl.ca> Date: Fri, 2 Apr 2021 12:51:24 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 2 Apr 2021 16:51:24 +0000 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: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2021-04-02 12:48 p.m., Simon Marchi via Gdb-patches wrote:>> This '@address_space_qualifier' is a bit of an undocumented and untested feature AFAIK. Even the avr tests for __flash don't test it. >> I did search the git history a bit, but couldn't really determine why it was added. Only that it was added years before the __flash patch was. >> But since it is there and since I need a language agnostic way to specify this, I plan to use it for a future target. >> >> The only test I could currently write for this patch is something like: >> gdb_test "*(@somerandomqualifiername int *) 0x12345678" "Unknown address space specifier: \"somerandomqualifiername\""> >> for a C++ program on any target. If you think that is valuable, I can easily add that. >> The target I want to use this for in the end won't be ready for upstream for a while unfortunately. > > Hi Felix, > > I think it would be valuable to have a test like this. It's better > than nothing, and it's always good to check error cases to make sure GDB > doesn't crash on them. I can imagine that this test could test with > both a C and C++ program to cover everything correctly (and maybe other > languages, but I don't know much about them, if that even applies to > them). > > A while ago I added a simavr board file, to be able to run tests against > an AVR target. simavr is easy to build and use (it may even be packaged > in distros, but I'd be tempted to use the latest available version). > All of this to say you could try to run and improve the flash qualifier > test for AVR (or write a new test). > > There's just one thing, avr-gcc/avr-g++ seem to produce stabs by > default, it's not really useful to test with stabs nowadays. I had a > patch to make that board use dwarf by default (see below), but I never > got around to try it properly and post it. I'll try to do it soon (but > you can apply it locally in the mean time). > > Simon Oh, and when running the test (with the dwarf patch applied), I hit an internal error: 92 (gdb) PASS: gdb.arch/avr-flash-qualifier.exp: print p 93 backtrace 1^M 94 #0 pass_to_function (p=0xe4 "\253") at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.arch/avr-flash-qualifier.c:23^M 95 /home/simark/src/binutils-gdb/gdb/trad-frame.h:143: internal-error: LONGEST trad_frame_saved_reg::addr() const: Assertion `m_kind == trad_frame_saved_reg_ kind::ADDR' failed.^M I'll try to bisect that, it might be a problem introduced by the recent trad_frame changes (or the changes merely uncovered an existing bug). Simon