]> git.sur5r.net Git - openocd/blobdiff - src/target/target.c
gdb_server: avoid gdb server for virtual targets
[openocd] / src / target / target.c
index 253928d7c3ce0c9a2c1e0ea0f258ce6c981b19ff..478c39d1bba3a6f2051a9f46fbf4db1003f4775c 100644 (file)
@@ -108,6 +108,7 @@ extern struct target_type quark_x10xx_target;
 extern struct target_type quark_d20xx_target;
 extern struct target_type stm8_target;
 extern struct target_type riscv_target;
+extern struct target_type mem_ap_target;
 
 static struct target_type *target_types[] = {
        &arm7tdmi_target,
@@ -144,6 +145,7 @@ static struct target_type *target_types[] = {
 #if BUILD_TARGET64
        &aarch64_target,
 #endif
+       &mem_ap_target,
        NULL,
 };
 
@@ -1203,6 +1205,16 @@ int target_get_gdb_reg_list(struct target *target,
 {
        return target->type->get_gdb_reg_list(target, reg_list, reg_list_size, reg_class);
 }
+
+bool target_supports_gdb_connection(struct target *target)
+{
+       /*
+        * based on current code, we can simply exclude all the targets that
+        * don't provide get_gdb_reg_list; this could change with new targets.
+        */
+       return !!target->type->get_gdb_reg_list;
+}
+
 int target_step(struct target *target,
                int current, target_addr_t address, int handle_breakpoints)
 {