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

[lldb] first secondary channel idea - query stack #59

Closed
lanza opened this issue Feb 19, 2019 · 1 comment
Closed

[lldb] first secondary channel idea - query stack #59

lanza opened this issue Feb 19, 2019 · 1 comment

Comments

@lanza
Copy link
Contributor

lanza commented Feb 19, 2019

So as a first idea of a feature that can be implemented via lldb's python API would be to query for the stack. You can do this either with a :NvimGdbQueryStack or as a persistent display on every single stop.

This could be don via something like (making up the APIs as I go as I don't know them all off the top of my head)

if is_x86_64():
    stack_pointer = "$rsp"
else:
    stack_pointer = "$sp"
output = lldb.HandleCommand(f"memory read -l 8 -c 64 {stack_pointer}")
process_stack_output(output)
vim.command("vert bo 30new | setlocal notemp | setlocal readonly")
w = vim.windows.getlast()
w.contents = output

What are your thoughts on this?

@sakhnik
Copy link
Owner

sakhnik commented Feb 19, 2019

That's interesting. I was thinking about it in a little bit different way:

  • The plugin should only provide a way to "define" a watch window
  • The user could specify any debugger-, platform-specific expression
  • The window would update itself upon events (either after parsing of debugger output for gdb and pdb, or from API events for lldb Two way socket communication with lldb #53)
  • The plugin code probably doesn't need to be too much aware of platform-specific things like x64, arm whatnot.

Could we have a function GdbCreateWatchWindow("expr")?

@lanza lanza closed this as completed Jun 22, 2020
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

2 participants