vadimcn / codelldb

A native debugger extension for VSCode based on LLDB
https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
MIT License
2.55k stars 246 forks source link

Debugger fails to launch if breakpoint set in assembly of Jni lib #591

Open YSaxon opened 2 years ago

YSaxon commented 2 years ago

OS: MacOS 11.6 VSCode version: 1.62.3 CodeLLDB version: v1.6.10 Compiler: android-ndk / clang / armeabi-v7a / SystemVersion22 Debuggee: an android native library

So I believe I actually solved the problem myself, but wanted to report it anyway.. I had been successfully launching and debugging the file I was debugging many times but then it abruptly stopped working (with a recreated error log below). Turns out the problem was that while I was debugging deep into the stack (past where I did not have the source so I had temporarily turned on "show dissassembly always" before stepping in further, I had tried setting a breakpoint inside a native JNI library. The name of the breakpoint as shown on the left hand side in my breakpoints list is @art::JNI::FindClass(_JNIEnv*, char const*) /. When that breakpoint is turned on, the debugger fails to launch (the little progress blue line in the run tab just keeps moving around forever), and produces the error log below; with it disabled, everything works again. Interestingly this does not seem to be a problem with other breakpoints in other disassembly-only areas.

Verbose log

(some non essential names redacted)

configuration: {
  name: 'Remote launch calldirectly',
  type: 'lldb',
  request: 'launch',
  justMyCode: false,
  program: '${workspaceFolder}/build/example/calldirectly',
  initCommands: [
    'platform select remote-android',
    'platform connect connect://0855555555:10086',
    'settings set target.inherit-env false',
    'file /cache/calldirectly',
    'b main'
  ],
  env: {
    PATH: '/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin',
    LD_LIBRARY_PATH: '/cache:/data/user/0/something/lib:/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin',
    ANDROID_DATA: '/data',
    SECONDARY_STORAGE: '/storage/sdcard1',
    LOOP_MOUNTPOINT: '/mnt/obb',
    ANDROID_ROOT: '/system',
    ANDROID_BOOTLOGO: '1',
    ANDROID_ASSETS: '/system/app',
    ASEC_MOUNTPOINT: '/mnt/asec',
    BOOTCLASSPATH: '/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/apache-xml.jar:/system/framework/qcmediaplayer.jar:/system/framework/WfdCommon.jar:/system/framework/oem-services.jar:/system/framework/org.codeaurora.Performance.jar:/system/framework/vcard.jar:/system/framework/tcmiface.jar:/system/framework/com.qrd.plugin.feature_query.jar:/data/app/something/base.apk',
    EMULATED_STORAGE_TARGET: '/storage/emulated',
    ANDROID_SOCKET_adbd: '10',
    EXTERNAL_STORAGE: '/storage/emulated/legacy',
    ANDROID_STORAGE: '/storage',
    SYSTEMSERVERCLASSPATH: '/system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar:/data/app/something/base.apk',
    ANDROID_PROPERTY_WORKSPACE: '8,0',
    EMULATED_STORAGE_SOURCE: '/mnt/shell/emulated'
  },
  __configurationTarget: 5,
  relativePathBase: '/Users/ysaxon/Desktop/folder'
}
liblldb: /Users/ysaxon/.vscode/extensions/vadimcn.vscode-lldb-1.6.10/lldb/lib/liblldb.dylib
environment: { RUST_BACKTRACE: 'FULL' }
params: { evaluateForHovers: true, commandCompletions: true }
Listening on port 57063
[2021-11-30T15:50:24.736Z DEBUG codelldb] New debug session
INFO(Python) 10:50:25 formatters: Initializing
INFO(Python) 10:50:25 formatters.rust: Initializing
[2021-11-30T15:50:25.426Z DEBUG codelldb::dap_codec] --> {"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"lldb","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true},"type":"request","seq":1}
[2021-11-30T15:50:25.427Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":1,"success":true,"command":"initialize","body":{"exceptionBreakpointFilters":[{"default":true,"filter":"cpp_throw","label":"C++: on throw"},{"default":false,"filter":"cpp_catch","label":"C++: on catch"}],"supportTerminateDebuggee":true,"supportsCancelRequest":true,"supportsCompletionsRequest":true,"supportsConditionalBreakpoints":true,"supportsConfigurationDoneRequest":true,"supportsDataBreakpoints":true,"supportsDelayedStackTraceLoading":true,"supportsEvaluateForHovers":true,"supportsFunctionBreakpoints":true,"supportsGotoTargetsRequest":true,"supportsHitConditionalBreakpoints":true,"supportsLogPoints":true,"supportsReadMemoryRequest":true,"supportsRestartFrame":true,"supportsSetVariable":true}}
[2021-11-30T15:50:25.448Z DEBUG codelldb::dap_codec] --> {"command":"launch","arguments":{"name":"Remote launch calldirectly","type":"lldb","request":"launch","justMyCode":false,"program":"/Users/ysaxon/Desktop/folder/build/example/calldirectly","initCommands":["platform select remote-android","platform connect connect://0855555555:10086","settings set target.inherit-env false","file /cache/calldirectly","b main"],"env":{"PATH":"/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin","LD_LIBRARY_PATH":"/cache:/data/user/0/something/lib:/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin","ANDROID_DATA":"/data","SECONDARY_STORAGE":"/storage/sdcard1","LOOP_MOUNTPOINT":"/mnt/obb","ANDROID_ROOT":"/system","ANDROID_BOOTLOGO":"1","ANDROID_ASSETS":"/system/app","ASEC_MOUNTPOINT":"/mnt/asec","BOOTCLASSPATH":"/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/apache-xml.jar:/system/framework/qcmediaplayer.jar:/system/framework/WfdCommon.jar:/system/framework/oem-services.jar:/system/framework/org.codeaurora.Performance.jar:/system/framework/vcard.jar:/system/framework/tcmiface.jar:/system/framework/com.qrd.plugin.feature_query.jar:/data/app/something/base.apk","EMULATED_STORAGE_TARGET":"/storage/emulated","ANDROID_SOCKET_adbd":"10","EXTERNAL_STORAGE":"/storage/emulated/legacy","ANDROID_STORAGE":"/storage","SYSTEMSERVERCLASSPATH":"/system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar:/data/app/something/base.apk","ANDROID_PROPERTY_WORKSPACE":"8,0","EMULATED_STORAGE_SOURCE":"/mnt/shell/emulated"},"__configurationTarget":5,"relativePathBase":"/Users/ysaxon/Desktop/folder","_adapterSettings":{"displayFormat":"auto","showDisassembly":"auto","dereferencePointers":true,"suppressMissingSourceFiles":true,"evaluationTimeout":5,"consoleMode":"commands","sourceLanguages":null,"terminalPromptClear":null,"evaluateForHovers":true,"commandCompletions":true,"reproducer":false},"__sessionId":"63e76b9a-3aa3-463b-92cd-bfd68e0d5060"},"type":"request","seq":2}
[2021-11-30T15:50:25.449Z DEBUG codelldb::debug_session] platform select remote-android -> SuccessFinishResult, Error:  Success
    Output Message:
      Platform: remote-android
     Connected: no

[2021-11-30T15:50:25.450Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":1,"event":"capabilities","body":{"capabilities":{"exceptionBreakpointFilters":[{"default":true,"filter":"cpp_throw","label":"C++: on throw"},{"default":false,"filter":"cpp_catch","label":"C++: on catch"}],"supportTerminateDebuggee":true,"supportsCancelRequest":true,"supportsCompletionsRequest":true,"supportsConditionalBreakpoints":true,"supportsConfigurationDoneRequest":true,"supportsDataBreakpoints":true,"supportsDelayedStackTraceLoading":true,"supportsEvaluateForHovers":true,"supportsFunctionBreakpoints":true,"supportsGotoTargetsRequest":true,"supportsHitConditionalBreakpoints":true,"supportsLogPoints":true,"supportsReadMemoryRequest":true,"supportsRestartFrame":true,"supportsSetVariable":true}}}
[2021-11-30T15:50:25.450Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":2,"event":"output","body":{"output":"Executing script: initCommands\n"}}
[2021-11-30T15:50:25.450Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":3,"event":"output","body":{"output":"  Platform: remote-android\n Connected: no\n\n"}}
[2021-11-30T15:50:25.498Z DEBUG codelldb::debug_session] platform connect connect://0855555555:10086 -> SuccessFinishResult, Error:  Success
    Output Message:
      Platform: remote-android
        Triple: arm-unknown-linux-android
    OS Version: 22 (3.10.49)
      Hostname: localhost
     Connected: yes
    WorkingDir: /cache
        Kernel: #1 SMP PREEMPT Fri Aug 20 11:52:15 HKT 2021

[2021-11-30T15:50:25.498Z DEBUG codelldb::debug_session] settings set target.inherit-env false -> SuccessFinishResult, Error:  Success
[2021-11-30T15:50:25.499Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":4,"event":"output","body":{"output":"  Platform: remote-android\n    Triple: arm-unknown-linux-android\nOS Version: 22 (3.10.49)\n  Hostname: localhost\n Connected: yes\nWorkingDir: /cache\n    Kernel: #1 SMP PREEMPT Fri Aug 20 11:52:15 HKT 2021\n\n"}}
[2021-11-30T15:50:25.754Z DEBUG codelldb::debug_session] file /cache/calldirectly -> SuccessFinishNoResult, Error:  Success
    Output Message:
    Current executable set to '/cache/calldirectly' (arm).

[2021-11-30T15:50:25.754Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":5,"event":"output","body":{"output":"Current executable set to '/cache/calldirectly' (arm).\n\n"}}
[2021-11-30T15:50:25.755Z DEBUG codelldb::debug_session] b main -> SuccessFinishResult, Error:  Success
    Output Message:
    Breakpoint 1: where = calldirectly`main + 12 at calldirectly.c:181:5, address = 0x00008224

[2021-11-30T15:50:25.755Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":6,"event":"output","body":{"output":"Breakpoint 1: where = calldirectly`main + 12 at calldirectly.c:181:5, address = 0x00008224\n\n"}}
[2021-11-30T15:50:25.763Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":7,"event":"initialized"}
[2021-11-30T15:50:25.769Z DEBUG codelldb::debug_session] Debug event: 0x7ff70be943c8 Event: broadcaster = 0x7ff70d31c040 (lldb.target), type = 0x00000002 (modules-loaded), data = {calldirectly}
[2021-11-30T15:50:25.770Z DEBUG codelldb::debug_session] Debug event: 0x7ff70bfff7a8 Event: broadcaster = 0x7ff70d31c040 (lldb.target), type = 0x00000002 (modules-loaded), data = {libart.so, libm.so, libunwind.so, libdl.so, libc.so, libbacktrace_libc++.so, libc++.so, libcutils.so, liblog.so, libnativebridge.so, libnativehelper.so, libselinux.so, libsigchain.so, libutils.so, libstdc++.so, libgccdemangle.so, libunwind-ptrace.so, libstlport.so, libpcre.so, libbacktrace.so}
[2021-11-30T15:50:25.771Z DEBUG codelldb::debug_session] Debug event: 0x7ff70bd6ce78 Event: broadcaster = 0x7ff70d31c040 (lldb.target), type = 0x00000001 (breakpoint-changed), data = {}
[2021-11-30T15:50:25.771Z DEBUG codelldb::debug_session] Debug event: 0x7ff70bc4bca8 Event: broadcaster = 0x7ff70c283240 (lldb.target), type = 0x00000002 (modules-loaded), data = {calldirectly}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":8,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"calldirectly","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/5C1305A0/calldirectly","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/5C1305A0/calldirectly","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":9,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libart.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/1C726E1B/libart.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/1C726E1B/libart.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":10,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libm.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/1B5EC265/libm.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/1B5EC265/libm.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":11,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libunwind.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/7A0D6A1E/libunwind.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/7A0D6A1E/libunwind.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":12,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libdl.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/9241C64E/libdl.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/9241C64E/libdl.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":13,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libc.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/090C57D2/libc.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/090C57D2/libc.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":14,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libbacktrace_libc++.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/353A1506/libbacktrace_libc++.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/353A1506/libbacktrace_libc++.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":15,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libc++.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/0970BBE1/libc++.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/0970BBE1/libc++.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":16,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libcutils.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/7A7C7462/libcutils.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/7A7C7462/libcutils.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":17,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"liblog.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/39FD59FD/liblog.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/39FD59FD/liblog.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":18,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libnativebridge.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/FAAFCD5C/libnativebridge.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/FAAFCD5C/libnativebridge.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":19,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libnativehelper.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/A71700C5/libnativehelper.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/A71700C5/libnativehelper.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":20,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libselinux.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/FD7617A9/libselinux.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/FD7617A9/libselinux.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":21,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libsigchain.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/72E106B1/libsigchain.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/72E106B1/libsigchain.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":22,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libutils.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/D1E8E322/libutils.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/D1E8E322/libutils.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":23,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libstdc++.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/76988E7D/libstdc++.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/76988E7D/libstdc++.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":24,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libgccdemangle.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/4FAE932E/libgccdemangle.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/4FAE932E/libgccdemangle.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":25,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libunwind-ptrace.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/BEA4F862/libunwind-ptrace.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/BEA4F862/libunwind-ptrace.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":26,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libstlport.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/197831D0/libstlport.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/197831D0/libstlport.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":27,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libpcre.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/00C88DAB/libpcre.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/00C88DAB/libpcre.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":28,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"libbacktrace.so","path":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/F9804682/libbacktrace.so","symbolFilePath":"/Users/ysaxon/.lldb/module_cache/remote-android/.cache/F9804682/libbacktrace.so","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":29,"event":"breakpoint","body":{"breakpoint":{"id":1,"line":181,"message":"Resolved locations: 0","source":{"name":"calldirectly.c","path":"/path/calldirectly.c"},"verified":true},"reason":"new"}}
[2021-11-30T15:50:25.773Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":30,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"calldirectly","path":"/Users/ysaxon/Desktop/folder/build/example/calldirectly","symbolFilePath":"/Users/ysaxon/Desktop/folder/build/example/calldirectly","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-11-30T15:50:25.776Z DEBUG codelldb::dap_codec] --> {"command":"setBreakpoints","arguments":{"source":{"name":"@art::JNI::FindClass(_JNIEnv*, char const*)","path":"@art::JNI::FindClass(_JNIEnv*, char const*)","sourceReference":1028,"adapterData":{"end":3068145000,"lineOffsets":[4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4],"start":3068144872}},"lines":[296],"breakpoints":[{"line":296}],"sourceModified":false},"type":"request","seq":3}
 (breakpoints 4..12 omitted)
thread '' panicked at 'index out of bounds: the len is 36 but the index is 296', adapter/src/debug_session/breakpoints.rs:188:27
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_bounds_check
   3: codelldb::debug_session::DebugSession::handle_request_args
   4: codelldb::debug_session::DebugSession::handle_request
   5: tokio::loom::std::unsafe_cell::UnsafeCell::with_mut
   6: tokio::runtime::task::core::CoreStage::poll
   7: tokio::runtime::task::harness::Harness::poll
   8: std::thread::local::LocalKey::with
   9: tokio::task::local::LocalSet::tick
  10: ::poll
  11:  as core::future::future::Future>::poll
  12: tokio::park::thread::CachedParkThread::block_on
  13: tokio::runtime::thread_pool::ThreadPool::block_on
  14: tokio::runtime::Runtime::block_on
  15: _entry
  16: codelldb::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

jiqimaogou commented 2 years ago

I have the same issue.

https://source.android.google.cn/devices/tech/debug/gdb?hl=zh-cn#vscode

the breakpoint set is not worked.

I guess maybe the version of lldb-server is different from the version of lldb in the extension.

android lldb-server is 11.0.0. the lldb in extension is 13.0.0.

vadimcn commented 2 years ago

@YSaxon thanks for the report, this part clearly needs to be coded more carefully.