public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug mi/29426] FAIL: gdb.mi/mi-var-invalidate.exp: linteger not anymore in scope due to binary changes (unexpected output)
Date: Fri, 29 Jul 2022 13:46:21 +0000	[thread overview]
Message-ID: <bug-29426-4717-tMvvG3hgd8@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29426-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=29426

--- Comment #7 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Lancelot SIX from comment #6)
> Hi
> 
> This is what I also see.  TBH, I am really wondering why I have not seen
> with my testing and with my ubuntu boxes.
> 

It's PIE vs. no-PIE (and not for the first time ;) ).

So my system has no-PIE by default (because I haven't installed the gcc-PIE
package).

Using target board unix/-fPIE/-pie (case PIE), the test passes.  Using unix
(case no-PIE), it fails.

On ubuntu, there's a PIE default for system gcc.  When you build gcc from
scratch, it probably had no-PIE default instead.

Anyway, in one case (no-PIE) var_create succeeds, in the other (PIE) not.

So, varobj_create calls get_frame_block, which calls block_for_pc, with a
relocated pc.  Then block_for_pc calls block_for_pc_sect, which call
blockvector_for_pc_sect, which calls find_pc_sect_compunit_symtab, which calls
objf->find_pc_sect_compunit_symtab with objf == mi-var-invalidate_bis.

In the PIE case, this query returns null because we try to find an relocated
address in an unrelocated objfile.

In the no-PIE case, this query returns non-null because we try to find an
non-relocatable address in an non-relocatable objfile.


In the PIE case

> I am working on a fix for this.
> 
> Thanks for taking the time and looking into it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2022-07-29 13:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-28 14:33 [Bug mi/29426] New: " vries at gcc dot gnu.org
2022-07-29  9:28 ` [Bug mi/29426] " lsix at lancelotsix dot com
2022-07-29 10:05 ` vries at gcc dot gnu.org
2022-07-29 10:31 ` vries at gcc dot gnu.org
2022-07-29 11:05 ` vries at gcc dot gnu.org
2022-07-29 12:28 ` vries at gcc dot gnu.org
2022-07-29 13:01 ` lsix at lancelotsix dot com
2022-07-29 13:46 ` vries at gcc dot gnu.org [this message]
2022-07-29 15:08 ` lsix at lancelotsix dot com
2022-07-29 16:25 ` vries at gcc dot gnu.org
2022-08-12 11:12 ` lsix at lancelotsix dot com

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=bug-29426-4717-tMvvG3hgd8@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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).