[Bug gdb/24669] New: index-cache.exp FAILs with -readnow

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/24669] New: index-cache.exp FAILs with -readnow

adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24669

            Bug ID: 24669
           Summary: index-cache.exp FAILs with -readnow
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

With board readnow, I see these failures:
...
FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: at least one file was
created
FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: expected file is there
FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: check index-cache
stats
FAIL: gdb.base/index-cache.exp: test_cache_enabled_hit: check index-cache stats
...

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/24669] index-cache.exp FAILs with -readnow

adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24669

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simark at simark dot ca

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Simon, is this a test-case issue, or does gdb need to be fixed?

Just by reading the documentation, I didn't manage to understand what the
expected behaviour is.

Readnow:
...
-readnow
    Read each symbol file's entire symbol table immediately, rather than the
default, which is to read it incrementally as it is needed. This makes startup
slower, but makes future operations faster.
...

index-cache:
...
When GDB finds a symbol file, it scans the symbols in the file in order to
construct an internal symbol table. This lets most GDB operations work
quickly—at the cost of a delay early on. For large programs, this delay can be
quite lengthy, so GDB provides a way to build an index, which speeds up
startup.
...

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/24669] index-cache.exp FAILs with -readnow

adhemerval.zanella at linaro dot org
In reply to this post by adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24669

--- Comment #2 from Simon Marchi <simark at simark dot ca> ---
I think it's by design, when using -readnow, we read the full symbols right
away, we don't read any index, or build any partial symbols.  So I would say,
the test needs to be adjusted to account for that.

See the comment here:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/dwarf2read.c;h=4cf9fcfa2189c5ecbe373a02fc2c37bedc4e400f;hb=HEAD#l6262

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/24669] index-cache.exp FAILs with -readnow

adhemerval.zanella at linaro dot org
In reply to this post by adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24669

--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Simon Marchi <[hidden email]>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=399aaebd1a5e9e3971758396bd0c5c3ec5ae2386

commit 399aaebd1a5e9e3971758396bd0c5c3ec5ae2386
Author: Simon Marchi <[hidden email]>
Date:   Sun Jun 16 09:07:16 2019 -0400

    Make gdb.base/index-cache.exp work with readnow board (PR 24669)

    The gdb.base/index-cache.exp test fails with the readnow board:

      $ make check TESTS="gdb.base/index-cache.exp"
RUNTESTFLAGS="--target_board=readnow"
      FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: at least one
file was created
      FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: expected file is
there
      FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: check
index-cache stats
      FAIL: gdb.base/index-cache.exp: test_cache_enabled_hit: check index-cache
stats

    The problem is similar to what was fixed in

      5a56d6a65f84 ("[gdb/testsuite] Fix index-cache.exp with
cc-with-{gdb-index,debug-names}")

    In that commit, gdb.base/index-cache.exp was modified to account for the
    fact that the index cache is not used when the binary already has an
    embedded index.

    The same situation happens when GDB is started with the -readnow flag:
    it bypasses indices and partial symbols.  So this patch updates the test
    to also expect the index cache not to be used if -readnow is present in
    $GDBFLAGS,

    gdb/testsuite/ChangeLog:

        PR gdb/24669
        * gdb.base/index-cache.exp (uses_readnow,
        expecting_index_cache_use): Define global variable.
        (test_cache_enabled_miss, test_cache_enabled_hit): Use
        expecting_index_cache_use.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/24669] index-cache.exp FAILs with -readnow

adhemerval.zanella at linaro dot org
In reply to this post by adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24669

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Simon Marchi <simark at simark dot ca> ---
Fixed by commit mentioned above.

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