Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Exception <class 'ValueError'> Variable not found #3

Open
yzsatgithub opened this issue Nov 13, 2018 · 2 comments
Open

Python Exception <class 'ValueError'> Variable not found #3

yzsatgithub opened this issue Nov 13, 2018 · 2 comments

Comments

@yzsatgithub
Copy link

When I call cv_imshow mat_name, I got the following exception:

Python Exception <class 'ValueError'> Variable 'mat_name' not found.: 
Error occurred in Python command: Variable 'mat_name' not found.

The variable actually exists.

@renatoGarcia
Copy link
Owner

Are you sure that the mat_name variable is on scope at the line where you set your breakpoint?
Could you share a minimal working example where this error appears?

@matemat13
Copy link

I believe this may happen when you try to show a cv::Mat, which is a field variable - e.g. a member of an object. This is because in cv_imshow.py:58 you use frame.read_var, which checks only for variables with the specific name from the specific frame, but not for field variables (e.g. this->arg instead of arg), which might also be visible from the frame.

I think the workaround should involve using gdb.lookup_symbol to translate the string arg to a gdb.Symbol, instead of using frame.read_var directly to the string, but I'm unable to make it work. I may have some buggy version of gdb, since gdb.lookup_symbol(arg) returns (None, True), when arg is a name of a field variable, which should not happen according to gdb docs (https://sourceware.org/gdb/onlinedocs/gdb/Symbols-In-Python.html).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants