Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Dmitry Neverov via Gdb <gdb@sourceware.org>
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: Mon, 13 Nov 2023 17:59:54 +0100	[thread overview]
Message-ID: <CAEY59_L6agrdhz6-0d-Ur+Tb3RknAZDoZTa9Li5J3KgSm5009A@mail.gmail.com> (raw)
In-Reply-To: <87h6m5jraw.fsf@tromey.com>

I think I found why index files are not used in the debug session
where they are created. Objfile.qf is initialized at

  dwarf2_initialize_objfile read.c:5396
  elf_symfile_read_dwarf2 elfread.c:1199
  elf_symfile_read elfread.c:1343
  read_symbols symfile.c:773
  syms_from_objfile_1 symfile.c:968
  syms_from_objfile symfile.c:985
  symbol_file_add_with_addrs symfile.c:1088
  symbol_file_add_from_bfd symfile.c:1168
  symbol_file_add symfile.c:1181
  symbol_file_add_main_1 symfile.c:1205
  symbol_file_command symfile.c:1653
  file_command exec.c:554
  do_simple_func cli-decode.c:95
  cmd_func cli-decode.c:2543
  execute_command top.c:690
  execute_control_command_1 cli-script.c:537
  execute_control_command cli-script.c:709
  execute_control_commands cli-script.c:410
  execute_user_command cli-script.c:460
  execute_command top.c:664
  command_handler event-top.c:616
  command_line_handler event-top.c:852
  tui_command_line_handler tui-interp.c:104
  gdb_rl_callback_handler event-top.c:246
  rl_callback_read_char callback.c:290
  gdb_rl_callback_read_char_wrapper_noexcept event-top.c:188
  gdb_rl_callback_read_char_wrapper event-top.c:221
  stdin_event_handler event-top.c:541
  handle_file_event event-loop.cc:573
  gdb_wait_for_event event-loop.cc:694
  gdb_do_one_event event-loop.cc:264
  start_event_loop main.c:411
  captured_command_loop main.c:471
  captured_main main.c:1330
  gdb_main main.c:1345
  main gdb.c:32

Since no gdb-index is created yet, qf is updated like this:

objfile->qf.push_front (make_cooked_index_funcs ());

After that the gdb-index is created at

  dwarf2_build_psymtabs read.c:5437
  cooked_index_functions::read_partial_symbols read.c:18601
  objfile::require_partial_symbols symfile-debug.c:582
  read_symbols symfile.c:795
  syms_from_objfile_1 symfile.c:968
  syms_from_objfile symfile.c:985
  symbol_file_add_with_addrs symfile.c:1088
  symbol_file_add_from_bfd symfile.c:1168
  symbol_file_add symfile.c:1181
  symbol_file_add_main_1 symfile.c:1205
  symbol_file_command symfile.c:1653
  file_command exec.c:554
  do_simple_func cli-decode.c:95
  cmd_func cli-decode.c:2543
  execute_command top.c:690
  execute_control_command_1 cli-script.c:537
  execute_control_command cli-script.c:709
  execute_control_commands cli-script.c:410
  execute_user_command cli-script.c:460
  execute_command top.c:664
  command_handler event-top.c:616
  command_line_handler event-top.c:852
  tui_command_line_handler tui-interp.c:104
  gdb_rl_callback_handler event-top.c:246
  rl_callback_read_char callback.c:290
  gdb_rl_callback_read_char_wrapper_noexcept event-top.c:188
  gdb_rl_callback_read_char_wrapper event-top.c:221
  stdin_event_handler event-top.c:541
  handle_file_event event-loop.cc:573
  gdb_wait_for_event event-loop.cc:694
  gdb_do_one_event event-loop.cc:264
  start_event_loop main.c:411
  captured_command_loop main.c:471
  captured_main main.c:1330
  gdb_main main.c:1345
  main gdb.c:32

but objfile.qf is not updated and the gdb-index is not used in
this debug session.

Is it an expected behavior and gdb indexes should be created
before the debug session to be used? Or maybe there is a way to
make gdb to use them?

Dmitry

  parent reply	other threads:[~2023-11-13 17:00 UTC|newest]

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

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_L6agrdhz6-0d-Ur+Tb3RknAZDoZTa9Li5J3KgSm5009A@mail.gmail.com \
    --to=gdb@sourceware.org \
    --cc=dmitry.neverov@jetbrains.com \
    --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