godebug icon indicating copy to clipboard operation
godebug copied to clipboard

Return and quit commands

Open willfaught opened this issue 9 years ago • 6 comments

  • Return from the current function
  • Quit the program

Any plans for these?

willfaught avatar Jun 19 '15 20:06 willfaught

Sure. Quit is really easy, so I've already added it. Return shouldn't be much harder, and is also useful.

jeremyschlatter avatar Jun 21 '15 05:06 jeremyschlatter

Return from current function: what should the command be called? @glycerine says that it is "fin" in gdb. pdb calls this "return". pdb also has "up" and "down" commands that let you move up and down the stack, so that "up" and then "next" does almost the same thing as "return".

Thoughts? I think I prefer pdb's scheme.

jeremyschlatter avatar Jul 29 '15 04:07 jeremyschlatter

I would name it "return" because it's self-documenting, and on the off-chance this is ever localized, it doesn't make sense to use a French word where English is used everywhere else.

It's been a while since I used pdb, but I thought up and down let you examine other stack frames, but didn't affect execution?

willfaught avatar Jul 29 '15 04:07 willfaught

Right, up and down don't affect execution, which is cool. I mentioned them because "up" followed by "next" is similar to "return".

I prefer "return", too. @glycerine, does that sound good to you?

jeremyschlatter avatar Jul 29 '15 05:07 jeremyschlatter

@jeremyschlatter I don't mind 'return' -- as long as the short to type abbreviation 'r' also suffices to the same effect!

glycerine avatar Jul 29 '15 05:07 glycerine

@glycerine Of course :)

jeremyschlatter avatar Jul 29 '15 05:07 jeremyschlatter