Commit Graph

32 Commits

Author SHA1 Message Date
regis@google.com 6f5281c404 Get rid of ast node ids.
Rename cid to deopt_id.
Review URL: https://chromiumcodereview.appspot.com//10832150

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10306 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 20:24:03 +00:00
hausner@google.com e3b118f88e Don't return private fields from imported libs
Fix for issue 4098 (dartbug.com/4098)
Review URL: https://chromiumcodereview.appspot.com//10783038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9722 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-17 21:18:44 +00:00
hausner@google.com 3aedbb74e8 Better breakpoint placement
Instead of using token distance to find the first possible breakpoint
position in a line, use generated code address, so the debugger
breaks before the first call on a source line.

Fix issue 3653 
http://code.google.com/p/dart/issues/detail?id=3318
Review URL: https://chromiumcodereview.appspot.com//10686003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9176 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-27 16:13:49 +00:00
hausner@google.com fbeaabda52 Debugger support to display global variables
- Add library id to ActivationFrame
- Add debugger function to get all global variables visible in
  a library (including imported variables).
- Add LibraryPrefixIterator
- Fix Dart_GetLibraryImports
Review URL: https://chromiumcodereview.appspot.com//10657048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9121 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-26 17:32:34 +00:00
asiva@google.com 5cbd276939 Make the parser agnostic to the TokenStream implementation. This is the first step towards compacting the token stream.
Pull the data stream writer/reader code out of snapshot into a generic file so that it can be reused into the token stream compaction implementation.
Review URL: https://chromiumcodereview.appspot.com//10632009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9043 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-22 20:37:01 +00:00
hausner@google.com 5fb638b575 Support captured variables in debugger
- Add context level ranges to LocalVarDescriptors
- Add callee-saved context chain register to LocalVarDescriptors
- Add context level and context offset of captured variables
  to LocalVarDescriptors
- Add context chain to ActivationFrame
- Add current context level to ActivationFrame
Review URL: https://chromiumcodereview.appspot.com//10579020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8863 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-19 18:52:34 +00:00
hausner@google.com a1cb082925 Add API to configure debugger pause on exception
Still to be done: proper determination whether an exception is
handled or unhandled. We still assume that TypeError and AssertionError
exceptions are unhanded.

Review URL: https://chromiumcodereview.appspot.com//10540121

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8579 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-12 21:56:50 +00:00
hausner@google.com eebec2a081 Debugger break on TypeError, AssertionError
Add debugger functionality to pause the VM whenever a TypeError
or AssertionError exception happens.

This is a first step towards breaking on handled and unhanded
exceptions in general. We first need to generate more debug info
for catch handlers so we can determine whether an exception will
be handled or not before we unwind the stack to run the catch
clauses.
Review URL: https://chromiumcodereview.appspot.com//10537065

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8457 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-08 17:51:50 +00:00
hausner@google.com 0c66cef0d9 Bigger stepping granularity in debugging
- Single step now steps to a safe point on the next line.
- Step into no longer steps into library code.
- Each library has a flag that specifies whether one
  can step into its code.

Later I will add an API to set the per-library flag. Currently
it's set to true for the top-level library and to false for
all other libraries.
Review URL: https://chromiumcodereview.appspot.com//10442088

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8173 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-31 20:17:34 +00:00
hausner@google.com eeaa660d52 Introduce library ids and info in the wire protocol
- Library hierarchy (imports, prefixes)
- Global (top-level) variables
- Removing breakpoints
Review URL: https://chromiumcodereview.appspot.com//10447045

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8075 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-29 19:51:51 +00:00
hausner@google.com b00ae2d1a0 Introduce remote objects in Debugger protocol
Review URL: https://chromiumcodereview.appspot.com//10407071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7864 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-22 18:06:34 +00:00
hausner@google.com de86bd5ed8 Debugger wire protocol: setting breakpoints
- Adding commands to set breakpoints and showing current stack trace.
- Adding a callback hook to signal when a breakpoint gets resolved to
  and actual line number. 
- Adding ids for breakpoints and new breakpoint API functions, deprecating
  the existing ones. 
- Adding one helper function to the JSON class

Anton may want to take a look at the JSON addition.
Review URL: https://chromiumcodereview.appspot.com//10383164

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7628 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-14 21:10:25 +00:00
hausner@google.com feafdf0e06 Properly recognize closures when setting breakpoints
Local functions and function literals are unknown to the VM
until the enclosing function is compiled. This change introduces
a list of known closures per class, and a function to look up
the innermost closure at a given token index.

The debugger now checks whether there are newly discovered
closures when a function containing a pending breakpoint is
compiled. If necessary, the breakpoint is set to the inner
function.
Review URL: https://chromiumcodereview.appspot.com//9716004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5599 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-16 22:28:57 +00:00
hausner@google.com cd6e29a898 Deoptimize functions before setting breakpoints
Does not yet handle cases where the functions have active frames
on the stack.
Review URL: https://chromiumcodereview.appspot.com//9696020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5436 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 20:37:49 +00:00
hausner@google.com de3cf9e2bd Teach debugger to ignore breakpoints
Reentrant debugger calls to fetch values may execute dart code as a
side effect. Teach the debugger to ignore any breakpoints it might
hit while doing so.
Review URL: https://chromiumcodereview.appspot.com//9668036

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5274 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-10 00:43:08 +00:00
hausner@google.com 661d0195fa Support breakpoints in closures
Properly set breakpoints in the code of closure functions.
Fix bug 1894.

Also renaming StackTrace to DebuggerStackTrace since we already have a class Stacktrace in the VM.
Review URL: https://chromiumcodereview.appspot.com//9572022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4910 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-02 23:43:34 +00:00
hausner@google.com e58b6e4d4c Splitting debugger breakpoints into two parts
Splitting breakpoints into SourceBreakpoint that represent
a user-defined source location of a breakpoint, and
CodeBreakpoint, which represents a code location. There can
be more than one CodeBreakpoint per SourceBreakpoint, e.g.
for functions that are also called as closures (and are thus
compiled twice.)

Functions are no longer compiled as a side effect of setting
a breakpoint. When they eventually get compiled, the previously
recorded SourceBreakpoint is found and a CodeBreakpoint is set.
Review URL: https://chromiumcodereview.appspot.com//9581013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4891 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-02 18:01:38 +00:00
hausner@google.com 6d9abc5e3b StepOver, StepInto, StepOut
Implement single stepping in the debugger.
- Add PC descriptors for function return
- functions to set temporary breakpoints on all
  locations in a function.
- patching/restoring of function return code pattern
- determine call target of instance calls
Review URL: https://chromiumcodereview.appspot.com//9484002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4639 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-27 22:00:28 +00:00
turnidge@google.com 0ddd4c04e9 Dart_PropagateError, take 2.
This change hopefully takes care of the non-mac build issues.  The
checked mode failures are fixed in a separate cl.
Review URL: https://chromiumcodereview.appspot.com//9316071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3863 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 19:05:06 +00:00
turnidge@google.com ae88492093 Revert Dart_PropagateError until I can track down the problems in
checked mode tests.

Sorry for the hubbub.
Review URL: https://chromiumcodereview.appspot.com//9314053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3823 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 23:39:28 +00:00
turnidge@google.com 9da62c5fea Add Dart_PropagateError.
This function can be used in native functions to properly pass all
errors up the stack.

Set the long jump base in the Compiler instead of outside of the
compiler.  A bunch of errors that used to be propagated through the
sticky_error are now propagated through return values.  This includes
all of the DartEntry and DartLibraryCall functions.

In particular, we no longer use the long jump to cross dart frames.
Instead errors are propagated across dart frames using the same
mechanism that we use for unhandled exceptions.  I've added assertions
to make sure that we only use the long jump when it is "safe".
Review URL: https://chromiumcodereview.appspot.com//9169102

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3815 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 22:34:16 +00:00
hausner@google.com e1d0b0619b Debugger API: get local variables of an activation frame
Also add a test case where the evaluation of a field name results in an error during the evaluation of the field.
Review URL: https://chromiumcodereview.appspot.com//9264058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3738 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-31 18:10:08 +00:00
hausner@google.com 864393bdad Add debugger functions to inspect objects and classes.
Next steps: inspect global variables, better support for inspecting local variables on stack.
Review URL: https://chromiumcodereview.appspot.com//9288071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3634 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-27 00:27:12 +00:00
hausner@google.com 595cb76374 Implement deletion of breakpoints
- deletion of breakpoints
- better cleanup of debugger resources
Review URL: https://chromiumcodereview.appspot.com//9271008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3470 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-20 22:10:59 +00:00
hausner@google.com 3ebdf081ca Set breakpoint at url, line number
Add debugger functionality to set breakpoint at given url and line number.
Review URL: https://chromiumcodereview.appspot.com//9240014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3420 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-18 23:15:56 +00:00
hausner@google.com 4ee7c947aa Getting value of local variables on stack trace
Introduce concept of scope in local variable info, according
to mirror proposal.
Review URL: http://codereview.chromium.org//8983034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3017 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-05 22:33:37 +00:00
hausner@google.com 44376ee4a5 Retrieve value of local variables in stack frames.
Works for stack-based variables. Need more work to distinguish between
stack and context (captured) variables.
 
Review URL: http://codereview.chromium.org//9019029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2736 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-22 00:17:15 +00:00
hausner@google.com 503e2219b8 First part of inspecting local variables
This change introduces variable descriptors that describe the name, stack slot index, and source code stretch in which a variable is valid.

Activation frames in the stack trace now can enumerate the variables that are active in that frame.

Next step: fetch the value of variables from the stack.
Review URL: http://codereview.chromium.org//8992020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2671 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-20 21:40:28 +00:00
hausner@google.com 75918306af First debugger API unit test
Add unit test file, expose more debugger functionality in the API.
Review URL: http://codereview.chromium.org//8872049

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2320 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-09 19:29:37 +00:00
hausner@google.com 9159389495 First bits of external debugger API
The debugger API is in a separate set of files. Embedders do not have
to include the debug api if they don't need to.
Review URL: http://codereview.chromium.org//8826007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2198 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-07 22:13:49 +00:00
hausner@google.com b122f27eac Debugger step 2
Add ActivationFrame and StackTrace classes.
Add Breakpoint info: url and line number.
Fix breakpoint stub so breakpoints don't get patched over by PatchStaticCall
Review URL: http://codereview.chromium.org//8775060

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2089 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-05 21:11:39 +00:00
hausner@google.com b7cf1328a1 Very first steps for a debugger
- Introduce Debugger class.
- Each isolate has a debugger object.
- Introduce stubs that can be put in place of static or dynamic
  Dart function calls.
- Very rudimentary command line option to place a breakpoint
  at the beginning of a function.
Review URL: http://codereview.chromium.org//8687037

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1928 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-30 17:04:45 +00:00