[PATCH 3/7] Don't hardcode CONTEXT size for a NOTE_INFO_THREAD win32pstatus note
Jon Turney
jon.turney@dronecode.org.uk
Wed Jul 1 21:32:21 GMT 2020
Don't hardcode the size of the Win32 API thread CONTEXT type read from a
NOTE_INFO_THREAD win32pstatus note (since it's different on different
architectures).
bfd/ChangeLog:
2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
* elf.c (elfcore_grok_win32pstatus): Don't hardcode the size of
the Win32 API thread CONTEXT type read from a NOTE_INFO_THREAD
win32pstatus note.
---
bfd/ChangeLog | 6 ++++++
bfd/elf.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/bfd/elf.c b/bfd/elf.c
index a7790a4eec4..a61e2b7dd1d 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -10171,7 +10171,7 @@ elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note)
return FALSE;
/* sizeof (thread_info.thread_context) */
- sect->size = 716;
+ sect->size = note->descsz - 12;
/* offsetof (thread_info.thread_context) */
sect->filepos = note->descpos + 12;
sect->alignment_power = 2;
--
2.27.0
More information about the Gdb-patches
mailing list