[PATCH 10/22] [GDBserver] Multi-process + multi-arch: GNU/Linux Blackfin

Pedro Alves
2013-05-30T12:14:51Z

This adjusts the GNU/Linux Blackfin port to new interfaces.

Completely untested.

2013-05-30 Pedro Alves <palves@redhat.com>

* linux-bfin-low.c (tdesc_bfin): Declare.
(bfin_arch_setup): New function.
(bfin_usrregs_info, regs_info): New globals.
(bfin_regs_info): New function.
(the_low_target): Adjust.
(initialize_low_arch): New function.
---
gdb/gdbserver/linux-bfin-low.c | 38 ++++++++++++++++++++++++++++++++++----
1 file changed, 34 insertions(+), 4 deletions(-)

diff --git a/gdb/gdbserver/linux-bfin-low.c b/gdb/gdbserver/linux-bfin-low.c
index 3295ffd..cced3e1 100644
--- a/gdb/gdbserver/linux-bfin-low.c
+++ b/gdb/gdbserver/linux-bfin-low.c
@@ -26,6 +26,7 @@

/* Defined in auto-generated file reg-bfin.c. */
void init_registers_bfin (void);
+extern const struct target_desc *tdesc_bfin;

static int bfin_regmap[] =
{
@@ -90,11 +91,33 @@ bfin_breakpoint_at (CORE_ADDR where)
return 0;
}

+static void
+bfin_arch_setup (void)
+{
+ current_process ()->tdesc = tdesc_bfin;
+}
+
+static struct usrregs_info bfin_usrregs_info =
+ {
+ bfin_num_regs,
+ bfin_regmap,
+ };
+
+static struct regs_info regs_info =
+ {
+ NULL, /* regset_bitmap */
+ &bfin_usrregs_info,
+ };
+
+static const struct regs_info *
+bfin_regs_info (void)
+{
+ return &regs_info;
+}
+
struct linux_target_ops the_low_target = {
- init_registers_bfin,
- bfin_num_regs,
- bfin_regmap,
- NULL,
+ bfin_arch_setup,
+ bfin_regs_info,
bfin_cannot_fetch_register,
bfin_cannot_store_register,
NULL, /* fetch_register */
@@ -106,3 +129,10 @@ struct linux_target_ops the_low_target = {
2,
bfin_breakpoint_at,
};
+
+
+void
+initialize_low_arch (void)
+{
+ init_registers_bfin ();
+}