aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/corelow.c15
2 files changed, 20 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5fb76d0..820a9d3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2021-06-25 Luis Machado <luis.machado@linaro.org>
+
+ * corelow.c (core_target::core_target) Update to read target
+ description.
+
2021-06-22 Simon Marchi <simon.marchi@polymtl.ca>
* python/lib/gdb/__init__.py: Format.
diff --git a/gdb/corelow.c b/gdb/corelow.c
index a1943ab..b762eaa 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -154,8 +154,23 @@ private: /* per-core data */
core_target::core_target ()
{
+ /* Find a first arch based on the BFD. We need the initial gdbarch so
+ we can setup the hooks to find a target description. */
m_core_gdbarch = gdbarch_from_bfd (core_bfd);
+ /* If the arch is able to read a target description from the core, it
+ could yield a more specific gdbarch. */
+ const struct target_desc *tdesc = read_description ();
+
+ if (tdesc != nullptr)
+ {
+ struct gdbarch_info info;
+ gdbarch_info_init (&info);
+ info.abfd = core_bfd;
+ info.target_desc = tdesc;
+ m_core_gdbarch = gdbarch_find_by_info (info);
+ }
+
if (!m_core_gdbarch
|| !gdbarch_iterate_over_regset_sections_p (m_core_gdbarch))
error (_("\"%s\": Core file format not supported"),