From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 0A1A93858D20; Tue, 20 Feb 2024 15:45:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A1A93858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1708443951; bh=Xqz+brR79pWGbiIPtf8cdZnnypaYjhAabH5w2eMKsYo=; h=From:To:Subject:Date:From; b=U0cuoKrJfiGi/nackPUGoP3zQRp83uXJ7BXQRdXq/3TGVNIUCTZ9EZv08jmgbcOto MpMJfXER9dgTL3S4Ht2UQDKCWvJmB7iwK1Uku3A+dyyJldoXt7y+B/SP4oHoggjA7m 1FBIxhC/MOeBIa6lKe5g2BZnJaLZzVMAclf3lNMs= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: pass frames as `const frame_info_ptr &` X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 1b2c120daf9e2d935453f9051bbeafbac7f9f14d X-Git-Newrev: 8480a37e146c40e82a93c0ecf6144571516c95c5 Message-Id: <20240220154551.0A1A93858D20@sourceware.org> Date: Tue, 20 Feb 2024 15:45:50 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D8480a37e146c= 40e82a93c0ecf6144571516c95c5 commit 8480a37e146c40e82a93c0ecf6144571516c95c5 Author: Simon Marchi Date: Mon Feb 19 13:07:47 2024 -0500 gdb: pass frames as `const frame_info_ptr &` =20 We currently pass frames to function by value, as `frame_info_ptr`. This is somewhat expensive: =20 - the size of `frame_info_ptr` is 64 bytes, which is a bit big to pass by value - the constructors and destructor link/unlink the object in the global `frame_info_ptr::frame_list` list. This is an `intrusive_list`, so it's not so bad: it's just assigning a few points, there's no memory allocation as if it was `std::list`, but still it's useless to do that over and over. =20 As suggested by Tom Tromey, change many function signatures to accept `const frame_info_ptr &` instead of `frame_info_ptr`. =20 Some functions reassign their `frame_info_ptr` parameter, like: =20 void the_func (frame_info_ptr frame) { for (; frame !=3D nullptr; frame =3D get_prev_frame (frame)) { ... } } =20 I wondered what to do about them, do I leave them as-is or change them (and need to introduce a separate local variable that can be re-assigned). I opted for the later for consistency. It might not be clear why some functions take `const frame_info_ptr &` while others take `frame_info_ptr`. Also, if a function took a `frame_info_ptr` because it did re-assign its parameter, I doubt that we would think to change it to `const frame_info_ptr &` should the implementation change such that it doesn't need to take `frame_info_ptr` anymore. It seems better to have a simple rule and apply it everywhere. =20 Change-Id: I59d10addef687d157f82ccf4d54f5dde9a963fd0 Approved-By: Andrew Burgess Diff: --- gdb/aarch64-fbsd-tdep.c | 6 +- gdb/aarch64-linux-tdep.c | 8 +- gdb/aarch64-tdep.c | 46 ++++----- gdb/ada-lang.c | 10 +- gdb/ada-lang.h | 2 +- gdb/alpha-linux-tdep.c | 2 +- gdb/alpha-mdebug-tdep.c | 16 +-- gdb/alpha-netbsd-tdep.c | 2 +- gdb/alpha-obsd-tdep.c | 2 +- gdb/alpha-tdep.c | 22 ++-- gdb/alpha-tdep.h | 2 +- gdb/amd64-darwin-tdep.c | 2 +- gdb/amd64-fbsd-tdep.c | 2 +- gdb/amd64-linux-tdep.c | 6 +- gdb/amd64-netbsd-tdep.c | 4 +- gdb/amd64-obsd-tdep.c | 12 +-- gdb/amd64-sol2-tdep.c | 2 +- gdb/amd64-tdep.c | 42 ++++---- gdb/amd64-windows-tdep.c | 12 +-- gdb/amdgpu-tdep.c | 8 +- gdb/arc-linux-tdep.c | 4 +- gdb/arc-tdep.c | 20 ++-- gdb/arc-tdep.h | 4 +- gdb/arch-utils.c | 9 +- gdb/arch-utils.h | 8 +- gdb/arm-fbsd-tdep.c | 2 +- gdb/arm-linux-tdep.c | 12 +-- gdb/arm-obsd-tdep.c | 2 +- gdb/arm-tdep.c | 74 ++++++------- gdb/arm-tdep.h | 4 +- gdb/arm-wince-tdep.c | 2 +- gdb/avr-tdep.c | 14 +-- gdb/bfin-linux-tdep.c | 2 +- gdb/bfin-tdep.c | 12 +-- gdb/blockframe.c | 4 +- gdb/bpf-tdep.c | 8 +- gdb/cp-abi.c | 2 +- gdb/cp-abi.h | 4 +- gdb/cris-tdep.c | 36 +++---- gdb/csky-linux-tdep.c | 4 +- gdb/csky-tdep.c | 22 ++-- gdb/dtrace-probe.c | 4 +- gdb/dummy-frame.c | 8 +- gdb/dummy-frame.h | 2 +- gdb/dwarf2/ada-imported.c | 2 +- gdb/dwarf2/call-site.h | 4 +- gdb/dwarf2/expr.c | 8 +- gdb/dwarf2/expr.h | 4 +- gdb/dwarf2/frame-tailcall.c | 23 +++-- gdb/dwarf2/frame-tailcall.h | 4 +- gdb/dwarf2/frame.c | 40 ++++---- gdb/dwarf2/frame.h | 25 +++-- gdb/dwarf2/loc.c | 51 ++++----- gdb/dwarf2/loc.h | 26 +++-- gdb/extension-priv.h | 2 +- gdb/extension.c | 2 +- gdb/extension.h | 2 +- gdb/findvar.c | 24 +++-- gdb/frame-base.c | 8 +- gdb/frame-base.h | 10 +- gdb/frame-unwind.c | 24 ++--- gdb/frame-unwind.h | 51 +++++---- gdb/frame.c | 171 ++++++++++++++++-----------= ---- gdb/frame.h | 142 ++++++++++++------------- gdb/frv-linux-tdep.c | 10 +- gdb/frv-tdep.c | 10 +- gdb/ft32-tdep.c | 8 +- gdb/gdbarch-gen.h | 72 ++++++------- gdb/gdbarch.c | 36 +++---- gdb/gdbarch_components.py | 36 +++---- gdb/gnu-v3-abi.c | 2 +- gdb/h8300-tdep.c | 12 +-- gdb/hppa-bsd-tdep.c | 2 +- gdb/hppa-linux-tdep.c | 8 +- gdb/hppa-netbsd-tdep.c | 4 +- gdb/hppa-tdep.c | 32 +++--- gdb/hppa-tdep.h | 8 +- gdb/i386-bsd-tdep.c | 2 +- gdb/i386-darwin-tdep.c | 4 +- gdb/i386-darwin-tdep.h | 2 +- gdb/i386-fbsd-tdep.c | 2 +- gdb/i386-gnu-tdep.c | 6 +- gdb/i386-linux-tdep.c | 10 +- gdb/i386-netbsd-tdep.c | 4 +- gdb/i386-nto-tdep.c | 4 +- gdb/i386-obsd-tdep.c | 10 +- gdb/i386-sol2-tdep.c | 2 +- gdb/i386-tdep.c | 64 ++++++------ gdb/i386-tdep.h | 12 +-- gdb/i386-windows-tdep.c | 2 +- gdb/i387-tdep.c | 6 +- gdb/i387-tdep.h | 6 +- gdb/ia64-libunwind-tdep.c | 10 +- gdb/ia64-libunwind-tdep.h | 8 +- gdb/ia64-tdep.c | 44 ++++---- gdb/ia64-tdep.h | 2 +- gdb/infcmd.c | 11 +- gdb/inferior.h | 4 +- gdb/infrun.c | 22 ++-- gdb/infrun.h | 2 +- gdb/inline-frame.c | 8 +- gdb/inline-frame.h | 2 +- gdb/iq2000-tdep.c | 10 +- gdb/jit.c | 6 +- gdb/language.h | 2 +- gdb/lm32-tdep.c | 8 +- gdb/loongarch-linux-tdep.c | 4 +- gdb/loongarch-tdep.c | 10 +- gdb/loongarch-tdep.h | 2 +- gdb/m32c-tdep.c | 10 +- gdb/m32r-linux-tdep.c | 14 +-- gdb/m32r-tdep.c | 8 +- gdb/m68hc11-tdep.c | 16 +-- gdb/m68k-linux-tdep.c | 12 +-- gdb/m68k-tdep.c | 18 ++-- gdb/mep-tdep.c | 8 +- gdb/mi/mi-cmd-stack.c | 6 +- gdb/mi/mi-main.c | 4 +- gdb/microblaze-linux-tdep.c | 4 +- gdb/microblaze-tdep.c | 10 +- gdb/minsyms.c | 2 +- gdb/mips-fbsd-tdep.c | 4 +- gdb/mips-linux-tdep.c | 22 ++-- gdb/mips-netbsd-tdep.c | 2 +- gdb/mips-sde-tdep.c | 12 +-- gdb/mips-tdep.c | 96 ++++++++--------- gdb/mips-tdep.h | 2 +- gdb/mips64-obsd-tdep.c | 2 +- gdb/mn10300-linux-tdep.c | 4 +- gdb/mn10300-tdep.c | 8 +- gdb/moxie-tdep.c | 8 +- gdb/msp430-tdep.c | 10 +- gdb/nds32-tdep.c | 20 ++-- gdb/nios2-linux-tdep.c | 4 +- gdb/nios2-tdep.c | 22 ++-- gdb/nios2-tdep.h | 2 +- gdb/observable.h | 2 +- gdb/or1k-linux-tdep.c | 4 +- gdb/or1k-tdep.c | 12 +-- gdb/ppc-fbsd-tdep.c | 8 +- gdb/ppc-linux-tdep.c | 12 +-- gdb/ppc-netbsd-tdep.c | 2 +- gdb/ppc-obsd-tdep.c | 8 +- gdb/ppc-sysv-tdep.c | 3 +- gdb/ppc-tdep.h | 4 +- gdb/ppc64-tdep.c | 20 ++-- gdb/ppc64-tdep.h | 2 +- gdb/printcmd.c | 2 +- gdb/probe.c | 2 +- gdb/probe.h | 4 +- gdb/python/py-event.h | 2 +- gdb/python/py-frame.c | 2 +- gdb/python/py-framefilter.c | 14 +-- gdb/python/py-inferior.c | 2 +- gdb/python/py-infevents.c | 4 +- gdb/python/py-unwind.c | 6 +- gdb/python/python-internal.h | 4 +- gdb/record-btrace.c | 14 +-- gdb/riscv-fbsd-tdep.c | 2 +- gdb/riscv-linux-tdep.c | 6 +- gdb/riscv-tdep.c | 12 +-- gdb/riscv-tdep.h | 2 +- gdb/rl78-tdep.c | 12 +-- gdb/rs6000-aix-tdep.c | 8 +- gdb/rs6000-tdep.c | 34 +++--- gdb/rx-tdep.c | 16 +-- gdb/s12z-tdep.c | 10 +- gdb/s390-linux-tdep.c | 8 +- gdb/s390-tdep.c | 36 +++---- gdb/s390-tdep.h | 2 +- gdb/sentinel-frame.c | 6 +- gdb/sh-linux-tdep.c | 6 +- gdb/sh-tdep.c | 16 +-- gdb/sol2-tdep.c | 2 +- gdb/sol2-tdep.h | 2 +- gdb/sparc-linux-tdep.c | 6 +- gdb/sparc-netbsd-tdep.c | 12 +-- gdb/sparc-obsd-tdep.c | 8 +- gdb/sparc-sol2-tdep.c | 8 +- gdb/sparc-tdep.c | 18 ++-- gdb/sparc-tdep.h | 10 +- gdb/sparc64-fbsd-tdep.c | 8 +- gdb/sparc64-linux-tdep.c | 8 +- gdb/sparc64-netbsd-tdep.c | 10 +- gdb/sparc64-obsd-tdep.c | 16 +-- gdb/sparc64-sol2-tdep.c | 8 +- gdb/sparc64-tdep.c | 10 +- gdb/sparc64-tdep.h | 2 +- gdb/stack.c | 42 ++++---- gdb/stack.h | 4 +- gdb/stap-probe.c | 4 +- gdb/std-regs.c | 8 +- gdb/symtab.h | 8 +- gdb/tic6x-linux-tdep.c | 4 +- gdb/tic6x-tdep.c | 22 ++-- gdb/tic6x-tdep.h | 2 +- gdb/tilegx-linux-tdep.c | 2 +- gdb/tilegx-tdep.c | 12 +-- gdb/tracepoint.c | 2 +- gdb/trad-frame.c | 8 +- gdb/trad-frame.h | 8 +- gdb/tramp-frame.c | 10 +- gdb/tramp-frame.h | 4 +- gdb/tui/tui-disasm.c | 2 +- gdb/tui/tui-disasm.h | 2 +- gdb/tui/tui-hooks.c | 2 +- gdb/tui/tui-regs.c | 4 +- gdb/tui/tui-regs.h | 2 +- gdb/tui/tui-source.c | 2 +- gdb/tui/tui-source.h | 2 +- gdb/tui/tui-status.c | 4 +- gdb/tui/tui-status.h | 2 +- gdb/tui/tui-winsource.h | 2 +- gdb/unittests/frame_info_ptr-selftests.c | 2 +- gdb/user-regs.c | 4 +- gdb/user-regs.h | 4 +- gdb/v850-tdep.c | 10 +- gdb/valops.c | 4 +- gdb/value.c | 23 +++-- gdb/value.h | 35 ++++--- gdb/vax-tdep.c | 14 +-- gdb/xstormy16-tdep.c | 12 +-- gdb/xtensa-tdep.c | 20 ++-- gdb/z80-tdep.c | 6 +- 224 files changed, 1351 insertions(+), 1339 deletions(-) diff --git a/gdb/aarch64-fbsd-tdep.c b/gdb/aarch64-fbsd-tdep.c index 2b043c0e735..44ca6c90c81 100644 --- a/gdb/aarch64-fbsd-tdep.c +++ b/gdb/aarch64-fbsd-tdep.c @@ -88,9 +88,9 @@ static const struct regcache_map_entry aarch64_fbsd_tls_r= egmap[] =3D =20 static void aarch64_fbsd_sigframe_init (const struct tramp_frame *self, - frame_info_ptr this_frame, - struct trad_frame_cache *this_cache, - CORE_ADDR func) + const frame_info_ptr &this_frame, + struct trad_frame_cache *this_cache, + CORE_ADDR func) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); enum bfd_endian byte_order =3D gdbarch_byte_order (gdbarch); diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c index 7812ec5b7a1..4ebc173a0a0 100644 --- a/gdb/aarch64-linux-tdep.c +++ b/gdb/aarch64-linux-tdep.c @@ -381,8 +381,8 @@ aarch64_linux_restore_vregs (struct gdbarch *gdbarch, SIGNAL_FRAME. */ =20 static void -aarch64_linux_read_signal_frame_info (frame_info_ptr this_frame, - struct aarch64_linux_sigframe &signal_frame) +aarch64_linux_read_signal_frame_info (const frame_info_ptr &this_frame, + aarch64_linux_sigframe &signal_frame) { signal_frame.sp =3D get_frame_register_unsigned (this_frame, AARCH64_SP_= REGNUM); signal_frame.sigcontext_address @@ -570,7 +570,7 @@ aarch64_linux_read_signal_frame_info (frame_info_ptr th= is_frame, =20 static void aarch64_linux_sigframe_init (const struct tramp_frame *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, struct trad_frame_cache *this_cache, CORE_ADDR func) { @@ -704,7 +704,7 @@ aarch64_linux_sigframe_init (const struct tramp_frame *= self, /* Implements the "prev_arch" method of struct tramp_frame. */ =20 static struct gdbarch * -aarch64_linux_sigframe_prev_arch (frame_info_ptr this_frame, +aarch64_linux_sigframe_prev_arch (const frame_info_ptr &this_frame, void **frame_cache) { struct trad_frame_cache *cache diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index b97e2153e14..d1d5486f90d 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -268,7 +268,7 @@ class instruction_reader : public abstract_instruction_= reader =20 static CORE_ADDR aarch64_frame_unmask_lr (aarch64_gdbarch_tdep *tdep, - frame_info_ptr this_frame, CORE_ADDR addr) + const frame_info_ptr &this_frame, CORE_ADDR addr) { if (tdep->has_pauth () && frame_unwind_register_unsigned (this_frame, @@ -298,7 +298,7 @@ aarch64_frame_unmask_lr (aarch64_gdbarch_tdep *tdep, /* Implement the "get_pc_address_flags" gdbarch method. */ =20 static std::string -aarch64_get_pc_address_flags (frame_info_ptr frame, CORE_ADDR pc) +aarch64_get_pc_address_flags (const frame_info_ptr &frame, CORE_ADDR pc) { if (pc !=3D 0 && get_frame_pc_masked (frame)) return "PAC"; @@ -995,7 +995,7 @@ aarch64_skip_prologue (struct gdbarch *gdbarch, CORE_AD= DR pc) cache CACHE. */ =20 static void -aarch64_scan_prologue (frame_info_ptr this_frame, +aarch64_scan_prologue (const frame_info_ptr &this_frame, struct aarch64_prologue_cache *cache) { CORE_ADDR block_addr =3D get_frame_address_in_block (this_frame); @@ -1049,7 +1049,7 @@ aarch64_scan_prologue (frame_info_ptr this_frame, not available. */ =20 static void -aarch64_make_prologue_cache_1 (frame_info_ptr this_frame, +aarch64_make_prologue_cache_1 (const frame_info_ptr &this_frame, struct aarch64_prologue_cache *cache) { CORE_ADDR unwound_fp; @@ -1087,7 +1087,7 @@ aarch64_make_prologue_cache_1 (frame_info_ptr this_fr= ame, *THIS_CACHE. */ =20 static struct aarch64_prologue_cache * -aarch64_make_prologue_cache (frame_info_ptr this_frame, void **this_cache) +aarch64_make_prologue_cache (const frame_info_ptr &this_frame, void **this= _cache) { struct aarch64_prologue_cache *cache; =20 @@ -1114,7 +1114,7 @@ aarch64_make_prologue_cache (frame_info_ptr this_fram= e, void **this_cache) /* Implement the "stop_reason" frame_unwind method. */ =20 static enum unwind_stop_reason -aarch64_prologue_frame_unwind_stop_reason (frame_info_ptr this_frame, +aarch64_prologue_frame_unwind_stop_reason (const frame_info_ptr &this_fram= e, void **this_cache) { struct aarch64_prologue_cache *cache @@ -1140,7 +1140,7 @@ aarch64_prologue_frame_unwind_stop_reason (frame_info= _ptr this_frame, PC and the caller's SP when we were called. */ =20 static void -aarch64_prologue_this_id (frame_info_ptr this_frame, +aarch64_prologue_this_id (const frame_info_ptr &this_frame, void **this_cache, struct frame_id *this_id) { struct aarch64_prologue_cache *cache @@ -1155,7 +1155,7 @@ aarch64_prologue_this_id (frame_info_ptr this_frame, /* Implement the "prev_register" frame_unwind method. */ =20 static struct value * -aarch64_prologue_prev_register (frame_info_ptr this_frame, +aarch64_prologue_prev_register (const frame_info_ptr &this_frame, void **this_cache, int prev_regnum) { struct aarch64_prologue_cache *cache @@ -1221,7 +1221,7 @@ static frame_unwind aarch64_prologue_unwind =3D *THIS_CACHE. */ =20 static struct aarch64_prologue_cache * -aarch64_make_stub_cache (frame_info_ptr this_frame, void **this_cache) +aarch64_make_stub_cache (const frame_info_ptr &this_frame, void **this_cac= he) { struct aarch64_prologue_cache *cache; =20 @@ -1251,7 +1251,7 @@ aarch64_make_stub_cache (frame_info_ptr this_frame, v= oid **this_cache) /* Implement the "stop_reason" frame_unwind method. */ =20 static enum unwind_stop_reason -aarch64_stub_frame_unwind_stop_reason (frame_info_ptr this_frame, +aarch64_stub_frame_unwind_stop_reason (const frame_info_ptr &this_frame, void **this_cache) { struct aarch64_prologue_cache *cache @@ -1266,7 +1266,7 @@ aarch64_stub_frame_unwind_stop_reason (frame_info_ptr= this_frame, /* Our frame ID for a stub frame is the current SP and LR. */ =20 static void -aarch64_stub_this_id (frame_info_ptr this_frame, +aarch64_stub_this_id (const frame_info_ptr &this_frame, void **this_cache, struct frame_id *this_id) { struct aarch64_prologue_cache *cache @@ -1282,7 +1282,7 @@ aarch64_stub_this_id (frame_info_ptr this_frame, =20 static int aarch64_stub_unwind_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, void **this_prologue_cache) { CORE_ADDR addr_in_block; @@ -1313,7 +1313,7 @@ static frame_unwind aarch64_stub_unwind =3D /* Return the frame base address of *THIS_FRAME. */ =20 static CORE_ADDR -aarch64_normal_frame_base (frame_info_ptr this_frame, void **this_cache) +aarch64_normal_frame_base (const frame_info_ptr &this_frame, void **this_c= ache) { struct aarch64_prologue_cache *cache =3D aarch64_make_prologue_cache (this_frame, this_cache); @@ -1334,7 +1334,7 @@ static frame_base aarch64_normal_base =3D *THIS_FRAME. */ =20 static struct value * -aarch64_dwarf2_prev_register (frame_info_ptr this_frame, +aarch64_dwarf2_prev_register (const frame_info_ptr &this_frame, void **this_cache, int regnum) { gdbarch *arch =3D get_frame_arch (this_frame); @@ -1361,7 +1361,7 @@ static const unsigned char op_lit1 =3D DW_OP_lit1; static void aarch64_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum, struct dwarf2_frame_state_reg *reg, - frame_info_ptr this_frame) + const frame_info_ptr &this_frame) { aarch64_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbar= ch); =20 @@ -2780,7 +2780,7 @@ aarch64_return_value (struct gdbarch *gdbarch, struct= value *func_value, /* Implement the "get_longjmp_target" gdbarch method. */ =20 static int -aarch64_get_longjmp_target (frame_info_ptr frame, CORE_ADDR *pc) +aarch64_get_longjmp_target (const frame_info_ptr &frame, CORE_ADDR *pc) { CORE_ADDR jb_addr; gdb_byte buf[X_REGISTER_SIZE]; @@ -3105,7 +3105,7 @@ aarch64_pseudo_register_reggroup_p (struct gdbarch *g= dbarch, int regnum, /* Helper for aarch64_pseudo_read_value. */ =20 static value * -aarch64_pseudo_read_value_1 (frame_info_ptr next_frame, +aarch64_pseudo_read_value_1 (const frame_info_ptr &next_frame, const int pseudo_reg_num, int raw_regnum_offset) { unsigned v_regnum =3D AARCH64_V0_REGNUM + raw_regnum_offset; @@ -3197,7 +3197,7 @@ aarch64_za_offsets_from_regnum (struct gdbarch *gdbar= ch, int regnum) /* Given REGNUM, a SME pseudo-register number, return its value in RESULT.= */ =20 static value * -aarch64_sme_pseudo_register_read (gdbarch *gdbarch, frame_info_ptr next_fr= ame, +aarch64_sme_pseudo_register_read (gdbarch *gdbarch, const frame_info_ptr &= next_frame, const int pseudo_reg_num) { aarch64_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbar= ch); @@ -3231,7 +3231,7 @@ aarch64_sme_pseudo_register_read (gdbarch *gdbarch, f= rame_info_ptr next_frame, /* Implement the "pseudo_register_read_value" gdbarch method. */ =20 static value * -aarch64_pseudo_read_value (gdbarch *gdbarch, frame_info_ptr next_frame, +aarch64_pseudo_read_value (gdbarch *gdbarch, const frame_info_ptr &next_fr= ame, const int pseudo_reg_num) { aarch64_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbar= ch); @@ -3296,7 +3296,7 @@ aarch64_pseudo_read_value (gdbarch *gdbarch, frame_in= fo_ptr next_frame, /* Helper for aarch64_pseudo_write. */ =20 static void -aarch64_pseudo_write_1 (gdbarch *gdbarch, frame_info_ptr next_frame, +aarch64_pseudo_write_1 (gdbarch *gdbarch, const frame_info_ptr &next_frame, int regnum_offset, gdb::array_view buf) { @@ -3322,7 +3322,7 @@ aarch64_pseudo_write_1 (gdbarch *gdbarch, frame_info_= ptr next_frame, pseudo-register. */ =20 static void -aarch64_sme_pseudo_register_write (gdbarch *gdbarch, frame_info_ptr next_f= rame, +aarch64_sme_pseudo_register_write (gdbarch *gdbarch, const frame_info_ptr = &next_frame, const int regnum, gdb::array_view data) { @@ -3364,7 +3364,7 @@ aarch64_sme_pseudo_register_write (gdbarch *gdbarch, = frame_info_ptr next_frame, /* Implement the "pseudo_register_write" gdbarch method. */ =20 static void -aarch64_pseudo_write (gdbarch *gdbarch, frame_info_ptr next_frame, +aarch64_pseudo_write (gdbarch *gdbarch, const frame_info_ptr &next_frame, const int pseudo_reg_num, gdb::array_view buf) { @@ -3437,7 +3437,7 @@ aarch64_pseudo_write (gdbarch *gdbarch, frame_info_pt= r next_frame, /* Callback function for user_reg_add. */ =20 static struct value * -value_of_aarch64_user_reg (frame_info_ptr frame, const void *baton) +value_of_aarch64_user_reg (const frame_info_ptr &frame, const void *baton) { const int *reg_p =3D (const int *) baton; =20 diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index a3fd695e003..3f398540010 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -11720,7 +11720,7 @@ ada_exception_support_info_sniffer (void) to most users. */ =20 static int -is_known_support_routine (frame_info_ptr frame) +is_known_support_routine (const frame_info_ptr &frame) { enum language func_lang; int i; @@ -11779,9 +11779,9 @@ is_known_support_routine (frame_info_ptr frame) part of the Ada run-time, starting from FI and moving upward. */ =20 void -ada_find_printable_frame (frame_info_ptr fi) +ada_find_printable_frame (const frame_info_ptr &initial_fi) { - for (; fi !=3D NULL; fi =3D get_prev_frame (fi)) + for (frame_info_ptr fi =3D initial_fi; fi !=3D nullptr; fi =3D get_prev_= frame (fi)) { if (!is_known_support_routine (fi)) { @@ -12913,7 +12913,7 @@ ada_add_standard_exceptions (compiled_regex *preg, =20 static void ada_add_exceptions_from_frame (compiled_regex *preg, - frame_info_ptr frame, + const frame_info_ptr &frame, std::vector *exceptions) { const struct block *block =3D get_frame_block (frame, 0); @@ -13339,7 +13339,7 @@ public: =20 struct value *read_var_value (struct symbol *var, const struct block *var_block, - frame_info_ptr frame) const override + const frame_info_ptr &frame) const override { /* The only case where default_read_var_value is not sufficient is when VAR is a renaming... */ diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index aefd335ff39..5083d004ac9 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -341,7 +341,7 @@ extern enum ada_renaming_category ada_parse_renaming (s= truct symbol *, const char **, int *, const char **); =20 -extern void ada_find_printable_frame (frame_info_ptr fi); +extern void ada_find_printable_frame (const frame_info_ptr &fi); =20 extern const char *ada_main_name (); =20 diff --git a/gdb/alpha-linux-tdep.c b/gdb/alpha-linux-tdep.c index 1a19626d9f0..5f5e46d514e 100644 --- a/gdb/alpha-linux-tdep.c +++ b/gdb/alpha-linux-tdep.c @@ -126,7 +126,7 @@ alpha_linux_pc_in_sigtramp (struct gdbarch *gdbarch, } =20 static CORE_ADDR -alpha_linux_sigcontext_addr (frame_info_ptr this_frame) +alpha_linux_sigcontext_addr (const frame_info_ptr &this_frame) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); CORE_ADDR pc; diff --git a/gdb/alpha-mdebug-tdep.c b/gdb/alpha-mdebug-tdep.c index 7691a53148a..7e9312d2aa7 100644 --- a/gdb/alpha-mdebug-tdep.c +++ b/gdb/alpha-mdebug-tdep.c @@ -185,7 +185,7 @@ struct alpha_mdebug_unwind_cache and store the resulting register save locations in the structure. */ =20 static struct alpha_mdebug_unwind_cache * -alpha_mdebug_frame_unwind_cache (frame_info_ptr this_frame,=20 +alpha_mdebug_frame_unwind_cache (const frame_info_ptr &this_frame, void **this_prologue_cache) { struct alpha_mdebug_unwind_cache *info; @@ -262,7 +262,7 @@ alpha_mdebug_frame_unwind_cache (frame_info_ptr this_fr= ame, frame. This will be used to create a new GDB frame struct. */ =20 static void -alpha_mdebug_frame_this_id (frame_info_ptr this_frame, +alpha_mdebug_frame_this_id (const frame_info_ptr &this_frame, void **this_prologue_cache, struct frame_id *this_id) { @@ -275,7 +275,7 @@ alpha_mdebug_frame_this_id (frame_info_ptr this_frame, /* Retrieve the value of REGNUM in FRAME. Don't give up! */ =20 static struct value * -alpha_mdebug_frame_prev_register (frame_info_ptr this_frame, +alpha_mdebug_frame_prev_register (const frame_info_ptr &this_frame, void **this_prologue_cache, int regnum) { struct alpha_mdebug_unwind_cache *info @@ -306,7 +306,7 @@ alpha_mdebug_max_frame_size_exceeded (struct mdebug_ext= ra_func_info *proc_desc) =20 static int alpha_mdebug_frame_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, void **this_cache) { CORE_ADDR pc =3D get_frame_address_in_block (this_frame); @@ -343,7 +343,7 @@ static const struct frame_unwind alpha_mdebug_frame_unw= ind =3D }; =20 static CORE_ADDR -alpha_mdebug_frame_base_address (frame_info_ptr this_frame, +alpha_mdebug_frame_base_address (const frame_info_ptr &this_frame, void **this_prologue_cache) { struct alpha_mdebug_unwind_cache *info @@ -353,7 +353,7 @@ alpha_mdebug_frame_base_address (frame_info_ptr this_fr= ame, } =20 static CORE_ADDR -alpha_mdebug_frame_locals_address (frame_info_ptr this_frame, +alpha_mdebug_frame_locals_address (const frame_info_ptr &this_frame, void **this_prologue_cache) { struct alpha_mdebug_unwind_cache *info @@ -363,7 +363,7 @@ alpha_mdebug_frame_locals_address (frame_info_ptr this_= frame, } =20 static CORE_ADDR -alpha_mdebug_frame_args_address (frame_info_ptr this_frame, +alpha_mdebug_frame_args_address (const frame_info_ptr &this_frame, void **this_prologue_cache) { struct alpha_mdebug_unwind_cache *info @@ -380,7 +380,7 @@ static const struct frame_base alpha_mdebug_frame_base = =3D { }; =20 static const struct frame_base * -alpha_mdebug_frame_base_sniffer (frame_info_ptr this_frame) +alpha_mdebug_frame_base_sniffer (const frame_info_ptr &this_frame) { CORE_ADDR pc =3D get_frame_address_in_block (this_frame); struct mdebug_extra_func_info *proc_desc; diff --git a/gdb/alpha-netbsd-tdep.c b/gdb/alpha-netbsd-tdep.c index 0213fe5b94f..569fe42a2a9 100644 --- a/gdb/alpha-netbsd-tdep.c +++ b/gdb/alpha-netbsd-tdep.c @@ -235,7 +235,7 @@ alphanbsd_pc_in_sigtramp (struct gdbarch *gdbarch, } =20 static CORE_ADDR -alphanbsd_sigcontext_addr (frame_info_ptr frame) +alphanbsd_sigcontext_addr (const frame_info_ptr &frame) { /* FIXME: This is not correct for all versions of NetBSD/alpha. We will probably need to disassemble the trampoline to figure diff --git a/gdb/alpha-obsd-tdep.c b/gdb/alpha-obsd-tdep.c index b22e584a4e4..610866835c8 100644 --- a/gdb/alpha-obsd-tdep.c +++ b/gdb/alpha-obsd-tdep.c @@ -69,7 +69,7 @@ alphaobsd_pc_in_sigtramp (struct gdbarch *gdbarch, } =20 static CORE_ADDR -alphaobsd_sigcontext_addr (frame_info_ptr this_frame) +alphaobsd_sigcontext_addr (const frame_info_ptr &this_frame) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); CORE_ADDR pc =3D get_frame_pc (this_frame); diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index cafadae45c7..e5e0860fe24 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -233,7 +233,7 @@ alpha_convert_register_p (struct gdbarch *gdbarch, int = regno, } =20 static int -alpha_register_to_value (frame_info_ptr frame, int regnum, +alpha_register_to_value (const frame_info_ptr &frame, int regnum, struct type *valtype, gdb_byte *out, int *optimizedp, int *unavailablep) { @@ -260,7 +260,7 @@ alpha_register_to_value (frame_info_ptr frame, int regn= um, } =20 static void -alpha_value_to_register (frame_info_ptr frame, int regnum, +alpha_value_to_register (const frame_info_ptr &frame, int regnum, struct type *valtype, const gdb_byte *in) { int reg_size =3D register_size (get_frame_arch (frame), regnum); @@ -840,7 +840,7 @@ alpha_deal_with_atomic_sequence (struct gdbarch *gdbarc= h, CORE_ADDR pc) into the "pc". This routine returns true on success. */ =20 static int -alpha_get_longjmp_target (frame_info_ptr frame, CORE_ADDR *pc) +alpha_get_longjmp_target (const frame_info_ptr &frame, CORE_ADDR *pc) { struct gdbarch *gdbarch =3D get_frame_arch (frame); alpha_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch); @@ -871,7 +871,7 @@ struct alpha_sigtramp_unwind_cache }; =20 static struct alpha_sigtramp_unwind_cache * -alpha_sigtramp_frame_unwind_cache (frame_info_ptr this_frame, +alpha_sigtramp_frame_unwind_cache (const frame_info_ptr &this_frame, void **this_prologue_cache) { struct alpha_sigtramp_unwind_cache *info; @@ -912,7 +912,7 @@ alpha_sigtramp_register_address (struct gdbarch *gdbarc= h, frame. This will be used to create a new GDB frame struct. */ =20 static void -alpha_sigtramp_frame_this_id (frame_info_ptr this_frame, +alpha_sigtramp_frame_this_id (const frame_info_ptr &this_frame, void **this_prologue_cache, struct frame_id *this_id) { @@ -954,7 +954,7 @@ alpha_sigtramp_frame_this_id (frame_info_ptr this_frame, /* Retrieve the value of REGNUM in FRAME. Don't give up! */ =20 static struct value * -alpha_sigtramp_frame_prev_register (frame_info_ptr this_frame, +alpha_sigtramp_frame_prev_register (const frame_info_ptr &this_frame, void **this_prologue_cache, int regnum) { struct alpha_sigtramp_unwind_cache *info @@ -979,7 +979,7 @@ alpha_sigtramp_frame_prev_register (frame_info_ptr this= _frame, =20 static int alpha_sigtramp_frame_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, void **this_prologue_cache) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); @@ -1221,7 +1221,7 @@ alpha_heuristic_analyze_probing_loop (struct gdbarch = *gdbarch, CORE_ADDR *pc, } =20 static struct alpha_heuristic_unwind_cache * -alpha_heuristic_frame_unwind_cache (frame_info_ptr this_frame, +alpha_heuristic_frame_unwind_cache (const frame_info_ptr &this_frame, void **this_prologue_cache, CORE_ADDR start_pc) { @@ -1398,7 +1398,7 @@ alpha_heuristic_frame_unwind_cache (frame_info_ptr th= is_frame, frame. This will be used to create a new GDB frame struct. */ =20 static void -alpha_heuristic_frame_this_id (frame_info_ptr this_frame, +alpha_heuristic_frame_this_id (const frame_info_ptr &this_frame, void **this_prologue_cache, struct frame_id *this_id) { @@ -1411,7 +1411,7 @@ alpha_heuristic_frame_this_id (frame_info_ptr this_fr= ame, /* Retrieve the value of REGNUM in FRAME. Don't give up! */ =20 static struct value * -alpha_heuristic_frame_prev_register (frame_info_ptr this_frame, +alpha_heuristic_frame_prev_register (const frame_info_ptr &this_frame, void **this_prologue_cache, int regnum) { struct alpha_heuristic_unwind_cache *info @@ -1438,7 +1438,7 @@ static const struct frame_unwind alpha_heuristic_fram= e_unwind =3D }; =20 static CORE_ADDR -alpha_heuristic_frame_base_address (frame_info_ptr this_frame, +alpha_heuristic_frame_base_address (const frame_info_ptr &this_frame, void **this_prologue_cache) { struct alpha_heuristic_unwind_cache *info diff --git a/gdb/alpha-tdep.h b/gdb/alpha-tdep.h index f9c7e295609..0423abb2558 100644 --- a/gdb/alpha-tdep.h +++ b/gdb/alpha-tdep.h @@ -81,7 +81,7 @@ struct alpha_gdbarch_tdep : gdbarch_tdep_base =20 /* Translate a signal handler stack base address into the address of the sigcontext structure for that signal handler. */ - CORE_ADDR (*sigcontext_addr) (frame_info_ptr) =3D nullptr; + CORE_ADDR (*sigcontext_addr) (const frame_info_ptr &) =3D nullptr; =20 /* Does the PC fall in a signal trampoline. */ /* NOTE: cagney/2004-04-30: Do not copy/clone this code. Instead diff --git a/gdb/amd64-darwin-tdep.c b/gdb/amd64-darwin-tdep.c index bfba7a5284a..001f5379def 100644 --- a/gdb/amd64-darwin-tdep.c +++ b/gdb/amd64-darwin-tdep.c @@ -75,7 +75,7 @@ const int amd64_darwin_thread_state_num_regs =3D address of the associated sigcontext structure. */ =20 static CORE_ADDR -amd64_darwin_sigcontext_addr (frame_info_ptr this_frame) +amd64_darwin_sigcontext_addr (const frame_info_ptr &this_frame) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); enum bfd_endian byte_order =3D gdbarch_byte_order (gdbarch); diff --git a/gdb/amd64-fbsd-tdep.c b/gdb/amd64-fbsd-tdep.c index 9144801a5d2..a837bd197ff 100644 --- a/gdb/amd64-fbsd-tdep.c +++ b/gdb/amd64-fbsd-tdep.c @@ -169,7 +169,7 @@ const struct regset amd64_fbsd_segbases_regset =3D =20 static void amd64_fbsd_sigframe_init (const struct tramp_frame *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, struct trad_frame_cache *this_cache, CORE_ADDR func) { diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index fe7f5d4a259..1deb13b4e9a 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -133,7 +133,7 @@ static const gdb_byte amd64_x32_linux_sigtramp_code[] = =3D the routine. Otherwise, return 0. */ =20 static CORE_ADDR -amd64_linux_sigtramp_start (frame_info_ptr this_frame) +amd64_linux_sigtramp_start (const frame_info_ptr &this_frame) { struct gdbarch *gdbarch; const gdb_byte *sigtramp_code; @@ -175,7 +175,7 @@ amd64_linux_sigtramp_start (frame_info_ptr this_frame) routine. */ =20 static int -amd64_linux_sigtramp_p (frame_info_ptr this_frame) +amd64_linux_sigtramp_p (const frame_info_ptr &this_frame) { CORE_ADDR pc =3D get_frame_pc (this_frame); const char *name; @@ -201,7 +201,7 @@ amd64_linux_sigtramp_p (frame_info_ptr this_frame) address of the associated sigcontext structure. */ =20 static CORE_ADDR -amd64_linux_sigcontext_addr (frame_info_ptr this_frame) +amd64_linux_sigcontext_addr (const frame_info_ptr &this_frame) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); enum bfd_endian byte_order =3D gdbarch_byte_order (gdbarch); diff --git a/gdb/amd64-netbsd-tdep.c b/gdb/amd64-netbsd-tdep.c index d1a7cf3a049..40500ee5f76 100644 --- a/gdb/amd64-netbsd-tdep.c +++ b/gdb/amd64-netbsd-tdep.c @@ -35,7 +35,7 @@ routine. */ =20 static int -amd64nbsd_sigtramp_p (frame_info_ptr this_frame) +amd64nbsd_sigtramp_p (const frame_info_ptr &this_frame) { CORE_ADDR pc =3D get_frame_pc (this_frame); const char *name; @@ -48,7 +48,7 @@ amd64nbsd_sigtramp_p (frame_info_ptr this_frame) return the address of the associated mcontext structure. */ =20 static CORE_ADDR -amd64nbsd_mcontext_addr (frame_info_ptr this_frame) +amd64nbsd_mcontext_addr (const frame_info_ptr &this_frame) { CORE_ADDR addr; =20 diff --git a/gdb/amd64-obsd-tdep.c b/gdb/amd64-obsd-tdep.c index 9cca6b12c84..6b37e8954ee 100644 --- a/gdb/amd64-obsd-tdep.c +++ b/gdb/amd64-obsd-tdep.c @@ -45,7 +45,7 @@ static const int amd64obsd_page_size =3D 4096; routine. */ =20 static int -amd64obsd_sigtramp_p (frame_info_ptr this_frame) +amd64obsd_sigtramp_p (const frame_info_ptr &this_frame) { CORE_ADDR pc =3D get_frame_pc (this_frame); CORE_ADDR start_pc =3D (pc & ~(amd64obsd_page_size - 1)); @@ -98,7 +98,7 @@ amd64obsd_sigtramp_p (frame_info_ptr this_frame) address of the associated sigcontext structure. */ =20 static CORE_ADDR -amd64obsd_sigcontext_addr (frame_info_ptr this_frame) +amd64obsd_sigcontext_addr (const frame_info_ptr &this_frame) { CORE_ADDR pc =3D get_frame_pc (this_frame); ULONGEST offset =3D (pc & (amd64obsd_page_size - 1)); @@ -315,7 +315,7 @@ amd64obsd_collect_uthread (const struct regcache *regca= che, #define amd64obsd_tf_reg_offset amd64obsd_sc_reg_offset =20 static struct trad_frame_cache * -amd64obsd_trapframe_cache (frame_info_ptr this_frame, void **this_cache) +amd64obsd_trapframe_cache (const frame_info_ptr &this_frame, void **this_c= ache) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); enum bfd_endian byte_order =3D gdbarch_byte_order (gdbarch); @@ -362,7 +362,7 @@ amd64obsd_trapframe_cache (frame_info_ptr this_frame, v= oid **this_cache) } =20 static void -amd64obsd_trapframe_this_id (frame_info_ptr this_frame, +amd64obsd_trapframe_this_id (const frame_info_ptr &this_frame, void **this_cache, struct frame_id *this_id) { struct trad_frame_cache *cache =3D @@ -372,7 +372,7 @@ amd64obsd_trapframe_this_id (frame_info_ptr this_frame, } =20 static struct value * -amd64obsd_trapframe_prev_register (frame_info_ptr this_frame, +amd64obsd_trapframe_prev_register (const frame_info_ptr &this_frame, void **this_cache, int regnum) { struct trad_frame_cache *cache =3D @@ -383,7 +383,7 @@ amd64obsd_trapframe_prev_register (frame_info_ptr this_= frame, =20 static int amd64obsd_trapframe_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, void **this_prologue_cache) { ULONGEST cs; diff --git a/gdb/amd64-sol2-tdep.c b/gdb/amd64-sol2-tdep.c index 30a5dfa4c5e..6cc84017f74 100644 --- a/gdb/amd64-sol2-tdep.c +++ b/gdb/amd64-sol2-tdep.c @@ -67,7 +67,7 @@ static int amd64_sol2_gregset_reg_offset[] =3D { 'mcontext_t' that contains the saved set of machine registers. */ =20 static CORE_ADDR -amd64_sol2_mcontext_addr (frame_info_ptr this_frame) +amd64_sol2_mcontext_addr (const frame_info_ptr &this_frame) { CORE_ADDR sp, ucontext_addr; =20 diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index a8ff9246b8a..f5968ab4d0f 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -348,7 +348,7 @@ amd64_pseudo_register_name (struct gdbarch *gdbarch, in= t regnum) } =20 static value * -amd64_pseudo_register_read_value (gdbarch *gdbarch, frame_info_ptr next_fr= ame, +amd64_pseudo_register_read_value (gdbarch *gdbarch, const frame_info_ptr &= next_frame, int regnum) { i386_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch); @@ -379,7 +379,7 @@ amd64_pseudo_register_read_value (gdbarch *gdbarch, fra= me_info_ptr next_frame, } =20 static void -amd64_pseudo_register_write (gdbarch *gdbarch, frame_info_ptr next_frame, +amd64_pseudo_register_write (gdbarch *gdbarch, const frame_info_ptr &next_= frame, int regnum, gdb::array_view buf) { i386_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch); @@ -2510,7 +2510,7 @@ amd64_skip_prologue (struct gdbarch *gdbarch, CORE_AD= DR start_pc) /* Normal frames. */ =20 static void -amd64_frame_cache_1 (frame_info_ptr this_frame, +amd64_frame_cache_1 (const frame_info_ptr &this_frame, struct amd64_frame_cache *cache) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); @@ -2579,7 +2579,7 @@ amd64_frame_cache_1 (frame_info_ptr this_frame, } =20 static struct amd64_frame_cache * -amd64_frame_cache (frame_info_ptr this_frame, void **this_cache) +amd64_frame_cache (const frame_info_ptr &this_frame, void **this_cache) { struct amd64_frame_cache *cache; =20 @@ -2603,7 +2603,7 @@ amd64_frame_cache (frame_info_ptr this_frame, void **= this_cache) } =20 static enum unwind_stop_reason -amd64_frame_unwind_stop_reason (frame_info_ptr this_frame, +amd64_frame_unwind_stop_reason (const frame_info_ptr &this_frame, void **this_cache) { struct amd64_frame_cache *cache =3D @@ -2620,7 +2620,7 @@ amd64_frame_unwind_stop_reason (frame_info_ptr this_f= rame, } =20 static void -amd64_frame_this_id (frame_info_ptr this_frame, void **this_cache, +amd64_frame_this_id (const frame_info_ptr &this_frame, void **this_cache, struct frame_id *this_id) { struct amd64_frame_cache *cache =3D @@ -2638,7 +2638,7 @@ amd64_frame_this_id (frame_info_ptr this_frame, void = **this_cache, } =20 static struct value * -amd64_frame_prev_register (frame_info_ptr this_frame, void **this_cache, +amd64_frame_prev_register (const frame_info_ptr &this_frame, void **this_c= ache, int regnum) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); @@ -2692,7 +2692,7 @@ amd64_gen_return_address (struct gdbarch *gdbarch, on both platforms. */ =20 static struct amd64_frame_cache * -amd64_sigtramp_frame_cache (frame_info_ptr this_frame, void **this_cache) +amd64_sigtramp_frame_cache (const frame_info_ptr &this_frame, void **this_= cache) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); i386_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch); @@ -2732,7 +2732,7 @@ amd64_sigtramp_frame_cache (frame_info_ptr this_frame= , void **this_cache) } =20 static enum unwind_stop_reason -amd64_sigtramp_frame_unwind_stop_reason (frame_info_ptr this_frame, +amd64_sigtramp_frame_unwind_stop_reason (const frame_info_ptr &this_frame, void **this_cache) { struct amd64_frame_cache *cache =3D @@ -2745,7 +2745,7 @@ amd64_sigtramp_frame_unwind_stop_reason (frame_info_p= tr this_frame, } =20 static void -amd64_sigtramp_frame_this_id (frame_info_ptr this_frame, +amd64_sigtramp_frame_this_id (const frame_info_ptr &this_frame, void **this_cache, struct frame_id *this_id) { struct amd64_frame_cache *cache =3D @@ -2763,7 +2763,7 @@ amd64_sigtramp_frame_this_id (frame_info_ptr this_fra= me, } =20 static struct value * -amd64_sigtramp_frame_prev_register (frame_info_ptr this_frame, +amd64_sigtramp_frame_prev_register (const frame_info_ptr &this_frame, void **this_cache, int regnum) { /* Make sure we've initialized the cache. */ @@ -2774,7 +2774,7 @@ amd64_sigtramp_frame_prev_register (frame_info_ptr th= is_frame, =20 static int amd64_sigtramp_frame_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, void **this_cache) { gdbarch *arch =3D get_frame_arch (this_frame); @@ -2816,7 +2816,7 @@ static const struct frame_unwind amd64_sigtramp_frame= _unwind =3D =0C =20 static CORE_ADDR -amd64_frame_base_address (frame_info_ptr this_frame, void **this_cache) +amd64_frame_base_address (const frame_info_ptr &this_frame, void **this_ca= che) { struct amd64_frame_cache *cache =3D amd64_frame_cache (this_frame, this_cache); @@ -2878,7 +2878,7 @@ amd64_stack_frame_destroyed_p (struct gdbarch *gdbarc= h, CORE_ADDR pc) =20 static int amd64_epilogue_frame_sniffer_1 (const struct frame_unwind *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, void **this_prologue_cache, bool override_p) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); @@ -2911,7 +2911,7 @@ amd64_epilogue_frame_sniffer_1 (const struct frame_un= wind *self, =20 static int amd64_epilogue_override_frame_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, void **this_prologue_cache) { return amd64_epilogue_frame_sniffer_1 (self, this_frame, this_prologue_c= ache, @@ -2920,7 +2920,7 @@ amd64_epilogue_override_frame_sniffer (const struct f= rame_unwind *self, =20 static int amd64_epilogue_frame_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, void **this_prologue_cache) { return amd64_epilogue_frame_sniffer_1 (self, this_frame, this_prologue_c= ache, @@ -2928,7 +2928,7 @@ amd64_epilogue_frame_sniffer (const struct frame_unwi= nd *self, } =20 static struct amd64_frame_cache * -amd64_epilogue_frame_cache (frame_info_ptr this_frame, void **this_cache) +amd64_epilogue_frame_cache (const frame_info_ptr &this_frame, void **this_= cache) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); enum bfd_endian byte_order =3D gdbarch_byte_order (gdbarch); @@ -2969,7 +2969,7 @@ amd64_epilogue_frame_cache (frame_info_ptr this_frame= , void **this_cache) } =20 static enum unwind_stop_reason -amd64_epilogue_frame_unwind_stop_reason (frame_info_ptr this_frame, +amd64_epilogue_frame_unwind_stop_reason (const frame_info_ptr &this_frame, void **this_cache) { struct amd64_frame_cache *cache @@ -2982,7 +2982,7 @@ amd64_epilogue_frame_unwind_stop_reason (frame_info_p= tr this_frame, } =20 static void -amd64_epilogue_frame_this_id (frame_info_ptr this_frame, +amd64_epilogue_frame_this_id (const frame_info_ptr &this_frame, void **this_cache, struct frame_id *this_id) { @@ -3018,7 +3018,7 @@ static const struct frame_unwind amd64_epilogue_frame= _unwind =3D }; =20 static struct frame_id -amd64_dummy_id (struct gdbarch *gdbarch, frame_info_ptr this_frame) +amd64_dummy_id (struct gdbarch *gdbarch, const frame_info_ptr &this_frame) { CORE_ADDR fp; =20 @@ -3081,7 +3081,7 @@ const struct regset amd64_fpregset =3D success. */ =20 static int -amd64_get_longjmp_target (frame_info_ptr frame, CORE_ADDR *pc) +amd64_get_longjmp_target (const frame_info_ptr &frame, CORE_ADDR *pc) { gdb_byte buf[8]; CORE_ADDR jb_addr; diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c index 50304e15cb8..7c5169fd98c 100644 --- a/gdb/amd64-windows-tdep.c +++ b/gdb/amd64-windows-tdep.c @@ -517,7 +517,7 @@ pc_in_range (CORE_ADDR pc, const struct amd64_windows_f= rame_cache *cache) Return 1 if an epilogue sequence was recognized, 0 otherwise. */ =20 static int -amd64_windows_frame_decode_epilogue (frame_info_ptr this_frame, +amd64_windows_frame_decode_epilogue (const frame_info_ptr &this_frame, struct amd64_windows_frame_cache *cache) { /* According to MSDN an epilogue "must consist of either an add RSP,cons= tant @@ -697,7 +697,7 @@ amd64_windows_frame_decode_epilogue (frame_info_ptr thi= s_frame, /* Decode and execute unwind insns at UNWIND_INFO. */ =20 static void -amd64_windows_frame_decode_insns (frame_info_ptr this_frame, +amd64_windows_frame_decode_insns (const frame_info_ptr &this_frame, struct amd64_windows_frame_cache *cache, CORE_ADDR unwind_info) { @@ -1077,7 +1077,7 @@ amd64_windows_find_unwind_info (struct gdbarch *gdbar= ch, CORE_ADDR pc, for THIS_FRAME. */ =20 static struct amd64_windows_frame_cache * -amd64_windows_frame_cache (frame_info_ptr this_frame, void **this_cache) +amd64_windows_frame_cache (const frame_info_ptr &this_frame, void **this_c= ache) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); enum bfd_endian byte_order =3D gdbarch_byte_order (gdbarch); @@ -1123,7 +1123,7 @@ amd64_windows_frame_cache (frame_info_ptr this_frame,= void **this_cache) using the standard Windows x64 SEH info. */ =20 static struct value * -amd64_windows_frame_prev_register (frame_info_ptr this_frame, +amd64_windows_frame_prev_register (const frame_info_ptr &this_frame, void **this_cache, int regnum) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); @@ -1169,7 +1169,7 @@ amd64_windows_frame_prev_register (frame_info_ptr thi= s_frame, the standard Windows x64 SEH info. */ =20 static void -amd64_windows_frame_this_id (frame_info_ptr this_frame, void **this_cache, +amd64_windows_frame_this_id (const frame_info_ptr &this_frame, void **this= _cache, struct frame_id *this_id) { struct amd64_windows_frame_cache *cache =3D @@ -1235,7 +1235,7 @@ amd64_windows_skip_prologue (struct gdbarch *gdbarch,= CORE_ADDR pc) /* Check Win64 DLL jmp trampolines and find jump destination. */ =20 static CORE_ADDR -amd64_windows_skip_trampoline_code (frame_info_ptr frame, CORE_ADDR pc) +amd64_windows_skip_trampoline_code (const frame_info_ptr &frame, CORE_ADDR= pc) { CORE_ADDR destination =3D 0; struct gdbarch *gdbarch =3D get_frame_arch (frame); diff --git a/gdb/amdgpu-tdep.c b/gdb/amdgpu-tdep.c index 44252e559cd..ac137d9acc4 100644 --- a/gdb/amdgpu-tdep.c +++ b/gdb/amdgpu-tdep.c @@ -846,7 +846,7 @@ struct amdgpu_frame_cache }; =20 static amdgpu_frame_cache * -amdgpu_frame_cache (frame_info_ptr this_frame, void **this_cache) +amdgpu_frame_cache (const frame_info_ptr &this_frame, void **this_cache) { if (*this_cache !=3D nullptr) return (struct amdgpu_frame_cache *) *this_cache; @@ -862,7 +862,7 @@ amdgpu_frame_cache (frame_info_ptr this_frame, void **t= his_cache) } =20 static void -amdgpu_frame_this_id (frame_info_ptr this_frame, void **this_cache, +amdgpu_frame_this_id (const frame_info_ptr &this_frame, void **this_cache, frame_id *this_id) { struct amdgpu_frame_cache *cache @@ -880,13 +880,13 @@ amdgpu_frame_this_id (frame_info_ptr this_frame, void= **this_cache, } =20 static frame_id -amdgpu_dummy_id (struct gdbarch *gdbarch, frame_info_ptr this_frame) +amdgpu_dummy_id (struct gdbarch *gdbarch, const frame_info_ptr &this_frame) { return frame_id_build (0, get_frame_pc (this_frame)); } =20 static struct value * -amdgpu_frame_prev_register (frame_info_ptr this_frame, void **this_cache, +amdgpu_frame_prev_register (const frame_info_ptr &this_frame, void **this_= cache, int regnum) { return frame_unwind_got_register (this_frame, regnum, regnum); diff --git a/gdb/arc-linux-tdep.c b/gdb/arc-linux-tdep.c index 03ff49a2b19..ca630ab6df0 100644 --- a/gdb/arc-linux-tdep.c +++ b/gdb/arc-linux-tdep.c @@ -159,7 +159,7 @@ static const int arc_linux_core_reg_offsets[] =3D { Returns TRUE if this is a sigtramp frame. */ =20 static bool -arc_linux_is_sigtramp (frame_info_ptr this_frame) +arc_linux_is_sigtramp (const frame_info_ptr &this_frame) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); CORE_ADDR pc =3D get_frame_pc (this_frame); @@ -257,7 +257,7 @@ arc_linux_is_sigtramp (frame_info_ptr this_frame) etc) in GDB hardcode values. */ =20 static CORE_ADDR -arc_linux_sigcontext_addr (frame_info_ptr this_frame) +arc_linux_sigcontext_addr (const frame_info_ptr &this_frame) { const int ucontext_offset =3D 0x80; const int sigcontext_offset =3D 0x14; diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c index 84e211ce9ad..12d8aee949f 100644 --- a/gdb/arc-tdep.c +++ b/gdb/arc-tdep.c @@ -998,7 +998,7 @@ arc_store_return_value (struct gdbarch *gdbarch, struct= type *type, /* Implement the "get_longjmp_target" gdbarch method. */ =20 static int -arc_get_longjmp_target (frame_info_ptr frame, CORE_ADDR *pc) +arc_get_longjmp_target (const frame_info_ptr &frame, CORE_ADDR *pc) { arc_debug_printf ("called"); =20 @@ -1062,7 +1062,7 @@ arc_return_value (struct gdbarch *gdbarch, struct val= ue *function, frame pointer. */ =20 static CORE_ADDR -arc_frame_base_address (frame_info_ptr this_frame, void **prologue_cache) +arc_frame_base_address (const frame_info_ptr &this_frame, void **prologue_= cache) { return (CORE_ADDR) get_frame_register_unsigned (this_frame, ARC_FP_REGNU= M); } @@ -1643,7 +1643,7 @@ arc_print_frame_cache (struct gdbarch *gdbarch, const= char *message, /* Frame unwinder for normal frames. */ =20 static struct arc_frame_cache * -arc_make_frame_cache (frame_info_ptr this_frame) +arc_make_frame_cache (const frame_info_ptr &this_frame) { arc_debug_printf ("called"); =20 @@ -1710,7 +1710,7 @@ arc_make_frame_cache (frame_info_ptr this_frame) /* Implement the "this_id" frame_unwind method. */ =20 static void -arc_frame_this_id (frame_info_ptr this_frame, void **this_cache, +arc_frame_this_id (const frame_info_ptr &this_frame, void **this_cache, struct frame_id *this_id) { arc_debug_printf ("called"); @@ -1755,7 +1755,7 @@ arc_frame_this_id (frame_info_ptr this_frame, void **= this_cache, /* Implement the "prev_register" frame_unwind method. */ =20 static struct value * -arc_frame_prev_register (frame_info_ptr this_frame, +arc_frame_prev_register (const frame_info_ptr &this_frame, void **this_cache, int regnum) { if (*this_cache =3D=3D NULL) @@ -1792,7 +1792,7 @@ arc_frame_prev_register (frame_info_ptr this_frame, static void arc_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum, struct dwarf2_frame_state_reg *reg, - frame_info_ptr info) + const frame_info_ptr &info) { if (regnum =3D=3D gdbarch_pc_regnum (gdbarch)) /* The return address column. */ @@ -1806,7 +1806,7 @@ arc_dwarf2_frame_init_reg (struct gdbarch *gdbarch, i= nt regnum, from within signal handlers. */ =20 static struct arc_frame_cache * -arc_make_sigtramp_frame_cache (frame_info_ptr this_frame) +arc_make_sigtramp_frame_cache (const frame_info_ptr &this_frame) { arc_debug_printf ("called"); =20 @@ -1845,7 +1845,7 @@ arc_make_sigtramp_frame_cache (frame_info_ptr this_fr= ame) frames. */ =20 static void -arc_sigtramp_frame_this_id (frame_info_ptr this_frame, +arc_sigtramp_frame_this_id (const frame_info_ptr &this_frame, void **this_cache, struct frame_id *this_id) { arc_debug_printf ("called"); @@ -1864,7 +1864,7 @@ arc_sigtramp_frame_this_id (frame_info_ptr this_frame, /* Get a register from a signal handler frame. */ =20 static struct value * -arc_sigtramp_frame_prev_register (frame_info_ptr this_frame, +arc_sigtramp_frame_prev_register (const frame_info_ptr &this_frame, void **this_cache, int regnum) { arc_debug_printf ("regnum =3D %d", regnum); @@ -1882,7 +1882,7 @@ arc_sigtramp_frame_prev_register (frame_info_ptr this= _frame, =20 static int arc_sigtramp_frame_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, void **this_cache) { arc_debug_printf ("called"); diff --git a/gdb/arc-tdep.h b/gdb/arc-tdep.h index 6fc1131a435..c59490dec00 100644 --- a/gdb/arc-tdep.h +++ b/gdb/arc-tdep.h @@ -131,10 +131,10 @@ struct arc_gdbarch_tdep : gdbarch_tdep_base bool has_hw_loops =3D false; =20 /* Detect sigtramp. */ - bool (*is_sigtramp) (frame_info_ptr) =3D nullptr; + bool (*is_sigtramp) (const frame_info_ptr &) =3D nullptr; =20 /* Get address of sigcontext for sigtramp. */ - CORE_ADDR (*sigcontext_addr) (frame_info_ptr) =3D nullptr; + CORE_ADDR (*sigcontext_addr) (const frame_info_ptr &) =3D nullptr; =20 /* Offset of registers in `struct sigcontext'. */ const int *sc_reg_offset =3D nullptr; diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 1faa013c16f..ae3354f6579 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -140,7 +140,7 @@ default_get_memtag (struct gdbarch *gdbarch, struct val= ue *address, } =20 CORE_ADDR -generic_skip_trampoline_code (frame_info_ptr frame, CORE_ADDR pc) +generic_skip_trampoline_code (const frame_info_ptr &frame, CORE_ADDR pc) { return 0; } @@ -166,7 +166,7 @@ generic_stack_frame_destroyed_p (struct gdbarch *gdbarc= h, CORE_ADDR pc) =20 int default_code_of_frame_writable (struct gdbarch *gdbarch, - frame_info_ptr frame) + const frame_info_ptr &frame) { return 1; } @@ -1079,7 +1079,7 @@ default_type_align (struct gdbarch *gdbarch, struct t= ype *type) /* See arch-utils.h. */ =20 std::string -default_get_pc_address_flags (frame_info_ptr frame, CORE_ADDR pc) +default_get_pc_address_flags (const frame_info_ptr &frame, CORE_ADDR pc) { return ""; } @@ -1105,7 +1105,8 @@ default_use_target_description_from_corefile_notes (s= truct gdbarch *gdbarch, } =20 CORE_ADDR -default_get_return_buf_addr (struct type *val_type, frame_info_ptr cur_fra= me) +default_get_return_buf_addr (struct type *val_type, + const frame_info_ptr &cur_frame) { return 0; } diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index 0f37aaf20f8..2dcd8f6dc53 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -158,7 +158,7 @@ struct value *default_get_memtag (struct gdbarch *gdbar= ch, struct value *address, memtag_type tag_type); =20 -extern CORE_ADDR generic_skip_trampoline_code (frame_info_ptr frame, +extern CORE_ADDR generic_skip_trampoline_code (const frame_info_ptr &frame, CORE_ADDR pc); =20 extern CORE_ADDR generic_skip_solib_resolver (struct gdbarch *gdbarch, @@ -171,7 +171,7 @@ extern int generic_stack_frame_destroyed_p (struct gdba= rch *gdbarch, CORE_ADDR pc); =20 extern int default_code_of_frame_writable (struct gdbarch *gdbarch, - frame_info_ptr frame); + const frame_info_ptr &frame); =20 /* By default, registers are not convertible. */ extern int generic_convert_register_p (struct gdbarch *gdbarch, int regnum, @@ -295,7 +295,7 @@ extern ULONGEST default_type_align (struct gdbarch *gdb= arch, struct type *type); =20 /* Default implementation of gdbarch get_pc_address_flags method. */ -extern std::string default_get_pc_address_flags (frame_info_ptr frame, +extern std::string default_get_pc_address_flags (const frame_info_ptr &fra= me, CORE_ADDR pc); =20 /* Default implementation of gdbarch read_core_file_mappings method. */ @@ -313,7 +313,7 @@ extern bool default_use_target_description_from_corefil= e_notes =20 /* Default implementation of gdbarch default_get_return_buf_addr method. = */ extern CORE_ADDR default_get_return_buf_addr (struct type *val_typegdbarch, - frame_info_ptr cur_frame); + const frame_info_ptr &cur_frame); =20 /* Default implementation of gdbarch default_dwarf2_omit_typedef_p method.= */ extern bool default_dwarf2_omit_typedef_p (struct type *target_type, diff --git a/gdb/arm-fbsd-tdep.c b/gdb/arm-fbsd-tdep.c index 143aaf121b7..b485951c376 100644 --- a/gdb/arm-fbsd-tdep.c +++ b/gdb/arm-fbsd-tdep.c @@ -105,7 +105,7 @@ static const struct regcache_map_entry arm_fbsd_tls_reg= map[] =3D =20 static void arm_fbsd_sigframe_init (const struct tramp_frame *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, struct trad_frame_cache *this_cache, CORE_ADDR func) { diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index b559de0fb2d..cc79247aaf1 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -277,7 +277,7 @@ static struct arm_get_next_pcs_ops arm_linux_get_next_p= cs_ops =3D { }; =20 static void -arm_linux_sigtramp_cache (frame_info_ptr this_frame, +arm_linux_sigtramp_cache (const frame_info_ptr &this_frame, struct trad_frame_cache *this_cache, CORE_ADDR func, int regs_offset) { @@ -300,7 +300,7 @@ arm_linux_sigtramp_cache (frame_info_ptr this_frame, /* See arm-linux.h for stack layout details. */ static void arm_linux_sigreturn_init (const struct tramp_frame *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, struct trad_frame_cache *this_cache, CORE_ADDR func) { @@ -320,7 +320,7 @@ arm_linux_sigreturn_init (const struct tramp_frame *sel= f, =20 static void arm_linux_rt_sigreturn_init (const struct tramp_frame *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, struct trad_frame_cache *this_cache, CORE_ADDR func) { @@ -343,7 +343,7 @@ arm_linux_rt_sigreturn_init (const struct tramp_frame *= self, =20 static void arm_linux_restart_syscall_init (const struct tramp_frame *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, struct trad_frame_cache *this_cache, CORE_ADDR func) { @@ -756,7 +756,7 @@ arm_linux_core_read_description (struct gdbarch *gdbarc= h, will return to ARM or Thumb code. Return 0 if it is not a rt_sigreturn/sigreturn syscall. */ static int -arm_linux_sigreturn_return_addr (frame_info_ptr frame, +arm_linux_sigreturn_return_addr (const frame_info_ptr &frame, unsigned long svc_number, CORE_ADDR *pc, int *is_thumb) { @@ -1720,7 +1720,7 @@ arm_linux_syscall_record (struct regcache *regcache, = unsigned long svc_number) /* Implement the skip_trampoline_code gdbarch method. */ =20 static CORE_ADDR -arm_linux_skip_trampoline_code (frame_info_ptr frame, CORE_ADDR pc) +arm_linux_skip_trampoline_code (const frame_info_ptr &frame, CORE_ADDR pc) { CORE_ADDR target_pc =3D arm_skip_stub (frame, pc); =20 diff --git a/gdb/arm-obsd-tdep.c b/gdb/arm-obsd-tdep.c index 9aa2408f36e..0bdecec3b6f 100644 --- a/gdb/arm-obsd-tdep.c +++ b/gdb/arm-obsd-tdep.c @@ -30,7 +30,7 @@ =20 static void armobsd_sigframe_init (const struct tramp_frame *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, struct trad_frame_cache *cache, CORE_ADDR func) { diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 081e934cf86..3b4ae15df07 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -339,7 +339,7 @@ arm_cache_init (struct arm_prologue_cache *cache, struc= t gdbarch *gdbarch) /* Similar to the previous function, but extracts GDBARCH from FRAME. */ =20 static void -arm_cache_init (struct arm_prologue_cache *cache, frame_info_ptr frame) +arm_cache_init (struct arm_prologue_cache *cache, const frame_info_ptr &fr= ame) { struct gdbarch *gdbarch =3D get_frame_arch (frame); arm_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch); @@ -628,7 +628,7 @@ arm_is_thumb (struct regcache *regcache) frame. */ =20 int -arm_frame_is_thumb (frame_info_ptr frame) +arm_frame_is_thumb (const frame_info_ptr &frame) { /* Check the architecture of FRAME. */ struct gdbarch *gdbarch =3D get_frame_arch (frame); @@ -2213,7 +2213,7 @@ arm_analyze_prologue (struct gdbarch *gdbarch, } =20 static void -arm_scan_prologue (frame_info_ptr this_frame, +arm_scan_prologue (const frame_info_ptr &this_frame, struct arm_prologue_cache *cache) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); @@ -2310,7 +2310,7 @@ arm_scan_prologue (frame_info_ptr this_frame, } =20 static struct arm_prologue_cache * -arm_make_prologue_cache (frame_info_ptr this_frame) +arm_make_prologue_cache (const frame_info_ptr &this_frame) { int reg; struct arm_prologue_cache *cache; @@ -2344,7 +2344,7 @@ arm_make_prologue_cache (frame_info_ptr this_frame) /* Implementation of the stop_reason hook for arm_prologue frames. */ =20 static enum unwind_stop_reason -arm_prologue_unwind_stop_reason (frame_info_ptr this_frame, +arm_prologue_unwind_stop_reason (const frame_info_ptr &this_frame, void **this_cache) { struct arm_prologue_cache *cache; @@ -2372,7 +2372,7 @@ arm_prologue_unwind_stop_reason (frame_info_ptr this_= frame, and the caller's SP when we were called. */ =20 static void -arm_prologue_this_id (frame_info_ptr this_frame, +arm_prologue_this_id (const frame_info_ptr &this_frame, void **this_cache, struct frame_id *this_id) { @@ -2400,7 +2400,7 @@ arm_prologue_this_id (frame_info_ptr this_frame, } =20 static struct value * -arm_prologue_prev_register (frame_info_ptr this_frame, +arm_prologue_prev_register (const frame_info_ptr &this_frame, void **this_cache, int prev_regnum) { @@ -2794,7 +2794,7 @@ arm_find_exidx_entry (CORE_ADDR memaddr, CORE_ADDR *s= tart) for the ARM Architecture" document. */ =20 static struct arm_prologue_cache * -arm_exidx_fill_cache (frame_info_ptr this_frame, gdb_byte *entry) +arm_exidx_fill_cache (const frame_info_ptr &this_frame, gdb_byte *entry) { CORE_ADDR vsp =3D 0; int vsp_valid =3D 0; @@ -3092,7 +3092,7 @@ arm_exidx_fill_cache (frame_info_ptr this_frame, gdb_= byte *entry) =20 static int arm_exidx_unwind_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, void **this_prologue_cache) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); @@ -3199,7 +3199,7 @@ struct frame_unwind arm_exidx_unwind =3D { }; =20 static struct arm_prologue_cache * -arm_make_epilogue_frame_cache (frame_info_ptr this_frame) +arm_make_epilogue_frame_cache (const frame_info_ptr &this_frame) { struct arm_prologue_cache *cache; int reg; @@ -3231,7 +3231,7 @@ arm_make_epilogue_frame_cache (frame_info_ptr this_fr= ame) 'struct frame_uwnind' for epilogue unwinder. */ =20 static void -arm_epilogue_frame_this_id (frame_info_ptr this_frame, +arm_epilogue_frame_this_id (const frame_info_ptr &this_frame, void **this_cache, struct frame_id *this_id) { @@ -3259,7 +3259,7 @@ arm_epilogue_frame_this_id (frame_info_ptr this_frame, 'struct frame_uwnind' for epilogue unwinder. */ =20 static struct value * -arm_epilogue_frame_prev_register (frame_info_ptr this_frame, +arm_epilogue_frame_prev_register (const frame_info_ptr &this_frame, void **this_cache, int regnum) { if (*this_cache =3D=3D NULL) @@ -3278,7 +3278,7 @@ static int thumb_stack_frame_destroyed_p (struct gdba= rch *gdbarch, =20 static int arm_epilogue_frame_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, void **this_prologue_cache) { if (frame_relative_level (this_frame) =3D=3D 0) @@ -3335,7 +3335,7 @@ static const struct frame_unwind arm_epilogue_frame_u= nwind =3D The trampoline 'bx r2' doesn't belong to main. */ =20 static CORE_ADDR -arm_skip_bx_reg (frame_info_ptr frame, CORE_ADDR pc) +arm_skip_bx_reg (const frame_info_ptr &frame, CORE_ADDR pc) { /* The heuristics of recognizing such trampoline is that FRAME is executing in Thumb mode and the instruction on PC is 'bx Rm'. */ @@ -3367,7 +3367,7 @@ arm_skip_bx_reg (frame_info_ptr frame, CORE_ADDR pc) } =20 static struct arm_prologue_cache * -arm_make_stub_cache (frame_info_ptr this_frame) +arm_make_stub_cache (const frame_info_ptr &this_frame) { struct arm_prologue_cache *cache; =20 @@ -3386,7 +3386,7 @@ arm_make_stub_cache (frame_info_ptr this_frame) /* Our frame ID for a stub frame is the current SP and LR. */ =20 static void -arm_stub_this_id (frame_info_ptr this_frame, +arm_stub_this_id (const frame_info_ptr &this_frame, void **this_cache, struct frame_id *this_id) { @@ -3404,7 +3404,7 @@ arm_stub_this_id (frame_info_ptr this_frame, =20 static int arm_stub_unwind_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, void **this_prologue_cache) { CORE_ADDR addr_in_block; @@ -3442,7 +3442,7 @@ struct frame_unwind arm_stub_unwind =3D { returned. */ =20 static struct arm_prologue_cache * -arm_m_exception_cache (frame_info_ptr this_frame) +arm_m_exception_cache (const frame_info_ptr &this_frame) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); arm_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch); @@ -3828,7 +3828,7 @@ arm_m_exception_cache (frame_info_ptr this_frame) /* Implementation of the stop_reason hook for arm_m_exception frames. */ =20 static enum unwind_stop_reason -arm_m_exception_frame_unwind_stop_reason (frame_info_ptr this_frame, +arm_m_exception_frame_unwind_stop_reason (const frame_info_ptr &this_frame, void **this_cache) { struct arm_prologue_cache *cache; @@ -3850,7 +3850,7 @@ arm_m_exception_frame_unwind_stop_reason (frame_info_= ptr this_frame, 'struct frame_uwnind'. */ =20 static void -arm_m_exception_this_id (frame_info_ptr this_frame, +arm_m_exception_this_id (const frame_info_ptr &this_frame, void **this_cache, struct frame_id *this_id) { @@ -3871,7 +3871,7 @@ arm_m_exception_this_id (frame_info_ptr this_frame, 'struct frame_uwnind'. */ =20 static struct value * -arm_m_exception_prev_register (frame_info_ptr this_frame, +arm_m_exception_prev_register (const frame_info_ptr &this_frame, void **this_cache, int prev_regnum) { @@ -3936,7 +3936,7 @@ arm_m_exception_prev_register (frame_info_ptr this_fr= ame, =20 static int arm_m_exception_unwind_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, void **this_prologue_cache) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); @@ -3964,7 +3964,7 @@ struct frame_unwind arm_m_exception_unwind =3D }; =20 static CORE_ADDR -arm_normal_frame_base (frame_info_ptr this_frame, void **this_cache) +arm_normal_frame_base (const frame_info_ptr &this_frame, void **this_cache) { struct arm_prologue_cache *cache; =20 @@ -3997,7 +3997,7 @@ struct arm_dwarf2_prev_register_cache }; =20 static struct value * -arm_dwarf2_prev_register (frame_info_ptr this_frame, void **this_cache, +arm_dwarf2_prev_register (const frame_info_ptr &this_frame, void **this_ca= che, int regnum) { struct gdbarch * gdbarch =3D get_frame_arch (this_frame); @@ -4897,7 +4897,7 @@ print_fpu_flags (struct ui_file *file, int flags) (if present) or emulator. */ static void arm_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, - frame_info_ptr frame, const char *args) + const frame_info_ptr &frame, const char *args) { unsigned long status =3D get_frame_register_unsigned (frame, ARM_FPS_REG= NUM); int type; @@ -5244,7 +5244,7 @@ static const unsigned char op_lit0 =3D DW_OP_lit0; static void arm_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum, struct dwarf2_frame_state_reg *reg, - frame_info_ptr this_frame) + const frame_info_ptr &this_frame) { arm_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch); =20 @@ -9343,7 +9343,7 @@ arm_return_value (struct gdbarch *gdbarch, struct val= ue *function, =20 =20 static int -arm_get_longjmp_target (frame_info_ptr frame, CORE_ADDR *pc) +arm_get_longjmp_target (const frame_info_ptr &frame, CORE_ADDR *pc) { struct gdbarch *gdbarch =3D get_frame_arch (frame); arm_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch); @@ -9415,7 +9415,7 @@ arm_is_sgstubs_section (struct obj_section *sec) return the target PC. Otherwise return 0. */ =20 CORE_ADDR -arm_skip_stub (frame_info_ptr frame, CORE_ADDR pc) +arm_skip_stub (const frame_info_ptr &frame, CORE_ADDR pc) { const char *name; int namelen; @@ -9821,7 +9821,7 @@ arm_neon_quad_read (struct gdbarch *gdbarch, readable= _regcache *regcache, register, in [0, 15]. */ =20 static value * -arm_neon_quad_read_value (gdbarch *gdbarch, frame_info_ptr next_frame, +arm_neon_quad_read_value (gdbarch *gdbarch, const frame_info_ptr &next_fra= me, int pseudo_reg_num, int quad_reg_index) { std::string raw_reg_name =3D string_printf ("d%d", quad_reg_index << 1); @@ -9836,7 +9836,7 @@ arm_neon_quad_read_value (gdbarch *gdbarch, frame_inf= o_ptr next_frame, /* Read the contents of the MVE pseudo register REGNUM and return it as a value. */ static value * -arm_mve_pseudo_read_value (gdbarch *gdbarch, frame_info_ptr next_frame, +arm_mve_pseudo_read_value (gdbarch *gdbarch, const frame_info_ptr &next_fr= ame, int pseudo_reg_num) { arm_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch); @@ -9847,7 +9847,7 @@ arm_mve_pseudo_read_value (gdbarch *gdbarch, frame_in= fo_ptr next_frame, } =20 static value * -arm_pseudo_read_value (gdbarch *gdbarch, frame_info_ptr next_frame, +arm_pseudo_read_value (gdbarch *gdbarch, const frame_info_ptr &next_frame, const int pseudo_reg_num) { arm_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch); @@ -9909,7 +9909,7 @@ arm_neon_quad_write (struct gdbarch *gdbarch, struct = regcache *regcache, } =20 static void -arm_neon_quad_write (gdbarch *gdbarch, frame_info_ptr next_frame, +arm_neon_quad_write (gdbarch *gdbarch, const frame_info_ptr &next_frame, int quad_reg_index, gdb::array_view buf) { std::string raw_reg_name =3D string_printf ("d%d", quad_reg_index << 1); @@ -9923,7 +9923,7 @@ arm_neon_quad_write (gdbarch *gdbarch, frame_info_ptr= next_frame, /* Store the contents of BUF to the MVE pseudo register REGNUM. */ =20 static void -arm_mve_pseudo_write (gdbarch *gdbarch, frame_info_ptr next_frame, +arm_mve_pseudo_write (gdbarch *gdbarch, const frame_info_ptr &next_frame, int pseudo_reg_num, gdb::array_view buf) { arm_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch); @@ -9933,7 +9933,7 @@ arm_mve_pseudo_write (gdbarch *gdbarch, frame_info_pt= r next_frame, } =20 static void -arm_pseudo_write (gdbarch *gdbarch, frame_info_ptr next_frame, +arm_pseudo_write (gdbarch *gdbarch, const frame_info_ptr &next_frame, const int pseudo_reg_num, gdb::array_view buf) { @@ -9973,7 +9973,7 @@ arm_pseudo_write (gdbarch *gdbarch, frame_info_ptr ne= xt_frame, } =20 static struct value * -value_of_arm_user_reg (frame_info_ptr frame, const void *baton) +value_of_arm_user_reg (const frame_info_ptr &frame, const void *baton) { const int *reg_p =3D (const int *) baton; return value_of_register (*reg_p, get_next_frame_sentinel_okay (frame)); @@ -10067,7 +10067,7 @@ arm_register_g_packet_guesses (struct gdbarch *gdba= rch) /* Implement the code_of_frame_writable gdbarch method. */ =20 static int -arm_code_of_frame_writable (struct gdbarch *gdbarch, frame_info_ptr frame) +arm_code_of_frame_writable (struct gdbarch *gdbarch, const frame_info_ptr = &frame) { arm_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch); =20 @@ -10095,7 +10095,7 @@ arm_gnu_triplet_regexp (struct gdbarch *gdbarch) /* Implement the "get_pc_address_flags" gdbarch method. */ =20 static std::string -arm_get_pc_address_flags (frame_info_ptr frame, CORE_ADDR pc) +arm_get_pc_address_flags (const frame_info_ptr &frame, CORE_ADDR pc) { if (get_frame_pc_masked (frame)) return "PAC"; diff --git a/gdb/arm-tdep.h b/gdb/arm-tdep.h index 506387b529d..11839b0ff4d 100644 --- a/gdb/arm-tdep.h +++ b/gdb/arm-tdep.h @@ -279,7 +279,7 @@ extern void arm_displaced_step_copy_insn_closure *dsc, int regno, ULONGEST val, enum pc_write_style write_pc); =20 -CORE_ADDR arm_skip_stub (frame_info_ptr, CORE_ADDR); +CORE_ADDR arm_skip_stub (const frame_info_ptr &, CORE_ADDR); =20 ULONGEST arm_get_next_pcs_read_memory_unsigned_integer (CORE_ADDR memaddr, int len, @@ -292,7 +292,7 @@ int arm_get_next_pcs_is_thumb (struct arm_get_next_pcs = *self); =20 std::vector arm_software_single_step (struct regcache *); int arm_is_thumb (struct regcache *regcache); -int arm_frame_is_thumb (frame_info_ptr frame); +int arm_frame_is_thumb (const frame_info_ptr &frame); =20 extern void arm_displaced_step_fixup (struct gdbarch *, displaced_step_copy_insn_closure *, diff --git a/gdb/arm-wince-tdep.c b/gdb/arm-wince-tdep.c index a31da71de08..b722851e7e1 100644 --- a/gdb/arm-wince-tdep.c +++ b/gdb/arm-wince-tdep.c @@ -36,7 +36,7 @@ static const gdb_byte arm_wince_thumb_le_breakpoint[] =3D= { 0xfe, 0xdf }; #define ARM_WINCE_JB_PC 10 =20 static CORE_ADDR -arm_pe_skip_trampoline_code (frame_info_ptr frame, CORE_ADDR pc) +arm_pe_skip_trampoline_code (const frame_info_ptr &frame, CORE_ADDR pc) { struct gdbarch *gdbarch =3D get_frame_arch (frame); enum bfd_endian byte_order =3D gdbarch_byte_order (gdbarch); diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 63b45be7563..2d38f41cd7f 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -979,7 +979,7 @@ avr_return_value (struct gdbarch *gdbarch, struct value= *function, for it IS the sp for the next frame. */ =20 static struct avr_unwind_cache * -avr_frame_unwind_cache (frame_info_ptr this_frame, +avr_frame_unwind_cache (const frame_info_ptr &this_frame, void **this_prologue_cache) { CORE_ADDR start_pc, current_pc; @@ -1059,7 +1059,7 @@ avr_frame_unwind_cache (frame_info_ptr this_frame, } =20 static CORE_ADDR -avr_unwind_pc (struct gdbarch *gdbarch, frame_info_ptr next_frame) +avr_unwind_pc (struct gdbarch *gdbarch, const frame_info_ptr &next_frame) { ULONGEST pc; =20 @@ -1069,7 +1069,7 @@ avr_unwind_pc (struct gdbarch *gdbarch, frame_info_pt= r next_frame) } =20 static CORE_ADDR -avr_unwind_sp (struct gdbarch *gdbarch, frame_info_ptr next_frame) +avr_unwind_sp (struct gdbarch *gdbarch, const frame_info_ptr &next_frame) { ULONGEST sp; =20 @@ -1082,7 +1082,7 @@ avr_unwind_sp (struct gdbarch *gdbarch, frame_info_pt= r next_frame) frame. This will be used to create a new GDB frame struct. */ =20 static void -avr_frame_this_id (frame_info_ptr this_frame, +avr_frame_this_id (const frame_info_ptr &this_frame, void **this_prologue_cache, struct frame_id *this_id) { @@ -1107,7 +1107,7 @@ avr_frame_this_id (frame_info_ptr this_frame, } =20 static struct value * -avr_frame_prev_register (frame_info_ptr this_frame, +avr_frame_prev_register (const frame_info_ptr &this_frame, void **this_prologue_cache, int regnum) { struct avr_unwind_cache *info @@ -1166,7 +1166,7 @@ static const struct frame_unwind avr_frame_unwind =3D= { }; =20 static CORE_ADDR -avr_frame_base_address (frame_info_ptr this_frame, void **this_cache) +avr_frame_base_address (const frame_info_ptr &this_frame, void **this_cach= e) { struct avr_unwind_cache *info =3D avr_frame_unwind_cache (this_frame, this_cache); @@ -1186,7 +1186,7 @@ static const struct frame_base avr_frame_base =3D { save_dummy_frame_tos(), and the PC match the dummy frame's breakpoint. = */ =20 static struct frame_id -avr_dummy_id (struct gdbarch *gdbarch, frame_info_ptr this_frame) +avr_dummy_id (struct gdbarch *gdbarch, const frame_info_ptr &this_frame) { ULONGEST base; =20 diff --git a/gdb/bfin-linux-tdep.c b/gdb/bfin-linux-tdep.c index 35fdf3f2acb..31aa14765ae 100644 --- a/gdb/bfin-linux-tdep.c +++ b/gdb/bfin-linux-tdep.c @@ -95,7 +95,7 @@ static const int bfin_linux_sigcontext_reg_offset[BFIN_NU= M_REGS] =3D =20 static void bfin_linux_sigframe_init (const struct tramp_frame *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, struct trad_frame_cache *this_cache, CORE_ADDR func) { diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c index 877fd94d7df..357866ef953 100644 --- a/gdb/bfin-tdep.c +++ b/gdb/bfin-tdep.c @@ -288,7 +288,7 @@ bfin_alloc_frame_cache (void) } =20 static struct bfin_frame_cache * -bfin_frame_cache (frame_info_ptr this_frame, void **this_cache) +bfin_frame_cache (const frame_info_ptr &this_frame, void **this_cache) { struct bfin_frame_cache *cache; int i; @@ -340,7 +340,7 @@ bfin_frame_cache (frame_info_ptr this_frame, void **thi= s_cache) } =20 static void -bfin_frame_this_id (frame_info_ptr this_frame, +bfin_frame_this_id (const frame_info_ptr &this_frame, void **this_cache, struct frame_id *this_id) { @@ -355,7 +355,7 @@ bfin_frame_this_id (frame_info_ptr this_frame, } =20 static struct value * -bfin_frame_prev_register (frame_info_ptr this_frame, +bfin_frame_prev_register (const frame_info_ptr &this_frame, void **this_cache, int regnum) { @@ -724,7 +724,7 @@ bfin_pseudo_register_write (struct gdbarch *gdbarch, st= ruct regcache *regcache, } =20 static CORE_ADDR -bfin_frame_base_address (frame_info_ptr this_frame, void **this_cache) +bfin_frame_base_address (const frame_info_ptr &this_frame, void **this_cac= he) { struct bfin_frame_cache *cache =3D bfin_frame_cache (this_frame, this_ca= che); =20 @@ -732,7 +732,7 @@ bfin_frame_base_address (frame_info_ptr this_frame, voi= d **this_cache) } =20 static CORE_ADDR -bfin_frame_local_address (frame_info_ptr this_frame, void **this_cache) +bfin_frame_local_address (const frame_info_ptr &this_frame, void **this_ca= che) { struct bfin_frame_cache *cache =3D bfin_frame_cache (this_frame, this_ca= che); =20 @@ -740,7 +740,7 @@ bfin_frame_local_address (frame_info_ptr this_frame, vo= id **this_cache) } =20 static CORE_ADDR -bfin_frame_args_address (frame_info_ptr this_frame, void **this_cache) +bfin_frame_args_address (const frame_info_ptr &this_frame, void **this_cac= he) { struct bfin_frame_cache *cache =3D bfin_frame_cache (this_frame, this_ca= che); =20 diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 6076ad64a4a..451818332de 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -52,7 +52,7 @@ slot instruction. */ =20 const struct block * -get_frame_block (frame_info_ptr frame, CORE_ADDR *addr_in_block) +get_frame_block (const frame_info_ptr &frame, CORE_ADDR *addr_in_block) { CORE_ADDR pc; const struct block *bl; @@ -115,7 +115,7 @@ get_pc_function_start (CORE_ADDR pc) /* Return the symbol for the function executing in frame FRAME. */ =20 struct symbol * -get_frame_function (frame_info_ptr frame) +get_frame_function (const frame_info_ptr &frame) { const struct block *bl =3D get_frame_block (frame, 0); =20 diff --git a/gdb/bpf-tdep.c b/gdb/bpf-tdep.c index 4409a1e696c..1b3f3e72c5b 100644 --- a/gdb/bpf-tdep.c +++ b/gdb/bpf-tdep.c @@ -154,7 +154,7 @@ bpf_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR s= tart_pc) /* Given THIS_FRAME, return its ID. */ =20 static void -bpf_frame_this_id (frame_info_ptr this_frame, +bpf_frame_this_id (const frame_info_ptr &this_frame, void **this_prologue_cache, struct frame_id *this_id) { @@ -165,7 +165,7 @@ bpf_frame_this_id (frame_info_ptr this_frame, /* Return the reason why we can't unwind past THIS_FRAME. */ =20 static enum unwind_stop_reason -bpf_frame_unwind_stop_reason (frame_info_ptr this_frame, +bpf_frame_unwind_stop_reason (const frame_info_ptr &this_frame, void **this_cache) { return UNWIND_OUTERMOST; @@ -174,7 +174,7 @@ bpf_frame_unwind_stop_reason (frame_info_ptr this_frame, /* Ask THIS_FRAME to unwind its register. */ =20 static struct value * -bpf_frame_prev_register (frame_info_ptr this_frame, +bpf_frame_prev_register (const frame_info_ptr &this_frame, void **this_prologue_cache, int regnum) { return frame_unwind_got_register (this_frame, regnum, regnum); @@ -235,7 +235,7 @@ bpf_sw_breakpoint_from_kind (struct gdbarch *gdbarch, i= nt kind, int *size) /* Assuming THIS_FRAME is a dummy frame, return its frame ID. */ =20 static struct frame_id -bpf_dummy_id (struct gdbarch *gdbarch, frame_info_ptr this_frame) +bpf_dummy_id (struct gdbarch *gdbarch, const frame_info_ptr &this_frame) { CORE_ADDR sp =3D get_frame_register_unsigned (this_frame, gdbarch_sp_regnum (gdbarch)); diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c index a6de59bf292..882c1a03fe2 100644 --- a/gdb/cp-abi.c +++ b/gdb/cp-abi.c @@ -153,7 +153,7 @@ cplus_make_method_ptr (struct type *type, gdb_byte *con= tents, } =20 CORE_ADDR -cplus_skip_trampoline (frame_info_ptr frame, +cplus_skip_trampoline (const frame_info_ptr &frame, CORE_ADDR stop_pc) { if (current_cp_abi.skip_trampoline =3D=3D NULL) diff --git a/gdb/cp-abi.h b/gdb/cp-abi.h index a993e1dd18a..fdbe4843129 100644 --- a/gdb/cp-abi.h +++ b/gdb/cp-abi.h @@ -204,7 +204,7 @@ extern std::string cplus_typename_from_type_info (struc= t value *value); address of the routine we are thunking to and continue to there instead. */ =20 -CORE_ADDR cplus_skip_trampoline (frame_info_ptr frame, +CORE_ADDR cplus_skip_trampoline (const frame_info_ptr &frame, CORE_ADDR stop_pc); =20 /* Return a struct that provides pass-by-reference information @@ -247,7 +247,7 @@ struct cp_abi_ops struct type *(*get_typeid_type) (struct gdbarch *gdbarch); struct type *(*get_type_from_type_info) (struct value *value); std::string (*get_typename_from_type_info) (struct value *value); - CORE_ADDR (*skip_trampoline) (frame_info_ptr, CORE_ADDR); + CORE_ADDR (*skip_trampoline) (const frame_info_ptr &, CORE_ADDR); struct language_pass_by_ref_info (*pass_by_reference) (struct type *type= ); }; =20 diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 1f108740ad2..02c35da723d 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -193,7 +193,7 @@ static const unsigned short rt_sigtramp_code[] =3D the routine. Otherwise, return 0. */ =20 static CORE_ADDR -cris_sigtramp_start (frame_info_ptr this_frame) +cris_sigtramp_start (const frame_info_ptr &this_frame) { CORE_ADDR pc =3D get_frame_pc (this_frame); gdb_byte buf[SIGTRAMP_LEN]; @@ -221,7 +221,7 @@ cris_sigtramp_start (frame_info_ptr this_frame) the routine. Otherwise, return 0. */ =20 static CORE_ADDR -cris_rt_sigtramp_start (frame_info_ptr this_frame) +cris_rt_sigtramp_start (const frame_info_ptr &this_frame) { CORE_ADDR pc =3D get_frame_pc (this_frame); gdb_byte buf[SIGTRAMP_LEN]; @@ -249,7 +249,7 @@ cris_rt_sigtramp_start (frame_info_ptr this_frame) return the address of the associated sigcontext structure. */ =20 static CORE_ADDR -cris_sigcontext_addr (frame_info_ptr this_frame) +cris_sigcontext_addr (const frame_info_ptr &this_frame) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); enum bfd_endian byte_order =3D gdbarch_byte_order (gdbarch); @@ -309,7 +309,7 @@ struct cris_unwind_cache }; =20 static struct cris_unwind_cache * -cris_sigtramp_frame_unwind_cache (frame_info_ptr this_frame, +cris_sigtramp_frame_unwind_cache (const frame_info_ptr &this_frame, void **this_cache) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); @@ -402,7 +402,7 @@ cris_sigtramp_frame_unwind_cache (frame_info_ptr this_f= rame, } =20 static void -cris_sigtramp_frame_this_id (frame_info_ptr this_frame, void **this_cache, +cris_sigtramp_frame_this_id (const frame_info_ptr &this_frame, void **this= _cache, struct frame_id *this_id) { struct cris_unwind_cache *cache =3D @@ -412,10 +412,10 @@ cris_sigtramp_frame_this_id (frame_info_ptr this_fram= e, void **this_cache, =20 /* Forward declaration. */ =20 -static struct value *cris_frame_prev_register (frame_info_ptr this_frame, +static struct value *cris_frame_prev_register (const frame_info_ptr &this_= frame, void **this_cache, int regnum); static struct value * -cris_sigtramp_frame_prev_register (frame_info_ptr this_frame, +cris_sigtramp_frame_prev_register (const frame_info_ptr &this_frame, void **this_cache, int regnum) { /* Make sure we've initialized the cache. */ @@ -425,7 +425,7 @@ cris_sigtramp_frame_prev_register (frame_info_ptr this_= frame, =20 static int cris_sigtramp_frame_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, void **this_cache) { if (cris_sigtramp_start (this_frame)=20 @@ -448,7 +448,7 @@ static const struct frame_unwind cris_sigtramp_frame_un= wind =3D =20 static int crisv32_single_step_through_delay (struct gdbarch *gdbarch, - frame_info_ptr this_frame) + const frame_info_ptr &this_frame) { cris_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch); ULONGEST erp; @@ -645,11 +645,11 @@ static void set_cris_dwarf2_cfi (const char *ignore_a= rgs, int from_tty, struct cmd_list_element *c); =20 static CORE_ADDR cris_scan_prologue (CORE_ADDR pc,=20 - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, struct cris_unwind_cache *info); =20 static CORE_ADDR crisv32_scan_prologue (CORE_ADDR pc,=20 - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, struct cris_unwind_cache *info); =20 /* When arguments must be pushed onto the stack, they go on in reverse @@ -692,7 +692,7 @@ pop_stack_item (struct cris_stack_item *si) for it IS the sp for the next frame. */ =20 static struct cris_unwind_cache * -cris_frame_unwind_cache (frame_info_ptr this_frame, +cris_frame_unwind_cache (const frame_info_ptr &this_frame, void **this_prologue_cache) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); @@ -729,7 +729,7 @@ cris_frame_unwind_cache (frame_info_ptr this_frame, frame. This will be used to create a new GDB frame struct. */ =20 static void -cris_frame_this_id (frame_info_ptr this_frame, +cris_frame_this_id (const frame_info_ptr &this_frame, void **this_prologue_cache, struct frame_id *this_id) { @@ -755,7 +755,7 @@ cris_frame_this_id (frame_info_ptr this_frame, } =20 static struct value * -cris_frame_prev_register (frame_info_ptr this_frame, +cris_frame_prev_register (const frame_info_ptr &this_frame, void **this_prologue_cache, int regnum) { struct cris_unwind_cache *info @@ -912,7 +912,7 @@ static const struct frame_unwind cris_frame_unwind =3D }; =20 static CORE_ADDR -cris_frame_base_address (frame_info_ptr this_frame, void **this_cache) +cris_frame_base_address (const frame_info_ptr &this_frame, void **this_cac= he) { struct cris_unwind_cache *info =3D cris_frame_unwind_cache (this_frame, this_cache); @@ -1004,7 +1004,7 @@ static const struct frame_base cris_frame_base =3D determine that it is a prologue (1). */ =20 static CORE_ADDR=20 -cris_scan_prologue (CORE_ADDR pc, frame_info_ptr this_frame, +cris_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame, struct cris_unwind_cache *info) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); @@ -1287,7 +1287,7 @@ cris_scan_prologue (CORE_ADDR pc, frame_info_ptr this= _frame, } =20 static CORE_ADDR=20 -crisv32_scan_prologue (CORE_ADDR pc, frame_info_ptr this_frame, +crisv32_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame, struct cris_unwind_cache *info) { struct gdbarch *gdbarch =3D get_frame_arch (this_frame); @@ -1756,7 +1756,7 @@ cris_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, i= nt reg) static void cris_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum, struct dwarf2_frame_state_reg *reg, - frame_info_ptr this_frame) + const frame_info_ptr &this_frame) { /* The return address column. */ if (regnum =3D=3D gdbarch_pc_regnum (gdbarch)) diff --git a/gdb/csky-linux-tdep.c b/gdb/csky-linux-tdep.c index d3105dc5475..d485f176317 100644 --- a/gdb/csky-linux-tdep.c +++ b/gdb/csky-linux-tdep.c @@ -310,7 +310,7 @@ csky_linux_iterate_over_regset_sections (struct gdbarch= *gdbarch, =20 static void csky_linux_rt_sigreturn_init (const struct tramp_frame *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, struct trad_frame_cache *this_cache, CORE_ADDR func) { @@ -355,7 +355,7 @@ csky_linux_rt_sigreturn_tramp_frame =3D { =20 static void csky_linux_rt_sigreturn_init_pt_regs (const struct tramp_frame *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, struct trad_frame_cache *this_cache, CORE_ADDR func) { diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c index 2aa6c0abcb8..c1ce8a5b02c 100644 --- a/gdb/csky-tdep.c +++ b/gdb/csky-tdep.c @@ -958,7 +958,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc, CORE_ADDR limit_pc, CORE_ADDR end_pc, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, struct csky_unwind_cache *this_cache, lr_type_t lr_type) { @@ -2063,7 +2063,7 @@ csky_analyze_lr_type (struct gdbarch *gdbarch, /* Heuristic unwinder. */ =20 static struct csky_unwind_cache * -csky_frame_unwind_cache (frame_info_ptr this_frame) +csky_frame_unwind_cache (const frame_info_ptr &this_frame) { CORE_ADDR prologue_start, prologue_end, func_end, prev_pc, block_addr; struct csky_unwind_cache *cache; @@ -2122,7 +2122,7 @@ csky_frame_unwind_cache (frame_info_ptr this_frame) /* Implement the this_id function for the normal unwinder. */ =20 static void -csky_frame_this_id (frame_info_ptr this_frame, +csky_frame_this_id (const frame_info_ptr &this_frame, void **this_prologue_cache, struct frame_id *this_id) { struct csky_unwind_cache *cache; @@ -2143,7 +2143,7 @@ csky_frame_this_id (frame_info_ptr this_frame, /* Implement the prev_register function for the normal unwinder. */ =20 static struct value * -csky_frame_prev_register (frame_info_ptr this_frame, +csky_frame_prev_register (const frame_info_ptr &this_frame, void **this_prologue_cache, int regnum) { struct csky_unwind_cache *cache; @@ -2172,7 +2172,7 @@ static const struct frame_unwind csky_unwind_cache = =3D { }; =20 static CORE_ADDR -csky_check_long_branch (frame_info_ptr frame, CORE_ADDR pc) +csky_check_long_branch (const frame_info_ptr &frame, CORE_ADDR pc) { gdb_byte buf[8]; struct gdbarch *gdbarch =3D get_frame_arch (frame); @@ -2209,7 +2209,7 @@ csky_check_long_branch (frame_info_ptr frame, CORE_AD= DR pc) =20 static int csky_stub_unwind_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, void **this_prologue_cache) { CORE_ADDR addr_in_block, pc; @@ -2240,7 +2240,7 @@ csky_stub_unwind_sniffer (const struct frame_unwind *= self, } =20 static struct csky_unwind_cache * -csky_make_stub_cache (frame_info_ptr this_frame) +csky_make_stub_cache (const frame_info_ptr &this_frame) { struct csky_unwind_cache *cache; =20 @@ -2252,7 +2252,7 @@ csky_make_stub_cache (frame_info_ptr this_frame) } =20 static void -csky_stub_this_id (frame_info_ptr this_frame, +csky_stub_this_id (const frame_info_ptr &this_frame, void **this_cache, struct frame_id *this_id) { @@ -2267,7 +2267,7 @@ csky_stub_this_id (frame_info_ptr this_frame, } =20 static struct value * -csky_stub_prev_register (frame_info_ptr this_frame, +csky_stub_prev_register (const frame_info_ptr &this_frame, void **this_cache, int prev_regnum) { @@ -2307,7 +2307,7 @@ static frame_unwind csky_stub_unwind =3D { for the normal unwinder. */ =20 static CORE_ADDR -csky_frame_base_address (frame_info_ptr this_frame, void **this_cache) +csky_frame_base_address (const frame_info_ptr &this_frame, void **this_cac= he) { struct csky_unwind_cache *cache; =20 @@ -2330,7 +2330,7 @@ static const struct frame_base csky_frame_base =3D { static void csky_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum, struct dwarf2_frame_state_reg *reg, - frame_info_ptr this_frame) + const frame_info_ptr &this_frame) { if (regnum =3D=3D gdbarch_pc_regnum (gdbarch)) reg->how =3D DWARF2_FRAME_REG_RA; diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c index 8bde53ea8fd..5757de1cf77 100644 --- a/gdb/dtrace-probe.c +++ b/gdb/dtrace-probe.c @@ -129,7 +129,7 @@ public: =20 /* See probe.h. */ struct value *evaluate_argument (unsigned n, - frame_info_ptr frame) override; + const frame_info_ptr &frame) override; =20 /* See probe.h. */ void compile_to_ax (struct agent_expr *aexpr, @@ -708,7 +708,7 @@ dtrace_probe::can_evaluate_arguments () const =20 struct value * dtrace_probe::evaluate_argument (unsigned n, - frame_info_ptr frame) + const frame_info_ptr &frame) { struct gdbarch *gdbarch =3D this->get_gdbarch (); struct dtrace_probe_arg *arg; diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c index 309483d95d4..5969ef2cdad 100644 --- a/gdb/dummy-frame.c +++ b/gdb/dummy-frame.c @@ -288,7 +288,7 @@ struct dummy_frame_cache =20 static int dummy_frame_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, + const frame_info_ptr &this_frame, void **this_prologue_cache) { /* When unwinding a normal frame, the stack structure is determined @@ -334,7 +334,7 @@ dummy_frame_sniffer (const struct frame_unwind *self, register value is taken from the local copy of the register buffer. */ =20 static struct value * -dummy_frame_prev_register (frame_info_ptr this_frame, +dummy_frame_prev_register (const frame_info_ptr &this_frame, void **this_prologue_cache, int regnum) { @@ -364,7 +364,7 @@ dummy_frame_prev_register (frame_info_ptr this_frame, dummy cache is located and saved in THIS_PROLOGUE_CACHE. */ =20 static void -dummy_frame_this_id (frame_info_ptr this_frame, +dummy_frame_this_id (const frame_info_ptr &this_frame, void **this_prologue_cache, struct frame_id *this_id) { @@ -390,7 +390,7 @@ const struct frame_unwind dummy_frame_unwind =3D /* See dummy-frame.h. */ =20 struct frame_id -default_dummy_id (struct gdbarch *gdbarch, frame_info_ptr this_frame) +default_dummy_id (struct gdbarch *gdbarch, const frame_info_ptr &this_fram= e) { CORE_ADDR sp, pc; =20 diff --git a/gdb/dummy-frame.h b/gdb/dummy-frame.h index 753be1aa54c..7d963ad9beb 100644 --- a/gdb/dummy-frame.h +++ b/gdb/dummy-frame.h @@ -78,6 +78,6 @@ extern int find_dummy_frame_dtor (dummy_frame_dtor_ftype = *dtor, for THIS_FRAME assuming that the frame is a dummy frame. */ =20 extern struct frame_id default_dummy_id (struct gdbarch *gdbarch, - frame_info_ptr this_frame); + const frame_info_ptr &this_frame); =20 #endif /* !defined (DUMMY_FRAME_H) */ diff --git a/gdb/dwarf2/ada-imported.c b/gdb/dwarf2/ada-imported.c index 1a0bc1d528e..065e2b90a0f 100644 --- a/gdb/dwarf2/ada-imported.c +++ b/gdb/dwarf2/ada-imported.c @@ -32,7 +32,7 @@ get_imported_name (const struct symbol *sym) /* Implement the read_variable method from symbol_computed_ops. */ =20 static struct value * -ada_imported_read_variable (struct symbol *symbol, frame_info_ptr frame) +ada_imported_read_variable (struct symbol *symbol, const frame_info_ptr &f= rame) { const char *name =3D get_imported_name (symbol); bound_minimal_symbol minsym =3D lookup_minimal_symbol_linkage (name, fal= se); diff --git a/gdb/dwarf2/call-site.h b/gdb/dwarf2/call-site.h index 5434c845260..0a0c7e83b81 100644 --- a/gdb/dwarf2/call-site.h +++ b/gdb/dwarf2/call-site.h @@ -94,7 +94,7 @@ struct call_site_target =20 void iterate_over_addresses (struct gdbarch *call_site_gdbarch, const struct call_site *call_site, - frame_info_ptr caller_frame, + const frame_info_ptr &caller_frame, iterate_ftype callback) const; =20 private: @@ -201,7 +201,7 @@ struct call_site throw NO_ENTRY_VALUE_ERROR. */ =20 void iterate_over_addresses (struct gdbarch *call_site_gdbarch, - frame_info_ptr caller_frame, + const frame_info_ptr &caller_frame, call_site_target::iterate_ftype callback) const { diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c index 9cfae104f31..d0256e7009d 100644 --- a/gdb/dwarf2/expr.c +++ b/gdb/dwarf2/expr.c @@ -49,7 +49,7 @@ static const registry::key = dwarf_arch_cookie; /* Ensure that a FRAME is defined, throw an exception otherwise. */ =20 static void -ensure_have_frame (frame_info_ptr frame, const char *op_name) +ensure_have_frame (const frame_info_ptr &frame, const char *op_name) { if (frame =3D=3D nullptr) throw_error (GENERIC_ERROR, @@ -78,7 +78,7 @@ bits_to_bytes (ULONGEST start, ULONGEST n_bits) /* See expr.h. */ =20 CORE_ADDR -read_addr_from_reg (frame_info_ptr frame, int reg) +read_addr_from_reg (const frame_info_ptr &frame, int reg) { struct gdbarch *gdbarch =3D get_frame_arch (frame); int regnum =3D dwarf_reg_to_regnum_or_error (gdbarch, reg); @@ -112,7 +112,7 @@ static piece_closure * allocate_piece_closure (dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, std::vector &&pieces, - frame_info_ptr frame) + const frame_info_ptr &frame) { piece_closure *c =3D new piece_closure; =20 @@ -1076,7 +1076,7 @@ dwarf_expr_context::fetch_result (struct type *type, = struct type *subobj_type, =20 value * dwarf_expr_context::evaluate (const gdb_byte *addr, size_t len, bool as_lv= al, - dwarf2_per_cu_data *per_cu, frame_info_ptr frame, + dwarf2_per_cu_data *per_cu, const frame_info_ptr &frame, const struct property_addr_info *addr_info, struct type *type, struct type *subobj_type, LONGEST subobj_offset) diff --git a/gdb/dwarf2/expr.h b/gdb/dwarf2/expr.h index 6acd07811f8..b02cc531640 100644 --- a/gdb/dwarf2/expr.h +++ b/gdb/dwarf2/expr.h @@ -137,7 +137,7 @@ struct dwarf_expr_context The ADDR_INFO property can be specified to override the range of memory addresses with the passed in buffer. */ value *evaluate (const gdb_byte *addr, size_t len, bool as_lval, - dwarf2_per_cu_data *per_cu, frame_info_ptr frame, [...] [diff truncated at 100000 bytes]