This entire structure is used to detect whether the LLDB being used has SBInstruction::GetControlFlowKind(), which LLDB versions 16 and newer have. Termux has had LLDB version 16 or newer since 2023. sbcommandinterpreter.rs: partially revert https://github.com/vadimcn/codelldb/commit/bc1281e93d611deaa3670bfcc395bf095fcba659, which is for LLDB 17 and older, to prevent this error: error: 'is_default_constructible' cannot be specialized: Users are not allowed to specialize this standard library entity [-Winvalid-specialization] --- a/src/lldb/src/sb/sbcommandinterpreter.rs +++ b/src/lldb/src/sb/sbcommandinterpreter.rs @@ -1,12 +1,5 @@ use super::*; -cpp! {{ -namespace std { - // Prevent cpp from auto-deriving Default, which would use the default SBCommandInterpreter constructor - // introduced in v18, causing codelldb to be incompatible with earlier versions. - template<> struct is_default_constructible : std::false_type {}; -} -}} cpp_class!(pub unsafe struct SBCommandInterpreter as "SBCommandInterpreter"); unsafe impl Send for SBCommandInterpreter {} --- a/src/lldb-stub/build.rs +++ b/src/lldb-stub/build.rs @@ -32,21 +32,6 @@ fn main() -> Result<(), Error> { let mut wl_config = weaklink_build::Config::new("liblldb"); - // Generate optional api groups via SBAPI.toml - let api_groups = get_api_groups("SBAPI.toml")?; - for (version, imports) in api_groups { - for imp in &imports { - if !common_syms.remove(&imp.name) { - println!( - "cargo:warning=Symbol \"{}\" is declared in {version}, but isn't used by codelldb.", - imp.name - ); - } - } - let symbols: Vec<_> = imports.iter().map(|e| SymbolStub::new(&e.name)).collect(); - wl_config.add_symbol_group(version.as_str(), symbols)?; - } - // Emit the rest of common symbols as base group. let symbols: Vec<_> = exports .into_iter() --- a/src/codelldb/src/debug_session.rs +++ b/src/codelldb/src/debug_session.rs @@ -614,7 +614,7 @@ impl DebugSession { supports_read_memory_request: Some(true), supports_restart_request: Some(true), supports_set_variable: Some(true), - supports_step_in_targets_request: Some(lldb_stub::v16.resolve().is_ok()), + supports_step_in_targets_request: Some(true), supports_stepping_granularity: Some(true), supports_write_memory_request: Some(true), ..Default::default() @@ -1434,7 +1434,7 @@ impl DebugSession { self.handle_breakpoint_event(&bp_event); } else if let Some(thread_event) = event.as_thread_event() { self.handle_thread_event(&thread_event); - } else if lldb_stub::v15.resolve().is_ok() { + } else { if let Some(diag_event) = event.as_diagnostic_event() { self.handle_diagnostic_event(&diag_event); } --- a/src/codelldb/src/debug_session/step_in.rs +++ b/src/codelldb/src/debug_session/step_in.rs @@ -32,7 +32,6 @@ impl super::DebugSession { let Some(cu) = frame.compile_uint() else { bail!("No compile unit for frame."); }; - let _token = lldb_stub::v16.resolve()?; // This is the typical case we aim to handle: // ``` @@ -183,7 +183,6 @@ impl super::DebugSession { } fn step_into_target(&self, thread: &SBThread, step_target: &StepInTargetInternal) -> Result<(), Error> { - let _token = lldb_stub::v16.resolve()?; self.with_sync_mode(|| { let start_frame = thread.frame_at_index(0); thread.step_into(RunMode::OnlyThisThread)?; --- a/src/lldb/src/lib.rs +++ b/src/lldb/src/lib.rs @@ -26,5 +26,4 @@ fn test_init() { use std::path::Path; lldb_stub::liblldb.load_from(Path::new(env!("LLDB_DYLIB"))).unwrap(); lldb_stub::base.resolve().unwrap().mark_permanent(); - lldb_stub::v16.resolve().unwrap().mark_permanent(); } --- a/src/codelldb/src/lib.rs +++ b/src/codelldb/src/lib.rs @@ -179,7 +179,6 @@ fn test_init() { use std::path::Path; lldb_stub::liblldb.load_from(Path::new(env!("LLDB_DYLIB"))).unwrap(); lldb_stub::base.resolve().unwrap().mark_permanent(); - lldb_stub::v16.resolve().unwrap().mark_permanent(); } #[cfg(test)]