aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2024-03-26 18:50:58 +0000
committerAndrew Burgess <aburgess@redhat.com>2024-03-26 18:50:58 +0000
commitc17389078ae2a2a4f6aade6bfbabbf3a41d28f14 (patch)
tree9f78899887955e8ee40110e128b1516818874b46
parent4c48ff3e92ab45de7b8bb9de30fcc6d70669e2ab (diff)
downloadgdb-c17389078ae2a2a4f6aade6bfbabbf3a41d28f14.zip
gdb-c17389078ae2a2a4f6aade6bfbabbf3a41d28f14.tar.gz
gdb-c17389078ae2a2a4f6aade6bfbabbf3a41d28f14.tar.bz2
Revert "gdb: fix possible uninitialised variable use"
This reverts commit 24df37a10f8773ad5db07dc000f694d6405e3a36.
-rw-r--r--gdb/i386-linux-tdep.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index 2e84384..ed14422 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -700,15 +700,17 @@ i386_linux_core_read_description (struct gdbarch *gdbarch,
x86_xsave_layout layout;
uint64_t xcr0 = i386_linux_core_read_xsave_info (abfd, layout);
- if (xcr0 == 0)
- {
- if (bfd_get_section_by_name (abfd, ".reg-xfp") != nullptr)
- xcr0 = X86_XSTATE_SSE_MASK;
- else
- xcr0 = X86_XSTATE_X87_MASK;
- }
+ const struct target_desc *tdesc;
+ if (xcr0 != 0)
+ tdesc = i386_linux_read_description (xcr0);
- return i386_linux_read_description (xcr0);
+ if (tdesc != NULL)
+ return tdesc;
+
+ if (bfd_get_section_by_name (abfd, ".reg-xfp") != NULL)
+ return i386_linux_read_description (X86_XSTATE_SSE_MASK);
+ else
+ return i386_linux_read_description (X86_XSTATE_X87_MASK);
}
/* Similar to i386_supply_fpregset, but use XSAVE extended state. */