From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qY0hHPY48GhEZDYAWB0awg (envelope-from ) for ; Wed, 15 Oct 2025 20:14:46 -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=WCamT1uY; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 6E89F1E0BA; Wed, 15 Oct 2025 20:14:46 -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 84B961E047 for ; Wed, 15 Oct 2025 20:14:45 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1BA6C3857C6E for ; Thu, 16 Oct 2025 00:14:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1BA6C3857C6E 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=WCamT1uY Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 8D5FE3858CB6 for ; Thu, 16 Oct 2025 00:12:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8D5FE3858CB6 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 8D5FE3858CB6 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=1760573524; cv=none; b=rPH+7RY+kbonnMHZWY/D2w5az4eaF4bhE45W8t5yCtcNNMVs9CA+xncqoWHuMSrQROzZ2d7wFJT9KKg8C3/1iAGmJ19gLX5r2njphS9WUuZesqFixOlkjDViK4xN0C1uU3A7xw6QmXyWj9/2HpA3ZB0T++GdteYWjhOlCj3HrNM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760573524; c=relaxed/simple; bh=S36nLSbFne8QUAEP87CmQ7hmEeBcV906KYkIoXnPQIE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=CK5QfjbqYSdPVIegYXPSY8VyoSjcnA9vZeXozwcrppzppI20SEHbf1Tu68Sh8aQcxQSL+0pIT3C4Vcl4fBrst41PWJVfbAU3qMCMRl8srnZTi+B6jJcrVsNB/tmctEvZYni/5UHTlAMtK+4lSIsSW6nceMao+KIk7be/qKnH2hU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D5FE3858CB6 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 59G0BwpM069747 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Oct 2025 20:12:03 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 59G0BwpM069747 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1760573523; bh=eHOuDiIOd7Xo+U/payNBperjoRF5ZHzPXrR9D3nDmtA=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=WCamT1uYPOilq3s7WGJW7d5OC8RQ1IZKj1eblOlwSgsDW7+nEFsRgp1i6JEl642tP V4efmrLov3eYn3LCkdzQAX6vZks/V9Ow0bSFn3dPqEGOzlfa4jFILTnp5cYsA/QPdH AFsQ3cCKkLnBjqqu4LOv84edRrtXvf5ekgF4uOdrhMGWKXwigcDg96VwpSv4ndvWI7 R/xJLG3rDKfXLK/VFovqlRvhnsSN+FExGx4G3p2RsLobB7NeUBx48fTyKvJ432H0Ai ulLUsJpz+HrX8kW3g3ftF/97JiJDjiEEitBEnEl0jZ48jqWb9Spfwmly7QLfwqmRo8 gAYWO7HZ6zdSA== Received: by simark.ca (Postfix) id 6898A1E057; Wed, 15 Oct 2025 20:11:58 -0400 (EDT) From: simon.marchi@polymtl.ca To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 01/10] gdb: rename find_pc_function -> find_symbol_for_pc Date: Wed, 15 Oct 2025 20:07:55 -0400 Message-ID: <20251016001154.3969223-2-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:11:58 +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: I2069be1a6d7c3250cf330574c941bf851c89bab4 --- gdb/blockframe.c | 4 ++-- gdb/btrace.c | 2 +- gdb/cli/cli-cmds.c | 4 ++-- gdb/dwarf2/loc.c | 2 +- gdb/eval.c | 2 +- gdb/guile/scm-frame.c | 2 +- gdb/infcall.c | 2 +- gdb/infcmd.c | 6 +++--- gdb/infrun.c | 4 ++-- gdb/python/py-finishbreakpoint.c | 2 +- gdb/solib-frv.c | 2 +- gdb/sparc-tdep.c | 4 ++-- gdb/symtab.c | 2 +- gdb/symtab.h | 2 +- gdb/tracepoint.c | 2 +- 15 files changed, 21 insertions(+), 21 deletions(-) diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 5a3e342ee513..7c421a0ad3f7 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -145,7 +145,7 @@ find_pc_sect_function (CORE_ADDR pc, struct obj_section *section) Backward compatibility, no section */ struct symbol * -find_pc_function (CORE_ADDR pc) +find_symbol_for_pc (CORE_ADDR pc) { return find_pc_sect_function (pc, find_pc_mapped_section (pc)); } @@ -419,7 +419,7 @@ find_function_entry_range_from_pc (CORE_ADDR pc, const char **name, struct type * find_function_type (CORE_ADDR pc) { - struct symbol *sym = find_pc_function (pc); + struct symbol *sym = find_symbol_for_pc (pc); if (sym != NULL && sym->value_block ()->entry_pc () == pc) return sym->type (); diff --git a/gdb/btrace.c b/gdb/btrace.c index ed7e41d3b79c..b5516a1499c8 100644 --- a/gdb/btrace.c +++ b/gdb/btrace.c @@ -557,7 +557,7 @@ ftrace_update_function (struct btrace_thread_info *btinfo, only a minimal symbol. */ if (pc.has_value ()) { - fun = find_pc_function (*pc); + fun = find_symbol_for_pc (*pc); bound_minimal_symbol bmfun = lookup_minimal_symbol_by_pc (*pc); mfun = bmfun.minsym; diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index d3536547c337..1007af46cbad 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -1039,7 +1039,7 @@ edit_command (const char *arg, int from_tty) paddress (get_current_arch (), sal.pc)); gdbarch = sal.symtab->compunit ()->objfile ()->arch (); - sym = find_pc_function (sal.pc); + sym = find_symbol_for_pc (sal.pc); if (sym) gdb_printf ("%ps is in %ps (%ps:%ps).\n", styled_string (address_style.style (), @@ -1475,7 +1475,7 @@ list_command (const char *arg, int from_tty) paddress (get_current_arch (), sal.pc)); gdbarch = sal.symtab->compunit ()->objfile ()->arch (); - sym = find_pc_function (sal.pc); + sym = find_symbol_for_pc (sal.pc); if (sym) gdb_printf ("%s is in %s (%s:%d).\n", paddress (gdbarch, sal.pc), diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 37c85d8d1921..cb4a39e65ad5 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -759,7 +759,7 @@ call_site_target::iterate_over_addresses (gdbarch *call_site_gdbarch, static struct symbol * func_addr_to_tail_call_list (struct gdbarch *gdbarch, CORE_ADDR addr) { - struct symbol *sym = find_pc_function (addr); + struct symbol *sym = find_symbol_for_pc (addr); struct type *type; if (sym == NULL || sym->value_block ()->entry_pc () != addr) diff --git a/gdb/eval.c b/gdb/eval.c index 07fa0af47223..5455164dc634 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -2054,7 +2054,7 @@ eval_op_objc_msgcall (struct type *expect_type, struct expression *exp, (exp->gdbarch, addr, current_inferior ()->top_target ()); /* Is it a high_level symbol? */ - sym = find_pc_function (addr); + sym = find_symbol_for_pc (addr); if (sym != NULL) method = value_of_variable (sym, 0); } diff --git a/gdb/guile/scm-frame.c b/gdb/guile/scm-frame.c index db35ae525967..c77633cb59aa 100644 --- a/gdb/guile/scm-frame.c +++ b/gdb/guile/scm-frame.c @@ -665,7 +665,7 @@ gdbscm_frame_function (SCM self) if (frame != NULL) { found = true; - sym = find_pc_function (get_frame_address_in_block (frame)); + sym = find_symbol_for_pc (get_frame_address_in_block (frame)); } } catch (const gdb_exception &except) diff --git a/gdb/infcall.c b/gdb/infcall.c index c4b4c8f0bead..3b7542cf70c8 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -480,7 +480,7 @@ static const char * get_function_name (CORE_ADDR funaddr, char *buf, int buf_size) { { - struct symbol *symbol = find_pc_function (funaddr); + struct symbol *symbol = find_symbol_for_pc (funaddr); if (symbol) return symbol->print_name (); diff --git a/gdb/infcmd.c b/gdb/infcmd.c index e4b3e5b61f82..7747f03b63b2 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -743,7 +743,7 @@ set_step_frame (thread_info *tp) set_step_info (tp, frame, sal); CORE_ADDR pc = get_frame_pc (frame); - tp->control.step_start_function = find_pc_function (pc); + tp->control.step_start_function = find_symbol_for_pc (pc); } /* Step until outside of current statement. */ @@ -1352,7 +1352,7 @@ until_next_command (int from_tty) not). */ pc = get_frame_pc (frame); - func = find_pc_function (pc); + func = find_symbol_for_pc (pc); if (!func) { @@ -1834,7 +1834,7 @@ finish_command (const char *arg, int from_tty) /* Find the function we will return from. */ frame_info_ptr callee_frame = get_selected_frame (nullptr); - sm->function = find_pc_function (get_frame_pc (callee_frame)); + sm->function = find_symbol_for_pc (get_frame_pc (callee_frame)); sm->return_buf = 0; /* Initialize buffer address is not available. */ /* Determine the return convention. If it is RETURN_VALUE_STRUCT_CONVENTION, diff --git a/gdb/infrun.c b/gdb/infrun.c index b3c408feb304..b5d2e43d5361 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -7865,7 +7865,7 @@ process_event_stop_test (struct execution_control_state *ecs) && ((ecs->event_thread->control.step_stack_frame_id != outer_frame_id) || (ecs->event_thread->control.step_start_function - != find_pc_function (ecs->event_thread->stop_pc ()))))) + != find_symbol_for_pc (ecs->event_thread->stop_pc ()))))) { CORE_ADDR stop_pc = ecs->event_thread->stop_pc (); CORE_ADDR real_stop_pc; @@ -9350,7 +9350,7 @@ print_stop_location (const target_waitstatus &ws) && (tp->control.step_frame_id == get_frame_id (get_current_frame ())) && (tp->control.step_start_function - == find_pc_function (tp->stop_pc ()))) + == find_symbol_for_pc (tp->stop_pc ()))) { symtab_and_line sal = find_frame_sal (get_selected_frame (nullptr)); if (sal.symtab != tp->current_symtab) diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c index 70e1684524d8..75224b6d2d7e 100644 --- a/gdb/python/py-finishbreakpoint.c +++ b/gdb/python/py-finishbreakpoint.c @@ -251,7 +251,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs) { if ((pc = get_frame_pc_if_available (frame))) { - struct symbol *function = find_pc_function (*pc); + struct symbol *function = find_symbol_for_pc (*pc); if (function != nullptr) { struct type *ret_type = diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c index beb880228fcd..d5c83f4573b0 100644 --- a/gdb/solib-frv.c +++ b/gdb/solib-frv.c @@ -904,7 +904,7 @@ frv_fdpic_find_canonical_descriptor (CORE_ADDR entry_point) /* Attempt to find the name of the function. If the name is available, it'll be used as an aid in finding matching functions in the dynamic symbol table. */ - sym = find_pc_function (entry_point); + sym = find_symbol_for_pc (entry_point); if (sym == 0) name = 0; else diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 914a568c98b9..6ac02def8c00 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -1249,7 +1249,7 @@ sparc32_frame_cache (const frame_info_ptr &this_frame, void **this_cache) cache = sparc_frame_cache (this_frame, this_cache); - sym = find_pc_function (cache->pc); + sym = find_symbol_for_pc (cache->pc); if (sym) { cache->struct_return_p = sparc32_struct_return_from_sym (sym); @@ -1552,7 +1552,7 @@ static int sparc32_dwarf2_struct_return_p (const frame_info_ptr &this_frame) { CORE_ADDR pc = get_frame_address_in_block (this_frame); - struct symbol *sym = find_pc_function (pc); + struct symbol *sym = find_symbol_for_pc (pc); if (sym) return sparc32_struct_return_from_sym (sym); diff --git a/gdb/symtab.c b/gdb/symtab.c index b0cea7a06b5b..9109103da416 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -4108,7 +4108,7 @@ find_function_alias_target (bound_minimal_symbol msymbol) if (!msymbol_is_function (msymbol.objfile, msymbol.minsym, &func_addr)) return NULL; - symbol *sym = find_pc_function (func_addr); + symbol *sym = find_symbol_for_pc (func_addr); if (sym != NULL && sym->loc_class () == LOC_BLOCK && sym->value_block ()->entry_pc () == func_addr) diff --git a/gdb/symtab.h b/gdb/symtab.h index 64028bf271f0..ea34228df12d 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -2206,7 +2206,7 @@ extern struct type *lookup_enum (const char *, const struct block *); return value will not be an inlined function; the containing function will be returned instead. */ -extern struct symbol *find_pc_function (CORE_ADDR); +extern struct symbol *find_symbol_for_pc (CORE_ADDR); /* lookup the function corresponding to the address and section. The return value will not be an inlined function; the containing diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 879e4a6b33e3..ade745a08653 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -217,7 +217,7 @@ set_traceframe_context (const frame_info_ptr &trace_frame) && (trace_pc = get_frame_pc_if_available (trace_frame))) { traceframe_sal = find_pc_line (*trace_pc, 0); - traceframe_fun = find_pc_function (*trace_pc); + traceframe_fun = find_symbol_for_pc (*trace_pc); /* Save linenumber as "$trace_line", a debugger variable visible to users. */ -- 2.51.0