[lldb-dev] How to set source line breakpoint using BreakpointCreateByLocation?

Jeffrey Tan via lldb-dev lldb-dev at lists.llvm.org
Wed Oct 7 20:31:26 PDT 2015


Hi,

I am writing a python script to set source line breakpoint in ObjC on Mac
OSX.
But self.debugger.GetSelectedTarget().BreakpointCreateByLocation("EATAnimatedView.m",
line) always fail. Any ideas?

Also, can I use full path instead of file basename? In lldb, I found "b
/Users/jeffreytan/fbsource/fbobjc/Apps/Internal/MPKEats/MPKEats/View/EATAnimatedView.m:21"
will fail to bind but "b EATAnimatedView.m:21" will succeed.

Traceback (most recent call last):
  File
"/Users/jeffreytan/fbsource/fbobjc/Tools/Nuclide/pkg/nuclide/debugger/lldb/scripts/chromedebugger.py",
line 69, in _generate_response
    params=message.get('params', {}),
  File
"/Users/jeffreytan/fbsource/fbobjc/Tools/Nuclide/pkg/nuclide/debugger/lldb/scripts/handler.py",
line 42, in handle
    return self._domains[domain_name].handle(method_name, params)
  File
"/Users/jeffreytan/fbsource/fbobjc/Tools/Nuclide/pkg/nuclide/debugger/lldb/scripts/handler.py",
line 106, in handle
    return self._handlers[method](params)
  File
"/Users/jeffreytan/fbsource/fbobjc/Tools/Nuclide/pkg/nuclide/debugger/lldb/scripts/handler.py",
line 56, in _handler_wrapper
    ret = func(self, params)
  File
"/Users/jeffreytan/fbsource/fbobjc/Tools/Nuclide/pkg/nuclide/debugger/lldb/scripts/debugger.py",
line 248, in setBreakpointByUrl
    int(params['lineNumber']) + 1)
  File
"/Users/jeffreytan/fbsource/fbobjc/Tools/Nuclide/pkg/nuclide/debugger/lldb/scripts/debugger.py",
line 283, in _set_breakpoint_by_filespec
    breakpoint =
self.debugger.GetSelectedTarget().BreakpointCreateByLocation(filespec, line)
  File
"/Applications/Xcode.app/Contents/Developer/../SharedFrameworks/LLDB.framework/Resources/Python/lldb/__init__.py",
line 8650, in BreakpointCreateByLocation
    return _lldb.SBTarget_BreakpointCreateByLocation(self, *args)
NotImplementedError: Wrong number of arguments for overloaded function
'SBTarget_BreakpointCreateByLocation'.
  Possible C/C++ prototypes are:
    BreakpointCreateByLocation(lldb::SBTarget *,char const *,uint32_t)
    BreakpointCreateByLocation(lldb::SBTarget *,lldb::SBFileSpec const
&,uint32_t)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20151007/7aecf738/attachment.html>


More information about the lldb-dev mailing list