Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner via Gdb-patches <gdb-patches@sourceware.org>
To: Tom de Vries <tdevries@suse.de>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH][gdb/testsuite] Fix gdb.dwarf2/locexpr-data-member-location.exp with nopie
Date: Thu, 5 May 2022 15:40:00 -0700	[thread overview]
Message-ID: <20220505154000.62c2a883@f35-zws-1> (raw)
In-Reply-To: <20220504120046.GA8717@delia.home>

Hi Tom,

On Wed, 4 May 2022 14:00:47 +0200
Tom de Vries <tdevries@suse.de> wrote:

> When running test-case gdb.dwarf2/locexpr-data-member-location.exp with
> target board unix/-fno-PIE/-no-pie/-m32 I run into:
> ...
> (gdb) step^M
> 26        return 0;^M
> (gdb) FAIL: gdb.dwarf2/locexpr-data-member-location.exp: step into foo
> ...
> 
> The problem is that the test-case tries to mimic some gdb_compile_shlib
> behaviour using:
> ...
> set flags {additional_flags=-fpic debug}
> get_func_info foo $flags
> ...
> but this doesn't work with the target board setting, because we end up doing:
> ...
> gcc locexpr-data-member-location-lib.c -fpic -g -lm -fno-PIE -no-pie -m32 \
>   -o func_addr23029.x
> ...
> while gdb_compile_shlib properly filters out the -fno-PIE -no-pie.
> 
> Consequently, the address for foo determined by get_func_info doesn't match
> the actual address of foo.
> 
> Fix this by printing the address of foo using the result of gdb_compile_shlib.
> 
> Any comments?

Nice job on cleaning up the problems with this test case!  (Though I did have
to spend a while studying 'with_shared_gdb'.)

LGTM...

Kevin



      reply	other threads:[~2022-05-05 22:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 12:00 Tom de Vries via Gdb-patches
2022-05-05 22:40 ` Kevin Buettner via Gdb-patches [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=20220505154000.62c2a883@f35-zws-1 \
    --to=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    --cc=tdevries@suse.de \
    /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