[RFC] Make "run" work on macOS 10.13
Pedro Alves
palves@redhat.com
Sat Jun 30 17:41:00 GMT 2018
On 06/29/2018 09:55 PM, Tom Tromey wrote:
> I would like some feedback on this patch.
>
> On macOS 10.13.5, "run" does not work in gdb. There are two cases:
>
> 1. If I forget to "set startup-with-shell off", then gdb will fail due
> to the system integrity protection feature. I believe this happens
> because gdb is not allowed to debug the shell.
>
> You can find many sites advocating "set startup-with-shell off",
> but it seems to me that it is friendlier for gdb to simply do it by
> default.
Judging from stackoverflow, input redirection is a common-ish thing
for users to do. Maybe we could reuse Eli's input redirection
emulation for Windows here:
https://sourceware.org/ml/gdb-patches/2016-10/msg00832.html
Doesn't have to be you or in this patch of course. Just a suggestion.
>
> One option here might be to do this conditionally based on the
> version of the OS.
>
> 2. I found that gdb was setting the solib breakpoint incorrectly,
> causing a failure. Adding the load address to the notifier address
> makes this work for me. I suspect this would regress earlier
> versions of macOS, but I have no way to test that; one idea might
> be to only do this when gdb_dyld_all_image_infos::version == 15.
14 vs 15 behaving differently does sound consistent with:
https://sourceware.org/ml/gdb-patches/2018-06/msg00167.html
Thanks,
Pedro Alves
More information about the Gdb-patches
mailing list