public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Dmitry Neverov <dmitry.neverov@jetbrains.com>
To: Tom Tromey <tom@tromey.com>
Cc: Dmitry Neverov via Gdb <gdb@sourceware.org>
Subject: Re: Index files are not used in the session where they were created
Date: Fri, 13 Oct 2023 10:57:53 +0200	[thread overview]
Message-ID: <CAEY59_LGJSVikf7L76EzsMQN8Mra5gcoa0Qj7SaxKSPac6fpyw@mail.gmail.com> (raw)
In-Reply-To: <CAEY59_LRxcYzCQHqz90XmM7ES1g+yPEQr+y-pCwz2EFfUff6Ew@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2307 bytes --]

Hi Tom,

I've debugged it a bit more and the number of CUs is indeed
different. Without indexes gdb loads 506 CUs during one slow
symbol lookup, with indexes no CUs are
loaded ('qf_require_partial_symbols()' returns empty list inside
'objfile::lookup_symbol'). Is it something expected? If not,
could you please suggest how to debug it further?


On Tue, Aug 1, 2023 at 8:42 AM Dmitry Neverov <dmitry.neverov@jetbrains.com>
wrote:

> Tom> To figure this out, we'd probably need a test case.  Maybe comparing
> the
> Tom> results between the two scenarios with "set debug symtab-create on"
> Tom> would indicate something.
>
> I have a reproducer, but it is somewhat tricky to build. It is
> also not my program, so I'm not sure if I can simplify it.
>
> The program is KiCad (https://gitlab.com/kicad/code/kicad.git).
> Build dependencies for Ubuntu can be obtained from the packaging
> files: https://dev-docs.kicad.org/en/build/linux/#_dependencies.
>
> Once KiCad is built I run the following commands in gdb:
>
> (gdb) file /home/nd/w/CLionProjects/kicad/build/debug/pcbnew/pcbnew
> (gdb) b /home/nd/w/CLionProjects/kicad/pcbnew/footprint_edit_frame.cpp:114
> (gdb) run
>
> When KiCad's window is opened I invoke the menu item "Tools >
> Footprint Editor" to hit the created breakpoint, and then run:
>
> (gdb) interpreter-exec mi2 "-var-create var1_this * \"this\""
> (gdb) interpreter-exec mi2 "-var-list-children --all-values \"var1_this\"
> -1 -1"
> (gdb) interpreter-exec mi2 "-var-list-children --all-values
> \"var1_this.private\" 0 8"
>
> The last command takes most of the time. The .gdbinit only sets up logging:
>
> set trace-commands on
> set logging overwrite on
> set logging debugredirect on
> set logging enabled on
> set debug symtab-create 1
>
> I've captured the logs, they are quite big, the zip (15Mb) is here:
>
> https://drive.google.com/file/d/1Cz-HOOqus6xwf_eIjBqcs727w8aOqco4/view?usp=sharing
> .
>
> There are 3 files in archive:
>
> - gdb.txt.index-cache-disabled - the slow run with index-cache
>   disabled
>
> - gdb.txt.index-cache-enabled-run1 - the first run with
>   index-cache enabled - it is still slow
>
> - gdb.txt.index-cache-enabled-run2 - the second run with
>   index-cache enabled - fast
>
>

  reply	other threads:[~2023-10-13  8:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25  8:01 Dmitry Neverov
2023-07-26 16:20 ` Tom Tromey
2023-08-01  6:42   ` Dmitry Neverov
2023-10-13  8:57     ` Dmitry Neverov [this message]
2023-10-25 15:59       ` Dmitry Neverov
2023-11-01 17:51         ` Tom Tromey
2023-11-06 10:41           ` Dmitry Neverov
2023-11-13 16:59           ` Dmitry Neverov
2023-11-15 10:18           ` Dmitry Neverov

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=CAEY59_LGJSVikf7L76EzsMQN8Mra5gcoa0Qj7SaxKSPac6fpyw@mail.gmail.com \
    --to=dmitry.neverov@jetbrains.com \
    --cc=gdb@sourceware.org \
    --cc=tom@tromey.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).