public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/25833] New: [cc-with-gdb-index] FAIL: gdb.base/with.exp: basics: with language ada -- print g_s
@ 2020-04-16  7:23 vries at gcc dot gnu.org
  2020-05-13  6:20 ` [Bug symtab/25833] " vries at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2020-04-16  7:23 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 25833
           Summary: [cc-with-gdb-index] FAIL: gdb.base/with.exp: basics:
                    with language ada -- print g_s
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

When running test-case with.exp with target board cc-with-gdb-index, we have:
...
(gdb) PASS: gdb.base/with.exp: basics: show language
with language ada -- print g_s^M
'g_s' has unknown type; cast it to its declared type^M
(gdb) FAIL: gdb.base/with.exp: basics: with language ada -- print g_s
...

This scenario hits this case:
...
static void
dw2_map_matching_symbols
  (struct objfile *objfile,
   const lookup_name_info &name, domain_enum domain,
   int global,
   gdb::function_view<symbol_found_callback_ftype> callback,
   symbol_compare_ftype *ordered_compare)
{
  /* Used for Ada.  */
  struct dwarf2_per_objfile *dwarf2_per_objfile
    = get_dwarf2_per_objfile (objfile);

  if (dwarf2_per_objfile->index_table != nullptr)
    {
      /* Ada currently doesn't support .gdb_index (see PR24713).  We can get    
         here though if the current language is Ada for a non-Ada objfile       
         using GNU index.  As Ada does not look for non-Ada symbols this        
         function should just return.  */
      return;
    }
...

The reasoning for do nothing here is from a language perspective.

But the problem is that it makes gdb behaviour inconsistent between:
- having a .gdb_index section, and 
- having a .gdb_names section, or a partial symtab, or -readnow.

I think it's better to have consistent behaviour, and we should fix this.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug symtab/25833] [cc-with-gdb-index] FAIL: gdb.base/with.exp: basics: with language ada -- print g_s
  2020-04-16  7:23 [Bug symtab/25833] New: [cc-with-gdb-index] FAIL: gdb.base/with.exp: basics: with language ada -- print g_s vries at gcc dot gnu.org
@ 2020-05-13  6:20 ` vries at gcc dot gnu.org
  2020-05-13  9:42 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2020-05-13  6:20 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 12528
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12528&action=edit
Tentative patch

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug symtab/25833] [cc-with-gdb-index] FAIL: gdb.base/with.exp: basics: with language ada -- print g_s
  2020-04-16  7:23 [Bug symtab/25833] New: [cc-with-gdb-index] FAIL: gdb.base/with.exp: basics: with language ada -- print g_s vries at gcc dot gnu.org
  2020-05-13  6:20 ` [Bug symtab/25833] " vries at gcc dot gnu.org
@ 2020-05-13  9:42 ` vries at gcc dot gnu.org
  2020-05-20  9:48 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2020-05-13  9:42 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Posted patch: https://sourceware.org/pipermail/gdb-patches/2020-May/168433.html

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug symtab/25833] [cc-with-gdb-index] FAIL: gdb.base/with.exp: basics: with language ada -- print g_s
  2020-04-16  7:23 [Bug symtab/25833] New: [cc-with-gdb-index] FAIL: gdb.base/with.exp: basics: with language ada -- print g_s vries at gcc dot gnu.org
  2020-05-13  6:20 ` [Bug symtab/25833] " vries at gcc dot gnu.org
  2020-05-13  9:42 ` vries at gcc dot gnu.org
@ 2020-05-20  9:48 ` cvs-commit at gcc dot gnu.org
  2020-05-20  9:49 ` vries at gcc dot gnu.org
  2020-05-20  9:49 ` vries at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-20  9:48 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

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

commit 9a0bacfb08eb87938919023915ecc0ca2ba21223
Author: Tom de Vries <tdevries@suse.de>
Date:   Wed May 20 11:48:39 2020 +0200

    [gdb/symtab] Handle .gdb_index in ada language mode

    When running test-case gdb.base/with.exp with target board
cc-with-gdb-index,
    we have:
    ...
    (gdb) PASS: gdb.base/with.exp: basics: show language
    with language ada -- print g_s^M
    'g_s' has unknown type; cast it to its declared type^M
    (gdb) FAIL: gdb.base/with.exp: basics: with language ada -- print g_s
    ...

    This is due to this bit in dw2_map_matching_symbols:
    ...
      if (dwarf2_per_objfile->index_table != nullptr)
        {
          /* Ada currently doesn't support .gdb_index (see PR24713).  We can
get
             here though if the current language is Ada for a non-Ada objfile
             using GNU index.  As Ada does not look for non-Ada symbols this
             function should just return.  */
          return;
        }
    ...

    While the reasoning in the comment may be sound from language perspective,
it
    does introduce an inconsistency in gdb behaviour between:
    - having a .gdb_index section, and
    - having a .gdb_names section, or a partial symtab, or -readnow.

    Fix the inconsistency by completing implementation of
    dw2_map_matching_symbols.

    Tested on x86_64-linux, both with native and target board
    cc-with-debug-index.

    gdb/ChangeLog:

    2020-05-20  Tom de Vries  <tdevries@suse.de>

            PR symtab/25833
            * dwarf2/read.c (dw2_map_matching_symbols): Handle .gdb_index.

    gdb/testsuite/ChangeLog:

    2020-05-20  Tom de Vries  <tdevries@suse.de>

            PR symtab/25833
            * gdb.base/with-mf-inc.c: New test.
            * gdb.base/with-mf-main.c: New test.
            * gdb.base/with-mf.exp: New file.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug symtab/25833] [cc-with-gdb-index] FAIL: gdb.base/with.exp: basics: with language ada -- print g_s
  2020-04-16  7:23 [Bug symtab/25833] New: [cc-with-gdb-index] FAIL: gdb.base/with.exp: basics: with language ada -- print g_s vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-05-20  9:48 ` cvs-commit at gcc dot gnu.org
@ 2020-05-20  9:49 ` vries at gcc dot gnu.org
  2020-05-20  9:49 ` vries at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2020-05-20  9:49 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
Patch with test-case committed, marking resolved-fixed.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug symtab/25833] [cc-with-gdb-index] FAIL: gdb.base/with.exp: basics: with language ada -- print g_s
  2020-04-16  7:23 [Bug symtab/25833] New: [cc-with-gdb-index] FAIL: gdb.base/with.exp: basics: with language ada -- print g_s vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-05-20  9:49 ` vries at gcc dot gnu.org
@ 2020-05-20  9:49 ` vries at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2020-05-20  9:49 UTC (permalink / raw)
  To: gdb-prs

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

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

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

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-20  9:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16  7:23 [Bug symtab/25833] New: [cc-with-gdb-index] FAIL: gdb.base/with.exp: basics: with language ada -- print g_s vries at gcc dot gnu.org
2020-05-13  6:20 ` [Bug symtab/25833] " vries at gcc dot gnu.org
2020-05-13  9:42 ` vries at gcc dot gnu.org
2020-05-20  9:48 ` cvs-commit at gcc dot gnu.org
2020-05-20  9:49 ` vries at gcc dot gnu.org
2020-05-20  9:49 ` vries at gcc dot gnu.org

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).