aboutsummaryrefslogtreecommitdiff
path: root/gdb/regformats
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2018-05-10 10:27:13 -0500
committerJoel Brobecker <brobecker@adacore.com>2018-05-10 11:27:13 -0400
commit190852c8ac75cb62a737c58edfadfb0e1fcef78a (patch)
tree5004c0da4d2f4b06cadf6f6961b3ab7b93ce7fdf /gdb/regformats
parent7dbac825b09f0847e608b50c80db816ef20d9315 (diff)
downloadbinutils-190852c8ac75cb62a737c58edfadfb0e1fcef78a.zip
binutils-190852c8ac75cb62a737c58edfadfb0e1fcef78a.tar.gz
binutils-190852c8ac75cb62a737c58edfadfb0e1fcef78a.tar.bz2
gdbserver/Windows: crash during connection establishment phase
On Windows, starting a new process with GDBserver seems to work, in the sense that the program does get started, and GDBserver confirms that it is listening for GDB to connect. However, as soon as GDB establishes the connection with GDBserver, and starts discussing with it, GDBserver crashes, with a SEGV. This SEGV occurs in remote-utils.c::prepare_resume_reply... | regp = current_target_desc ()->expedite_regs; | [...] | while (*regp) ... because, in our case, REGP is NULL. This patches fixes the issues by adding a parameter to init_target_desc, in order to make sure that we always provide the list of registers when we initialize a target description. gdb/ChangeLog: PR server/23158: * regformats/regdat.sh: Adjust script, following the addition of the new expedite_regs parameter to init_target_desc. gdb/gdbserver/ChangeLog: PR server/23158: * tdesc.h (init_target_desc) <expedite_regs>: New parameter. * tdesc.c (init_target_desc) <expedite_regs>: New parameter. Use it to set the expedite_regs field in the given tdesc. * x86-tdesc.h: New file. * linux-aarch64-tdesc.c (aarch64_linux_read_description): Adjust following the addition of the new expedite_regs parameter to init_target_desc. * linux-tic6x-low.c (tic6x_read_description): Likewise. * linux-x86-tdesc.c: #include "x86-tdesc.h". (i386_linux_read_description, amd64_linux_read_description): Adjust following the addition of the new expedite_regs parameter to init_target_desc. * lynx-i386-low.c: #include "x86-tdesc.h". (lynx_i386_arch_setup): Adjust following the addition of the new expedite_regs parameter to init_target_desc. * nto-x86-low.c: #include "x86-tdesc.h". (nto_x86_arch_setup): Adjust following the addition of the new expedite_regs parameter to init_target_desc. * win32-i386-low.c: #include "x86-tdesc.h". (i386_arch_setup): Adjust following the addition of the new expedite_regs parameter to init_target_desc.
Diffstat (limited to 'gdb/regformats')
-rwxr-xr-xgdb/regformats/regdat.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/regformats/regdat.sh b/gdb/regformats/regdat.sh
index 8f546fe..5a8564a 100755
--- a/gdb/regformats/regdat.sh
+++ b/gdb/regformats/regdat.sh
@@ -185,11 +185,10 @@ echo
cat <<EOF
#ifndef IN_PROCESS_AGENT
- result->expedite_regs = expedite_regs_${name};
result->xmltarget = xmltarget_${name};
#endif
- init_target_desc (result);
+ init_target_desc (result, expedite_regs_${name});
tdesc_${name} = result;
}