Commit Graph

4 Commits

Author SHA1 Message Date
turnidge@google.com 86fd5069df Rework how we run/kill scripts and how we quit in ddbg.
-------------

Details:

Add a new Command class to ddbg and begin using it to implement
command dispatching, help, and completion.  I hope to migrate all the
commands to this pattern.

Since command dispatch now accepts command prefixes (e.g. 'q' for
'quit') I now use slightly longer command names.

The debugged program no longer starts automatically.  It can now be
started and stopped with the run/kill commands.

The set/show commands are added which provide a general way to
modify/query debugger settings.  For example, this can be used to
change the arguments passed to the debugged script or its vm
(e.g. 'set vmargs --myvmarg').

'q' -> 'quit'

'h' -> 'help'.  Also added command help, e.g. 'help run', 'help help'.
This is only implemented for the new commands so far.

Commando now exports a Stream instead of taking a command handler.
This makes it simpler to add error/done handlers for Commando.

Reworking ddbg quitting.  When the debugged process quits, the
debugger no longer quits.  When the user quits, try to kill the
debugged process, shut down the debugger connection, and shut down
commando.  When we get an unexpected error in Commando, try to handle
it better.  Whenever we quit, try to restore echomode/linemode.

Add a retry "loop" to handle the case where the debugged process takes
a bit to open its debug port.  This tends to happen a lot on the
second 'run' for some reason.

R=hausner@google.com

Review URL: https://codereview.chromium.org//99963004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30871 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-04 21:21:35 +00:00
turnidge@google.com ed3e5b12ee Move an old change into a new client. Old client got messed up.
Already reviewed by hausner.

Review URL: https://codereview.chromium.org//105243002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30865 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-04 19:37:01 +00:00
turnidge@google.com 7ae9140023 Fix a bug with command line history.
R=hausner@google.com

Review URL: https://codereview.chromium.org//82823007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30590 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-22 22:29:23 +00:00
turnidge@google.com 957758f207 Add support for command-line editing to ddbg.
This is implemented using two new files, commando.dart and
terminfo.dart.  My hope is to eventually submit commando.dart to pub
for general use once the wrinkles are ironed out.

Commando supports:

- Emacs style editing keys:
  ^A (home)
  ^E (end)
  ^B or left arrow (back)
  ^F or right arrow (forward)
  ^K (kill from cursor)   [^Y not yet implemented]
  ^L (clear screen)
  ^U (clear line)
  backspace

- Command line history
  ^P or up arrow (history previous)
  ^N or down arrow (history next)

- Tab completion
  single-TAB (complete current command)
  double-TAB (list all completions)

I have not yet completed reasonable command line completion for ddbg.
Currently only first part of command is completed.

I have only tested this on Mac.  It may work on linux and definitely
will not work on Windows.  I need to implement a fallback mode for
windows.  I am leaving this to another cl, as the command line
debugger, as I believe that the command line debugger is not widely
used yet.

R=hausner@google.com

Review URL: https://codereview.chromium.org//69343017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30585 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-22 20:59:00 +00:00