DerekSelander / LLDB

A collection of LLDB aliases/regexes and Python scripts to aid in your debugging sessions
GNU General Public License v2.0
1.77k stars 198 forks source link

Enumerating NoneType #11

Closed cclamb closed 5 years ago

cclamb commented 5 years ago

So there's a bug that seems pretty endemic with respect to enumerating a NoneType. You can see it in search at line 110 (I think i may be a python3 issue?):

Currently in search.py:110: if 'nil' in res.GetOutput():

Fixed with? ro = res.GetOutput() if ro is None or 'nil' in res.GetOutput():

Not sure if this is correct though.

jasonmolenda commented 5 years ago

You could try calling res.HasResult() before grabbing the output. If SBCommandReturnObject::GetOutput() is returning None, my guess is that the expression (HandleCommand() call) couldn't be executed for some reason. There's also a SBCommandReturnObject::Succeeded() method.

cclamb commented 5 years ago

That sounds like a better solution (e.g. ::HasOuput()). I'll look at making these changes and submitting a pull request. ::Succeeded() should likely be used as well, I'll see where it makes sense.

On Fri, Jan 4, 2019 at 12:48 PM Jason Molenda notifications@github.com wrote:

You could try calling res.HasResult() before grabbing the output. If SBCommandReturnObject::GetOutput() is returning None, my guess is that the expression (HandleCommand() call) couldn't be executed for some reason. There's also a SBCommandReturnObject::Succeeded() method.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DerekSelander/LLDB/issues/11#issuecomment-451549433, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPUh5pnNOp1fMQrcOOzhb872hfnBFitks5u_7AFgaJpZM4ZsG01 .