aboutsummaryrefslogtreecommitdiff
path: root/gdb/arch/riscv.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/arch/riscv.h')
-rw-r--r--gdb/arch/riscv.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/gdb/arch/riscv.h b/gdb/arch/riscv.h
index 016a5fc..d40862c 100644
--- a/gdb/arch/riscv.h
+++ b/gdb/arch/riscv.h
@@ -66,10 +66,28 @@ struct riscv_gdbarch_features
}
};
-/* Create and return a target description that is compatible with
- FEATURES. */
+#ifdef GDBSERVER
+
+/* Create and return a target description that is compatible with FEATURES.
+ This is only used directly from the gdbserver where the created target
+ description is modified after it is return. */
+
+target_desc *riscv_create_target_description
+ (const struct riscv_gdbarch_features features);
+
+#else
+
+/* Lookup an already existing target description matching FEATURES, or
+ create a new target description if this is the first time we have seen
+ FEATURES. For the same FEATURES the same target_desc is always
+ returned. This is important when trying to lookup gdbarch objects as
+ GDBARCH_LIST_LOOKUP_BY_INFO performs a pointer comparison on target
+ descriptions to find candidate gdbarch objects. */
+
+const target_desc *riscv_lookup_target_description
+ (const struct riscv_gdbarch_features features);
+
+#endif /* GDBSERVER */
-const target_desc *riscv_create_target_description
- (struct riscv_gdbarch_features features);
#endif /* ARCH_RISCV_H */