Commit Graph

285 Commits

Author SHA1 Message Date
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
Denis Zharkov e75efc88ff Add support for desctructuring of lambda parameters in JVM backend
#KT-5828 In Progress
2016-09-19 20:22:57 +03:00
Michael Bogdanov 237afb4b7c Mark linenumber in property reference 2016-09-07 12:01:48 +03:00
Nikolay Krasko 8b84b7158a Debugger doesn't step into 'for' body if there's inline function call in range expression (KT-13534)
#KT-13534 Fixed
2016-08-25 15:35:08 +03:00
Natalia Ukhorskaya f6bb70aad1 Debugger: allow to evaluate 'this' and fields in java files 2016-08-16 09:08:34 +03:00
Natalia Ukhorskaya 6a04cd39b2 Debugger: allow to evaluate kotlin expressions in java files
#KT-7549 Fixed

 If the context is inside PsiJavaFile, get list of all local variables available in current frame (this logic was removed in 29778311e8 01.12.2015 Drop unnecesary logic about additional context for lambda in debugger). For each variable create KtProperty inside top-level KtFunction in KtFile and set it as contextElement for KtCodeFragment. This file should have all imports from PsiJavaFile. We do not create properties on top-level because they will be highlighted as top-level vals/vars.
2016-08-03 17:51:49 +03:00
Natalia Ukhorskaya d823d6f4ab Debugger tests: mark objects using NodeDescriptorImpl.getMarkup. Primitive values cannot be marked. 2016-08-03 17:51:49 +03:00
Nikolay Krasko a9ee10a8b7 Ignore intervals that has no mapping for origin line (KT-12896) 2016-08-02 01:05:08 +03:00
Nikolay Krasko 2dd7470cdc Better search for inlined strings in strata: there might me several file mappings to the same file (KT-12896)
#KT-12896 In Progress
2016-08-02 01:05:05 +03:00
Nikolay Krasko 5df7358dab Fix breakpoints in inline functions after dexing (KT-12896)
#KT-12896 In Progress
2016-08-02 01:02:07 +03:00
Nikolay Krasko 64979ae190 Allow to step into inline functions while debugging Android app (KT-12896)
#KT-12896 In Progress
2016-08-02 01:02:07 +03:00
Natalia Ukhorskaya 3cbe28095b Debugger: check that label for marked object is a valid java identifier (KT-12651)
#KT-12651 Fixed
2016-07-19 17:52:55 +03:00
Nikolay Krasko 57ef3f5656 Generate linenumber for goto instruction in while (KT-13059)
Otherwise linenumber for previous instruction will be used in debugger. That can lead to error stepping
because it might be line that isn't reachable on current iteration.

 #KT-13059 Fixed
2016-07-12 15:19:02 +03:00
Nikolay Krasko eee45e91ce Add more tests for PropertyAccessorDescriptor.isDeafult() usages 2016-06-29 16:16:31 +03:00
Nikolay Krasko 4087e650aa Wrong delegation to delegation property in debugger when property defined in another module (KT-12678)
Different bytecode can be generated for delegated property and for non-delegated one. Backend inspects DELEGATED_PROPERTY_CALL to understand the property type, and expects that
this information had been already recorded into context. Frontend writes DELEGATED_PROPERTY_CALL into context during body resolve or type inference if type is not present.

Either way in debugger context it may happen that the DELEGATED_PROPERTY_CALL won't be written into context.

 #KT-12678
2016-06-20 16:22:04 +03:00
Nikolay Krasko 3f4cde3d25 NoSuchFieldError in Evaluate Expression on a property of a derived class (KT-12206)
#KT-12206 Fixed
2016-06-02 14:39:51 +03:00
Ilya Gorbunov d70b46fd37 Change evaluation test data not to encounter special implementation of single element list. 2016-04-29 22:21:19 +03:00
Nikolay Krasko 6b7aa98980 Test data modification: Don't compute compiled bytecode for same expression twice
Result of dc9fa6d9ac commit.
Previously computation were saved into the map that were invalidated by the computation. Now map is recreated after computation and result is saved into it.
2016-04-25 19:50:22 +03:00
Natalia Ukhorskaya e8f46f5315 Debugger: 'Step Over' unexpectedly resume if condition of 'while' loop contains inline function call
#KT-11932 Fixed
2016-04-15 18:11:36 +03:00
Natalia Ukhorskaya f0badb05ea Debugger: fix step over for inline argument with non-local return 2016-04-15 18:11:36 +03:00
Natalia Ukhorskaya f0cfd450e5 Debugger: fix step over inside inline function (do not step into function literal argument) 2016-04-15 18:11:36 +03:00
Natalia Ukhorskaya d42823d4ee Debugger: cannot evaluate expression with raw types
#KT-11831 Fixed
2016-04-15 15:58:07 +03:00
Natalia Ukhorskaya 070ee10872 Debugger: do not insert ambiguous imports inside codeFragments
#KT-11927 Fixed
2016-04-15 15:58:07 +03:00
Natalia Ukhorskaya d7a87b2ff0 Debugger: fix breakpoints inside generic crossinline argument body
#KT-11848 Fixed
2016-04-15 15:58:07 +03:00