Commit Graph

585 Commits

Author SHA1 Message Date
hausner@google.com db3e0327a0 Fix static field inspection in debugger
- Handle static fields that have no getter (issue 2462).
- Get correct value of initialized fields (issue 2221).
- Add test case.
Review URL: https://chromiumcodereview.appspot.com//10009023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6251 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-05 22:42:45 +00:00
hausner@google.com 48bafb9900 Fix use-after-free bug in debugger
This was the cause for crashes on Linux.
Review URL: https://chromiumcodereview.appspot.com//9726017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5668 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-19 23:35:30 +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 0a668f551c Now that it works, make it nice.
INT_MAX is almost as good as INTPTR_MAX, and it has the benefit
that it works on all platforms.

TBR=srdjan
Review URL: https://chromiumcodereview.appspot.com//9704044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5501 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 23:49:22 +00:00
hausner@google.com 6a576fbf79 More fixing
Review URL: https://chromiumcodereview.appspot.com//9701049

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5500 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 23:37:17 +00:00
hausner@google.com d55f4fb816 If at first you don't succeed...
...give up.
Review URL: https://chromiumcodereview.appspot.com//9699055

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5499 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 23:25:14 +00:00
hausner@google.com f04c722086 Fix breakpoint location
The debugger code erroneously assumed that PC descriptors are
sorted by ascending token_index. That is not the case. This change
fixes the translation from token index to pc descriptor index.
Review URL: https://chromiumcodereview.appspot.com//9706038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5496 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 23:10:35 +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
asiva@google.com d595dc2fae Use GrowableObjectArray in the debugger instance/static field lists.
Review URL: https://chromiumcodereview.appspot.com//9634002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5148 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-08 01:24:34 +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 0428eb229e Placate Windows compiler
Review URL: https://chromiumcodereview.appspot.com//9580014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4893 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-02 18:08:56 +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 4be3dd1f7e Fix debugger stepping on Linux
Missing instance field initialization. Bah!

TBR=regis
Review URL: https://chromiumcodereview.appspot.com//9513005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4721 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 19:35:45 +00:00
srdjan@google.com f6dfa63c9a Cleaned up usage of Function::code, since it may be misunderstood that it points to the only Code object that belongs to that function. That is not the case, there can be several Code object generated for the same function. "Renamed" "code()" to "CurrentCode()", use unoptimized_code where it is clear that we are using unoptimized code only. If compiled, there is a 1:1 correspondence between function and unoptimized code.
Review URL: https://chromiumcodereview.appspot.com//9475031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4656 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 01:31:44 +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 9dea8d3795 Bingo
Tripped the linux compiler again...
Review URL: https://chromiumcodereview.appspot.com//9113099

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3635 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-27 00:29:47 +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 f4dee306e5 Fix local variable info in debugger stack trace.
Review URL: https://chromiumcodereview.appspot.com//9117042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3572 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-24 21:33:40 +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 164ee66e38 More fixing linux.
Review URL: http://codereview.chromium.org//8806022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2093 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-05 21:44:11 +00:00
hausner@google.com f296131d32 Fix linux build
Mac doesn't care when you compare signed and unsigned values it seems...
Review URL: http://codereview.chromium.org//8803025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2091 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-05 21:40:44 +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 84d5a83afa Fix linux build.
Review URL: http://codereview.chromium.org//8749007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1929 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-30 17:10:56 +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