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

Inspect local variables #77

Closed
guettli opened this issue Jan 11, 2019 · 5 comments
Closed

Inspect local variables #77

guettli opened this issue Jan 11, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@guettli
Copy link

guettli commented Jan 11, 2019

First: Thank you very much for this great tool.

Is it possible to look at the local variables of a frame?

This would be awesome.

In my case I see that a django process is executing a sql statement which takes long.

It would be very nice if I could see the sql statement.

What do you think?

@benfred benfred added the enhancement New feature or request label Jan 16, 2019
benfred added a commit that referenced this issue Oct 6, 2019
This adds the ability to show the local variables for each frame when showing
the stack trace with the dump command. Currently we only support str/float/int
/bool/nonetype/list/tuple/dict objects - everything else will just show the
type and address.  (#77).
Dictionary processing also currently only works for python 3.6+, everything else
will show a 'dict' object instead.

This also adds the ability to show the thead names for each thread during dump.
Since this relies on a bunch of dictionary lookups, this also only works for
python 3.6+ (#47)
@benfred
Copy link
Owner

benfred commented Oct 6, 2019

I've added some basic ability to do this in #176 - if you pass in --locals to the dump command now it will print out the local variables associated with each frame. It's limited to combinations of str/float/int/bool/nonetype/list/tuple/dict objects - but could still be pretty helpful for lightweight debugging .

benfred added a commit that referenced this issue Oct 7, 2019
This adds the ability to show the local variables for each frame when showing
the stack trace with the dump command. Currently we only support str/float/int
/bool/nonetype/list/tuple/dict objects - everything else will just show the
type and address.  (#77).
Dictionary processing also currently only works for python 3.6+, everything else
will show a 'dict' object instead.

This also adds the ability to show the thead names for each thread during dump.
Since this relies on a bunch of dictionary lookups, this also only works for
python 3.6+ (#47)
benfred added a commit that referenced this issue Oct 7, 2019
This adds the ability to show the local variables for each frame when showing
the stack trace with the dump command. Currently we only support str/float/int
/bool/nonetype/list/tuple/dict objects - everything else will just show the
type and address.  (#77).
Dictionary processing also currently only works for python 3.6+, everything else
will show a 'dict' object instead.

This also adds the ability to show the thead names for each thread during dump.
Since this relies on a bunch of dictionary lookups, this also only works for
python 3.6+ (#47)
@benfred benfred closed this as completed Oct 7, 2019
@guettli
Copy link
Author

guettli commented Oct 7, 2019

@benfred thank you very much!

@benfred
Copy link
Owner

benfred commented Oct 8, 2019

This change is in v0.2.2 - it looks something like:

localvars

@benfred
Copy link
Owner

benfred commented Oct 9, 2019

uggh - just tried this out on Linux and there are some remaining issues so I'm reopening this:

  1. This messes up the thread idle detection logic (which is visible in the screenshot above with the thread being marked as idle).
  2. This doesn't work with the native profiling option.

@benfred benfred reopened this Oct 9, 2019
@benfred
Copy link
Owner

benfred commented Oct 10, 2019

fix is here: #180

@benfred benfred closed this as completed Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants