From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) by sourceware.org (Postfix) with ESMTPS id DBBB43858417 for ; Wed, 18 Jan 2023 15:30:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DBBB43858417 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-il1-x129.google.com with SMTP id u8so17198474ilg.0 for ; Wed, 18 Jan 2023 07:30:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PLEg362xbWVJpaTC2hkMMVUnA5WXds1dLjruyBqOxIc=; b=Kj87Jpiwz6dLOAxKpXwrJvTA5x7KRR6Fb7R3htDkGs5tFLkWF8DaPHLDGHGAx5mvVx BDKmIf1dCupbNUXIWbm8EYrlL+gBee5xCU2L3VQY/aFhmnfDNerIfhS4uoxwoUEjwUoT W+EdmBBzt4P2WU2L0TsqlE8ipECgp5WwevalhAD8WfhcKZP+w0uMjGkH2Uy8FEz75ird eX5aAlC3cwxnIbzm0olYg7uknHuYOYwmyJxZVX13wrm/OiTl0QgXp7XeAhFqMragxqLJ fCcqSjHjwRsc3s0w8+RE20vhnyTHaAUqXgg0YdGnRjZ9f3VXVNF4kL+M4l0konU/OmyJ QSiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PLEg362xbWVJpaTC2hkMMVUnA5WXds1dLjruyBqOxIc=; b=gtw8vLei/CdY59Z615v7SewgfH0JIgX5tXT0U11o2BubJANoe6ewRH/q4ShsipbJjW 8IRONgZ6NxDJtE3kZIFcJt32IbleQMyWaKQXwI9/uVM9VebsF2txMdykWkX/s9ar4YdC nBQzxfXL+UhSWcV6YK/4w3HGteJ/CKEcbB2zEdwJMp7aQIPz2I5mNnXmVKh+BBdDKzr6 iSpg7kqHrBKUTBena7X6E1DijXndDnWeCTTXbO7Dye3+4OKSSdu6BpKySWcqC0ZxaGeo l2GJTiGTqm0XdrERQD68NRyEsgPHOPWGvyn+N/naH3NvtV1V7XP9DhmXdC9tr/cHv4P2 f80Q== X-Gm-Message-State: AFqh2kpzw0FJmYxAuS1yj6LDnhDv4EvlsBC0OLSa2ppE+Qmj0zxvXmVb sGq+/5eKBOcM5zLX9mqnWv0bo4bB8Tt2N9Op X-Google-Smtp-Source: AMrXdXtH9LMYrUbTgAewdIoEL90sa0bZz5zPZ2PrK1VPqJiECYKX9HC/bEVkldEVDAFmnMtvAWrcOQ== X-Received: by 2002:a92:c682:0:b0:30f:e5f:ff8d with SMTP id o2-20020a92c682000000b0030f0e5fff8dmr6440981ilg.16.1674055839101; Wed, 18 Jan 2023 07:30:39 -0800 (PST) Received: from localhost.localdomain (97-122-76-186.hlrn.qwest.net. [97.122.76.186]) by smtp.gmail.com with ESMTPSA id m4-20020a056e020de400b0030bf2476c5fsm10106502ilj.25.2023.01.18.07.30.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 07:30:38 -0800 (PST) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 4/6] Set section index when setting a symbol's block Date: Wed, 18 Jan 2023 08:30:23 -0700 Message-Id: <20230118153025.342512-5-tromey@adacore.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230118153025.342512-1-tromey@adacore.com> References: <20230118153025.342512-1-tromey@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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: When a symbol's block is set, the block has the runtime section offset applied. So, it seems to me that the symbol implicitly is in the same section as the block. Therefore, this patch sets the symbol's section index at this same spot. --- gdb/buildsym.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 8c61223b1a0..fa55699b40e 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -247,6 +247,7 @@ buildsym_compunit::finish_block_internal struct type *ftype = symbol->type (); struct mdict_iterator miter; symbol->set_value_block (block); + symbol->set_section_index (m_section_index); block->set_function (symbol); if (ftype->num_fields () <= 0) -- 2.38.1