public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Kevin Buettner <kevinb@redhat.com>,
	Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Cc: "Alexandra Hájková" <alexandra.khirnova@gmail.com>
Subject: Re: [PATCH 2/2] Test case reproducing PR28030 bug
Date: Wed, 1 Sep 2021 12:32:23 -0400	[thread overview]
Message-ID: <157f9974-249e-8976-6ebd-37719b671196@polymtl.ca> (raw)
In-Reply-To: <20210901092022.3d6b8183@f33-m1.lan>



On 2021-09-01 12:20 p.m., Kevin Buettner wrote:
> On Wed, 1 Sep 2021 09:35:09 -0400
> Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> wrote:
> 
>> Thanks for the test case.  The comments are very nice, it would be very
>> hard to understand without them.  They also communicate the intentions
>> well, that will be useful if someone needs to debug it in the future.
>>
>>>  gdb/testsuite/gdb.dwarf2/locexpr-dml-lib.c  |  48 +++
>>>  gdb/testsuite/gdb.dwarf2/locexpr-dml-main.c |  27 ++
>>>  gdb/testsuite/gdb.dwarf2/locexpr-dml.exp    | 360 ++++++++++++++++++++
>>>  gdb/testsuite/gdb.dwarf2/locexpr-dml.h      |  30 ++  
>>
>> What does "dml" stand for?
> 
> data member location, since the use of DW_AT_data_member_location was
> one (of several) key elements needed to reproduce the bug.
> 
> I'll make a note of the meaning of dml early in the file. If someone
> can think of a better name for this test case, I'll use that instead.

I would just spell it out (locexpr-data-member-location.exp).

>>> +# Compile the shared library: -DIS_SHAREDLIB prevents main() from
>>> +# being defined.  Note that debugging symbols will be present for
>>> +# this compilation.
>>> +if {[gdb_compile_shlib $libsrc $lib_so \
>>> +                       {additional_flags=-DIS_SHAREDLIB debug}] != ""} {
>>> +    untested "failed to compile shared library"
>>> +    return
>>> +}  
>>
>> I don't understand when $libsrc is compiled without -DIS_SHAREDLIB.
> 
> I call get_func_info in this test case.  It calls function_range. 
> which in turn calls gdb_compile.  It's compiled without -DIS_SHAREDLIB
> whenever get_func_info is called.
> 
> I'll find some place to mention this fact in one of the comments.

Ah, I see, thanks.  Hopefully compiling with and without the main
doesn't change the addresses of the functions you are getting info
for.

It would take a bit of cleanup before hand, but ideally the
function_range proc would be able to compile shared libraries, or work
on an already built binary.

Simon

  reply	other threads:[~2021-09-01 16:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31 20:34 [PATCH 1/2] gdbtypes.c: Add the case for FIELD_LOC_KIND_DWARF_BLOCK Alexandra Hájková
2021-08-31 20:34 ` [PATCH 2/2] Test case reproducing PR28030 bug Alexandra Hájková
2021-09-01 13:35   ` Simon Marchi
2021-09-01 16:20     ` Kevin Buettner
2021-09-01 16:32       ` Simon Marchi [this message]
2021-09-02  6:32         ` Kevin Buettner
2021-09-01 13:37   ` Simon Marchi
2021-09-01 16:22     ` Kevin Buettner
2021-09-01 12:59 ` [PATCH 1/2] gdbtypes.c: Add the case for FIELD_LOC_KIND_DWARF_BLOCK Simon Marchi

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=157f9974-249e-8976-6ebd-37719b671196@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=alexandra.khirnova@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    /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).