From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id 421D53858D28 for ; Thu, 19 Oct 2023 16:55:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 421D53858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 421D53858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::52f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697734554; cv=none; b=Hv8rome04p4HFV9V8RTwi9iE8Jvz2UKC82Lep4v+RDT8447JUqvBJab8w7KlthRsZdFvcq3+rEO8RerTrI7kt0vzJ5K6oRt98By/in5Nepeo7TGABT1i9PY7YUHd4x9QGKBuaBt5R/aldPT8C6FYt7s+wE0maTtliICzD0GEPSo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697734554; c=relaxed/simple; bh=Me88lqnqzEyyYtfiuFN4TfDj0AvyI2H3i7GYa0vBIe0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=qWlrtnSeONuzQv9wOr4l5wfeqVJKv4s8/Bd/nQHe8Vwhsxnm9HnbXrCFn+P6PkVoq5SbNGXg93EknU3oGTrrf0CMGS8qsJeuk3g4PWNF3uH67FfMnI6cwX0gQt7nE02GdOZO/SrQY0nNXM4yk9aW6f8+LejngrtSQdGeswZAx0s= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-5aa7fdd1420so4121815a12.3 for ; Thu, 19 Oct 2023 09:55:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697734551; x=1698339351; darn=sourceware.org; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=zRip2ILaJDeRMkHdsxmWfj7Cp9FYqPN5webuyV2k08g=; b=UQeylzZzojKoaVpXxEA5IuPLARSN5Flo26orw37ofRbNp8sqHmhIq5/ExbhStgCPNJ Kb2KwPVsA+DLpc8EsPUWj8s8S/dB4t47fvue7mGXyQC1VPzZ/YmwXQYxFQscCXGA26sH IHT40LIzamcBg+FPbIe7y5BAxFfcp86oMxIdT8nb0BcRcyX3KG1lzvsQ7CryF3n0SnjU q+03lTiLhSRBA8kkqde1Wt0oz9XxDM1OfShhGjc/jnLpum6Uf4VxEwc+XS2WLoZZqzzH 4W9hP8cu9D916thrStghSQrGmKa6+CmoC45PUBgQybOoL/qxjUouoEZGUI2Hqxqq7Zp6 OvEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697734551; x=1698339351; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zRip2ILaJDeRMkHdsxmWfj7Cp9FYqPN5webuyV2k08g=; b=FhiSB+BL4FkFIvx538vKNVaEn9pMpzJOHGT1JUJm7mdFQwajJWvuNMSTOLo9X4TJ2z unWgBvABjcKscgrJ7eC0XfWPf0cx2DDYPOwG+O7HtaiAQCxDTjKY3qzr411NsT2sqzLH QqB6w+fiDAExtTAUox6CRhsykrPZGZhXRiDSSQjPEImt+lBlo25AdbCOdGpNDcyfB3s+ 2APS7H1G3uqIzZxxfDwudGi5Y8xapciemnRe2X1orWq0wwEiO/aWh8obFcBHnCyulbn4 LfoKKfNduAkt8KUyCPWUJNqgCvKEF9Ylr/QSz+aI0qOkoUYJuGfRlVcK6bVbagTcvAE3 u14Q== X-Gm-Message-State: AOJu0YyPyYyqpFo/OKbNV4mZkXz5GHPUkQDzD7ny0nvBGYH/pIAAorr6 CU1OyBI15ibrEAuwwwX7m/aVtg== X-Google-Smtp-Source: AGHT+IGKFHmRqTQyHOaGz3rXseXjlRwvS0G1ichJHGXE64580bEbKALREjvre5HnN021OYNJBvWb2Q== X-Received: by 2002:a05:6a21:a5a7:b0:159:f71f:4083 with SMTP id gd39-20020a056a21a5a700b00159f71f4083mr3268665pzc.6.1697734551138; Thu, 19 Oct 2023 09:55:51 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:853b:819f:d133:32d9]) by smtp.gmail.com with ESMTPSA id w9-20020a170902e88900b001c613b4aa33sm2155123plg.287.2023.10.19.09.55.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 09:55:50 -0700 (PDT) References: <20231011153214.25769-1-tdevries@suse.de> User-agent: mu4e 1.10.7; emacs 29.1 From: Thiago Jung Bauermann To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 1/2] [gdb/symtab] Fix style issues in v9 .gdb_index section support In-reply-to: <20231011153214.25769-1-tdevries@suse.de> Date: Thu, 19 Oct 2023 13:55:48 -0300 Message-ID: <87fs26tuuj.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-11.7 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: Hello Tom, Tom de Vries writes: > @@ -1217,7 +1217,7 @@ write_shortcuts_table (cooked_index *table, data_buf& shortcuts, > } > } > > - shortcuts.append_uint (4, BFD_ENDIAN_LITTLE, dw_lang); > + shortcuts.append_offset (dw_lang); This is a functional change. Is it intentional? If so, it'd be better as a separate patch. > shortcuts.append_offset (main_name_offset); > } > > diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c > index b96eaa96e23..34c5dfd5803 100644 > --- a/gdb/dwarf2/read-gdb-index.c > +++ b/gdb/dwarf2/read-gdb-index.c > @@ -777,10 +777,10 @@ static void > set_main_name_from_gdb_index (dwarf2_per_objfile *per_objfile, > mapped_gdb_index *index) > { > - const auto expected_size = 4 + sizeof (offset_type); > + const auto expected_size = 2 * sizeof (offset_type); This is also a functional change. > if (index->shortcut_table.size () < expected_size) > /* The data in the section is not present, is corrupted or is in a version > - * we don't know about. Regardless, we can't make use of it. */ > + we don't know about. Regardless, we can't make use of it. */ One further style issue that could be fixed here is the lack of double space after period. > return; > > auto ptr = index->shortcut_table.data (); > @@ -794,7 +794,7 @@ set_main_name_from_gdb_index (dwarf2_per_objfile *per_objfile, > if (dw_lang == 0) > { > /* Don't bother if the language for the main symbol was not known or if > - * there was no main symbol at all when the index was built. */ > + there was no main symbol at all when the index was built. */ > return; Also here, double space after period is lacking. > } > ptr += 4; > diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h > index 1d9432c5c11..c92474d8b9d 100644 > --- a/gdb/dwarf2/read.h > +++ b/gdb/dwarf2/read.h > @@ -246,11 +246,11 @@ struct dwarf2_per_cu_data > std::vector *imported_symtabs = nullptr; > > /* The original DW_LANG_* value of the CU, as provided to us by > - * DW_AT_language. It is interesting to keep this value around in cases where > - * we can't use the values from the language enum, as the mapping to them is > - * lossy, and, while that is usually fine, things like the index have an > - * understandable bias towards not exposing internal GDB structures to the > - * outside world, and so prefer to use DWARF constants in their stead. */ > + DW_AT_language. It is interesting to keep this value around in cases where > + we can't use the values from the language enum, as the mapping to them is > + lossy, and, while that is usually fine, things like the index have an > + understandable bias towards not exposing internal GDB structures to the > + outside world, and so prefer to use DWARF constants in their stead. */ I think the lack of double space after period here are fixed in the other patch you sent. -- Thiago