[lldb-dev] Linkage issue?
Jared Carlson
jared.carlson23 at gmail.com
Thu Aug 30 14:46:15 PDT 2012
Since I'm on a roll, might as well ask another..
I can't seem to restart my process via process.Continue().. here's the code:
def exercise( execfile, args, cmd ):
dbg = lldb.SBDebugger.Create()
target = dbg.CreateTarget( execfile )
bp1 = target.BreakpointCreateByName('override')
bp1.SetEnabled(True)
if not bp1.IsValid():
print "Breakpoint is not valid"
return None
ci = dbg.GetCommandInterpreter()
res = lldb.SBCommandReturnObject()
process = target.LaunchSimple( args,None,os.getcwd() )
process = target.GetProcess()
while process.GetState() == lldb.eStateStopped:
ci.HandleCommand( cmd, res )
print res
print "\n"
err = process.Continue()
print err
print "Done"
return res
When I run, the cmd (a backtrace) runs just fine but the process.Continue() fails:
Status: Success
Output Message:
* thread #1: tid = 0x1d07, 0x000000010ac75db7 simple2`override(int) + 7 at simple.cxx:45, stop reason = breakpoint 1.1
frame #0: 0x000000010ac75db7 simple2`override(int) + 7 at simple.cxx:45
frame #1: 0x000000010ac75d13 simple2`check(int) + 19 at simple.cxx:29
frame #2: 0x000000010ac75cbe simple2`main + 46 at simple.cxx:18
frame #3: 0x00007fff912077e1 libdyld.dylib`start + 1
error: Resume request failed - process still running.
Do I need to do something to the break point to allow the process to continue?? The code I see under the testing directories seems to not do anything in particular…
Thanks for any help,
- Jared
On Aug 30, 2012, at 4:56 PM, Jared Carlson <jared.carlson23 at gmail.com> wrote:
> Thanks…
>
> Just noticed that… need more sleep ;)
>
> - Jared
>
>
> On Aug 30, 2012, at 4:54 PM, Filipe Cabecinhas <filcab at gmail.com> wrote:
>
>> The correct name is 'IsValid' (capital 'I'). ;-)
>>
>> Regards,
>>
>> Filipe
>>
>>
>> On Thursday, August 30, 2012 at 9:46 PM, Jared Carlson wrote:
>>
>>> Afternoon,
>>>
>>> I'm trying to run some lldb python code outside of Xcode and I'm running into an issue..
>>>
>>> So I used PYTHONPATH to point to the lldv module within Xcode.app (This is on Mountain Lion) and I can import lldv, etc just fine from the command line but when I try to use breakpoints or some other code I've seen others use I run into swig issues, for example:
>>>
>>> bp1 = target.BreakpointCreateByName('override')
>>>>>> bp1
>>>>>
>>>>
>>>
>>>
>>> <lldb.SBBreakpoint; proxy of <Swig Object of type 'lldb::SBBreakpoint *' at 0x10d80dc30> >
>>>>>> bp1.isValid()
>>>>>
>>>>
>>>
>>>
>>> Traceback (most recent call last):
>>> File "<stdin>", line 1, in <module>
>>> File "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/Python/lldb/__init__.py", line 1119, in <lambda>
>>> __getattr__ = lambda self, name: _swig_getattr(self, SBBreakpoint, name)
>>> File "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/Python/lldb/__init__.py", line 78, in _swig_getattr
>>> raise AttributeError(name)
>>> AttributeError: isValid
>>>
>>> I can create various variables, etc… but I notice it seems like I'm missing a few odds and ends.. I would guess that this is a linkage issue but am a little stumped as to why it seems I'm getting most of the functionality I expect.
>>>
>>> Thanks for any help you can give.
>>>
>>> - Jared
>>>
>>>
>>> _______________________________________________
>>> lldb-dev mailing list
>>> lldb-dev at cs.uiuc.edu (mailto:lldb-dev at cs.uiuc.edu)
>>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>>
>>
>>
>
More information about the lldb-dev
mailing list