From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id CF85D383B414 for ; Wed, 16 Jun 2021 11:09:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CF85D383B414 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E98FC1FD47; Wed, 16 Jun 2021 11:09:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623841766; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OHL13OXqk05aNLAiXfsQKqNtG5TkV1kfUU2V2rRlzLQ=; b=pj/zl/EU0PAthnI+nMMyIrvrBvmCB35GwFwQco7oZ7zp5XykeadEWAQHWD9As8/GNX2XMv ybQXdQQz7f+tZweLcHOhnclF0qbqXAmCRFbLL/K+71JJtoDdd6x2FOd68Unxx9cN5MyJeJ TkNljVDLmia4/0Y3qb8zR727c/4pRsk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623841766; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OHL13OXqk05aNLAiXfsQKqNtG5TkV1kfUU2V2rRlzLQ=; b=cbeyysO0TiSLeqJedXDHHelXgE/bvy8otMddHRKPLGjAgCxnSZq1KiN7e7x1w08XqOaPuz KcEYC5HMmZ8C/bBA== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id C6B7F118DD; Wed, 16 Jun 2021 11:09:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623841766; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OHL13OXqk05aNLAiXfsQKqNtG5TkV1kfUU2V2rRlzLQ=; b=pj/zl/EU0PAthnI+nMMyIrvrBvmCB35GwFwQco7oZ7zp5XykeadEWAQHWD9As8/GNX2XMv ybQXdQQz7f+tZweLcHOhnclF0qbqXAmCRFbLL/K+71JJtoDdd6x2FOd68Unxx9cN5MyJeJ TkNljVDLmia4/0Y3qb8zR727c/4pRsk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623841766; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OHL13OXqk05aNLAiXfsQKqNtG5TkV1kfUU2V2rRlzLQ=; b=cbeyysO0TiSLeqJedXDHHelXgE/bvy8otMddHRKPLGjAgCxnSZq1KiN7e7x1w08XqOaPuz KcEYC5HMmZ8C/bBA== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id wc5pL+bbyWCuZAAALh3uQQ (envelope-from ); Wed, 16 Jun 2021 11:09:26 +0000 Subject: Re: [PATCH 2/2] Remove dwarf2_cu::language From: Tom de Vries To: Tom Tromey Cc: Simon Marchi , gdb-patches@sourceware.org References: <20210608152630.4155280-1-tom@tromey.com> <20210608152630.4155280-3-tom@tromey.com> <87czsuzsvk.fsf@tromey.com> <9ba9db87-fd7b-646a-2b40-cea033f95ab7@suse.de> <87eed8h2el.fsf@tromey.com> <2a23ada7-efaf-189c-e147-db24b4e339ef@suse.de> Message-ID: Date: Wed, 16 Jun 2021 13:09:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <2a23ada7-efaf-189c-e147-db24b4e339ef@suse.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, 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: Wed, 16 Jun 2021 11:09:29 -0000 On 6/15/21 12:16 AM, Tom de Vries wrote: >> What sort of test case would this affect? > I've written a dwarf assembly test-case. > I'd like to commit this. Any objections? > Thanks, > - Tom > > > > 0001-gdb-testsuite-Add-gdb.dwarf2-imported-unit-c.exp.patch > > [gdb/testsuite] Add gdb.dwarf2/imported-unit-c.exp > > This test-case is intended to excercise this code in process_imported_unit_die: > ... > /* We're importing a C++ compilation unit with tag DW_TAG_compile_unit > into another compilation unit, at root level. Regard this as a hint, > and ignore it. */ > if (die->parent && die->parent->parent == NULL > && per_cu->unit_type == DW_UT_compile > && per_cu->lang == language_cplus) > return; > ... > in the sense that the test-case should fail if the > "per_cu->lang == language_cplus" clause is removed. > > Tested on x86_64-linux. > > gdb/testsuite/ChangeLog: > > 2021-06-14 Tom de Vries > > * gdb.dwarf2/imported-unit-c.exp: New file. > > --- > gdb/testsuite/gdb.dwarf2/imported-unit-c.exp | 110 +++++++++++++++++++++++++++ > 1 file changed, 110 insertions(+) > > diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit-c.exp b/gdb/testsuite/gdb.dwarf2/imported-unit-c.exp > new file mode 100644 > index 00000000000..14047ab8eb9 > --- /dev/null > +++ b/gdb/testsuite/gdb.dwarf2/imported-unit-c.exp > @@ -0,0 +1,110 @@ > +load_lib dwarf.exp > + > +# This test can only be run on targets which support DWARF-2 and use gas. > +if {![dwarf2_support]} { > + return 0 > +}; > + > +standard_testfile main-foo.c .S > + > +set executable ${testfile} > +set asm_file [standard_output_file ${srcfile2}] > + > +# We need to know the size of integer and address types in order > +# to write some of the debugging info we'd like to generate. > +if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}] { > + return -1 > +} > + > +# Create the DWARF. > +Dwarf::assemble $asm_file { > + declare_labels cu_label cu2_label int_label int2_label > + set int_size [get_sizeof "int" 4] > + > + # imported CU 1: inty unsigned > + cu {} { > + cu_label: compile_unit { > + {language @DW_LANG_C} > + {name ""} > + } { > + int_label: base_type { > + {byte_size $int_size sdata} > + {encoding @DW_ATE_unsigned} > + {name {unsigned int}} > + } > + DW_TAG_typedef { > + {DW_AT_name inty} > + {DW_AT_type :$int_label} > + } > + } > + } > + > + # imported CU 2: inty signed > + cu {} { > + cu2_label: compile_unit { > + {language @DW_LANG_C} > + {name ""} > + } { > + int2_label: base_type { > + {byte_size $int_size sdata} > + {encoding @DW_ATE_signed} > + {name {int}} > + } > + DW_TAG_typedef { > + {DW_AT_name inty} > + {DW_AT_type :$int2_label} > + } > + } > + } > + > + # main CU > + cu {} { > + compile_unit { > + {language @DW_LANG_C} > + {name ""} > + } { > + imported_unit { > + {import %$cu2_label} > + } > + > + subprogram { > + {MACRO_AT_func {main}} > + {external 1 flag} > + } > + } > + } > + > + # foo CU > + cu {} { > + compile_unit { > + {language @DW_LANG_C} > + {name ""} > + } { > + imported_unit { > + {import %$cu_label} > + } > + > + subprogram { > + {MACRO_AT_func {foo}} > + {external 1 flag} > + } > + } > + } > + > +} > + > +if { [prepare_for_testing "failed to prepare" ${testfile} \ > + [list $srcfile $asm_file] {nodebug}] } { > + return -1 > +} > + > +if ![runto_main] { > + return -1 > +} > + > +gdb_test "ptype inty" "type = int" "ptype in main" > + > +gdb_breakpoint "foo" > +gdb_continue_to_breakpoint "continue to breakpoint for foo" > + > +gdb_test "ptype inty" "type = unsigned int" "ptype in foo" >