diff options
author | Tom Tromey <tom@tromey.com> | 2018-06-28 11:57:39 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-07-03 09:28:26 -0600 |
commit | a50c11c666e07b922d64aa5bb2747f180ce17c03 (patch) | |
tree | 80d95fd601e4a2aadee6e5bc34d1f921f306333f /gdb/nat/linux-osdata.c | |
parent | b8a6ced79668ec8af3180e50b76f7517ebbab0d9 (diff) | |
download | binutils-a50c11c666e07b922d64aa5bb2747f180ce17c03.zip binutils-a50c11c666e07b922d64aa5bb2747f180ce17c03.tar.gz binutils-a50c11c666e07b922d64aa5bb2747f180ce17c03.tar.bz2 |
Fix crash in "run" on macOS when gdb is not signed
On macOS, when gdb is not code-signed, it will throw an exception from
darwin_attach_pid. However, gdb also then crashes:
thread.c:93: internal-error: struct thread_info *inferior_thread(): Assertion `tp' failed.
I think the problem here is that darwin_attach_pid does not clean up
inferior_ptid and inf->pid on failure. This leads to a situation
where gdb tries to find a thread, but cannot.
In other cases, gdb would mourn the inferior at this point; but here
this is not possible because the target has not been pushed. Instead
this patch works by simply updating the inferior and inferior_ptid on
failure.
Tested by building an unsigned gdb on macOS and trying to run an
inferior.
gdb/ChangeLog
2018-07-03 Tom Tromey <tom@tromey.com>
PR cli/23340:
* darwin-nat.c (darwin_attach_pid): Reset inferior and
inferior_ptid on error.
Diffstat (limited to 'gdb/nat/linux-osdata.c')
0 files changed, 0 insertions, 0 deletions