This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Make "run" work on macOS 10.13
- From: Tom Tromey <tom at tromey dot com>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>
- Cc: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org, roirand at adacore dot com
- Date: Thu, 23 Aug 2018 14:03:24 -0600
- Subject: Re: [RFC] Make "run" work on macOS 10.13
- References: <20180629205532.25377-1-tom@tromey.com> <d4d3994e73220253b058babb07c995fc@polymtl.ca>
>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
>> {
>> + /* Starting with Sierra, SIP prevents gdb from attaching to the
>> + shell, so users have to disable startup-with-shell. */
>> + scoped_restore save_startup
>> + = make_scoped_restore (&startup_with_shell, 0);
>> +
>> /* Do the hard work. */
>> fork_inferior (exec_file, allargs, env, darwin_ptrace_me,
Simon> I think this part is good. I would suggest printing a
Simon> message/warnings to indicate that we are disabling startup-with-shell
Simon> (only if startup_with_shell is 1 in the first place).
See the bug and also Pedro's comments on Xavier's similar patch --
there are other, probably better, ideas here.
Simon> The unrelocated value of the symbol is 0xf782. That breakpoint is
Simon> used for "set stop-on-solib-events", it seems, so I tried to enable
Simon> that with both of your patches. I got a stop with Xavier's patch and
Simon> none with Tom's, which leads me to think that Xavier's patch gets it
Simon> right. I think you may be using the executable base address, while we
Simon> actually want to use dyld's base address? This is not very clear to
Simon> me yet.
I think we want Xavier's patch and not mine. Mine was more of a stab in
the dark.
Tom