From: Simon Marchi Date: Thu, 16 Oct 2025 00:08:02 +0000 (-0400) Subject: gdb: rename find_pc_sect_line -> find_sal_for_pc_sect X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f76b668ff7003e40c3c3f4b2a5dc27d52b5604a;p=thirdparty%2Fbinutils-gdb.git gdb: rename find_pc_sect_line -> find_sal_for_pc_sect Change-Id: I9c2a72de57a4ea9c316fc949db4fb0bf7f78eb4b Approved-by: Kevin Buettner --- diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index b1021c071c5..b670586050b 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 05f676ee38d..703af9ccdb9 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 047833a261d..887c8546c42 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 f36d5b26295..fab16f7ad48 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 9f6a6c36122..6e828328062 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