From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by sourceware.org (Postfix) with ESMTPS id 6128A3858D28 for ; Mon, 24 Apr 2023 16:22:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6128A3858D28 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-xd30.google.com with SMTP id ca18e2360f4ac-7606ce9bfdeso419938739f.0 for ; Mon, 24 Apr 2023 09:22:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1682353342; x=1684945342; 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=0qXgozTq3Kpx2xV2FF1zZBl8h2B9nur2u2YIGosJuC4=; b=bjiNLS70KszwqiAzO/1B1sr5liNIj2F7tp+7yZ1FdOP1elu/uR6M7KH0GQ/ROFDFRM euXRkntGeltz0bdp8bcr6oBpEqra+uVAtT63eaya+zuV4WgGo8d9YozvjVfWnx+jLNOV jMdhfjGd2OrmjacjBGoFco0MSDjaWVq8zBixA0BRtnwy8ooRX0oq30ASh1eAcm51r7Na rwYeYcmefosVl4llK8uxEZwAq4gYbhmuGgxvqQZrnFo5dK3oe4WVmpkpmWAkS49PvMWc mXAbmj/FxauM3nUlejk3HQdbHq0BLfqBDfy3urUvQneJrGKW1vtD+nGyB0xnvfOJQfq0 DLxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682353342; x=1684945342; 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=0qXgozTq3Kpx2xV2FF1zZBl8h2B9nur2u2YIGosJuC4=; b=E9PH+Gh2mBz0yiQZtjJU1gHHuP/fgK1DcH6+yqduIsA3ojXLa3SOxjrwhBWgBk9lM1 f+5ZgFQuQGRK1TFfp/8VDaT4pQRh8EciswrK+fNLvEsEK1zhO5hPHlBMyqJGJxF9Wm2S OkZbJzwKFdc59CjaQbuAMm9+wKlnxPBvbsTVTYK80bFD+buDEVHBMv9H6Sm9wd8JyZX8 qLhoflquHuszFpxeuwl+z19tQoGZbNEUZsJPsXHbJi27+Ag3FO7B+ds9OdRQY5WsnE4g bOyHkBJ07hUWNr6oW8NjXeiJaWJ1OePKehY0zONuz5b8CpsMrevpbYN42ZGDUXEAlk9o I2sw== X-Gm-Message-State: AAQBX9dmdVA4JMA2yybgPJLPPw5DImAFI7iQxYxDKXgC3qzpoy4hdbEw NFxo2m2uJh1RW6rsIHEyWN2ZoOjAQP2eiJUz0nXLfw== X-Google-Smtp-Source: AKy350asGwDB9YiFRGN1WAximV0y2iNJltCERjK4jJbpCmNuM26GbJAlH9SuvkMkIaCeACF38be/kA== X-Received: by 2002:a5d:9914:0:b0:763:8eea:5d8b with SMTP id x20-20020a5d9914000000b007638eea5d8bmr5841863iol.4.1682353342546; Mon, 24 Apr 2023 09:22:22 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:22:22 -0700 (PDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFC 01/10] Remove baseaddr parameter from dwarf2_record_block_ranges Date: Mon, 24 Apr 2023 10:22:02 -0600 Message-Id: <20230424162211.682763-2-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.2 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: dwarf2_record_block_ranges is only ever called with the text section offset, so this patch removes the parameter entirely. This makes a subsequent patch a little simpler. --- gdb/dwarf2/read.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 29a95cb8b2f..904dcc09405 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -904,7 +904,7 @@ static void get_scope_pc_bounds (struct die_info *, struct dwarf2_cu *); static void dwarf2_record_block_ranges (struct die_info *, struct block *, - CORE_ADDR, struct dwarf2_cu *); + struct dwarf2_cu *); static void dwarf2_add_field (struct field_info *, struct die_info *, struct dwarf2_cu *); @@ -6423,7 +6423,7 @@ process_full_comp_unit (dwarf2_cu *cu, enum language pretend_language) (such as virtual method tables). Record the ranges in STATIC_BLOCK's addrmap to help ensure it has an accurate map of pc values belonging to this comp unit. */ - dwarf2_record_block_ranges (cu->dies, static_block, baseaddr, cu); + dwarf2_record_block_ranges (cu->dies, static_block, cu); cust = cu->get_builder ()->end_compunit_symtab_from_static_block (static_block, 0); @@ -10188,7 +10188,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) &objfile->objfile_obstack); /* If we have address ranges, record them. */ - dwarf2_record_block_ranges (die, block, baseaddr, cu); + dwarf2_record_block_ranges (die, block, cu); gdbarch_make_symbol_special (gdbarch, cstk.name, objfile); @@ -10301,7 +10301,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) there. But since we don't even decide whether to create a block until after we've traversed its children, that's hard to do. */ - dwarf2_record_block_ranges (die, block, baseaddr, cu); + dwarf2_record_block_ranges (die, block, cu); } *cu->get_builder ()->get_local_symbols () = cstk.locals; cu->get_builder ()->set_local_using_directives (cstk.local_using_directives); @@ -11278,9 +11278,10 @@ get_scope_pc_bounds (struct die_info *die, static void dwarf2_record_block_ranges (struct die_info *die, struct block *block, - CORE_ADDR baseaddr, struct dwarf2_cu *cu) + struct dwarf2_cu *cu) { struct objfile *objfile = cu->per_objfile->objfile; + CORE_ADDR baseaddr = objfile->text_section_offset (); struct gdbarch *gdbarch = objfile->arch (); struct attribute *attr; struct attribute *attr_high; -- 2.39.1