Check results of get_darwin_inferior
authorTom Tromey <tom@tromey.com>
Fri, 13 Jul 2018 18:45:07 +0000 (12:45 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 2 Aug 2018 21:08:44 +0000 (15:08 -0600)
commitb5bddbbbbcece5d52115bd3e1299cec2a3b362f0
treec199bb0c240fe568d96dc21548bc618c31990912
parent8094f49a4dd9679c294e6254e928ea75c229aa95
Check results of get_darwin_inferior

I noticed that the existing kill-detach-inferiors-cmd.exp test was
causing gdb to crash on macOS 10.13.  The bug was that an inferior
that hadn't yet been started would cause get_darwin_inferior to return
NULL, and this was not checked.

I went through the places calling get_darwin_inferior and added checks
where appropriate.  This makes the test get a bit further.  Not all of
these spots are exercised by the test, but they seem safe enough in
any case.

gdb/ChangeLog
2018-08-02  Tom Tromey  <tom@tromey.com>

* darwin-nat.c (find_inferior_task_it, darwin_find_thread)
(darwin_suspend_inferior, darwin_resume_inferior)
(darwin_decode_notify_message, darwin_resume_inferior_threads)
(darwin_check_new_threads): Check result of get_darwin_inferior.
gdb/ChangeLog
gdb/darwin-nat.c