From: Thiago Jung Bauermann Date: Mon, 28 Apr 2025 02:57:56 +0000 (-0300) Subject: GDB: linux-nat: Make tdesc parameters available early X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63603295544821124aa5bed9f0e153d0c809f01a;p=thirdparty%2Fbinutils-gdb.git GDB: linux-nat: Make tdesc parameters available early Otherwise reg_buffer::initialize_variable_size_registers () won't be able to resolve the types of variable-size registers. --- diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 2f98060506b..72d1448da62 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -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 diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h index 6e539918ced..62f4296279f 100644 --- a/gdb/linux-nat.h +++ b/gdb/linux-nat.h @@ -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;