Commit Graph

585 Commits

Author SHA1 Message Date
hausner@google.com 6b51661ec2 Fix bug 5944
Ensure both closureized and regular function are deoptimized when
setting a breakpoint. 
Review URL: https://codereview.chromium.org//11669017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16464 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-22 01:09:44 +00:00
hausner@google.com 2d02548fb0 Ignore nested breakpoints
Fixes issue 5945.

When stepping into core library code, it is possible to hit a breakpoint
recursively when the debugger executes dart code to evaluate values.

This change ignores nested breakpoint and exception events.
Review URL: https://codereview.chromium.org//11644085

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16458 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-21 23:37:26 +00:00
asiva@google.com 7ea520f10f Create read only handles for empty_array and sentinel objects
(trying out a basic framework and will extend it to others once this
works).
Review URL: https://codereview.chromium.org//11648006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16416 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-21 02:33:05 +00:00
asiva@google.com 2c6de68680 Changed the API in DartEntry for invoking dart code from C++ to make it more compatible with the requirements of the runtime.
Deleted all the code duplication that was added to circumvent the old DartEntry API requirements.
Review URL: https://codereview.chromium.org//11613009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16288 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-18 21:36:01 +00:00
srdjan@google.com d6772016eb Cleanups based on Kevin's and Florian's suggestions.
Review URL: https://codereview.chromium.org//11481002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15850 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-07 17:59:53 +00:00
hausner@google.com 5e47a858f3 Set BP in closurized function if necessary
If a function has been closurized, and both the regular function as well as
the closurized function are already compiled when the user sets a breakpoint,
then two code breakpoints have to be installed.

Fixed issue 2318.
 
Review URL: https://codereview.chromium.org//11446020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15764 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-06 00:09:36 +00:00
srdjan@google.com c0315644f3 Pass handles not raw objects into methods.
Review URL: https://codereview.chromium.org//11441021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15748 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-05 19:50:50 +00:00
kmillikin@google.com 8c4e214722 Pass IC data and arguments descriptor to IC miss runtime functions.
Before, we obtained them by pattern matching backwards on the machine
instructions at the call site.  This previous approach becomes unwieldy when
we need to use to use multiple instance call patterns.

R=vegorov@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15737 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-05 15:35:18 +00:00
srdjan@google.com 7c6a68f2a4 Simplify CodePatcher::GetStaticCallAt.
Review URL: https://codereview.chromium.org//11411072

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15101 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 19:17:02 +00:00
srdjan@google.com a6dae8cd4a First part of static call cleanup: store static call targets into code object, referenced by code-offset.
Review URL: https://codereview.chromium.org//11418046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15091 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 16:39:07 +00:00
asiva@google.com ceed3e5beb - Add support to interrupt a running isolate with the following command:
<===  InterruptCmd = "{" RequestId "," command ":" interrupt "," params ":" "{" isolateId ":" Integer "}" "}"
===>  InterruptCmdResp = "{" RequestId "}"

- Send isolate events over to the debugger client in the following format:
===>  "{" event ":" isolate "," params ":" "{" reason ":" created "," id ":" Integer "}" "}"
===>  "{" event ":" isolate "," params ":" "{" reason ":" shutdown "," id ":" Integer "}" "}"
===>  "{" event ":" paused "," params ":" "{" reason ":" interrupted "," callFrames ":" StackTrace "}" "}"

- Added id ";" Integer, to params in all paused events messages

- create per isolate debugger message queues, instead of the global static one

- Add 'i' command in ddbg to exercise the interrupt feature

- Add support for handling isolave event messages in ddbg
Review URL: https://codereview.chromium.org//11028040

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13333 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-05 23:10:28 +00:00
asiva@google.com 6076250adb 1. Create a port when a debugger object is created for an isolate, use this
port as the unique ID to represent an isolate in the debugger message
   format.

2. Switch the Event handler API to use an isolate id instead of the isolate
   object itself.

3. Add a unit test case for isolate debugger event handling with an
   interrupt of isolate to ensure that interrupting the isolate runs
   the interrupt event handler.
Review URL: https://codereview.chromium.org//11052006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13207 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-04 00:13:37 +00:00
asiva@google.com 27e1b05914 Add isolate event handler setup in order to be able to propagate isolate
events (create/shutdown/interrupted)
Review URL: https://codereview.chromium.org//11026011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13130 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-02 18:09:55 +00:00
hausner@google.com 201bce4219 Support for show/hide combinators
- Add a new VM object called a Namespace.
- A Namespace is a library, and two list of names to hide/show.
- Convert Library and LibraryPrefix to contain Namespace
  objects instead of Libraries in their import list.
Review URL: https://codereview.chromium.org//10967052

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12804 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 20:46:56 +00:00
devoncarew@google.com fdae229dcc Fix for http://code.google.com/p/dart/issues/detail?id=5085 - break-on-exceptions in the debugger can recurse.
This CL turns off the break-on-exceptions behavior when evaluating Dart code in the debugger (in particular, the toString() method).
Review URL: https://chromiumcodereview.appspot.com//10928149

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12275 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 18:01:50 +00:00
cshapiro@google.com da14bf70a7 Add attributions so printf like functions can have their arguments checked.
This change also corrects some misuses of format strings and format
arguments that discovered by the compiler checks.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11912 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 00:58:25 +00:00
ajohnsen@google.com 3a6daefd99 Expose remaining 'errors' in an unified dart:core.
This is a follow-up on my previous move of AssertionError.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11513 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 11:57:37 +00:00
ajohnsen@google.com a04ecc7678 Unify AssertionError.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11448 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-28 14:39:50 +00:00
hausner@google.com 028f8c78d1 Suppress "Waiting for debugger..." message on cosole
Less noise in the debugger console window.

Also put the verbose debugger output under command line flag
instead of compile time flag.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11328 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-24 17:57:57 +00:00
iposva@google.com 99d563982c - Support for patching of class methods and fields.
Review URL: https://chromiumcodereview.appspot.com//10827288

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10616 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 00:38:01 +00:00
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
turnidge@google.com 2803d78dfd Change the zone allocation api.
Instead of passing a size in bytes to the allocation function, we now
have a templatized Alloc function:

  zone->Alloc<Type>(len)

This is better for security, as we can check for integer overflow in
the size computation before performing the allocation.  Before, we
often failed to check this.
Review URL: https://chromiumcodereview.appspot.com//10836061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10254 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-03 21:51:44 +00:00
hausner@google.com 2db691aa14 Better breakpoint management
If a function is already compiled, make a source breakpoint at
the actual breakpoint line number, which may be different from the
requested line number.

Fixes an issue that was brought up in bug 3782.
Review URL: https://chromiumcodereview.appspot.com//10839002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10027 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-30 22:37:10 +00:00
asiva@google.com ec7f44f025 Create frequently used symbols in the vm isolate
- Avoids the need for doing a NewSymbol on these everytime
- saves space as they get shared by isolates
Review URL: https://chromiumcodereview.appspot.com//10783035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9834 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 00:01:50 +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
regis@google.com d95cbc8d7f Use VM type cast and save handles.
Review URL: https://chromiumcodereview.appspot.com//10693071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9317 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-02 21:42:53 +00:00
hausner@google.com 11d2c19fc4 Make sure breakpoints are enabled
With my previous checkin it became possible that internal
code breakpoints became disabled. Now make sure that when
one of these breakpoints is re-used, it becomes enabled.
Review URL: https://chromiumcodereview.appspot.com//10690053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9265 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-29 20:39:48 +00:00
hausner@google.com c4280b8b89 Fix Dart_RemoveBreakpoint
The debugger code assumed that breakpoints can only be removed
while the debugger is paused. That is not true. An embedder can
remove breakpoints while the isolate is idle and running any
Dart code.

Fix for issue 3781 (http://dartbug.com/3781)
Review URL: https://chromiumcodereview.appspot.com//10698051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9258 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-29 18:24:35 +00:00
hausner@google.com 86b00700aa Add a platform-independent max uword value.
Review URL: https://chromiumcodereview.appspot.com//10695009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9181 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-27 17:24:41 +00:00
hausner@google.com 0300423892 Write once debug everywhere
Review URL: https://chromiumcodereview.appspot.com//10696009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9177 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-27 16:25:11 +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
hausner@google.com 0b403430bf Fix parent function of deeply nested closures
We got the parent of nested closures wrong if the nesting level
was > 2.

Fix for issue 3412.
Review URL: https://chromiumcodereview.appspot.com//10665009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9065 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-25 15:43:04 +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 7d00d4b2e6 Do not collect stack trace unnecessarily
The debugger collected stack traces on each exception throw
even when the debugger client specifies "no pause on exception".
This fixes the asserts that Anton saw in some tests.
Review URL: https://chromiumcodereview.appspot.com//10645003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8996 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-21 18:48:20 +00:00
hausner@google.com 56bc7ca48a Fix stuff
Fix for issue 3781: don't hang on to deleted breakpoints (manually tested).
Fix for issue 3390: allow function names in all string interpolation expressions.
Review URL: https://chromiumcodereview.appspot.com//10603003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8956 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-21 00:16:27 +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 41bd5107c4 Fix issue 3636, break on exception
Call the "pause on exception" handler in the debugger even when
there are no breakpoints set.

Fixes issue 3636.
Review URL: https://chromiumcodereview.appspot.com//10544159

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8679 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-14 18:07:48 +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 6ddf54511d Replace linked list of loaded libraries
Replace the linked list of loaded libraries with a growable array
or libraries in the object store. This array will be used in the
debugger, where we use the index of a library in the array as an
id number, similarly to the class id and the table of loaded classes.
Review URL: https://chromiumcodereview.appspot.com//10414084

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7923 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-23 20:28:21 +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
asiva@google.com c71a8cc1ee Change dart frame and stub frame layout to include the PC of the code executing on the frame. The stack frame layout is as follows:
ret PC
  saved EBP                          <== EBP
  PC (used to locate RawInstruction) <== ESP
Review URL: https://chromiumcodereview.appspot.com//10375059

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7675 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 00:47:05 +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
asiva@google.com 3107319e40 Simplify representation of stack frames. Remove the special types DartFrame/StubFrame and instead use StackFrame with methods IsDartFrame and IsStubFrame for frames representing Dart or Stub Code. This eliminates all the complexity that was added to ensure that we always see only one stub frame before hitting a dart frame during iteration.
Fixes bug 6380625 which was another case when we had two stub frames before hitting the dart frame.
Review URL: https://chromiumcodereview.appspot.com//10173008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6920 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-25 01:15:28 +00:00
asiva@google.com 2d3775a1b1 Resubmit change 6302 after fixing the compiler warning on older GCC compiler versions:
Change 6302 description:
- Wire the stack frame iterator to use stack maps for traversing objects if
there are stack maps in the code object. If there are no stack maps it still
does the old style stack frame traversal between fp and sp looking for tagged
pointers.
- Added a mechanism to be able to iterate over the code space and look for a
particular object.
Review URL: https://chromiumcodereview.appspot.com//10030001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6331 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-09 18:20:23 +00:00
asiva@google.com c79da818cc Revert change 6302 until the compiler warning is addressed.
Review URL: https://chromiumcodereview.appspot.com//10025003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6304 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-07 02:04:28 +00:00
asiva@google.com c27cec5b6e - Wire the stack frame iterator to use stack maps for traversing objects if there are stack maps in the code object. If there are no stack maps it still does the old style stack frame traversal between fp and sp looking for tagged pointers.
- Added a mechanism to be able to iterate over the code space and look for a particular object.

- Remove registration of code objects into the code index table.
Review URL: https://chromiumcodereview.appspot.com//9791048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6302 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-07 01:44:48 +00:00