From patchwork Thu Mar 15 21:51:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 26331 Received: (qmail 66152 invoked by alias); 15 Mar 2018 21:51:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 66032 invoked by uid 89); 15 Mar 2018 21:51:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=manipulation X-HELO: mail-wm0-f46.google.com Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com) (74.125.82.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 15 Mar 2018 21:51:39 +0000 Received: by mail-wm0-f46.google.com with SMTP id x7so13245796wmc.0 for ; Thu, 15 Mar 2018 14:51:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=6zVxeKlQzQFW4n/GDJwM9dJt95YrdRAEsam5c6bHXZw=; b=lZDkuaIXNLs+RWTYk8ZOUyGBLP6wYAkd5JrzsRH5vnEr2ruehkmWEju4NdWO4288vT eiMZFxW9cM4PKKXEl1Km32QGlMjjnoALlyn83b5UEISvnH93ZiWz5aDyJxbkueRvkORd TtXudJL4HhQ26avVfZ3N+7rVOBTkE2DtykRQ+4BP1cRRSFs230AFcgAkuFrzDe+m5Fqi SJOnLGNWyqc2o6BdvE/r0Y/WRIM8it/G+MEi4u1J8xTt7l7L8QoLMvdhkkWQG7Y1igow UvXiNvNvkM3aRb4wvTbldGFEqfHPMm1d8jp80yJbWbL9+HY9t4Il+n43P2BqF55mInrt M8qg== X-Gm-Message-State: AElRT7HonmyV69AoxEYsk6M4TtRgL8rou2joZgsXrx2yLEHdylqJymrS HFivguRxHUynIpbICqKNbRhC7pGs X-Google-Smtp-Source: AG47ELs583/ja37IuNR97wR/F74Xubei6GSZGnLZVgCYpMDUzLZPpWsje+waOVHDvn7xsDmShaNy/w== X-Received: by 10.28.190.19 with SMTP id o19mr5988780wmf.53.1521150695782; Thu, 15 Mar 2018 14:51:35 -0700 (PDT) Received: from localhost (host86-177-103-167.range86-177.btcentralplus.com. [86.177.103.167]) by smtp.gmail.com with ESMTPSA id f14sm6030919wmi.11.2018.03.15.14.51.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Mar 2018 14:51:34 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Yao Qi , Simon Marchi , Andrew Burgess Subject: [PATCHv2 4/4] gdb: Supply default gdbarch_unwind_sp and use where possible Date: Thu, 15 Mar 2018 21:51:24 +0000 Message-Id: <521fbe45f552c74f4c0c6d25357d4a1a819136cf.1521149611.git.andrew.burgess@embecosm.com> In-Reply-To: References: In-Reply-To: References: <20180307220420.23307-1-andrew.burgess@embecosm.com> X-IsSubscribed: yes Most unwind_sp methods follow the same pattern. This commit provides a default implementation of gdbarch_unwind_sp and switches targets over to this method where possible. gdb/ChangeLog: * aarch64-tdep.c (aarch64_unwind_sp): Delete. (aarch64_gdbarch_init): Don't call set_gdbarch_unwind_sp. * arm-tdep.c (arm_unwind_sp): Delete. (arm_gdbarch_init): Don't call set_gdbarch_unwind_sp. * cris-tdep.c (cris_unwind_sp): Delete. (cris_gdbarch_init): Don't call set_gdbarch_unwind_sp. * frame-unwind.c (default_unwind_sp): Define new function. * frame-unwind.h (default_unwind_sp): Declare new function. * frame.c (get_frame_sp): Assume gdbarch_unwind_sp is always available. * frv-tdep.c (frv_unwind_sp): Delete. (frv_gdbarch_init): Don't call set_gdbarch_unwind_sp. * ft32-tdep.c (ft32_unwind_sp): Delete. (ft32_gdbarch_init): Don't call set_gdbarch_unwind_sp. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * gdbarch.sh: Update 'unwind_sp', remove predicate, and supply a default method name. * h8300-tdep.c (h8300_unwind_sp): Delete. (h8300_gdbarch_init): Don't call set_gdbarch_unwind_sp. * iq2000-tdep.c (iq2000_unwind_sp): Delete. (iq2000_gdbarch_init): Don't call set_gdbarch_unwind_sp. * lm32-tdep.c (lm32_unwind_sp): Delete. (lm32_gdbarch_init): Don't call set_gdbarch_unwind_sp. * m32r-tdep.c (m32r_unwind_sp): Delete. (m32r_gdbarch_init): Don't call set_gdbarch_unwind_sp. * m68hc11-tdep.c (m68hc11_unwind_sp): Delete. (m68hc11_gdbarch_init): Don't call set_gdbarch_unwind_sp. * mep-tdep.c (mep_unwind_sp): Delete. (mep_gdbarch_init): Don't call set_gdbarch_unwind_sp. * mn10300-tdep.c (mn10300_unwind_sp): Delete. (mn10300_frame_unwind_init): Don't call set_gdbarch_unwind_sp. (mn10300_push_dummy_call): Call gdbarch_unwind_sp instead. * moxie-tdep.c (moxie_unwind_sp): Delete. (moxie_gdbarch_init): Don't call set_gdbarch_unwind_sp. * msp430-tdep.c (msp430_unwind_sp): Delete. (msp430_gdbarch_init): Don't call set_gdbarch_unwind_sp. * nds32-tdep.c (nds32_unwind_sp): Delete. (nds32_gdbarch_init): Don't call set_gdbarch_unwind_sp. * nios2-tdep.c (nios2_unwind_sp): Delete. (nios2_gdbarch_init): Don't call set_gdbarch_unwind_sp. * riscv-tdep.c (riscv_unwind_sp): Delete. (riscv_gdbarch_init): Don't call set_gdbarch_unwind_sp. * rl78-tdep.c (rl78_unwind_sp): Delete. (rl78_gdbarch_init): Don't call set_gdbarch_unwind_sp. * rx-tdep.c (rx_unwind_sp): Delete. (rx_gdbarch_init): Don't call set_gdbarch_unwind_sp. * score-tdep.c (score_unwind_sp): Delete. (score_gdbarch_init): Don't call set_gdbarch_unwind_sp. * sh-tdep.c (sh_unwind_sp): Delete. (sh_gdbarch_init): Don't call set_gdbarch_unwind_sp. * sh64-tdep.c (sh64_unwind_sp): Delete. (sh64_gdbarch_init): Don't call set_gdbarch_unwind_sp. * tic6x-tdep.c (tic6x_unwind_sp): Delete. (tic6x_gdbarch_init): Don't call set_gdbarch_unwind_sp. * tilegx-tdep.c (tilegx_unwind_sp): Delete. (tilegx_gdbarch_init): Don't call set_gdbarch_unwind_sp. * v850-tdep.c (v850_unwind_sp): Delete. (v850_gdbarch_init): Don't call set_gdbarch_unwind_sp. * xstormy16-tdep.c (xstormy16_unwind_sp): Delete. (xstormy16_gdbarch_init): Don't call set_gdbarch_unwind_sp. --- gdb/ChangeLog | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ gdb/aarch64-tdep.c | 11 --------- gdb/arm-tdep.c | 9 -------- gdb/cris-tdep.c | 14 ------------ gdb/frame-unwind.c | 11 +++++++++ gdb/frame-unwind.h | 6 +++++ gdb/frame.c | 15 +++--------- gdb/frv-tdep.c | 7 ------ gdb/ft32-tdep.c | 10 -------- gdb/gdbarch.c | 13 ++--------- gdb/gdbarch.h | 2 -- gdb/gdbarch.sh | 2 +- gdb/h8300-tdep.c | 7 ------ gdb/iq2000-tdep.c | 7 ------ gdb/lm32-tdep.c | 7 ------ gdb/m32r-tdep.c | 9 -------- gdb/m68hc11-tdep.c | 10 -------- gdb/mep-tdep.c | 11 --------- gdb/mn10300-tdep.c | 12 +--------- gdb/moxie-tdep.c | 10 -------- gdb/msp430-tdep.c | 9 -------- gdb/nds32-tdep.c | 9 -------- gdb/nios2-tdep.c | 10 -------- gdb/riscv-tdep.c | 11 --------- gdb/rl78-tdep.c | 9 -------- gdb/rx-tdep.c | 12 ---------- gdb/score-tdep.c | 7 ------ gdb/sh-tdep.c | 8 ------- gdb/sh64-tdep.c | 8 ------- gdb/tic6x-tdep.c | 11 --------- gdb/tilegx-tdep.c | 7 ------ gdb/v850-tdep.c | 8 ------- gdb/xstormy16-tdep.c | 7 ------ 33 files changed, 88 insertions(+), 265 deletions(-) diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 7b41ee0466c..f2fa7be2015 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -974,14 +974,6 @@ struct frame_base aarch64_normal_base = aarch64_normal_frame_base }; -/* Implement the "unwind_sp" gdbarch method. */ - -static CORE_ADDR -aarch64_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - return frame_unwind_register_unsigned (this_frame, AARCH64_SP_REGNUM); -} - /* Return the value of the REGNUM register in the previous frame of *THIS_FRAME. */ @@ -2913,9 +2905,6 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_push_dummy_call (gdbarch, aarch64_push_dummy_call); set_gdbarch_frame_align (gdbarch, aarch64_frame_align); - /* Frame handling. */ - set_gdbarch_unwind_sp (gdbarch, aarch64_unwind_sp); - /* Advance PC across function entry code. */ set_gdbarch_skip_prologue (gdbarch, aarch64_skip_prologue); diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index e8179e6699b..b1cb3fa6c14 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -3055,12 +3055,6 @@ struct frame_base arm_normal_base = { arm_normal_frame_base }; -static CORE_ADDR -arm_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - return frame_unwind_register_unsigned (this_frame, ARM_SP_REGNUM); -} - static struct value * arm_dwarf2_prev_register (struct frame_info *this_frame, void **this_cache, int regnum) @@ -9336,9 +9330,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_write_pc (gdbarch, arm_write_pc); - /* Frame handling. */ - set_gdbarch_unwind_sp (gdbarch, arm_unwind_sp); - frame_base_set_default (gdbarch, &arm_normal_base); /* Address manipulation. */ diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index fdcb6490c98..0e3401948ed 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -651,9 +651,6 @@ static CORE_ADDR crisv32_scan_prologue (CORE_ADDR pc, struct frame_info *this_frame, struct cris_unwind_cache *info); -static CORE_ADDR cris_unwind_sp (struct gdbarch *gdbarch, - struct frame_info *next_frame); - /* When arguments must be pushed onto the stack, they go on in reverse order. The below implements a FILO (stack) to do this. Copied from d10v-tdep.c. */ @@ -1358,15 +1355,6 @@ cris_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) return pc_after_prologue; } -static CORE_ADDR -cris_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - ULONGEST sp; - sp = frame_unwind_register_unsigned (next_frame, - gdbarch_sp_regnum (gdbarch)); - return sp; -} - /* Implement the breakpoint_kind_from_pc gdbarch method. */ static int @@ -4072,8 +4060,6 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_breakpoint_kind_from_pc (gdbarch, cris_breakpoint_kind_from_pc); set_gdbarch_sw_breakpoint_from_kind (gdbarch, cris_sw_breakpoint_from_kind); - set_gdbarch_unwind_sp (gdbarch, cris_unwind_sp); - if (tdep->cris_dwarf2_cfi == 1) { /* Hook in the Dwarf-2 frame sniffer. */ diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c index 052998a1c4d..cc1b1b832ae 100644 --- a/gdb/frame-unwind.c +++ b/gdb/frame-unwind.c @@ -214,6 +214,17 @@ default_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) return addr; } +/* Default unwind of the SP. */ + +CORE_ADDR +default_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) +{ + int sp_regnum; + + sp_regnum = gdbarch_sp_regnum (gdbarch); + return frame_unwind_register_unsigned (next_frame, sp_regnum); +} + /* Helper functions for value-based register unwinding. These return a (possibly lazy) value of the appropriate type. */ diff --git a/gdb/frame-unwind.h b/gdb/frame-unwind.h index 4dfc7bedcc6..3ca3fdfe727 100644 --- a/gdb/frame-unwind.h +++ b/gdb/frame-unwind.h @@ -76,6 +76,12 @@ enum unwind_stop_reason extern CORE_ADDR default_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame); +/* A default unwind_sp callback that simply unwinds the register identified + by GDBARCH_SP_REGNUM. */ + +extern CORE_ADDR default_unwind_sp (struct gdbarch *gdbarch, + struct frame_info *next_frame); + /* Assuming the frame chain: (outer) prev <-> this <-> next (inner); use THIS frame, and through it the NEXT frame's register unwind method, to determine the frame ID of THIS frame. diff --git a/gdb/frame.c b/gdb/frame.c index 340dc99d5af..f1876db7ff6 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -2777,18 +2777,9 @@ get_frame_sp (struct frame_info *this_frame) { struct gdbarch *gdbarch = get_frame_arch (this_frame); - /* Normality - an architecture that provides a way of obtaining any - frame inner-most address. */ - if (gdbarch_unwind_sp_p (gdbarch)) - /* NOTE drow/2008-06-28: gdbarch_unwind_sp could be converted to - operate on THIS_FRAME now. */ - return gdbarch_unwind_sp (gdbarch, this_frame->next); - /* Now things are really are grim. Hope that the value returned by - the gdbarch_sp_regnum register is meaningful. */ - if (gdbarch_sp_regnum (gdbarch) >= 0) - return get_frame_register_unsigned (this_frame, - gdbarch_sp_regnum (gdbarch)); - internal_error (__FILE__, __LINE__, _("Missing unwind SP method")); + /* NOTE drow/2008-06-28: gdbarch_unwind_sp could be converted to + operate on THIS_FRAME now. */ + return gdbarch_unwind_sp (gdbarch, this_frame->next); } /* Return the reason why we can't unwind past FRAME. */ diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index ab49a2bff50..00ebc6c399a 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -1432,12 +1432,6 @@ static const struct frame_base frv_frame_base = { frv_frame_base_address }; -static CORE_ADDR -frv_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, sp_regnum); -} - static struct gdbarch * frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { @@ -1521,7 +1515,6 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_return_value (gdbarch, frv_return_value); /* Frame stuff. */ - set_gdbarch_unwind_sp (gdbarch, frv_unwind_sp); set_gdbarch_frame_align (gdbarch, frv_frame_align); frame_base_set_default (gdbarch, &frv_frame_base); /* We set the sniffer lower down after the OSABI hooks have been diff --git a/gdb/ft32-tdep.c b/gdb/ft32-tdep.c index 79cf1a08c1d..17f1ceb7a9b 100644 --- a/gdb/ft32-tdep.c +++ b/gdb/ft32-tdep.c @@ -383,14 +383,6 @@ ft32_address_class_name_to_type_flags (struct gdbarch *gdbarch, return 0; } -/* Implement the "unwind_sp" gdbarch method. */ - -static CORE_ADDR -ft32_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, FT32_SP_REGNUM); -} - /* Given a return value in `regbuf' with a type `valtype', extract and copy its value into `valbuf'. */ @@ -586,8 +578,6 @@ ft32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) func_void_type); TYPE_INSTANCE_FLAGS (tdep->pc_type) |= TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1; - set_gdbarch_unwind_sp (gdbarch, ft32_unwind_sp); - set_gdbarch_num_regs (gdbarch, FT32_NUM_REGS); set_gdbarch_sp_regnum (gdbarch, FT32_SP_REGNUM); set_gdbarch_pc_regnum (gdbarch, FT32_PC_REGNUM); diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 1789eabae01..228e9a9318f 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -430,6 +430,7 @@ gdbarch_alloc (const struct gdbarch_info *info, gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint; gdbarch->remote_register_number = default_remote_register_number; gdbarch->unwind_pc = default_unwind_pc; + gdbarch->unwind_sp = default_unwind_sp; gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr; gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity; gdbarch->addr_bits_remove = core_addr_identity; @@ -617,7 +618,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of fetch_tls_load_module_address, has predicate. */ /* Skip verify of frame_args_skip, invalid_p == 0 */ /* Skip verify of unwind_pc, invalid_p == 0 */ - /* Skip verify of unwind_sp, has predicate. */ + /* Skip verify of unwind_sp, invalid_p == 0 */ /* Skip verify of frame_num_args, has predicate. */ /* Skip verify of frame_align, has predicate. */ /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */ @@ -1439,9 +1440,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: unwind_pc = <%s>\n", host_address_to_string (gdbarch->unwind_pc)); - fprintf_unfiltered (file, - "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n", - gdbarch_unwind_sp_p (gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: unwind_sp = <%s>\n", host_address_to_string (gdbarch->unwind_sp)); @@ -3066,13 +3064,6 @@ set_gdbarch_unwind_pc (struct gdbarch *gdbarch, gdbarch->unwind_pc = unwind_pc; } -int -gdbarch_unwind_sp_p (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - return gdbarch->unwind_sp != NULL; -} - CORE_ADDR gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) { diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index be6a945a7ca..b8dc6081eb1 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -627,8 +627,6 @@ typedef CORE_ADDR (gdbarch_unwind_pc_ftype) (struct gdbarch *gdbarch, struct fra extern CORE_ADDR gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame); extern void set_gdbarch_unwind_pc (struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype *unwind_pc); -extern int gdbarch_unwind_sp_p (struct gdbarch *gdbarch); - typedef CORE_ADDR (gdbarch_unwind_sp_ftype) (struct gdbarch *gdbarch, struct frame_info *next_frame); extern CORE_ADDR gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame); extern void set_gdbarch_unwind_sp (struct gdbarch *gdbarch, gdbarch_unwind_sp_ftype *unwind_sp); diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index d5409d1b2f0..e93d7d49169 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -600,7 +600,7 @@ F;CORE_ADDR;fetch_tls_load_module_address;struct objfile *objfile;objfile # v;CORE_ADDR;frame_args_skip;;;0;;;0 m;CORE_ADDR;unwind_pc;struct frame_info *next_frame;next_frame;;default_unwind_pc;;0 -M;CORE_ADDR;unwind_sp;struct frame_info *next_frame;next_frame +m;CORE_ADDR;unwind_sp;struct frame_info *next_frame;next_frame;;default_unwind_sp;;0 # DEPRECATED_FRAME_LOCALS_ADDRESS as been replaced by the per-frame # frame-base. Enable frame-base before frame-unwind. F;int;frame_num_args;struct frame_info *frame;frame diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index 16ece47cc4c..068014c34b0 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -92,12 +92,6 @@ static int is_h8300_normal_mode (struct gdbarch *gdbarch); && !is_h8300_normal_mode (gdbarch)) \ ? h8300h_reg_size : h8300_reg_size) -static CORE_ADDR -h8300_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, E_SP_REGNUM); -} - /* Normal frames. */ /* Allocate and initialize a frame cache. */ @@ -1340,7 +1334,6 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_skip_prologue (gdbarch, h8300_skip_prologue); /* Frame unwinder. */ - set_gdbarch_unwind_sp (gdbarch, h8300_unwind_sp); frame_base_set_default (gdbarch, &h8300_frame_base); /* diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c index 7fc4c5d05a1..082c78f6fbd 100644 --- a/gdb/iq2000-tdep.c +++ b/gdb/iq2000-tdep.c @@ -434,12 +434,6 @@ static const struct frame_unwind iq2000_frame_unwind = { default_frame_sniffer }; -static CORE_ADDR -iq2000_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, E_SP_REGNUM); -} - static CORE_ADDR iq2000_frame_base_address (struct frame_info *this_frame, void **this_cache) { @@ -827,7 +821,6 @@ iq2000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_register_type (gdbarch, iq2000_register_type); set_gdbarch_frame_align (gdbarch, iq2000_frame_align); - set_gdbarch_unwind_sp (gdbarch, iq2000_unwind_sp); frame_base_set_default (gdbarch, &iq2000_frame_base); set_gdbarch_push_dummy_call (gdbarch, iq2000_push_dummy_call); diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c index 651b09c73ec..5cf15625304 100644 --- a/gdb/lm32-tdep.c +++ b/gdb/lm32-tdep.c @@ -382,12 +382,6 @@ lm32_return_value (struct gdbarch *gdbarch, struct value *function, return RETURN_VALUE_REGISTER_CONVENTION; } -static CORE_ADDR -lm32_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, SIM_LM32_SP_REGNUM); -} - /* Put here the code to store, into fi->saved_regs, the addresses of the saved registers of frame described by FRAME_INFO. This includes special registers such as pc and fp saved in special ways @@ -537,7 +531,6 @@ lm32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Frame unwinding. */ set_gdbarch_frame_align (gdbarch, lm32_frame_align); frame_base_set_default (gdbarch, &lm32_frame_base); - set_gdbarch_unwind_sp (gdbarch, lm32_unwind_sp); frame_unwind_append_unwinder (gdbarch, &lm32_frame_unwind); /* Breakpoints. */ diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index 77019162d22..4b2ab6d01bf 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -649,13 +649,6 @@ m32r_frame_unwind_cache (struct frame_info *this_frame, return info; } -static CORE_ADDR -m32r_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, M32R_SP_REGNUM); -} - - static CORE_ADDR m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, @@ -884,8 +877,6 @@ m32r_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_wchar_bit (gdbarch, 16); set_gdbarch_wchar_signed (gdbarch, 0); - set_gdbarch_unwind_sp (gdbarch, m32r_unwind_sp); - set_gdbarch_num_regs (gdbarch, M32R_NUM_REGS); set_gdbarch_pc_regnum (gdbarch, M32R_PC_REGNUM); set_gdbarch_sp_regnum (gdbarch, M32R_SP_REGNUM); diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 9855c023d4d..93a95a1e8d8 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -969,14 +969,6 @@ static const struct frame_base m68hc11_frame_base = { m68hc11_frame_args_address }; -static CORE_ADDR -m68hc11_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - ULONGEST sp; - sp = frame_unwind_register_unsigned (next_frame, HARD_SP_REGNUM); - return sp; -} - /* Assuming THIS_FRAME is a dummy, return the frame ID of that dummy frame. The frame ID's base needs to match the TOS value saved by save_dummy_frame_tos(), and the PC match the dummy frame's breakpoint. */ @@ -1484,8 +1476,6 @@ m68hc11_gdbarch_init (struct gdbarch_info info, /* Characters are unsigned. */ set_gdbarch_char_signed (gdbarch, 0); - set_gdbarch_unwind_sp (gdbarch, m68hc11_unwind_sp); - /* Set register info. */ set_gdbarch_fp0_regnum (gdbarch, -1); diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index ebd4890f273..fe25ca4934d 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -2064,16 +2064,6 @@ static const struct frame_unwind mep_frame_unwind = { NULL, default_frame_sniffer }; - - -/* Our general unwinding function can handle unwinding the SP. */ -static CORE_ADDR -mep_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, MEP_SP_REGNUM); -} - - /* Return values. */ @@ -2451,7 +2441,6 @@ mep_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Frames and frame unwinding. */ frame_unwind_append_unwinder (gdbarch, &mep_frame_unwind); - set_gdbarch_unwind_sp (gdbarch, mep_unwind_sp); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_frame_args_skip (gdbarch, 0); diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index b05dec16365..a46fdc80a03 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -1141,21 +1141,11 @@ static const struct frame_unwind mn10300_frame_unwind = { default_frame_sniffer }; -static CORE_ADDR -mn10300_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - ULONGEST sp; - - sp = frame_unwind_register_unsigned (this_frame, E_SP_REGNUM); - return sp; -} - static void mn10300_frame_unwind_init (struct gdbarch *gdbarch) { dwarf2_append_unwinders (gdbarch); frame_unwind_append_unwinder (gdbarch, &mn10300_frame_unwind); - set_gdbarch_unwind_sp (gdbarch, mn10300_unwind_sp); } /* Function: push_dummy_call @@ -1289,7 +1279,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch, { CORE_ADDR func_addr = find_function_addr (target_func, NULL); CORE_ADDR unwound_sp - = mn10300_unwind_sp (gdbarch, create_new_frame (sp, func_addr)); + = gdbarch_unwind_sp (gdbarch, create_new_frame (sp, func_addr)); if (sp != unwound_sp) regcache_cooked_write_unsigned (regcache, E_SP_REGNUM, sp - (unwound_sp - sp)); diff --git a/gdb/moxie-tdep.c b/gdb/moxie-tdep.c index 9ace7a4588a..ecc3195bb51 100644 --- a/gdb/moxie-tdep.c +++ b/gdb/moxie-tdep.c @@ -448,14 +448,6 @@ moxie_software_single_step (struct regcache *regcache) return next_pcs; } -/* Implement the "unwind_sp" gdbarch method. */ - -static CORE_ADDR -moxie_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, MOXIE_SP_REGNUM); -} - /* Given a return value in `regbuf' with a type `valtype', extract and copy its value into `valbuf'. */ @@ -1074,8 +1066,6 @@ moxie_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_wchar_bit (gdbarch, 32); set_gdbarch_wchar_signed (gdbarch, 0); - set_gdbarch_unwind_sp (gdbarch, moxie_unwind_sp); - set_gdbarch_num_regs (gdbarch, MOXIE_NUM_REGS); set_gdbarch_sp_regnum (gdbarch, MOXIE_SP_REGNUM); set_gdbarch_pc_regnum (gdbarch, MOXIE_PC_REGNUM); diff --git a/gdb/msp430-tdep.c b/gdb/msp430-tdep.c index d89f4450166..710dc1f1ce4 100644 --- a/gdb/msp430-tdep.c +++ b/gdb/msp430-tdep.c @@ -447,14 +447,6 @@ msp430_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) return p.prologue_end; } -/* Implement the "unwind_sp" gdbarch method. */ - -static CORE_ADDR -msp430_unwind_sp (struct gdbarch *arch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, MSP430_SP_REGNUM); -} - /* Given a frame described by THIS_FRAME, decode the prologue of its associated function if there is not cache entry as specified by THIS_PROLOGUE_CACHE. Save the decoded prologue in the cache and @@ -975,7 +967,6 @@ msp430_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Frames, prologues, etc. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_skip_prologue (gdbarch, msp430_skip_prologue); - set_gdbarch_unwind_sp (gdbarch, msp430_unwind_sp); set_gdbarch_frame_align (gdbarch, msp430_frame_align); dwarf2_append_unwinders (gdbarch); frame_unwind_append_unwinder (gdbarch, &msp430_unwind); diff --git a/gdb/nds32-tdep.c b/gdb/nds32-tdep.c index 2a169d6eea4..c6a343dd4d2 100644 --- a/gdb/nds32-tdep.c +++ b/gdb/nds32-tdep.c @@ -1388,14 +1388,6 @@ static const struct frame_unwind nds32_epilogue_frame_unwind = nds32_epilogue_frame_sniffer }; -/* Implement the "unwind_sp" gdbarch method. */ - -static CORE_ADDR -nds32_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, NDS32_SP_REGNUM); -} - /* Floating type and struct type that has only one floating type member can pass value using FPU registers (when FPU ABI is used). */ @@ -2122,7 +2114,6 @@ nds32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sp_regnum (gdbarch, NDS32_SP_REGNUM); set_gdbarch_pc_regnum (gdbarch, NDS32_PC_REGNUM); - set_gdbarch_unwind_sp (gdbarch, nds32_unwind_sp); set_gdbarch_stack_frame_destroyed_p (gdbarch, nds32_stack_frame_destroyed_p); set_gdbarch_dwarf2_reg_to_regnum (gdbarch, nds32_dwarf2_reg_to_regnum); diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c index f4d22597b76..8b47add604a 100644 --- a/gdb/nios2-tdep.c +++ b/gdb/nios2-tdep.c @@ -1878,14 +1878,6 @@ nios2_push_dummy_call (struct gdbarch *gdbarch, struct value *function, return sp; } -/* Implement the unwind_sp gdbarch method. */ - -static CORE_ADDR -nios2_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - return frame_unwind_register_unsigned (this_frame, NIOS2_SP_REGNUM); -} - /* Use prologue analysis to fill in the register cache *THIS_PROLOGUE_CACHE for THIS_FRAME. This function initializes *THIS_PROLOGUE_CACHE first. */ @@ -2300,8 +2292,6 @@ nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_breakpoint_kind_from_pc (gdbarch, nios2_breakpoint_kind_from_pc); set_gdbarch_sw_breakpoint_from_kind (gdbarch, nios2_sw_breakpoint_from_kind); - set_gdbarch_unwind_sp (gdbarch, nios2_unwind_sp); - /* The dwarf2 unwinder will normally produce the best results if the debug information is available, so register it first. */ dwarf2_append_unwinders (gdbarch); diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index 12cf09d62fb..8b7d5d6a20d 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -2325,14 +2325,6 @@ riscv_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr) return align_down (addr, 16); } -/* Implement the unwind_sp gdbarch method. */ - -static CORE_ADDR -riscv_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, RISCV_SP_REGNUM); -} - /* Generate, or return the cached frame cache for the RiscV frame unwinder. */ @@ -2529,9 +2521,6 @@ riscv_gdbarch_init (struct gdbarch_info info, set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_frame_align (gdbarch, riscv_frame_align); - /* Functions to access frame data. */ - set_gdbarch_unwind_sp (gdbarch, riscv_unwind_sp); - /* Functions handling dummy frames. */ set_gdbarch_call_dummy_location (gdbarch, ON_STACK); set_gdbarch_push_dummy_code (gdbarch, riscv_push_dummy_code); diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c index 46dd4f75f7b..8226d1a4bfd 100644 --- a/gdb/rl78-tdep.c +++ b/gdb/rl78-tdep.c @@ -1074,14 +1074,6 @@ rl78_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) return p.prologue_end; } -/* Implement the "unwind_sp" gdbarch method. */ - -static CORE_ADDR -rl78_unwind_sp (struct gdbarch *arch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, RL78_SP_REGNUM); -} - /* Given a frame described by THIS_FRAME, decode the prologue of its associated function if there is not cache entry as specified by THIS_PROLOGUE_CACHE. Save the decoded prologue in the cache and @@ -1458,7 +1450,6 @@ rl78_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Frames, prologues, etc. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_skip_prologue (gdbarch, rl78_skip_prologue); - set_gdbarch_unwind_sp (gdbarch, rl78_unwind_sp); set_gdbarch_frame_align (gdbarch, rl78_frame_align); dwarf2_append_unwinders (gdbarch); diff --git a/gdb/rx-tdep.c b/gdb/rx-tdep.c index 07e83d0e11e..9c85c3cc232 100644 --- a/gdb/rx-tdep.c +++ b/gdb/rx-tdep.c @@ -751,16 +751,6 @@ static const struct frame_unwind rx_exception_unwind = { rx_exception_sniffer }; -/* Implement the "unwind_sp" gdbarch method. */ -static CORE_ADDR -rx_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - ULONGEST sp; - - sp = frame_unwind_register_unsigned (this_frame, RX_SP_REGNUM); - return sp; -} - /* Implement the "push_dummy_call" gdbarch method. */ static CORE_ADDR rx_push_dummy_call (struct gdbarch *gdbarch, struct value *function, @@ -1091,8 +1081,6 @@ rx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sw_breakpoint_from_kind (gdbarch, rx_breakpoint::bp_from_kind); set_gdbarch_skip_prologue (gdbarch, rx_skip_prologue); - set_gdbarch_unwind_sp (gdbarch, rx_unwind_sp); - /* Target builtin data types. */ set_gdbarch_char_signed (gdbarch, 0); set_gdbarch_short_bit (gdbarch, 16); diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c index 9f2cdc992d9..54e81dc71ab 100644 --- a/gdb/score-tdep.c +++ b/gdb/score-tdep.c @@ -64,12 +64,6 @@ score_register_type (struct gdbarch *gdbarch, int regnum) return builtin_type (gdbarch)->builtin_uint32; } -static CORE_ADDR -score_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, SCORE_SP_REGNUM); -} - static const char * score7_register_name (struct gdbarch *gdbarch, int regnum) { @@ -1466,7 +1460,6 @@ score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_type (gdbarch, score_register_type); set_gdbarch_frame_align (gdbarch, score_frame_align); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); - set_gdbarch_unwind_sp (gdbarch, score_unwind_sp); switch (target_mach) { diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index c672ba5cfe5..54f52bc9d71 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -1976,13 +1976,6 @@ static const struct frame_unwind sh_frame_unwind = { default_frame_sniffer }; -static CORE_ADDR -sh_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, - gdbarch_sp_regnum (gdbarch)); -} - static CORE_ADDR sh_frame_base_address (struct frame_info *this_frame, void **this_cache) { @@ -2295,7 +2288,6 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_believe_pcc_promotion (gdbarch, 1); set_gdbarch_frame_align (gdbarch, sh_frame_align); - set_gdbarch_unwind_sp (gdbarch, sh_unwind_sp); frame_base_set_default (gdbarch, &sh_frame_base); set_gdbarch_stack_frame_destroyed_p (gdbarch, sh_stack_frame_destroyed_p); diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c index 8d27bdb0da3..a7759650e88 100644 --- a/gdb/sh64-tdep.c +++ b/gdb/sh64-tdep.c @@ -2312,13 +2312,6 @@ static const struct frame_unwind sh64_frame_unwind = { default_frame_sniffer }; -static CORE_ADDR -sh64_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, - gdbarch_sp_regnum (gdbarch)); -} - static CORE_ADDR sh64_frame_base_address (struct frame_info *this_frame, void **this_cache) { @@ -2405,7 +2398,6 @@ sh64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_believe_pcc_promotion (gdbarch, 1); set_gdbarch_frame_align (gdbarch, sh64_frame_align); - set_gdbarch_unwind_sp (gdbarch, sh64_unwind_sp); frame_base_set_default (gdbarch, &sh64_frame_base); set_gdbarch_print_registers_info (gdbarch, sh64_print_registers_info); diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c index d9637f0feff..97997fd7097 100644 --- a/gdb/tic6x-tdep.c +++ b/gdb/tic6x-tdep.c @@ -366,15 +366,6 @@ tic6x_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum, reg->how = DWARF2_FRAME_REG_UNDEFINED; } -/* This is the implementation of gdbarch method unwind_sp. */ - -static CORE_ADDR -tic6x_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - return frame_unwind_register_unsigned (this_frame, TIC6X_SP_REGNUM); -} - - /* Frame base handling. */ static struct tic6x_unwind_cache* @@ -1269,8 +1260,6 @@ tic6x_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sw_breakpoint_from_kind (gdbarch, tic6x_sw_breakpoint_from_kind); - set_gdbarch_unwind_sp (gdbarch, tic6x_unwind_sp); - /* Unwinding. */ dwarf2_append_unwinders (gdbarch); diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c index df6bdf05daa..af73a37fd16 100644 --- a/gdb/tilegx-tdep.c +++ b/gdb/tilegx-tdep.c @@ -930,12 +930,6 @@ static const struct frame_base tilegx_frame_base = { tilegx_frame_base_address }; -static CORE_ADDR -tilegx_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, TILEGX_SP_REGNUM); -} - /* We cannot read/write the "special" registers. */ static int @@ -1010,7 +1004,6 @@ tilegx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_inner_than (gdbarch, core_addr_lessthan); /* Frame Info. */ - set_gdbarch_unwind_sp (gdbarch, tilegx_unwind_sp); set_gdbarch_frame_align (gdbarch, tilegx_frame_align); frame_base_set_default (gdbarch, &tilegx_frame_base); diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index f2322f10802..a7700fbc41a 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -1326,13 +1326,6 @@ static const struct frame_unwind v850_frame_unwind = { default_frame_sniffer }; -static CORE_ADDR -v850_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, - gdbarch_sp_regnum (gdbarch)); -} - static CORE_ADDR v850_frame_base_address (struct frame_info *this_frame, void **this_cache) { @@ -1449,7 +1442,6 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_skip_prologue (gdbarch, v850_skip_prologue); set_gdbarch_frame_align (gdbarch, v850_frame_align); - set_gdbarch_unwind_sp (gdbarch, v850_unwind_sp); frame_base_set_default (gdbarch, &v850_frame_base); /* Hook in ABI-specific overrides, if they have been registered. */ diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index ca00c14dcb2..035a0b28381 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -751,12 +751,6 @@ static const struct frame_base xstormy16_frame_base = { xstormy16_frame_base_address }; -static CORE_ADDR -xstormy16_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, E_SP_REGNUM); -} - /* Function: xstormy16_gdbarch_init Initializer function for the xstormy16 gdbarch vector. Called by gdbarch. Sets up the gdbarch vector(s) for this target. */ @@ -810,7 +804,6 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* * Frame Info */ - set_gdbarch_unwind_sp (gdbarch, xstormy16_unwind_sp); set_gdbarch_frame_align (gdbarch, xstormy16_frame_align); frame_base_set_default (gdbarch, &xstormy16_frame_base);