From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by sourceware.org (Postfix) with ESMTPS id BA078385841C for ; Mon, 24 Apr 2023 16:22:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BA078385841C 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-io1-xd35.google.com with SMTP id ca18e2360f4ac-7606d443bb2so134940539f.1 for ; Mon, 24 Apr 2023 09:22:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1682353349; x=1684945349; 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=QmyTl4Pd8ZpNRSlolQ4WrVznD562fAyiXAa5kWJrPTI=; b=MiNjCxQHBPhaFEd9NSLMF+BRDqVxA65/HKNpwOpD8IF6XBiaJ7SGsGSmBkqp1NabnR 4+ktpwU7nWxSjQWrZRbvLLkAXCynFX/MhXL28vApDW6ScpBZHVUbFhZ/XP+qs91SIPyH 6WGISkWB1k/yasjZvAHM62Jxpi2XXumFZ2KV5Ko8q5OeQog6AWXTxVrzDd9OL8jCBqI3 pIx5jpkLn1vKplj+PlifLpl2dawKXxij6uhNQpdbs5SGj7TWJlBTTyImH40xT8xP0Vhy Mkn6itfX7wIEGUzFvM6UgkSXP6Y8jB1xSPdU28e8zgBoSoqqp4DEIPrTz58Ux4VfI4DY jUtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682353349; x=1684945349; 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=QmyTl4Pd8ZpNRSlolQ4WrVznD562fAyiXAa5kWJrPTI=; b=bZ+WubKLbkpU44rRHi20yx79iCjBB1G6IVNom/+598O04HT6dblXxTW9gIS/5MmbK1 WhYB58sWo5LK0nsfaYaXhuHsUO9OQzvlJtzIWmQgo24txHvBt41jTN9rmo8CjXsPXvd7 OSKbByFQp99C+QULO+ewiWCo03pjnLTW7vNCn3m+2btHVcjyPgyEK3N6kOyAJYs2aWLB Nbq+xT7xAyZnGk/w5ZblvUMLVFIW1ZgKWf96JJW+8nU6TCQfTDA8VWn7397tRhfEZZWS TOsy2fLJ3JgubFhtwC7yJmt2WjPgm+EOwa9Is1qH/5B2IAhz1C33W7ser+lCrqU27nj0 WaLA== X-Gm-Message-State: AAQBX9fke/EZOeXISvhRce/TrKplQNSPgiTCgCsFkXKLPYgCfgvfiBds teGZ7kBsswtoxCG15Ohd0HNMQCeliEkIme/bqlKIzg== X-Google-Smtp-Source: AKy350ZbXWx78fy4YL2plGAa4ud+Jiq7i8L2EaBSjfMoNKZzsmeqnoO7Z168InUHcgaDsaaBxwNaLg== X-Received: by 2002:a05:6602:258b:b0:74c:d67a:6fa0 with SMTP id p11-20020a056602258b00b0074cd67a6fa0mr5779170ioo.7.1682353348875; Mon, 24 Apr 2023 09:22:28 -0700 (PDT) Received: from localhost.localdomain (71-211-191-82.hlrn.qwest.net. [71.211.191.82]) by smtp.gmail.com with ESMTPSA id cx27-20020a056638491b00b0040fa19472bcsm3444049jab.92.2023.04.24.09.22.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:22:28 -0700 (PDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFC 09/10] Use local "text offset" variable in dwarf2_frame_cache Date: Mon, 24 Apr 2023 10:22:10 -0600 Message-Id: <20230424162211.682763-10-tromey@adacore.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230424162211.682763-1-tromey@adacore.com> References: <20230424162211.682763-1-tromey@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.3 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,T_SCC_BODY_TEXT_LINE 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: A few spots in dwarf2_frame_cache use: cache->per_objfile->objfile->text_section_offset () ... and a subsequent patch will add more, so move this into a local variable. --- gdb/dwarf2/frame.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c index 8f8add201f4..705e2a7eeb9 100644 --- a/gdb/dwarf2/frame.c +++ b/gdb/dwarf2/frame.c @@ -922,6 +922,8 @@ dwarf2_frame_cache (frame_info_ptr this_frame, void **this_cache) gdb_assert (fde != NULL); gdb_assert (cache->per_objfile != nullptr); + CORE_ADDR text_offset = cache->per_objfile->objfile->text_section_offset (); + /* Allocate and initialize the frame state. */ struct dwarf2_frame_state fs (pc1, fde->cie); @@ -934,7 +936,7 @@ dwarf2_frame_cache (frame_info_ptr this_frame, void **this_cache) execute_cfa_program (fde, fde->cie->initial_instructions, fde->cie->end, gdbarch, get_frame_address_in_block (this_frame), &fs, - cache->per_objfile->objfile->text_section_offset ()); + text_offset); /* Save the initialized register set. */ fs.initial = fs.regs; @@ -950,9 +952,8 @@ dwarf2_frame_cache (frame_info_ptr this_frame, void **this_cache) && entry_pc < fde->initial_location + fde->address_range) { /* Decode the insns in the FDE up to the entry PC. */ - instr = execute_cfa_program - (fde, fde->instructions, fde->end, gdbarch, entry_pc, &fs, - cache->per_objfile->objfile->text_section_offset ()); + instr = execute_cfa_program (fde, fde->instructions, fde->end, gdbarch, + entry_pc, &fs, text_offset); if (fs.regs.cfa_how == CFA_REG_OFFSET && (dwarf_reg_to_regnum (gdbarch, fs.regs.cfa_reg) @@ -968,7 +969,7 @@ dwarf2_frame_cache (frame_info_ptr this_frame, void **this_cache) /* Then decode the insns in the FDE up to our target PC. */ execute_cfa_program (fde, instr, fde->end, gdbarch, get_frame_address_in_block (this_frame), &fs, - cache->per_objfile->objfile->text_section_offset ()); + text_offset); try { -- 2.39.1