From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe2a.google.com (mail-vs1-xe2a.google.com [IPv6:2607:f8b0:4864:20::e2a]) by sourceware.org (Postfix) with ESMTPS id AF7CA3858C01 for ; Mon, 13 Nov 2023 17:00:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AF7CA3858C01 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=jetbrains.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jetbrains.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AF7CA3858C01 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::e2a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699894809; cv=none; b=WOQH2aG4LpWMytFfLXpU4H/3IFw5u2/Acm3t3jMnh5uNM/Ly3QWaUA/ym+lKzZeWANkuzQhj8sbeFR4hnnhrtSQcRbmB3PaERMvNIhS/iJnjlKzO92Ch896JBy9Ha1rpyMmqJ3ZSvyOu2ac0sz1DeblAh9UzcwTyyPAYg4syr38= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699894809; c=relaxed/simple; bh=fCLTuM4Spzcj2SLFWBEMlxziSztND2PxMkiKfJXB+pI=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=KXeA1sFXfPebhT6kbiRzBJQX+ZnKOMj76JctI/p0+5LfZbaMszqez/ZFPuTRvSHh3G89AWIQB3jWeDFjTOyG3d0b5KGNQa1zwReoCm57RJbVRTGlp5rdHgVu6BmV1yvEeDiMcvnMWxXusCwiCDoLnf2qkpOuFULx4QbaR8rsVhc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-vs1-xe2a.google.com with SMTP id ada2fe7eead31-45da062101bso2068582137.2 for ; Mon, 13 Nov 2023 09:00:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jetbrains.com; s=googleapps; t=1699894805; x=1700499605; darn=sourceware.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=AQkMTaskvzu/yZn4anhyg4NflSTpeTsGnvS6A0q3w8E=; b=geuJrjISi2h/pdVFumhTHAtvynowqSelrYHa249Ff7U10JaUMkCsSe6nIUCLuXWzmr tRakqT6k2+7XTpYd3NOpVCiONX8Q/p2ew56sG00MoQwvslj2MmotSlZVsOPu0gQcnRXC VH3rwlW0DmbBJ/vZUZuQoyT678mvBGMbIZRf8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699894805; x=1700499605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AQkMTaskvzu/yZn4anhyg4NflSTpeTsGnvS6A0q3w8E=; b=Is5hVjRhoPYqJrQCT5A9aYSMPJBbUk+9d05zpQsYqS1nCDhVy558XzHmSkGiKRTHX9 VfPSxPp8CTA8A/AqBfsEY4Zok2ahQxpr3aHZ+oDoOBbbnOSjpASjDhhmf9FgxqEVWIvu P++DNJE3eKEmN7jxnr9/4hfSwyrgmzi7aoo/eGs39o1oszSH+UOehfgvQ5YodHtwLLYn YLoTgxc2dl+fbq0aaOo77u5ftftpX9ZknQ+eX3sekzT8w0Xf6zRvwKb48DXSinQWUYDX Fz0VOWkv5XfdTvaqqp04bvz/Ov7eO6S6XcX958rEy4xdfjpRQFJMW1YyyPtTfeRGAIpo mkeg== X-Gm-Message-State: AOJu0YyIO4UpdOSB9/Pj43irciy63IzX/PvUZXZuKkWBeuAeGztQkbq9 vaMYCeY29utURWCspwDnmhU0mSW29augDhxx2ggAplx2RqvzgYeBIzBy3w== X-Google-Smtp-Source: AGHT+IGb+wwyA2LLUuwyUO4n4na8UTnXQlF2b4S7mdODiGROgECRMs+8Bq9uzFqSBZ3rHnfQccYABBysKeqidHOgI70= X-Received: by 2002:a67:e0de:0:b0:45d:9223:9532 with SMTP id m30-20020a67e0de000000b0045d92239532mr6331853vsl.19.1699894805008; Mon, 13 Nov 2023 09:00:05 -0800 (PST) MIME-Version: 1.0 References: <87351ak5kt.fsf@tromey.com> <87h6m5jraw.fsf@tromey.com> In-Reply-To: <87h6m5jraw.fsf@tromey.com> From: Dmitry Neverov Date: Mon, 13 Nov 2023 17:59:54 +0100 Message-ID: Subject: Re: Index files are not used in the session where they were created To: Tom Tromey Cc: Dmitry Neverov via Gdb Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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