public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tromey@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 4/4] Fix parameter-less template regression in new DWARF reader
Date: Fri, 27 Jan 2023 00:47:57 -0500	[thread overview]
Message-ID: <26ba8dcf-3f4e-983d-bbb8-a61c4b94c47d@simark.ca> (raw)
In-Reply-To: <871qnt2bob.fsf@tromey.com>

On 1/17/23 14:39, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
> 
> Simon> Starting with this patch, I get (using _GLIBCXX_DEBUG):
> [...]
> 
> Ugh, sorry about that.
> I've reproduce it and I'm working on a fix.
> 
> Tom

I started to look into this, using that other patch I sent that dumps
the contents of the cooked index.  You probably already know this, as
you have been looking at the problem already, but it can perhaps help
pothers.  The specific instance I look at is:

  $ ./gdb -nx -q --data-directory=data-directory testsuite/outputs/gdb.cp/cpexprs/cpexprs -ex start -ex "print policy1::function" -batch

When searching in the cooked index, the search string (canonicalized
version of the input, I think) is:

  "policy<int, operation_1<void*> >::function"

The problem is that the lower bound function used in
cooked_index::find (cooked_index_entry::compare) is invalid for these
two consecutive entries:

    [365] ((cooked_index_entry *) 0x621000115080)
    name:       policy
    canonical:  policy
    DWARF tag:  DW_TAG_subprogram
    flags:      0x0 []
    DIE offset: 0x3951
    parent:     ((cooked_index_entry *) 0x6210001137a0) [policy<int, operation_2<void*> >]

    [366] ((cooked_index_entry *) 0x621000113740)
    name:       policy<int, operation_1<void*> >
    canonical:  policy<int, operation_1<void*> >
    DWARF tag:  DW_TAG_class_type
    flags:      0x0 []
    DIE offset: 0x22a3
    parent:     ((cooked_index_entry *) 0)

It returns that [365] greater or equal to our search string, but also
that [366] is less than our search string.  This is a contradiction,
because elements are supposed to be sorted according to the comparison
function.

Simon

  reply	other threads:[~2023-01-27  5:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10 18:33 [PATCH v2 0/4] Fix " Tom Tromey
2023-01-10 18:33 ` [PATCH v2 1/4] Avoid submitting empty tasks in parallel_for_each Tom Tromey
2023-01-14  6:03   ` Joel Brobecker
2023-01-10 18:33 ` [PATCH v2 2/4] Don't erase empty indices in DWARF reader Tom Tromey
2023-01-14  6:05   ` Joel Brobecker
2023-01-17 13:53     ` Tom Tromey
2023-01-10 18:33 ` [PATCH v2 3/4] Move hash_entry and eq_entry into cooked_index::do_finalize Tom Tromey
2023-01-14  6:06   ` Joel Brobecker
2023-01-10 18:33 ` [PATCH v2 4/4] Fix parameter-less template regression in new DWARF reader Tom Tromey
2023-01-14  6:11   ` Joel Brobecker
2023-01-17 13:54     ` Tom Tromey
2023-01-17 16:44     ` Tom de Vries
2023-01-17 18:46       ` Tom Tromey
2023-01-17 18:09   ` Simon Marchi
2023-01-17 19:39     ` Tom Tromey
2023-01-27  5:47       ` Simon Marchi [this message]
2023-01-27 10:15         ` Andrew Burgess
2023-01-27 14:30           ` Tom Tromey
2023-01-27 19:57             ` Tom Tromey

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=26ba8dcf-3f4e-983d-bbb8-a61c4b94c47d@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.com \
    /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).