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 testsuite/27920] New: [gdb/testsuite] hardcoding -readnow skips testing of partial symbols
Date: Thu, 27 May 2021 09:57:34 +0000	[thread overview]
Message-ID: <bug-27920-4717@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 27920
           Summary: [gdb/testsuite] hardcoding -readnow skips testing of
                    partial symbols
           Product: gdb
           Version: 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: testsuite
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

I looked into test-case gdb.dwarf2/dw2-icycle.exp, and found:
...
if { [prepare_for_testing "failed to prepare" ${testfile} \
          [list $srcfile $srcfile2] {nodebug}] } {
    return -1
}

# We are trying to verify that the partial symtab to symtab expansion
# for the debugging info hand-coded in our assembly file does not cause
# the debugger to crash (infinite recursion).  To facilitate the test,
# start the debugger with -readnow.  This force expansion as soon as
# the objfile is loaded.                                                        

set saved_gdbflags $GDBFLAGS
set GDBFLAGS "$GDBFLAGS -readnow"
clean_restart ${testfile}
set GDBFLAGS $saved_gdbflags
...

There seems to be a mismatch between comment and code.

It's true that -readnow forces full symtabs to be generated.

But it specifically skips expansion from partial symtab to full symtab.

I we want to exercise that path, we should use "maint expand-symtabs" instead.

Generally, hardcoding -readnow in test-cases is undesirable because it skips
testing the default way of handling things in gdb using partial symtabs.

Testing readnow can be done using the target board.

And if we really want a test-case to be tested with readnow with any target
board we can f.i. add -readnow.exp variant (see
gdb.base/list-ambiguous-readnow.exp).  There are also test-cases that
internally iterate over different loading modes like
partial-syms/readnow/index.

I did a first scan in gdb.dwarf2/*.exp, removing -readnow from test-cases, and
ran into PR27919.

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

             reply	other threads:[~2021-05-27  9:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27  9:57 vries at gcc dot gnu.org [this message]
2021-05-27 13:22 ` [Bug testsuite/27920] " cvs-commit at gcc dot gnu.org

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-27920-4717@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).