Re: XCode Debugger Breakpoint Question
Re: XCode Debugger Breakpoint Question
- Subject: Re: XCode Debugger Breakpoint Question
- From: Jim Ingham <email@hidden>
- Date: Wed, 27 Apr 2016 10:51:17 -0700
> On Apr 27, 2016, at 2:48 AM, Dave <email@hidden> wrote:
>
> Hi Again,
>
>> On 26 Apr 2016, at 22:07, Jim Ingham <email@hidden> wrote:
>>
>>
>>> On Apr 26, 2016, at 1:54 PM, Dave <email@hidden> wrote:
>>>
>>> Hi Jim,
>>>
>>> Thanks for this, I’m too tired to take it in now, I’ll look at it in more detail tomorrow. Off the top though, a couple of questions:
>>>
>>> 1. The “breakpoint_filters.py” file. Do I have to add this to my XCode Project?
>>
>> No, it just needs to be some place you can find it on the file system. LLDB doesn't know about Xcode's build variables, so there's no way to tell lldb about it in a "project relative" manner (i.e. $PROJECT_DIR/Python/…)
>
> Ok, thanks.
>
>
>>
>>> 2. The Commands:
>>>
>>>> (lldb) break set -E objc
>>>> (lldb) commmand script import ~/breakpoint_filters.py
>>>> (lldb) break command add -F breakpoint_filters.reject_by_parent_name
>>>
>>> Do I need to type this in each time I open XCode? Is there a way of having it auto-magically run when the Project is opened?
>>>
>>
>> You need to run these commands when the debugging session starts, not when the project is opened. I suggested below putting an auto-continue breakpoint on main and inserting the commands given above into the Actions of that breakpoint.
>
> So I need to run this command every time I start the debugger? If so, then its of no use as I’ll never be able to get everyone to remember to run it each time. I thought there might have been a way to automate running the coomands at startup, if not, then its not worth it and I’ll just have to live with not getting exceptions caught.
I don't know what kind of project you are debugging. But if it has any code that gets run BEFORE you start hitting these exceptions, my suggestion was to make an Xcode breakpoint, symbolic or file & line, make the breakpoint "auto-continue" and put these commands in the Breakpoint Actions (as lldb command actions) in the breakpoint. That auxiliary breakpoint is stored in the Xcode project, so it will persist, as will its commands. Then when you start debugging, the process you are debugging will execute this code, which will trip the breakpoint and run these commands. Then you'll be set. If you are debugging a project that makes a executable (.app, command-line tool, etc) then "main" is a convenient symbol to use for this sort of thing.
Jim
>
> Cheers
> Dave
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden