Question

I am trying to find out what is causing my application to SEGFAULT and managed to track it down to a certain module. I have set a trace within a certain function of the module:

def algorithm_wrapper(*args, **kwargs):        
    _version = version
    if "Version" in kwargs:
        _version = kwargs["Version"]
        del kwargs["Version"]
    algm = _framework.createAlgorithm(algorithm, _version)
    pdb.set_trace()
    _set_logging_option(algm, kwargs)

If I want to check local variables _version and algm I get the following error:

-> _set_logging_option(algm, kwargs)
(Pdb) _version
    NameError: name '_version' is not defined
(Pdb) algm
    NameError: name 'algm' is not defined

I'm at a loss, this is the first time I find this error. Please help!

No correct solution

OTHER TIPS

I'm not an expert on pdb, and it might just be a typo in your sample code and not what you actually tried, but don't you need to type the following into pdb to print a variable?

(Pdb) p _version

Versus just plain

(Pdb) _version

Sorry if that's not what's going on, that's just the only thing I see amiss. Good luck!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top