]> 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>
Thu, 23 Oct 2025 04:17:05 +0000 (01:17 -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 0c24e10c2c9ec49b14304ac447ee80004efb9ef0..c92beeddaeb3760022d7e4cf541b713e3a3b0b70 100644 (file)
@@ -4655,6 +4655,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 70d1241c54948fbb3b136d498cc25d06e368b7ce..82edf23eb8659ca8e92bc8a1a2d60db4ce85df2b 100644 (file)
@@ -199,6 +199,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;