public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Aktemur, Tankut Baris" <tankut.baris.aktemur@intel.com>
To: Simon Marchi <simon.marchi@polymtl.ca>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH v2 2/2] gdb/dwarf2: fix "info locals" for clang-compiled inlined functions
Date: Wed, 14 Apr 2021 17:08:28 +0000	[thread overview]
Message-ID: <SN6PR11MB28933BC6E71EB04747D459F8C44E9@SN6PR11MB2893.namprd11.prod.outlook.com> (raw)
In-Reply-To: <3ee31fb1-58b0-570f-1dc3-da4b8fc2254b@polymtl.ca>

On Wednesday, April 14, 2021 3:30 PM, Simon Marchi wrote:
> On 2021-04-14 4:14 a.m., Tankut Baris Aktemur wrote:
> > diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp
> b/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp
> > new file mode 100644
> > index 00000000000..e815c859639
> > --- /dev/null
> > +++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp
> > @@ -0,0 +1,137 @@
> > +# Copyright 2021 Free Software Foundation, Inc.
> > +
> > +# This program is free software; you can redistribute it and/or modify
> > +# it under the terms of the GNU General Public License as published by
> > +# the Free Software Foundation; either version 3 of the License, or
> > +# (at your option) any later version.
> > +#
> > +# This program is distributed in the hope that it will be useful,
> > +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > +# GNU General Public License for more details.
> > +#
> > +# You should have received a copy of the GNU General Public License
> > +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
> > +
> > +# Test that scoped local variables in an inlined function are printed
> > +# properly.
> > +
> > +load_lib dwarf.exp
> > +
> > +# This test can only be run on targets that support DWARF-2 and use
> > +# gas.
> > +if {![dwarf2_support]} {
> > +    return 0
> > +}
> > +
> > +standard_testfile .c .S
> > +
> > +# Make some DWARF for the test.  The concrete inlined instance
> > +# (i.e. the DW_TAG_inlined_subroutine) has a DW_TAG_lexical_block that
> > +# does not contain a DW_AT_abstract_origin attribute.  This is
> > +# deliberate.  Bad GDB printed duplicate local variables with
> > +# "optimized out" values in this case.
> > +
> > +set asm_file [standard_output_file $srcfile2]
> > +Dwarf::assemble $asm_file {
> > +    global srcfile srcdir subdir
> > +    declare_labels int_label func_label num_label value_label lines_label
> > +
> > +    get_func_info main
> > +    set func_call [gdb_get_line_number "func call"]
> > +
> > +    cu {} {
> > +	compile_unit {
> > +	    {language @DW_LANG_C99}
> > +	    {name $srcfile}
> > +	    {low_pc $main_start addr}
> > +	    {high_pc "$main_start + $main_len" addr}
> > +	    {stmt_list ${lines_label} DW_FORM_sec_offset}
> > +	} {
> > +	    int_label: base_type {
> > +                {name "int"}
> > +                {byte_size 4 sdata}
> > +		{encoding @DW_ATE_signed}
> > +            }
> > +
> > +	    func_label: subprogram {
> > +		{name func}
> > +		{inline 3 data1}
> 
> You could maybe use
> 
>   {inline @DW_INL_declared_inlined}
> 
> here.  The form will be sdata instead of data1, but I don't think that's
> a problem.
> 
> Otherwise, LGTM, thanks!
> 
> Simon

Ahh, I thought I had made this change, but I pushed the patch without it.
Sorry about that.  I'll fix it now.  I hope it's OK.

-Baris


Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

      reply	other threads:[~2021-04-14 17:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14  8:14 [PATCH v2 0/2] " Tankut Baris Aktemur
2021-04-14  8:14 ` [PATCH v2 1/2] testsuite, gdb: recognize DW_OP_fbreg in lib/dwarf.exp Tankut Baris Aktemur
2021-04-14  9:50   ` Andrew Burgess
2021-04-14  8:14 ` [PATCH v2 2/2] gdb/dwarf2: fix "info locals" for clang-compiled inlined functions Tankut Baris Aktemur
2021-04-14 12:18   ` Aktemur, Tankut Baris
2021-04-14 15:46     ` Andrew Burgess
2021-04-14 17:00       ` Aktemur, Tankut Baris
2021-04-14 13:30   ` Simon Marchi
2021-04-14 17:08     ` Aktemur, Tankut Baris [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SN6PR11MB28933BC6E71EB04747D459F8C44E9@SN6PR11MB2893.namprd11.prod.outlook.com \
    --to=tankut.baris.aktemur@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).