[lldb-dev] Can't debug "hello, world" with stock lldb from XCode 5?

Dan Kegel dank at kegel.com
Wed Jan 29 18:15:36 PST 2014


Where does Apple install its debugserver binary?

On Wed, Jan 29, 2014 at 6:10 PM, Richard Mitton <richard at codersnotes.com> wrote:
> Last time I tried that didn't work for me, I had to setuid the debugserver
> binary as root instead.
>
> Richard Mitton
> richard at codersnotes.com
>
>
> On 01/29/2014 04:48 PM, Dan Kegel wrote:
>>
>> Aha, that looks helpful.  I was indeed using ssh.
>>
>>
>> On Wed, Jan 29, 2014 at 4:48 PM, Greg Clayton <gclayton at apple.com> wrote:
>>>
>>> If you are ssh or using telnet, you can authorize yourself to be able to
>>> debug with:
>>>
>>> % sudo /usr/sbin/DevToolsSecurity --enable
>>>
>>> Otherwise, the first time you debug on a machine, it will pop up an
>>> authentication dialog box asking you for your password.
>>>
>>>
>>>
>>> On Jan 29, 2014, at 4:36 PM, Greg Clayton <gclayton at apple.com> wrote:
>>>
>>>> The comments below are only if you are building your own LLDB from
>>>> sources, so please ignore this if you are using a stock Xcode that was
>>>> installed from the App Store...
>>>>
>>>> If you are using a stock Xcode, try rebooting and see if that helps.
>>>>
>>>> Greg
>>>>
>>>> On Jan 29, 2014, at 4:22 PM, Greg Clayton <gclayton at apple.com> wrote:
>>>>
>>>>> You must have made your "lldb_codesign" prior to installing 10.9?
>>>>>
>>>>> If you didn't please follow the instructions:
>>>>>
>>>>>    % svn cat
>>>>> http://llvm.org/svn/llvm-project/lldb/trunk/docs/code-signing.txt
>>>>>
>>>>> If you already have a "lldb_codesign", it now needs to be marked as
>>>>> trusted again after the recent OS install. This is easier than doing
>>>>> everything from scratch, you just need to do:
>>>>>
>>>>> - Launch /Applications/Utilities/Keychain Access.app
>>>>> - Drag the existing "lldb_codesign" code signing certificate from the
>>>>> "login" keychain to the "System" keychain in the
>>>>> - In the Keychain Access GUI, click and drag "lldb_codesign" in the
>>>>> "System" keychain onto the desktop. The drag will create a
>>>>> "~/Desktop/lldb_codesign.cer" file used in the next step.
>>>>> - Switch to Terminal, and run the following:
>>>>>
>>>>> % sudo security add-trust -d -r trustRoot -p basic -p codeSign -k
>>>>> /Library/Keychains/System.keychain ~/Desktop/lldb_codesign.cer
>>>>> % rm -f ~/Desktop/lldb_codesign.cer
>>>>>
>>>>> - Drag the "lldb_codesign" certificate from the "System" keychain back
>>>>> into the "login" keychain
>>>>> - Quit Keychain Access
>>>>> - delete your old LLDB build folder as it has been code signed by an
>>>>> invalid code signature and will be cached by the kernel
>>>>> - Reboot
>>>>>
>>>>> You can also run lldb with "sudo" and it will work regardless of the
>>>>> code signing...
>>>>>
>>>>> On Jan 29, 2014, at 1:43 PM, Dan Kegel <dank at kegel.com> wrote:
>>>>>
>>>>>> Hi!
>>>>>> I just installed a fresh copy of Mac OS X 10.9, and on that, XCode 5.
>>>>>> Alas, it doesn't seem to be able to debug a trivial C program:
>>>>>>
>>>>>> $ lldb --version
>>>>>> lldb-300.2.53
>>>>>> $ gcc -g hello.c
>>>>>> $ lldb ./a.out
>>>>>> 2014-01-29 13:42:20.095 lldb[273:262f] Metadata.framework [Error]:
>>>>>> couldn't get the client port
>>>>>> Current executable set to './a.out' (x86_64).
>>>>>> (lldb) run
>>>>>> Process 3511 launched: './a.out' (x86_64)
>>>>>> error: initial process state wasn't stopped: exited
>>>>>>
>>>>>> Can I buy a clue?
>>>>>>
>>>>>> Thanks!
>>>>>> _______________________________________________
>>>>>> lldb-dev mailing list
>>>>>> lldb-dev at cs.uiuc.edu
>>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>>>>>
>>>>> _______________________________________________
>>>>> lldb-dev mailing list
>>>>> lldb-dev at cs.uiuc.edu
>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>>>>
>>>> _______________________________________________
>>>> lldb-dev mailing list
>>>> lldb-dev at cs.uiuc.edu
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>>
>> _______________________________________________
>> lldb-dev mailing list
>> lldb-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>
>
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev



More information about the lldb-dev mailing list