summaryrefslogtreecommitdiff
path: root/runtime/debugger.cc
Commit message (Collapse)AuthorAgeFilesLines
* Inclusive language fixesOrion Hodson2020-07-281-3/+3
| | | | | | | | | | | | Based on: https://source.android.com/setup/contribute/respectful-code #inclusivefixit Bug: 161336379 Bug: 161896447 Test: art/test.py --host --64 Change-Id: I02c96aa477c4be6af8384222f1f111cc7ae1eeac
* Update language to comply with Android’s inclusive language guidanceIan Pedowitz2020-07-241-1/+1
| | | | | | | | | | | See https://source.android.com/setup/contribute/respectful-code for reference Bug: 161896447 Bug: 161850439 Bug: 161336379 Test: m -j checkbuild cts docs tests Change-Id: I32d869c274a5d9a3dac63221e25874fe685d38c4
* Remove old JDWP implementation from ARTAlex Light2020-01-291-4203/+62
| | | | | | | | | | | | | | | | | | | | The old 'internal' JDWP implementation hasn't been used for a few releases and it's a lot of code that's barely being tested and is at risk of bit-rot. To simplify the runtime and remove potentially buggy code this removes it. We also needed to rewrite the DdmThreadNotification code since it relied on the suspension functionality from the old debugger and was generally unsafe. Test: ./test.py --host Test: atest --test-mapping cts/tests/jdwp/TEST_MAPPING Test: atest --test-mapping cts/hostsidetests/jdwptunnel/TEST_MAPPING Test: Manual ddms Bug: 119034743 Change-Id: I775f310a009141296b730e4a6c2503506a329481
* Handle nterp in IsForcedInterpreterNeededForUpcallImpl.Nicolas Geoffray2019-12-181-7/+1
| | | | | | | | Nterp is an interpreter but can have exit stubs. Test: 1916-get-set-current-frame Bug: 112676029 Change-Id: Ia6f175e0badc572c2f4a03cff99f70bf6649a535
* Revert^4 "Walk internal ArtField/ArtMethod pointers"Alex Light2019-10-071-7/+10
| | | | | | | | | | | | | Several of the new tests make use of the invoke-custom opcode. This opcode is not supported by dexter/slicer causing the tests to fail. This reverts commit c34eab45161c51bf63e548e44645cbcc59d01268. Reason for revert: Added tests to redefine-stress known failures Test: ./test.py --host --redefine-stress Bug: 134162467 Change-Id: Ic1b375a0cb1e44d0252c17115af92c269fb8efc5
* Revert "Revert^2 "Walk internal ArtField/ArtMethod pointers""Nicolas Geoffray2019-10-071-10/+7
| | | | | | | | | | This reverts commit ea2a3d949354c8b054983ba629c81bc5ff7163da. Bug: 134162467 Reason for revert: Fails redefine stress Change-Id: If487c0bcacaf3a3f565ff475b6dad8321e3428b9
* Revert^2 "Walk internal ArtField/ArtMethod pointers"Alex Light2019-10-041-7/+10
| | | | | | | | | | | | | | | | | This reverts commit 712fa800b2b78e527d36c88dc369bf4b723587ea. We incorrectly didn't check if a method was obsolete before giving its class's MethodIds array. We then incorrectly used this array and the (placeholder) -1 index to try to find the previous method-id. Since -1 is not a valid array index we got check failures. To fix this we simply added a check that the method is not obsolete and if it is we go to the slow-path. Reason for revert: Fixed issue causing out-of-bounds array access Test: ./test.py --host --debuggable --ndebuggable Bug: 134162467 Change-Id: Iaffefeab6e889b4fb6554a11452d0af051001cb7
* Revert "Walk internal ArtField/ArtMethod pointers"Nicolas Geoffray2019-10-041-10/+7
| | | | | | | | | | This reverts commit c84fc3a742b160ce51cbf01c2e5f971ccc0a2c6c. Bug: 134162467 Reason for revert: Test fails on debuggable. Change-Id: I240d58fafcc7434749947330b64c67d65b9b7a1e
* Walk internal ArtField/ArtMethod pointersAlex Light2019-10-031-7/+10
| | | | | | | | | | | | | | | During structural class redefinition we sometimes need to update some of the ArtMethod/ArtField pointers held by runtime frames. This adds support for doing this through a StackReflectiveHandleScope similar to the StackHandleScope used for holding object references. This also updates various places where reflective-handles to ArtMethods and ArtFields are needed, for example the JniIdManager, field Read/Write operations and events, field resolution, and the old debugger. Test: ./test.py --host Bug: 134162467 Change-Id: I4ea73e85956a07735c6d7b125c5828a4233670bc
* ART: Conditionally install Dbg class callbacksAndreas Gampe2019-06-111-2/+4
| | | | | | | | | | | Temporary allocations in the dispatch code are unnecessary when they end up in disabled code. Instead follow the example of the method inspection callback and only add the callback when the debugger is actually active. Test: m test-art-host Test: atest CtsJdwpTestCases Change-Id: I750f2df475400147b1d569f463228d436aa3ae5a
* JVMTI Force early returnAlex Light2019-06-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Add support for can_force_early_return jvmti capability. This allows one to force java frames to exit early. Exited frames have all of their normal locks released. We implement this by modifying the existing method exit events to allow one to modify the exit value during the callback. This is used to implement ForceEarlyReturn by adding internal-only events that will change the return value of methods once they return (using kForcePopFrame) avoiding the need to modify the actual interpreter very deeply. This also makes it simple to continue to use the standard deoptimization functions to force the actual return. In order to simplify book-keeping the internal event is refcounted, not associated with any specific jvmtiEnv, and only settable on specific threads. The internal event is added by the ForceEarlyReturn function and then removed by the MethodExit event when we update the return value. Bug: 130028055 Test: ./test.py --host Change-Id: Ifa44605b4e8032605f503a654ddf4bd2fc6b60bf
* Add default argument kIsInstrumented=true.Vladimir Marko2019-05-171-2/+2
| | | | | | | | | | | kIsInstrumented=false is reserved for use by specialized entrypoints which are used only when we can ensure that the code is not instrumented. So add the default argument to simplify all other callers. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I3419795794fec9a1733ab3ad698b6415dbac679d
* Add StackVisitor::SetVRegReference().Vladimir Marko2019-05-081-2/+1
| | | | | | | | | | | Avoid converting ObjPtr<>s to uint32_t and back. Test: m test-art-host-gtest Test: testrunner.py --host --interpreter Test: run-jdwp-tests.sh --mode=host --variant=X64 Test: run-jdwp-tests.sh --mode=host --variant=X64 --debug Bug: 31113334 Change-Id: I4e5c1577930de58772b35179aa4281ae4bbca300
* ObjPtr<>-ify debugger/jdwp.Vladimir Marko2019-05-081-65/+83
| | | | | | | | | Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-jdwp-tests.sh --mode=host --variant=X64 Test: run-jdwp-tests.sh --mode=host --variant=X64 --debug Bug: 31113334 Change-Id: I76889e7c64d7d57ca34236d1b424f00e8e2dda90
* ART: Fix some typesAndreas Gampe2019-04-251-3/+3
| | | | | | | | | Use better types and fix some typing issues exposed by clang-tidy's readability-implicit-bool-conversion. Bug: 32619234 Test: WITH_TIDY=1 mmma art Change-Id: I787d291a4843a3192a84853d105d57377b774b23
* ObjPtr<>-ify Monitor/-Pool.Vladimir Marko2019-04-011-2/+2
| | | | | | | Test: m test-art-host-gtest Test: testrunner.py --host Bug: 31113334 Change-Id: I2d2ebc5ef56e73e5678e0cfcd84c479611dfcca8
* ART: Fix stale reference use in debugger.Vladimir Marko2019-03-291-3/+4
| | | | | | Test: run-jdwp-tests.sh --mode=host --variant=X32 --debug Bug: 31113334 Change-Id: I48d137b0fe87b01ed982a4275d1b558fd6e23a4f
* ObjPtr<>-ify mirror::Object::As*(), fix stale refs in test.Vladimir Marko2019-03-291-41/+45
| | | | | | | Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: Ia04c4996f5cbfa1f26acbadcd747342c57b1aac3
* Revert "Revert "Change state to waiting during aborting the VM""Koji Fukui2019-03-271-0/+1
| | | | | | | | | | | This reverts commit ebb481d070e3fdbb7950580e6f6886c3231a1ad9. Dex2oatWatchdogTest.TestWatchdogTrigger passed. Apply the change again. Test: ART_HEAP_POISONING=true make test-art-host-gtest-dex2oat_test64 Bug: 127875380 Change-Id: If4326990cd612815ffe1511490712ca8babfec55
* ObjPtr<>-ify mirror::ObjectArray.Vladimir Marko2019-03-271-2/+2
| | | | | | | Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: I611b3e49d3feed306f6cd35d2b662a1e727e24c6
* ObjPtr<>-ify mirror::Class.Vladimir Marko2019-03-261-1/+1
| | | | | | | | | | And move function definitions that rely on obj_ptr-inl.h from class.h to class-inl.h . Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: I5ccc765d0a02b1d37cb39ed68c17b8456faf92ea
* ObjPtr<>-ify String allocations, fix stale refs.Vladimir Marko2019-03-251-1/+1
| | | | | | | | | | | ObjPtr<>-ify String allocation functions and related code and remove some unnecessary calls to ObjPtr<>::Ptr(). Fix stale reference uses in reference_table_test and stub_test. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: I42927fb8b7240e5132188f73318b2ccb218748fd
* Revert "Change state to waiting during aborting the VM"Nicolas Geoffray2019-03-191-1/+0
| | | | | | | | | | This reverts commit 97b964960123d5f215a1cebbce548c8a5322c307. Bug: 127875380 Reason for revert: Broke Dex2oatWatchdogTest.TestWatchdogTrigger on host x86_64 and heap poisoning. Change-Id: Iaebfc4a03543bff4e7239d711dd7ad8c7f880d52
* Change state to waiting during aborting the VMKoji Fukui2019-03-181-0/+1
| | | | | | | | | | | | | | | | | | | Symptom: Process freeze when multiple runtime error happen on runnable threads. Root cause: When multiple runtime error happen, only one thread locks abort_lock_ and other threads are blocked even if they are runnable state. If an other thread tries to suspend blocked threads at the same time, blocked threads can't be suspended until abort_lock_ is unlocked from owner thread. But owner thread can be suspended even if it locks abort_lock_. Thus, these threads causes dead lock. Solution: Change state to waiting when locking abort_lock_. Bug: 127875380 Change-Id: I7e914924690bb30d6d0490cf5f8afdb1c3cd4e4a
* Merge "Deoptimize zygote compiled methods in DeoptimizeBootImage."Nicolas Geoffray2019-01-101-1/+1
|\
| * Deoptimize zygote compiled methods in DeoptimizeBootImage.Nicolas Geoffray2018-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Those methods don't get compiled with the "debuggable" flag, so we need to deoptimize them. Also fix a bug revealed by the new test where a concurrent JIT collection happens when trying to disable it. Also make DeoptimizeBootImage truly mutator lock exclusive. Test: 689-zygote-jit-deopt Change-Id: I00607dbe100350c5328293c35c87946fa97924b8
* | ART: Move dex structs into own headerAndreas Gampe2019-01-021-1/+1
|/ | | | | | | | | Separating out the structs from DexFile allows them to be forward- declared, which reduces the need to include the dex_file header. Bug: 119869270 Test: m Change-Id: I32dde5a632884bca7435cd584b4a81883de2e7b4
* C++17 compatibility: make WITH_TIDY=1 happy again.Elliott Hughes2018-11-291-4/+4
| | | | | | Bug: http://b/111067277 Test: builds Change-Id: I8b69ea3815e14bb6eb27f40c0dd01a85b340a355
* Revert^4 "ART: Add StackVisitor accepting a lambda"Andreas Gampe2018-11-191-311/+219
| | | | | | | | | | This reverts commit ec43a01e0ac948c59d5b1f9c3812f2901b48942a. Reason for revert: Added missing code. Bug: 115837065 Test: m test-art-host Change-Id: Id30ccdf9aa9a6e56a914254793e399f2712c882d
* Revert "Revert^2 "ART: Add StackVisitor accepting a lambda""Nicolas Geoffray2018-11-171-217/+311
| | | | | | | | | | This reverts commit 3d477f3a3eea757a49ca621cc579f711f22fccdd. Bug: 115837065 Reason for revert: Breaks jdwp tests. Change-Id: I09249331798970751a20c6b41675c3efef72adfb
* Revert^2 "ART: Add StackVisitor accepting a lambda"Andreas Gampe2018-11-161-311/+217
| | | | | | | | | | This reverts commit 8248490f24e8582ce2ead8cd878d8a2c38310a48. Reason for revert: Fixed instrumentation.cc Bug: 115837065 Test: m test-art-host Change-Id: I484833f4712c835fcaf3452dca4cae5b031d5a7d
* Revert "ART: Add StackVisitor accepting a lambda"Andreas Gampe2018-11-161-217/+311
| | | | | | | | | | This reverts commit 36f8d22c672498753b9edc66ba11acc9816b2a17. Reason for revert: Seems to be breaking test 687 Bug: 115837065 Change-Id: I83bb1a9d76cc701c3d582778e5047ebd5dab5d29 Test: TreeHugger
* ART: Add StackVisitor accepting a lambdaAndreas Gampe2018-11-021-311/+217
| | | | | | | | | | To simplify implementation of visitors. Rewrite some visitors. Bug: 115837065 Test: mmma art Test: m test-art-host Change-Id: I04172d7626b702c1d69c63eba65526378935a25d
* ART: Add string-alloc-inl.hAndreas Gampe2018-10-301-0/+1
| | | | | | | | | | In an effort to reduce the (transitive) proliferation of heap-inl add a specific inline header for string allocation. Bug: 118385392 Test: mmma art Test: m test-art-host Change-Id: I68d3bcf2b3615d12231010940d0a24a1dbc03826
* ART: Add class-alloc-inl.hAndreas Gampe2018-10-261-0/+1
| | | | | | | | | | In an effort to reduce the (transitive) proliferation of heap-inl add a specific inline header for class instance allocation. Bug: 118385392 Test: mmma art Test: m test-art-host Change-Id: I32529f0221a836452c58687330a91ac0d5fde162
* ART: Add array-alloc-inl.hAndreas Gampe2018-10-251-0/+1
| | | | | | | | | | In an effort to reduce the (transitive) proliferation of heap-inl add a specific inline header for array allocation. Bug: 118385392 Test: mmma art Test: m test-art-host Change-Id: Id3378f40c52fa7ef4297af08cb7509e0c04b94d1
* ART: Refactor for bugprone-argument-commentAndreas Gampe2018-10-231-8/+8
| | | | | | | | Handles runtime. Bug: 116054210 Test: WITH_TIDY=1 mmma art Change-Id: Ibc0d5086809d647f0ce4df5452eb84442d27ecf0
* Cache the value of MterpShouldSwitchInterpreters()David Srbecky2018-10-221-2/+3
| | | | | | | | | | | Add field to the Thread object which stores the value instead (negated). Explicitly update the field when relevant state changes (which is rare). This speeds up golem interpreter benchmarks by 3.5% on average with some benchmarks up to 15% faster. Test: test.py -b -r --interpreter --host Change-Id: If2df0d3bf9e69ab50c30102b2648e997927c34d8
* Remove InvokeVirtualOrInterface event from instrumentation.David Srbecky2018-10-041-11/+0
| | | | | | | It is no longer used. Test: test-art-host-gtest Change-Id: I4d5f574d972ad2943a27adcca1d326d5d82a1923
* Refactor DecodeDebugLocalInfoMathieu Chartier2018-09-131-45/+29
| | | | | | | | | | Refactor the function to use a visitor instead of callback. Test: test-art-ghost Bug: 112311591 Bug: 77709234 Change-Id: I55385994952373b3fec4f9122400cf3c9d43da3b
* Refactor debug info position visitingMathieu Chartier2018-09-121-70/+35
| | | | | | | | | | Move logic to CodeItemDebugInfoAccessor, makes it easier to modify the debug info format. Test: test-art-host Bug: 112311591 Bug: 77709234 Change-Id: Ice56a88951efa54dc07d88f2c228c01be4670e73
* ART: Continue adding override annotationsAndreas Gampe2018-09-071-5/+5
| | | | | | | | | Use Clang-tidy's modernize-use-override to add more annotations. Ignore inferred annotations on destructors. Bug: 32619234 Test: mmma art Change-Id: Ic432c928e398d44df9171e42db04ee19946e6887
* Use 'final' and 'override' specifiers directly in ART.Roland Levillain2018-08-281-17/+17
| | | | | | | | | | | | | | | Remove all uses of macros 'FINAL' and 'OVERRIDE' and replace them with 'final' and 'override' specifiers. Remove all definitions of these macros as well, which were located in these files: - libartbase/base/macros.h - test/913-heaps/heaps.cc - test/ti-agent/ti_macros.h ART is now using C++14; the 'final' and 'override' specifiers have been introduced in C++11. Test: mmma art Change-Id: I256c7758155a71a2940ef2574925a44076feeebf
* ObjPtr<>-ify ArtMethod and mirror::Method.Vladimir Marko2018-07-191-1/+1
| | | | | | | | | And clean up some forgotten things after old CLs. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: I8af0e845c24d674d0efab21d80c29949b1cc0593
* ObjPtr<>-ify array allocations.Vladimir Marko2018-06-011-6/+5
| | | | | | | | | And remove some unnecessary calls to ObjPtr<>::Ptr(). Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: Ie313980f7f23b33b0ccea4fa8d5131d643c59080
* ART: Move JNI files to runtime/jni/ .Vladimir Marko2018-05-091-1/+1
| | | | | Test: Rely on TreeHugger. Change-Id: I9cae11191ef1567ae9453be498882a7767285140
* Revert^6 "Ensure that OSR still is possible with jvmti"Alex Light2018-04-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | The instrumentation uninstall could set methods to non-debuggable boot.oat code. This could cause events to be missed due to methods being inlined. We needed to change the path so that we would only have the JIT/interpreter replace methods. We do this by adding a new callback that can be used to determine if a method needs to be debuggable and being more careful about replacing code when this is true. This reverts commit 5f3005c8844d851d7d218b88b5f90d6c9083ce24. This unreverts commit b9ad26d1ed9146b89555d4333021f44eeb831f05. Reason for revert: Fixed issue causing CTS version of test 993 failure. Test: cts-tradefed run cts-dev CtsJvmtiRunTest993HostTestCases Test: ./test.py --host -j50 --all -t 993 Test: ./test.py --host Test: while ./test/run-test --host --jit 1935; do; done Test: while ./test/run-test --host --jit --jvmti-redefine-stress 1935; do; done Test: am start --attach-agent -n com.example.android.displayingbitmaps/.ui.ImageGridActivity Run blur filter. Bug: 76226464 Bug: 77306669 Change-Id: I5068201a03f7613787c66981405499b6499c24e1
* Remove unhelpful ExceptionDescribe from DDMS error path.Alex Light2018-03-281-6/+9
| | | | | | | | | | | | If a DDMS handler threw an error or returned invalid input we would call ExceptionDescribe on the exception. This is usually not very helpful since it goes to System.err instead of logcat and can make testing difficult. This change replaces the ExceptionDescribe with a LOG(INFO). Test: ./test.py --host -j50 Bug: 70988713 Change-Id: I41e743c42e63c0dcb6d32473c31f391983819d32
* Header library to remove dependence on runtime/David Sehr2018-02-281-1/+1
| | | | | | | | | | | | Add a new header library to remove libdexfile and others' dependence on runtime (typically runtime/base) includes in libdexfile. Also a small step to tease dexlayout and profman away from relying on these as well. Bug: 22322814 Test: make -j 50 checkbuild make -j 50 test-art-host-gtest Change-Id: I38e2fe399a75f4bc6318c77a71954c00ea73ec2b
* Small documentation and stylistic changes.Roland Levillain2018-02-271-3/+3
| | | | | Test: art/test.py Change-Id: Ibc74ee4783314266bf1d027811715058626c57c8