Commit Graph

308 Commits

Author SHA1 Message Date
Denis Zharkov 6e114a90dc Adjust debugger to the new suspend function strategy
Now it's impossible to determine by descriptor if there is
a state machine for function, but at the same time
it doesn't really matter here since there is no LINENUMBERs
in doResume of continuation implementations for named suspend
functions

 #KT-17585 Fixed
 #KT-16603 Fixed
2017-05-05 14:14:38 +03:00
Mikhael Bogdanov 708bfdbd5f Generate line numbers for function call parameters
Before this fix line numbers for function call arguments were not generated,
 so if argument was on another line than function call it was
 impossible to stop on argument line during debugging.
 Now line number for each argument is generated if necessary
 (another line than function call line).

 #KT-17144 Fixed
2017-04-17 16:09:59 +02:00
Mikhail Zarechenskiy e86d52b681 Fix return type of private members that return anonymous object
#KT-16813 Fixed

Anonymous objects returned from private-in-file members should behave as for private class members
2017-04-17 16:21:05 +03:00
Nikolay Krasko 42868b1364 Fix evaluate for internal functions (KT-15854)
#KT-15854 Fixed
2017-04-11 12:33:07 +03:00
Yan Zhulanow 9e61eea758 Support inline properties in debugger class search 2017-04-10 23:25:55 +03:00
Yan Zhulanow 622430a296 Debugger: Fix AbstractPositionManagerTest
MockReferenceType can't be used anymore because the new DebuggerClassNameProvider requires much more from it.
The new SmartMockReferenceType implements methods such as nestedTypes() or allLineLocations() properly.

Also, as PositionManager can return more than one class, we should check if any of the classes it returned matches the pattern.
2017-04-10 23:25:53 +03:00
Nikolay Krasko 0d5913287f Add line numbers for suspend function to enhance stepping (KT-16025)
Stop at function start on step into.
Step at function end on step out.

Both cases should actually be skipped by debugger, but this is postponed
till new backend generation for suspend functions is ready.

 #KT-16025 Fixed
2017-03-30 19:48:49 +03:00
Nikolay Krasko 84c473d800 Speed up debugger tests by replacing base output preprocessor
Avoid calling InetAddress.getLocalHost() that can be very slow.
Exact connection or disconnection string isn't relevant for tests
anyway.
2017-03-23 00:31:43 +03:00
Nikolay Krasko 9ad705a60a Remove all allFiles*.out from debugger output 2017-03-23 00:31:42 +03:00
Dmitry Petrov 3c09a26e16 KT-5248 Don't wrap variable if it is captured only in inlined closures
Remove non-escaping Ref's on bytecode postprocessing pass.
2017-03-13 09:04:31 +03:00
Nikolay Krasko 688802de51 Check breakpoints work in delegate initializer
Additional test after review
2017-03-10 14:59:37 +03:00
Nikolay Krasko e6ee933b27 Fix "smart step into" for classes with complex hierarchy (KT-16667)
#KT-16667 Fixed
2017-03-10 14:58:21 +03:00
Nikolay Krasko 9120ccc054 Fix breakpoints in inline calls in fields initialization (KT-16525)
Backend generates properties initializer in constructor context

 #KT-16525 Fixed
2017-03-10 14:58:15 +03:00
Nikolay Krasko d886cd7d06 Fix breakpoints when inline call is in qualified expression (KT-16062)
Scope is stored for DOT_QUALIFIED_EXPRESSION not directly for
CALL_EXPRESSION.

 #KT-16062 Fixed
2017-03-10 14:58:14 +03:00
Nikolay Krasko 2719016539 Fix search of correspondent call expression by element (KT-11234)
getStrictParentOfType() looks for nearest parent of given type

In complex expressions like:

SamConversion.doAction({
  inlineCall {
    {
      // here <--
    }()
  }
})

doAction was found twice, while inlineCall was skipped.

See code:
// call(param, { <it> })
lambdaExpression?.typedParent<KtValueArgument>()?.typedParent<KtValueArgumentList>()?.typedParent<KtCallExpression>() ?:

// call { <it> }
lambdaExpression?.typedParent<KtLambdaArgument>()?.typedParent<KtCallExpression>()

 #KT-11234 Fixed
2017-03-10 14:58:13 +03:00
Nikolay Krasko f0be88fc07 Use doResume name for suspend lambdas context (KT-16481)
#KT-16481 Fixed
2017-02-27 14:49:13 +03:00
Nikolay Krasko dffbe0f707 Count JVM class name for inlined function from base declaration
Drop code with naive removing all anonymous classes.
Breakpoints now works when inline call is in anonymous call.
2017-02-27 14:49:12 +03:00
Natalia Ukhorskaya 68f722b337 Debugger: fix evaluate expression when breakpoint is set on function without body inside object
#KT-15855 Fixed
2017-02-01 14:31:35 +03:00
Nikolay Krasko c8999c4141 Fix in test bad behaviour of smart step into for stored lambda
When lambda is stored and not executed immediately, smart step into
doesn't work.
2017-01-30 21:28:59 +03:00
Nikolay Krasko 4a4a8250fd Fix smart step into functions call with suspend lambdas (KT-14700)
#KT-14700 Fixed
2017-01-30 21:28:59 +03:00
Denis Zharkov 1d5144b168 Move coroutine-related diagnostic tests to run them with stdlib
It's necessary because all coroutine related declarations (Continuation, etc)
are now in the stdlib
2017-01-27 23:24:13 +03:00
Nikolay Krasko c525a59df8 Make breakpoints work in suspend functions 2017-01-25 16:46:35 +03:00
Nikolay Krasko 649ec9a73d Check that breakpoints work in suspend function without suspension points 2017-01-25 16:46:33 +03:00
Mikhael Bogdanov e1bec0df2e Proper generate interval for catch block variable; Fix for KT-15646: InconsistentDebugInfoException when stepping over throw
#KT-15646 Fixed
2017-01-19 09:33:10 +01:00
Nikolay Krasko ded7d5911b Fix tests
Addition to 5d08e82aaf
2017-01-16 16:05:02 +03:00
Nikolay Krasko 5d08e82aaf Fix look up for breakpoint in crossinline lambdas in android (KT-15282)
#KT-15282 Fixed
2017-01-16 13:00:46 +03:00
Dmitry Petrov 8756f00849 Fix testData for debugger test. 2017-01-13 13:54:07 +03:00
Dmitry Petrov ba933fa887 KT-15112, KT-15631
Revert changes for "tolerant to uninitialized values" in OptimizationBasicInterpreter:
this approach doesn't converge for some specific cases where local variable is reused
(e.g., in several inlined functions - see https://youtrack.jetbrains.com/issue/KT-15112).

Instead, treat fake always-false conditional jump in the beginning of the post-condition loop as a "reference point" for stack on loop break / continue.
This requires an extra abstraction layer in FixStackAnalyzer, since we can't perform fine-grain manipulations on Frames
(such as "combine frame C from local variables of frame A and stack of frame B").

NB additional NOPs will be generated for post-condition loops.
Should make a separate bytecode postprocessing pass to get rid of unnecessary NOPs
(several YT issues for perceived quality of the generated bytecode are about such NOPs).
2017-01-13 10:31:07 +03:00
Natalia Ukhorskaya 01d4ec4187 Debugger: ability to set breakpoint to lambda in return statement (KT-14615)
#KT-14615 Fixed
2016-11-30 13:56:29 +03:00
Natalia Ukhorskaya d14136b0b6 Debugger: cannot call member extension in an object in Evaluate Expression
#KT-14822 Fixed
2016-11-26 00:20:43 +03:00
Nikolay Krasko b007306740 Make breakpoints work inside nameless function bodies in inline calls 2016-11-25 18:06:36 +03:00
Nikolay Krasko 60e3c8eecd Make breakpoints work in local functions in secondary constructors 2016-11-23 17:29:28 +03:00
Nikolay Krasko 1889f4f7b1 Fix breakpoints in function literals in inline calls (KT-11521, KT-12734, KT-12470)
#KT-11521 Fixed
 #KT-12734 Fixed
 #KT-12470 Fixed
2016-11-23 17:29:28 +03:00
Nikolay Krasko 59a349a4ae Test breakpoint is hit inside crossinline lambda called from anonymous object (KT-12612)
#KT-12612 Fixed
2016-11-23 17:29:28 +03:00
Nikolay Krasko 6f95667f54 Better diagnostic for inlined line under dex on step over 2016-11-17 13:47:27 +03:00
Nikolay Krasko 623ee316c0 Fix step over for inlined functions in Android Studio (KT-14374)
#KT-14374 Fixed
2016-11-17 13:47:10 +03:00
Natalia Ukhorskaya 0fb5a18a26 Debugger: refactor smart step into to use descriptors instead of psi elements (KT-13485)
#KT-13485 Fixed
2016-11-16 15:20:00 +03:00
Nikolay Krasko 8865c0be34 Step into functions with local variable on first line under "Skip simple getters" (KT-14488)
(cherry picked from commit 9423d65)

 #KT-14488 Fixed
2016-10-24 16:28:17 +03:00
Denis Zharkov a9fcee098d Support single-underscore named variables in JVM backend
There are mainly two kind of changes:
- skipping 'componentX' calls for destructuring entries named _
- fixing local variable table for them
 - skip entries for destructuring entries named _
 - use $noName_<i> format for lambda parameters named _

 #KT-3824 Fixed
 #KT-2783 Fixed
2016-10-24 10:19:25 +03:00
Nikolay Krasko 74f0bb3d4e Remove mentioning KT-11395 from the wrong test
(cherry picked from commit c4fb0e9)

 #KT-11395 Open
2016-10-18 15:41:18 +03:00
Nikolay Krasko 944b9b5b6c Evaluate overloaded toString() in watches for Kotlin classes with delegate properties (KT-14068)
(cherry picked from commit 7774d2c)

 #KT-14068 Fixed
2016-10-17 15:16:46 +03:00
Nikolay Krasko 8c2e61604e Test for "Debugger: "Step over" dives into recursive call" (KT-12924)
Fixed in 7992df7b93

(cherry picked from commit 78e2f05)

 #KT-12924 Fixed
2016-10-14 21:06:27 +03:00
Nikolay Krasko 06b72e608e Do an ordinal step over while stepping over inlined calls in dex
(cherry picked from commit d741895)
2016-10-14 18:57:38 +03:00
Nikolay Krasko fe901e9516 Use Dex suffix instead of dex prefix for better test sorting
(cherry picked from commit 7f3a9c1)
2016-10-14 14:52:56 +03:00
Nikolay Krasko 7510ff4864 Check current behaviour of stepping over inline 'hasNext' and 'next' in for
(cherry picked from commit 008e574)

 #KT-14296 Open
2016-10-14 14:52:44 +03:00
Nikolay Krasko 7992df7b93 Change the way 'step over' over inline calls works (KT-13751)
Previously it worked by invoking 'Run To Cursor' for the last position of inline function. As there's only one 'run to cursor' breakpoint
available in Idea framework, it couldn't work when inline function call was was used in conditions of control flow statements.

A new approach works through multiple step over operation and controlling stop position. In other words we try to "step over" inlined lines.
Same thing is actually done in "Smart Step Into" action.

(cherry picked from commit 2e8775d)

 #KT-13751 Fixed
2016-10-14 14:52:31 +03:00
Nikolay Krasko 9594316b0a Test for "Breakpoint inside lambda argument of InlineOnly function doesn't work" (KT-11395)
(cherry picked from commit d0ffe06)

 #KT-11395 Fixed
2016-10-14 14:52:22 +03:00
Nikolay Krasko 87b628a3f7 Generate 'nop' instruction on lambda call when everything on line is going to be eliminated by inliner (KT-6477)
(cherry picked from commit 462bdb2)

 #KT-6477 Fixed
2016-10-14 14:52:06 +03:00
Nikolay Krasko 58ff7f53fa Tests only: Debugger test data modification: extra removed 2016-09-20 15:10:43 +03:00
Denis Zharkov 42e85b07c9 Fix types in local var table for destructured variables 2016-09-20 13:44:44 +03:00