31i73 / atom-dbg

An Atom package - An interactive debugger frontend
https://atom.io/packages/dbg
MIT License
30 stars 4 forks source link

dbgProvider api.ui.currentLine(line) #12

Closed pablomayobre closed 7 years ago

pablomayobre commented 7 years ago

It would be great if you could set the line currently being executed from the dbgProvider (through a function of the api.ui object). This is most useful to signal the line where the debugger was paused.

If this feature is already available then it may not be clear enough.

Not directly related: I wanna develop a debugger but it doesn't have a stepIn, stepOut and stepOver. So I was gonna ignore this events (function () {} ). It does however have a step which just goes to the line that follows the last executed line, executes it and pauses the debugger. Would there be a problem if I mapped this to the stepOver event? Or could there be an extra button for this? Also it would be nice to disable buttons and/or panels if the debugger doesn't support the functionality

ProPuke commented 7 years ago

That's done with api.ui.setStack

So, for example:

api.ui.stop();
api.ui.setStack([
    {local: true, file: absolutepath, line: lineNumber, name: functionName, path: localpath}
]);

Usually you'd feed it a full stack, not just a single position - so the first item would be the entrypoint of the program, then the next function called.. and so on until the current location.

Yeah, disabling stuff not available makes sense. If you or someone else needs it I'll add it in :]

pablomayobre commented 7 years ago

That's done with api.ui.setStack

Cool! I understand... I think that it should probably be documented somewhere, but it totally makes sense

Yeah, disabling stuff not available makes sense. If you or someone else needs it I'll add it in :]

I found out that the debugger actually provides step into/over/out so I don't really need to disable stuff, but it would be a good feature nonetheless

ProPuke commented 7 years ago

It is documented. It's in the horribly long README. But it is an ugly/cryptic-looking thing to thing to read :S

I'm gonna be lazy and skip removal for now, then :D But if someone does need it I'll chuck it in.

good luck!

pablomayobre commented 7 years ago

Yeah, I can see it... What I meant is that this line:

Frames are ordered from bottom to top, with index 0 being the entrypoint of the program and the highest index being the current executing location

Doesn't tell me that when the function is called the Atom cursor goes to the specified file and line of the current executing location (if available)

But since the functionality is there and it works as intended you may as well close this! Thank you very much for the awesome package, will report back when I actually finish this debugger!

ProPuke commented 7 years ago

<3