Can't switch to different stack frames or threads #17

Closed
rchl opened this Issue Apr 1, 2012 · 11 comments

Comments

Projects
None yet
2 participants

rchl commented Apr 1, 2012

I'm getting this exception:

Traceback (most recent call last):
File "/Applications/Sublime Text 2.app/Contents/MacOS/sublime_plugin.py", line 225, in on_query_context
callback.module, "on_query_context", FAST_EVENT_TIMEOUT)
File "/Applications/Sublime Text 2.app/Contents/MacOS/sublime_plugin.py", line 154, in run_timed_function
ret = f()
File "/Applications/Sublime Text 2.app/Contents/MacOS/sublime_plugin.py", line 224, in
val = run_timed_function(lambda: callback.on_query_context(v, key, operator, operand, match_all),
File "./sublimegdb.py", line 1393, in on_query_context
AttributeError: 'NoneType' object has no attribute 'id'

Using build ST2 2192.

More info needed?

Owner

quarnster commented Apr 2, 2012

Line 1393 in my sublimegdb.py is not on_query_context, so maybe your plugin is out of date?

Is it an osx app you are trying to debug? What version of gdb are you using?

@quarnster quarnster added a commit that referenced this issue Apr 2, 2012

@quarnster quarnster gdb_* contexts can now be queried properly when the queried view
is closed. Related to issue #17, but doesn't fix it.
34f35ed
Owner

quarnster commented Apr 2, 2012

The only time the context is queried (I think) is when using the keyboard to navigate the gdb views. I found one issue when the variables or register view happened to be closed that could cause such an AttributeError that should now be fixed.

However, there are no key bindings set up to change the stack frame or current thread, that is all handled by clicking in the view on the corresponding line you want to go to (and IIRC context's can't be queried for mouse clicks, but maybe I'm wrong).

If updating to the latest version doesn't fix anything for you, please provide more details as I've not been able to reproduce not being able to switch stack frame or threads.

rchl commented Apr 2, 2012

That stack happens when pressing enter in the stack trace view. I get it with new version too:

Traceback (most recent call last):
File "/Applications/Sublime Text 2.app/Contents/MacOS/sublime_plugin.py", line 225, in on_query_context
callback.module, "on_query_context", FAST_EVENT_TIMEOUT)
File "/Applications/Sublime Text 2.app/Contents/MacOS/sublime_plugin.py", line 154, in run_timed_function
ret = f()
File "/Applications/Sublime Text 2.app/Contents/MacOS/sublime_plugin.py", line 224, in
val = run_timed_function(lambda: callback.on_query_context(v, key, operator, operand, match_all),
File "./sublimegdb.py", line 1440, in on_query_context
AttributeError: 'NoneType' object has no attribute 'id'

Still doesn't seem to match the right line in the file but is close this time.

Using mouse to change stack frame doesn't do anything at all (I didn't know that it's possible even). No error in console either.

"GNU gdb 6.3.50-20050815 (Apple version gdb-1752) (Sat Jan 28 03:02:46 UTC 2012)\n"

rchl commented Apr 2, 2012

Hmm, I've added some logging near where you changed things in the last commit and now it doesn't throw any exception. But it doesn't switch frame either...

rchl commented Apr 2, 2012

Maybe there was some problem with stale .pyc code? Anyways, like I've mentioned, I don't get exceptions anymore but original problem still exists.

BTW. My stacktrace looks rather weird - all object arguments are expanded so that one stack frame can actually take many, many lines. Is that expected?
You can see it here: https://gist.github.com/2286183 (had to mask real letters so you'll see 'x''s only :)).

rchl commented Apr 2, 2012

Oh, you wrote that it's not possible to switch context using keyboard. I'm not a very careful reader it seems. That's fine though as long as switching with mouse works (and doesn't for me).

Owner

quarnster commented Apr 2, 2012

If you enter sublime.log_commands(True) in the python console, what's printed in it when you click in the views?

It should be something like this

command: drag_select {"event": {"button": 1, "x": 588.5, "y": 286.5}}
command: gdb_click {"event": {"button": 1, "x": 588.5, "y": 286.5}}

Some other plugin or maybe sublime itself might eat the clicks. The mousemap isn't as well documented as the keymap so I don't know if there's a way to bind them to only happen in a certain context.

Yeah, the expanded stacktrace argument thing is a known issue I haven't bothered to fix or open a tracking issue for yet. Opened as issue #18 now.

rchl commented Apr 2, 2012

I only get these:

command: drag_select {"event": {"button": 1, "x": 768.5, "y": 453.5}}
command: status_bar_function {"event": {"button": 1, "x": 768.5, "y": 453.5}}

rchl commented Apr 2, 2012

And the status_bar_function thing I had defined in my mouse map configuration as:

{
   "button": "button1", "count": 1,
   "press_command": "drag_select",
   "command": "status_bar_function"
}

Removing it fixed the problem. :)

BTW. Some related "issues": clicking stacktrace scrolls this view to the bottom. Pretty annoying.

Also these expanded arguments often have trailing spaces in them which show up in pretty ugly way in my configuration(on purpose). I suppose this is how gdb gives them to the plugin. And would become irrelevant after fixing #18 anyway so I won't bother you more about that. :)

BTW2. Do you have some donation set up or something? I think you deserve some money for great work on SublimeGDB and SublimeClang (at least the latter I'm using daily, not sure if I can get accustomed to the former :)).

Owner

quarnster commented Apr 2, 2012

You have this code among your packages, don't you? :)

Since https://github.com/akrabat/SublimeFunctionNameDisplay seems to have taken over (and is not using a mousemap) one way to fix this would be to delete the files associated with the old display function stuff and install that new package instead. Hopefully there's nothing else that conflicts then. If there's still a conflict, you could always copy and paste SublimeGDB's *.sublime-mousemap file into your User package folder so that it gets precedence over other mousemaps.

Also there's no context support for mouse maps, so unclear how conflicts such as this can be prevented.

Owner

quarnster commented Apr 2, 2012

Closing this issue since I can't think of any specific action items here. The conflicts between mouse maps is unfortunate but I see it as more of a ST2 issue. One could argue that SublimeGDB should support everything via keyboard commands, but if someone feels very strongly about that I would accept a pull request or some beer money to fix that ;)

BTW1 #19
BTW2 Donate

quarnster closed this Apr 2, 2012

@ProPuke ProPuke added a commit to ProPuke/SublimeGDB that referenced this issue Apr 7, 2012

@quarnster @ProPuke quarnster + ProPuke gdb_* contexts can now be queried properly when the queried view
is closed. Related to issue #17, but doesn't fix it.
0bd3ea7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment