diff --git a/src/target/arm.h b/src/target/arm.h index 316ff9ab8..10a053ced 100644 --- a/src/target/arm.h +++ b/src/target/arm.h @@ -263,6 +263,7 @@ struct reg_cache *armv8_build_reg_cache(struct target *target); extern const struct command_registration arm_command_handlers[]; int arm_arch_state(struct target *target); +const char *arm_get_gdb_arch(struct target *target); int arm_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class); diff --git a/src/target/arm11.c b/src/target/arm11.c index 13fbd207a..443866149 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -1362,6 +1362,7 @@ struct target_type arm11_target = { .assert_reset = arm11_assert_reset, .deassert_reset = arm11_deassert_reset, + .get_gdb_arch = arm_get_gdb_arch, .get_gdb_reg_list = arm_get_gdb_reg_list, .read_memory = arm11_read_memory, diff --git a/src/target/arm720t.c b/src/target/arm720t.c index bcbfa9dff..3d12aba22 100644 --- a/src/target/arm720t.c +++ b/src/target/arm720t.c @@ -560,6 +560,7 @@ struct target_type arm720t_target = { .deassert_reset = arm7_9_deassert_reset, .soft_reset_halt = arm720t_soft_reset_halt, + .get_gdb_arch = arm_get_gdb_arch, .get_gdb_reg_list = arm_get_gdb_reg_list, .read_memory = arm720t_read_memory, diff --git a/src/target/arm7tdmi.c b/src/target/arm7tdmi.c index 9dcb302d9..e1e91c3a0 100644 --- a/src/target/arm7tdmi.c +++ b/src/target/arm7tdmi.c @@ -699,6 +699,7 @@ struct target_type arm7tdmi_target = { .deassert_reset = arm7_9_deassert_reset, .soft_reset_halt = arm7_9_soft_reset_halt, + .get_gdb_arch = arm_get_gdb_arch, .get_gdb_reg_list = arm_get_gdb_reg_list, .read_memory = arm7_9_read_memory, diff --git a/src/target/arm920t.c b/src/target/arm920t.c index 7927a2bea..39d75902c 100644 --- a/src/target/arm920t.c +++ b/src/target/arm920t.c @@ -1693,6 +1693,7 @@ struct target_type arm920t_target = { .deassert_reset = arm7_9_deassert_reset, .soft_reset_halt = arm920t_soft_reset_halt, + .get_gdb_arch = arm_get_gdb_arch, .get_gdb_reg_list = arm_get_gdb_reg_list, .read_memory = arm920t_read_memory, diff --git a/src/target/arm926ejs.c b/src/target/arm926ejs.c index 58de77850..07c519a53 100644 --- a/src/target/arm926ejs.c +++ b/src/target/arm926ejs.c @@ -804,6 +804,7 @@ struct target_type arm926ejs_target = { .deassert_reset = arm7_9_deassert_reset, .soft_reset_halt = arm926ejs_soft_reset_halt, + .get_gdb_arch = arm_get_gdb_arch, .get_gdb_reg_list = arm_get_gdb_reg_list, .read_memory = arm7_9_read_memory, diff --git a/src/target/arm946e.c b/src/target/arm946e.c index 06c9fc30d..5e25d71ec 100644 --- a/src/target/arm946e.c +++ b/src/target/arm946e.c @@ -756,6 +756,7 @@ struct target_type arm946e_target = { .deassert_reset = arm7_9_deassert_reset, .soft_reset_halt = arm7_9_soft_reset_halt, + .get_gdb_arch = arm_get_gdb_arch, .get_gdb_reg_list = arm_get_gdb_reg_list, /* .read_memory = arm7_9_read_memory, */ diff --git a/src/target/arm966e.c b/src/target/arm966e.c index 0429c54b5..c9d7f01aa 100644 --- a/src/target/arm966e.c +++ b/src/target/arm966e.c @@ -259,6 +259,7 @@ struct target_type arm966e_target = { .deassert_reset = arm7_9_deassert_reset, .soft_reset_halt = arm7_9_soft_reset_halt, + .get_gdb_arch = arm_get_gdb_arch, .get_gdb_reg_list = arm_get_gdb_reg_list, .read_memory = arm7_9_read_memory, diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c index 82b430f88..6425027f4 100644 --- a/src/target/arm9tdmi.c +++ b/src/target/arm9tdmi.c @@ -902,6 +902,7 @@ struct target_type arm9tdmi_target = { .deassert_reset = arm7_9_deassert_reset, .soft_reset_halt = arm7_9_soft_reset_halt, + .get_gdb_arch = arm_get_gdb_arch, .get_gdb_reg_list = arm_get_gdb_reg_list, .read_memory = arm7_9_read_memory, diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c index 96a63e497..af8fd9a7f 100644 --- a/src/target/armv4_5.c +++ b/src/target/armv4_5.c @@ -1179,6 +1179,20 @@ const struct command_registration arm_command_handlers[] = { COMMAND_REGISTRATION_DONE }; +/* + * gdb for arm targets (e.g. arm-none-eabi-gdb) supports several variants + * of arm architecture. You can list them using the autocompletion of gdb + * command prompt by typing "set architecture " and then press TAB key. + * The default, selected automatically, is "arm". + * Let's use the default value, here, to make gdb-multiarch behave in the + * same way as a gdb for arm. This can be changed later on. User can still + * set the specific architecture variant with the gdb command. + */ +const char *arm_get_gdb_arch(struct target *target) +{ + return "arm"; +} + int arm_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class) diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c index 0a55a2006..07644fa09 100644 --- a/src/target/cortex_a.c +++ b/src/target/cortex_a.c @@ -3171,6 +3171,7 @@ struct target_type cortexa_target = { .deassert_reset = cortex_a_deassert_reset, /* REVISIT allow exporting VFP3 registers ... */ + .get_gdb_arch = arm_get_gdb_arch, .get_gdb_reg_list = arm_get_gdb_reg_list, .read_memory = cortex_a_read_memory, @@ -3250,6 +3251,7 @@ struct target_type cortexr4_target = { .deassert_reset = cortex_a_deassert_reset, /* REVISIT allow exporting VFP3 registers ... */ + .get_gdb_arch = arm_get_gdb_arch, .get_gdb_reg_list = arm_get_gdb_reg_list, .read_memory = cortex_a_read_phys_memory, diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 4ce776cd0..e8ad770ec 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -2518,6 +2518,7 @@ struct target_type cortexm_target = { .deassert_reset = cortex_m_deassert_reset, .soft_reset_halt = cortex_m_soft_reset_halt, + .get_gdb_arch = arm_get_gdb_arch, .get_gdb_reg_list = armv7m_get_gdb_reg_list, .read_memory = cortex_m_read_memory, diff --git a/src/target/fa526.c b/src/target/fa526.c index 9f6b80551..bb9f7353a 100644 --- a/src/target/fa526.c +++ b/src/target/fa526.c @@ -364,6 +364,7 @@ struct target_type fa526_target = { .deassert_reset = arm7_9_deassert_reset, .soft_reset_halt = arm920t_soft_reset_halt, + .get_gdb_arch = arm_get_gdb_arch, .get_gdb_reg_list = arm_get_gdb_reg_list, .read_memory = arm920t_read_memory, diff --git a/src/target/feroceon.c b/src/target/feroceon.c index 6b14ab6a8..21963e55e 100644 --- a/src/target/feroceon.c +++ b/src/target/feroceon.c @@ -710,6 +710,7 @@ struct target_type feroceon_target = { .deassert_reset = arm7_9_deassert_reset, .soft_reset_halt = arm926ejs_soft_reset_halt, + .get_gdb_arch = arm_get_gdb_arch, .get_gdb_reg_list = arm_get_gdb_reg_list, .read_memory = arm7_9_read_memory, @@ -747,6 +748,7 @@ struct target_type dragonite_target = { .deassert_reset = arm7_9_deassert_reset, .soft_reset_halt = arm7_9_soft_reset_halt, + .get_gdb_arch = arm_get_gdb_arch, .get_gdb_reg_list = arm_get_gdb_reg_list, .read_memory = arm7_9_read_memory, diff --git a/src/target/hla_target.c b/src/target/hla_target.c index 9ebf24168..567a61dc3 100644 --- a/src/target/hla_target.c +++ b/src/target/hla_target.c @@ -820,6 +820,7 @@ struct target_type hla_target = { .resume = adapter_resume, .step = adapter_step, + .get_gdb_arch = arm_get_gdb_arch, .get_gdb_reg_list = armv7m_get_gdb_reg_list, .read_memory = adapter_read_memory, diff --git a/src/target/xscale.c b/src/target/xscale.c index 87a3d0f78..3ac455390 100644 --- a/src/target/xscale.c +++ b/src/target/xscale.c @@ -3703,6 +3703,7 @@ struct target_type xscale_target = { .deassert_reset = xscale_deassert_reset, /* REVISIT on some cores, allow exporting iwmmxt registers ... */ + .get_gdb_arch = arm_get_gdb_arch, .get_gdb_reg_list = arm_get_gdb_reg_list, .read_memory = xscale_read_memory,