From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QRpcFZuf42aWTikAWB0awg (envelope-from ) for ; Thu, 12 Sep 2024 22:12:43 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=iMn8sS8v; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 3F6141E353; Thu, 12 Sep 2024 22:12:43 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-11.5 required=5.0 tests=ARC_SIGNED,ARC_VALID, BAYES_00,DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, URIBL_BLOCKED,URIBL_DBL_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A9D891E08F for ; Thu, 12 Sep 2024 22:12:42 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3DFFF3858C33 for ; Fri, 13 Sep 2024 02:12:42 +0000 (GMT) Received: from omta040.useast.a.cloudfilter.net (omta040.useast.a.cloudfilter.net [44.202.169.39]) by sourceware.org (Postfix) with ESMTPS id B498E3858C60 for ; Fri, 13 Sep 2024 02:12:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B498E3858C60 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B498E3858C60 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1726193528; cv=none; b=wvxn1JRa7qFFbVv2/zb4VH7qZ3z8XRlhzbvHGv2Mg2fU4dlSkA89xzxkYPR17QGgNWDBKJkCclPXed3UIahvktu4zMQX8JhmBZLZvpPw5lpboG32C1E0XkgA/E1OI0r7oAhQdk/kAgT0F6NgjLgqxW0h4rbWmcwpZ1NxgIuJlZs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1726193528; c=relaxed/simple; bh=7xD/xq8vB3B0V9P0w4PF1kJ7DDX0GFSkVvXk0hTpOvg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=m02WEWwCW5phTibmsauxJ1Vek+B2Qkk0qWKOL5/OdyXWXkmo4ZhuXsgCorZUoO9Sqn3+0St2oL3hZ1HmwoAePZBmXMbepy6GYtgCj5xogtQN3EDvgAXXg5AlWSXoI94XLuwn/KSFP5yZedh8Wr7jfMxq4IfUQIy5vUfVeFJrfeI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6005a.ext.cloudfilter.net ([10.0.30.201]) by cmsmtp with ESMTPS id ouuDsiYh7nNFGovn1slcaq; Fri, 13 Sep 2024 02:12:03 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id ovn0skqk8RBkMovn0sG1pR; Fri, 13 Sep 2024 02:12:02 +0000 X-Authority-Analysis: v=2.4 cv=CbPD56rl c=1 sm=1 tr=0 ts=66e39f72 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=EaEq8P2WXUwA:10 a=ItBw4LHWJt0A:10 a=lZ6-92vF6IzwjJBkYGwA:9 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Gmk9FBOC7gRKhJAFb7h+1r3YzXD/ZGNUWHdhfqhdYVY=; b=iMn8sS8vm7Tw58A9FEM2VG75o2 6XVU79Jwgrk/AGZbPPVEsiG9cta2ltM079CfxUqldnz5gQ4dtigZq5EvEJ7SAs9mSZIztwkQnPQCq Xv2YVF0VgHF2DaFaRu+HH7nRu; Received: from 97-118-34-56.hlrn.qwest.net ([97.118.34.56]:46146 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1sovmz-0005iw-25; Thu, 12 Sep 2024 20:12:01 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Update more types for section index change Date: Thu, 12 Sep 2024 20:11:54 -0600 Message-ID: <20240913021154.1458345-1-tom@tromey.com> X-Mailer: git-send-email 2.45.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.118.34.56 X-Source-L: No X-Exim-ID: 1sovmz-0005iw-25 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-34-56.hlrn.qwest.net (localhost.localdomain) [97.118.34.56]:46146 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfBxijgvP0OYWqBFVQfLTPUi6jSVr4otYB80EwgSLHs+RDdf3v2qGpro+wvRn0yQVnvAzyvs/sKXWYjkPrPCJUa9PCSU6T0FWzDn9pprH3caM13oArgGz K/Ri0233lf/IMhalDXpBrU0u5mDiX4ATVnIZtACoEuXf94E8BsZixSPJv2oCx7g5GzQIvwgJfLC+PfREqPcXZWu02FRBWQjULM4= X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Commit f89276a2f3e ("change type of `general_symbol_info::m_section` to int") did what it says in the title -- changed the type of the section index from short to int. However, it seems incomplete, in that there are uses of the section index that use the type 'short'. This patch fixes the ones I found, first by searching for "short.*sect" and then by looking at all the callers of section_index (and then functions called with the resulting value) just to try to be more sure. --- gdb/coff-pe-read.c | 3 +-- gdb/ctfread.c | 2 +- gdb/mdebugread.c | 4 ++-- gdb/minsyms.c | 3 +-- gdb/psymtab.c | 2 +- gdb/psymtab.h | 2 +- 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c index ed5e533a362..bb85b000ca9 100644 --- a/gdb/coff-pe-read.c +++ b/gdb/coff-pe-read.c @@ -176,7 +176,6 @@ add_pe_forwarded_sym (minimal_symbol_reader &reader, { enum minimal_symbol_type msymtype; int forward_dll_name_len = strlen (forward_dll_name); - short section; std::string forward_qualified_name = string_printf ("%s!%s", forward_dll_name, @@ -215,7 +214,7 @@ add_pe_forwarded_sym (minimal_symbol_reader &reader, unrelocated_addr vma = unrelocated_addr (msymbol.value_address () - objfile->text_section_offset ()); msymtype = msymbol.minsym->type (); - section = msymbol.minsym->section_index (); + int section = msymbol.minsym->section_index (); /* Generate a (hopefully unique) qualified name using the first part of the dll name, e.g. KERNEL32!AddAtomA. This matches the style diff --git a/gdb/ctfread.c b/gdb/ctfread.c index 9eb9537ef41..ee7c30f7d87 100644 --- a/gdb/ctfread.c +++ b/gdb/ctfread.c @@ -1460,7 +1460,7 @@ ctf_psymtab_type_cb (ctf_id_t tid, void *arg) { struct ctf_context *ccp; uint32_t kind; - short section = -1; + int section = -1; ccp = (struct ctf_context *) arg; diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index ab4d509e02a..f1211be108c 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -3368,7 +3368,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, char *sym_name; enum address_class theclass; unrelocated_addr minsym_value; - short section = -1; + int section = -1; (*swap_sym_in) (cur_bfd, ((char *) debug_info->external_sym @@ -3616,7 +3616,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, enum address_class theclass; SYMR *psh; CORE_ADDR svalue; - short section; + int section; gdb_assert (ext_ptr->ifd == f_idx); diff --git a/gdb/minsyms.c b/gdb/minsyms.c index b5c4b95f1ba..33eb9072e5f 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -1594,7 +1594,6 @@ find_solib_trampoline_target (const frame_info_ptr &frame, CORE_ADDR pc) CORE_ADDR minimal_symbol_upper_bound (bound_minimal_symbol minsym) { - short section; struct obj_section *obj_section; CORE_ADDR result; struct minimal_symbol *iter, *msymbol; @@ -1616,7 +1615,7 @@ minimal_symbol_upper_bound (bound_minimal_symbol minsym) = (minsym.objfile->per_bfd->msymbols.get () + minsym.objfile->per_bfd->minimal_symbol_count); msymbol = minsym.minsym; - section = msymbol->section_index (); + int section = msymbol->section_index (); for (iter = msymbol + 1; iter != past_the_end; ++iter) { if ((iter->unrelocated_address () diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 0df3dc8ecbb..e25c3ab33ec 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1082,7 +1082,7 @@ void partial_symtab::add_psymbol (std::string_view name, bool copy_name, domain_enum domain, enum address_class theclass, - short section, + int section, psymbol_placement where, unrelocated_addr coreaddr, enum language language, diff --git a/gdb/psymtab.h b/gdb/psymtab.h index 508e77810d2..a81526cddee 100644 --- a/gdb/psymtab.h +++ b/gdb/psymtab.h @@ -349,7 +349,7 @@ struct partial_symtab void add_psymbol (std::string_view name, bool copy_name, domain_enum domain, enum address_class theclass, - short section, + int section, psymbol_placement where, unrelocated_addr coreaddr, enum language language, -- 2.45.0