From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id BeENO/FKZ2DqVAAAWB0awg (envelope-from ) for ; Fri, 02 Apr 2021 12:48:49 -0400 Received: by simark.ca (Postfix, from userid 112) id E406C1EF62; Fri, 2 Apr 2021 12:48:49 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 E19851EE0E for ; Fri, 2 Apr 2021 12:48:48 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7D9AF3858D33; Fri, 2 Apr 2021 16:48:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D9AF3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1617382128; bh=UHDAli/X2ravIqwjVxuMAaX0ZuocXEChaHezzu9a5IU=; 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=TtlZlhML63p2AjjogNGjW9PSux1owRLnUHXNu06b6I+2L4C5cQ+IjnbsephAgCv7v jkIrYWAnxdfAKb/ZCkIygzYltttu9ymZPH7v0wvQrn/b1zdQbpHJDLm+MkoQD9M7um 6/Nqv9cpdlL1ZDwutw22wietms4UI76WhUBHiQlc= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 58E2D3858D33 for ; Fri, 2 Apr 2021 16:48:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 58E2D3858D33 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 132Gmccl000308 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 2 Apr 2021 12:48:42 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 132Gmccl000308 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) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 95BF61EE0E; Fri, 2 Apr 2021 12:48:37 -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: Date: Fri, 2 Apr 2021 12:48:37 -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:48:38 +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" > 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 >From d1215e56aad6f9fc02f2cb2318ea522b32fd4f79 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sun, 21 Jun 2020 11:25:12 -0400 Subject: [PATCH] gdb/testsuite: use -gdwarf-4 in simavr board Change-Id: I70e471fad3a79ab1d79d13dda8436bb9eb666e0a --- gdb/testsuite/boards/simavr.exp | 1 + 1 file changed, 1 insertion(+) diff --git a/gdb/testsuite/boards/simavr.exp b/gdb/testsuite/boards/simavr.exp index c4f278ccb12e..35885ef78c27 100644 --- a/gdb/testsuite/boards/simavr.exp +++ b/gdb/testsuite/boards/simavr.exp @@ -43,6 +43,7 @@ set_board_info c++compiler avr-g++ set_board_info cflags "-mmcu=${simavr_mcu}" set_board_info ldflags "-mmcu=${simavr_mcu}" +set_board_info debug_flags "-gdwarf-4" set_board_info use_gdb_stub 1 set_board_info gdb_protocol "remote" -- 2.30.1