]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
GDB: linux-nat: Make tdesc parameters available early
authorThiago Jung Bauermann <thiago.bauermann@linaro.org>
Mon, 28 Apr 2025 02:57:56 +0000 (23:57 -0300)
committerThiago Jung Bauermann <thiago.bauermann@linaro.org>
Mon, 28 Apr 2025 05:50:10 +0000 (02:50 -0300)
Otherwise reg_buffer::initialize_variable_size_registers () won't be
able to resolve the types of variable-size registers.

gdb/linux-nat.c
gdb/linux-nat.h

index 2f98060506bb7afb3e92bc4e4ce533a7db939c91..72d1448da626b831a125e424d7db6660eb6f523e 100644 (file)
@@ -4637,6 +4637,17 @@ linux_nat_target::supports_set_thread_options (gdb_thread_options options)
   return ((options & supported_options) == options);
 }
 
+/* See gdb/process-stratum-target.h.  */
+
+void
+linux_nat_target::supply_early_registers (regcache *regcache)
+{
+  if (regcache->has_variable_size_registers ())
+    /* We need the values of target description parameter early, so make
+       sure they're available.  */
+    regcache->update_tdesc_parameters ();
+}
+
 linux_nat_target::linux_nat_target ()
 {
   /* We don't change the stratum; this target will sit at
index 6e539918ced0755840a1d8255bbcdf885ed3d4cc..62f4296279fc75407f0d1b85687d3dba7bcfa7ec 100644 (file)
@@ -192,6 +192,8 @@ public:
      recognizes SIGTRAP only.  */
   virtual bool low_status_is_event (int status);
 
+  void supply_early_registers (regcache *regcache) override;
+
 protected:
 
     void post_startup_inferior (ptid_t) override;