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=98c6087472db01089dbc20378ed22e27924fccd8;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 0c24e10c2c9..c92beeddaeb 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -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 diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h index 70d1241c549..82edf23eb86 100644 --- a/gdb/linux-nat.h +++ b/gdb/linux-nat.h @@ -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;