From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 43B953858D35 for ; Mon, 29 Apr 2024 13:17:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 43B953858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 43B953858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714396626; cv=none; b=P/E/i5se/5s9y4dVjOKKtNek4xxeMH4dnZOJes/zvjVnaLX2WR8MFDvrhNf2hleAtsbUQ7L9epj+tZCiR/ogz+DWQ+Cctfq7fI1/GzUKhSlkHfrqWCtg5937al7XU8lHAwN18uTBAGTK4o40WoqKzA8DoVCtiJ4QJge2p8RkhqQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714396626; c=relaxed/simple; bh=pWKHbLUufdch/qFGDqGT+6g++Mxu3zznBXl374IuNeE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=poJw2wdr9/i3fesIXr5mFyRJ5d8OtgTQIZTJm1yt2VhGpd2M73wKR05m0DL0+GuduYDwSYfudhCLvWoU9+reCta5q52SCIzKTCd+jwWR3bW0fcu1ovA9eSXISE4sWKrymgeB8D1tc0vbUUirDD35Nx5bTkEsnugltnJIoEvNyHo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714396622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ItqmARaUQ1uBppbloTfmGTjDgXv4eCeKYzz+SDy0ae0=; b=A5AKR5LsE9c+VOZ0NRD93sZI8uWpXGNUHdu3aZ2nb8jHEzVdxclaPcrBgC1aaR3yglCgeg T7k6BghmBxwB0ZtSKiUTARNh6c33HkemmL00edistgOwlNgMtf5NSbqmWYXfi869gk75k3 2wHvcdGha97ToxqGOWePnzYYN1Dh9nE= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-670-LDF7DFXCOICmmN3AwjKiUA-1; Mon, 29 Apr 2024 09:17:01 -0400 X-MC-Unique: LDF7DFXCOICmmN3AwjKiUA-1 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2e0b3a7ffbeso4385531fa.1 for ; Mon, 29 Apr 2024 06:17:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714396620; x=1715001420; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ItqmARaUQ1uBppbloTfmGTjDgXv4eCeKYzz+SDy0ae0=; b=CcXn9lyotBANkNXLDF+lNCNCGIaN/52ppMpq6+QwGdC8ZdkeQWKQNiTgPga2QQpVe+ uPY5PxevvC2CbVB8pdKk0tyu4UaAO0MWgLlJn3PW3PZsEoyY6KPkr2QGTSJgq2Iqf81p awjUzIiiUZ2WND4ZaVAMxurlC8hjEvwaBD9Pg1YV2abxU9UJQabnTyjRv+L3pFhB1ITX 7YHiWQufNJFem8ng2JIYaLyokhQPgaIbb5afSgILNCPDaEl+GLtguPRuzAd1kT6j/QsA TRuLWeEEQVoPReOklp9iT+HmB+7qo+Q1Ru2qnRt0kY1nxuKn6BORgQUhZyoqHcx0HJyu gFJA== X-Forwarded-Encrypted: i=1; AJvYcCVQFc24bCDlvyv21Nf3om1+qWqljBJ4zw8fdDt/eO9mZKAztyailH/fRUyDpQziRKVVY4myX+9MBxO7ElBWA8xKGbq8ycyI/TMmaQ== X-Gm-Message-State: AOJu0YzxWT2YzXIuowhN9ugc7wezphy6hmJfnNh5jY/pQz/i1ChOSedU qxI9vfxddJuwncz6JsvCxvyM3izv02cGg0usg9cCVLnPkaB2TFkAmYP8wtLJ4pkEXE7qG1aDp7C JFXq/ewxWvgXOLoQhg36oHhDy9GoOcmGnB68ZOZ48RF26u11pPGeYoVhmUToMxuBXSRA= X-Received: by 2002:a2e:9e48:0:b0:2db:98d0:fd1b with SMTP id g8-20020a2e9e48000000b002db98d0fd1bmr7769326ljk.46.1714396619605; Mon, 29 Apr 2024 06:16:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFfiTV/9NaQAst0yyUJmBfg7BWXpF+Q4rR94zkQhEs4mI3/ev/hqSFIpIv6ckodP8EoaTw90A== X-Received: by 2002:a2e:9e48:0:b0:2db:98d0:fd1b with SMTP id g8-20020a2e9e48000000b002db98d0fd1bmr7769302ljk.46.1714396618867; Mon, 29 Apr 2024 06:16:58 -0700 (PDT) Received: from localhost (185.223.159.143.dyn.plus.net. [143.159.223.185]) by smtp.gmail.com with ESMTPSA id l15-20020a5d480f000000b0034d5d00979csm149841wrq.59.2024.04.29.06.16.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 06:16:58 -0700 (PDT) From: Andrew Burgess To: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 1/5] Remove call to dwarf2_per_objfile::adjust from ranges readers In-Reply-To: <87cyq8pbnp.fsf@redhat.com> References: <20240416-dwarf-race-relocate-2-v1-0-1fc912e95e87@tromey.com> <20240416-dwarf-race-relocate-2-v1-1-1fc912e95e87@tromey.com> <87cyq8pbnp.fsf@redhat.com> Date: Mon, 29 Apr 2024 14:16:57 +0100 Message-ID: <87a5lcpauu.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: Andrew Burgess writes: > Hi Tom, > > So, I don't know the details of the DWARF reader too well, so my attempt > to review this patch might be just wasting your time. But I didn't > really understand what was going on here, so... > > Tom Tromey writes: > >> dwarf2_per_objfile::adjust applies gdbarch_adjust_dwarf2_addr to an >> address, leaving the result unrelocated. However, this adjustment is >> only needed for text-section symbols -- it isn't needed for any sort > > I didn't know if the use of the word 'symbols' here was significant. > gdbarch_adjust_dwarf2_addr operates on addresses, and I guess symbol > could be a synonym for address in some contexts. But the addresses here > do seem to be .text addresses, so clearly there's some important > distinction that I'm not understanding. > >> of address mapping. Therefore, these calls can be removed from > > gdbarch_adjust_dwarf2_addr seems to be relevant for .text addresses, > which is what you're handling here, but you are creating a map, but it's > not clear _why_ those addresses wouldn't need to be updated. A follow on question. Looking through gdb/dwarf/ there seem to be several other places where the addrmap_mutable::set_empty is called, and in at least some of those places the addresses are still being adjusted. E.g.: dwarf2_ranges_read cooked_indexer::check_bounds cooked_indexer::scan_attributes Why do these not need changing? Thanks, Andrew > > Sorry to ask what are probably obvious questions... > > Thanks, > Andrew > >> read_addrmap_from_aranges and create_addrmap_from_gdb_index. >> --- >> gdb/dwarf2/aranges.c | 2 -- >> gdb/dwarf2/read-gdb-index.c | 2 -- >> 2 files changed, 4 deletions(-) >> >> diff --git a/gdb/dwarf2/aranges.c b/gdb/dwarf2/aranges.c >> index d577db62726..0d1dc11e27a 100644 >> --- a/gdb/dwarf2/aranges.c >> +++ b/gdb/dwarf2/aranges.c >> @@ -190,8 +190,6 @@ read_addrmap_from_aranges (dwarf2_per_objfile *per_objfile, >> continue; >> } >> ULONGEST end = start + length; >> - start = (ULONGEST) per_objfile->adjust ((unrelocated_addr) start); >> - end = (ULONGEST) per_objfile->adjust ((unrelocated_addr) end); >> mutable_map->set_empty (start, end - 1, per_cu); >> } >> >> diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c >> index 8c0895b9639..cc6361674e8 100644 >> --- a/gdb/dwarf2/read-gdb-index.c >> +++ b/gdb/dwarf2/read-gdb-index.c >> @@ -566,8 +566,6 @@ create_addrmap_from_gdb_index (dwarf2_per_objfile *per_objfile, >> continue; >> } >> >> - lo = (ULONGEST) per_objfile->adjust ((unrelocated_addr) lo); >> - hi = (ULONGEST) per_objfile->adjust ((unrelocated_addr) hi); >> mutable_map.set_empty (lo, hi - 1, per_bfd->get_cu (cu_index)); >> } >> >> >> -- >> 2.43.0