Commit Graph

373 Commits

Author SHA1 Message Date
Natalia Selezneva 19e7002d02 Evaluate Expression: fix ClassNotFoundException for primitives and arrays 2018-02-14 14:40:31 +03:00
Natalia Selezneva dbd7ceb5fd Fix Evaluate Expression for inline functions from multifile package class.
Find main class generated for debugger by its name instead of relativePath length.
 #KT-22311 Fixed
2018-01-16 16:00:32 +03:00
Nikolay Krasko 449fee74e8 Skip all same line locations when stepping over inline call (KT-20351)
#KT-20351
2017-12-26 12:46:45 +03:00
Nikolay Krasko f39250c9a2 Fix irrelevant additional stops on breakpoint on line with inlines (KT-21945)
#KT-21945 Fixed
2017-12-26 12:46:45 +03:00
Nikolay Krasko c5886bc7a2 Remove sleep() from soSuspendableCallInEndOfFun and guarantee suspending 2017-12-26 12:46:45 +03:00
Nikolay Krasko a3028beca9 Fix smart step into to Kotlin SAM adapter (KT-21538)
#KT-21538 Fixed
2017-12-18 11:50:49 +03:00
Nikolay Krasko 6456f4ed98 Test step into for Java constructor with SAM conversion
Additional test for KT-21538

 #KT-21538 Fixed
2017-12-15 16:14:50 +03:00
Nikolay Krasko d6cface66f Make isFromJava check work for SAM adapter extension descriptors (KT-21538)
Consider all callable descriptor in JavaClassDescriptor to be from Java.

This is used to check if smart step into should be intercepted by Kotlin
handler or delegated to Java.

 #KT-21538 Fixed
2017-12-15 16:14:50 +03:00
Nikolay Krasko 57d62eb74a Document error behaviour of evaluate expression lost sometime 2017-12-05 16:07:54 +03:00
Yan Zhulanow 43a1162b25 Evaluate: Fix for evaluating local variables captured by an inline function (KT-17514) 2017-10-16 21:25:44 +03:00
Yan Zhulanow 79b2b40289 Allow access to effectively invisible declarations in evaluator (KT-18775) 2017-09-15 17:54:46 +03:00
Nikolay Krasko d8c20ed9c0 Fix debugger test in 172 (KT-18848)
#KT-18848 Fixed
2017-08-10 22:05:49 +03:00
Nikolay Krasko 1ef5362edc Fix breakpoints from Kotlin file placed in irrelevant class (KT-19429)
State that there're no locations in given file, if all locations for
line were filtered out because of wrong file name. Need this because
if we throw exception, other positions managers may return locations
without explicit check for file type or file name.

See PositionManagerImpl.java

 #KT-19429 Fixed
2017-08-03 13:11:06 +03:00
Nikolay Krasko f664ffb06b Check correspondent call on end token for better step over (KT-18949)
#KT-18949 Fixed
2017-07-18 14:39:54 +03:00
Nikolay Krasko d282f14eac Don't add double linenumber when return expression is absent (KT-18949)
#KT-18949 Fixed
2017-07-18 14:39:54 +03:00
Nikolay Krasko ce4f923ba0 Replace return with nop to avoid merging line instructions (KT-18949)
Dex ignores subsequent line numbers for same instructions and interprets
instruction after inline as if they were inlined. This makes debugger
behaves as if there's nowhere to stop on line with breakpoint.

This also makes stepping through inline function consistent with
non-inline analog. In both context debugger now stops on '}'.

 #KT-18949 Fixed
 #KT-17120 Fixed
2017-07-18 14:39:54 +03:00
Nikolay Krasko 87889904ee Allow only one invoke to be a target for smart step into (KT-18632)
It's difficult to distinguish such calls reliably in debug session

 #KT-18632 Fixed
2017-06-23 21:33:26 +03:00
Nikolay Krasko 502ac80b89 Do not skip invoke call on parameters during smart step into (KT-18577)
#KT-18577 Fixed
2017-06-23 13:47:33 +03:00
Nikolay Krasko 3ffd63a17c Attempt for fix flaky debugger tests - wait for the resume before exit 2017-06-21 17:49:03 +03:00
Nikolay Krasko 850568b8e9 Support "Force Step Over" action over suspended calls (KT-18453)
#KT-18453 Fixed
2017-06-15 13:29:28 +03:00
Nikolay Krasko 0e8e8ef546 Step over for suspended calls (KT-18453)
Debugger do the normal step over action and checks if function is
going to suspend. In this case the "run-to-cursor" breakpoint is
installed on function enter to intercept re-enter into function
after suspension.

 #KT-18453 In Progress
2017-06-15 13:29:27 +03:00
Nikolay Krasko 6d22e06359 Move all test data for single test to one directory 2017-06-13 19:14:48 +03:00
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 cb9e90183a 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:54 +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