From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SSwIC+E58Gj6ZjYAWB0awg (envelope-from ) for ; Wed, 15 Oct 2025 20:18:41 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=GdPF7UB/; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 292FB1E0BA; Wed, 15 Oct 2025 20:18:41 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 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 85D721E047 for ; Wed, 15 Oct 2025 20:18:40 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0D59B385801B for ; Thu, 16 Oct 2025 00:18:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D59B385801B Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=GdPF7UB/ Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id D5C2D3857C5D for ; Thu, 16 Oct 2025 00:14:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D5C2D3857C5D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D5C2D3857C5D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760573646; cv=none; b=bG2d0bHaXqz+GQxOT1OfjQHmw5woflNqrHEeZrHTv5P3ia2xoOz8y8vzrELhMHx/qJqrSbZ32eVnI5H8LqCjrz71hHZaeQzHAA8/mL2Qm/xBiQf85xkK7aQtc1vIuUpEXpvIofvxF2lJWEX6K9HDHZeXHruxdAWl2X9ycgTJMYo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760573646; c=relaxed/simple; bh=eehJS4eZWhrXhsmCy7LENpRYP28vLIhkPwnBT+V7Jms=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ARx90t3IwoFVdlNP0aYBTZ1gdccmw2E+B3eolR49epE0vRTBFasatbN1GSAU8Li8hxpwkKhYwuGnJDGgomTjxuXBRLShHXb/2hO3m3rgSnNZOQ83yKEFWqpjqG2Pq9XfyUCivm0TR3hRmJxzKmOnU6b+S3T/fUV5jmTvwSy1sIA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D5C2D3857C5D Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 59G0E07K070339 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Oct 2025 20:14:05 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 59G0E07K070339 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1760573645; bh=ZlGQew3/ZI6yazg5WETtRm77avD0oG6ajtjlvsVlEjY=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=GdPF7UB/mIxbilttgh2oNpB1daCEyH7V4IvoKcdItnRMU8ptLgAl0ae4nsr5EAb4w 08E2Z1GEsIrrgP3keBlXAJTS9ojQYZFDp6D7FXfUvmww/BRe6+1k1ib1Xao/vJA10T 8El1S1rPKjjD6eGcWrG5az4gxjySx0Fs1g/VeKuaE9zBjRkC8fkHFOaYw3tDdPOARs pnbXzabobH6J55wV+5ejfF4hUgj+PcA7UA/+RBvqfvlf82UAFwtm0HeHiMrSQOnpYL Toop8mbJ6vpBZyokbRbhkxNoYfhkSXd4wp3mN0r7Ak7+rl20BivCC3r+t6UKD7QzBY Bzzsb9c6uNH9w== Received: by simark.ca (Postfix) id 7EB1D1E047; Wed, 15 Oct 2025 20:14:00 -0400 (EDT) From: simon.marchi@polymtl.ca To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 08/10] gdb: rename find_pc_sect_line -> find_sal_for_pc_sect Date: Wed, 15 Oct 2025 20:08:02 -0400 Message-ID: <20251016001154.3969223-9-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251016001154.3969223-1-simon.marchi@polymtl.ca> References: <20251016001154.3969223-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 16 Oct 2025 00:14:00 +0000 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 From: Simon Marchi Change-Id: I9c2a72de57a4ea9c316fc949db4fb0bf7f78eb4b --- gdb/amd64-tdep.c | 4 ++-- gdb/linespec.c | 2 +- gdb/printcmd.c | 4 ++-- gdb/symtab.c | 22 +++++++++++----------- gdb/symtab.h | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index b1021c071c55..b670586050b2 100755 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -2784,14 +2784,14 @@ amd64_skip_xmm_prologue (CORE_ADDR pc, CORE_ADDR start_pc) if (pc == start_pc) return pc; - start_pc_sal = find_pc_sect_line (start_pc, NULL, 0); + start_pc_sal = find_sal_for_pc_sect (start_pc, NULL, 0); if (start_pc_sal.symtab == NULL || producer_is_gcc_ge_4 (start_pc_sal.symtab->compunit () ->producer ()) < 6 || start_pc_sal.pc != start_pc || pc >= start_pc_sal.end) return pc; - next_sal = find_pc_sect_line (start_pc_sal.end, NULL, 0); + next_sal = find_sal_for_pc_sect (start_pc_sal.end, NULL, 0); if (next_sal.line != start_pc_sal.line) return pc; diff --git a/gdb/linespec.c b/gdb/linespec.c index 05f676ee38d4..703af9ccdb95 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -4113,7 +4113,7 @@ add_minsym (struct minimal_symbol *minsym, struct objfile *objfile, CORE_ADDR func_addr; if (msymbol_is_function (objfile, minsym, &func_addr)) { - symtab_and_line sal = find_pc_sect_line (func_addr, NULL, 0); + symtab_and_line sal = find_sal_for_pc_sect (func_addr, NULL, 0); if (symtab != sal.symtab) return; diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 047833a261d9..887c8546c424 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -719,7 +719,7 @@ build_address_symbolic (struct gdbarch *gdbarch, { struct symtab_and_line sal; - sal = find_pc_sect_line (addr, section, 0); + sal = find_sal_for_pc_sect (addr, section, 0); if (sal.symtab) { @@ -815,7 +815,7 @@ find_instruction_backward (struct gdbarch *gdbarch, CORE_ADDR addr, do { pcs.clear (); - sal = find_pc_sect_line (loop_start, NULL, 1); + sal = find_sal_for_pc_sect (loop_start, NULL, 1); if (sal.line <= 0) { /* We reach here when line info is not available. In this case, diff --git a/gdb/symtab.c b/gdb/symtab.c index f36d5b262955..fab16f7ad48c 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2902,7 +2902,7 @@ find_symbol_at_address (CORE_ADDR address) symtab. */ struct symtab_and_line -find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent) +find_sal_for_pc_sect (CORE_ADDR pc, struct obj_section *section, int notcurrent) { /* Info on best line seen so far, and where it starts, and its file. */ const linetable_entry *best = NULL; @@ -3017,7 +3017,7 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent) should occur, we'd like to know about it, so error out, fatally. */ if (mfunsym.value_address () == pc) - internal_error (_("Infinite recursion detected in find_pc_sect_line;" + internal_error (_("Infinite recursion detected in find_sal_for_pc_sect;" "please file a bug report")); return find_sal_for_pc (mfunsym.value_address (), 0); @@ -3181,14 +3181,14 @@ find_sal_for_pc (CORE_ADDR pc, int notcurrent) section = find_pc_overlay (pc); if (!pc_in_unmapped_range (pc, section)) - return find_pc_sect_line (pc, section, notcurrent); + return find_sal_for_pc_sect (pc, section, notcurrent); /* If the original PC was an unmapped address then we translate this to a mapped address in order to lookup the sal. However, as the user passed us an unmapped address it makes more sense to return a result that has the pc and end fields translated to unmapped addresses. */ pc = overlay_mapped_address (pc, section); - symtab_and_line sal = find_pc_sect_line (pc, section, notcurrent); + symtab_and_line sal = find_sal_for_pc_sect (pc, section, notcurrent); sal.pc = overlay_unmapped_address (sal.pc, section); sal.end = overlay_unmapped_address (sal.end, section); return sal; @@ -3434,7 +3434,7 @@ find_line_pc_range (struct symtab_and_line sal, CORE_ADDR *startptr, This also insures that we never give a range like "starts at 0x134 and ends at 0x12c". */ - found_sal = find_pc_sect_line (startaddr, sal.section, 0); + found_sal = find_sal_for_pc_sect (startaddr, sal.section, 0); if (found_sal.line != sal.line) { /* The specified line (sal) has zero bytes. */ @@ -3522,7 +3522,7 @@ static symtab_and_line find_function_start_sal_1 (CORE_ADDR func_addr, obj_section *section, bool funfirstline) { - symtab_and_line sal = find_pc_sect_line (func_addr, section, 0); + symtab_and_line sal = find_sal_for_pc_sect (func_addr, section, 0); if (funfirstline && sal.symtab != NULL && (sal.symtab->compunit ()->locations_valid () @@ -3760,7 +3760,7 @@ skip_prologue_sal (struct symtab_and_line *sal) if (linetable_pc) { pc = *linetable_pc; - start_sal = find_pc_sect_line (pc, section, 0); + start_sal = find_sal_for_pc_sect (pc, section, 0); force_skip = 1; continue; } @@ -3782,7 +3782,7 @@ skip_prologue_sal (struct symtab_and_line *sal) pc = overlay_mapped_address (pc, section); /* Calculate line number. */ - start_sal = find_pc_sect_line (pc, section, 0); + start_sal = find_sal_for_pc_sect (pc, section, 0); /* Check if gdbarch_skip_prologue left us in mid-line, and the next line is still part of the same function. */ @@ -3795,7 +3795,7 @@ skip_prologue_sal (struct symtab_and_line *sal) /* First pc of next line */ pc = start_sal.end; /* Recalculate the line number (might not be N+1). */ - start_sal = find_pc_sect_line (pc, section, 0); + start_sal = find_sal_for_pc_sect (pc, section, 0); } /* On targets with executable formats that don't have a concept of @@ -3807,7 +3807,7 @@ skip_prologue_sal (struct symtab_and_line *sal) { pc = gdbarch_skip_main_prologue (gdbarch, pc); /* Recalculate the line number (might not be N+1). */ - start_sal = find_pc_sect_line (pc, section, 0); + start_sal = find_sal_for_pc_sect (pc, section, 0); force_skip = 1; } } @@ -3825,7 +3825,7 @@ skip_prologue_sal (struct symtab_and_line *sal) { pc = skip_prologue_using_lineinfo (pc, sym->symtab ()); /* Recalculate the line number. */ - start_sal = find_pc_sect_line (pc, section, 0); + start_sal = find_sal_for_pc_sect (pc, section, 0); } /* If we're already past the prologue, leave SAL unchanged. Otherwise diff --git a/gdb/symtab.h b/gdb/symtab.h index 9f6a6c361221..6e8283280623 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -2409,8 +2409,8 @@ extern struct symtab_and_line find_sal_for_pc (CORE_ADDR, int); /* Same function, but specify a section as well as an address. */ -extern struct symtab_and_line find_pc_sect_line (CORE_ADDR, - struct obj_section *, int); +extern struct symtab_and_line find_sal_for_pc_sect (CORE_ADDR, + obj_section *, int); /* Given PC, and assuming it is part of a range of addresses that is part of a line, go back through the linetable and find the starting PC of that -- 2.51.0