2,035 questions
0
votes
0
answers
60
views
How to inspect structures like NSRect/NSSize using lldb?
I have previously used lldb to print structures like NSRect or NSSize of 3rd party processes without issues. But I am struggling in modern versions of Xcode to inspect them. Namely since the ...
1
vote
0
answers
109
views
The iOS Watchdog kills a debugged daemon process 2 minutes into the debugging session
On a jailbroken iPhone, I'm attaching the debugserver to an iOS system daemon: debugserver 0.0.0.0:1234 -a <daemon-process>.
It is possible to connect to the iOS debugserver using lldb on my Mac....
0
votes
1
answer
56
views
Disassembly view in Xcode: how can I symbolicate a function's address?
In Xcode, I set a breakpoint to a function which is a part of an iOS framework and the disassembly view showed up. All function calls except one (0x1bb286280) were symbolicated (i.e. Xcode showed the ...
1
vote
1
answer
57
views
How can I skip uninteresting functions/files with lldb (in boost asio)?
I would like to skip the whole boost library details when stepping through the code in the debugger.
Example uninteresting things I would like to skip:
(lldb) n
Process 577286 stopped
* thread #1, ...
0
votes
1
answer
36
views
Is there a way to debug macports provided packages with source code?
How do I debug a macports provided package with the source code?
I currently see the decompiled assembly language, what I need is the line on which the code crashed.
Process 90037 stopped
* thread #1, ...
1
vote
2
answers
162
views
How to print swift object in LLDB for given address?
In ObjC++, I just use po $x0 to print the first argument of a function. If it's an object, it will display it in detail.
However, in Swift when I do this for an swift object, I got an error:
po $x0
...
0
votes
0
answers
184
views
Debugger not stepping through code in VSCode with Rust – Unable to debug using `lldb` on Windows
I'm trying to debug my Rust project in VSCode but the debugger doesn't step through the code. I have lldb configured as the debugger, but breakpoints aren't hit, and I can't step through my code. I’m ...
2
votes
1
answer
135
views
How to put source information in the debug symbols without embedding the full sources on Linux?
MSVC has a very useful flag /SOURCELINK. This allows you to tell where in your versioning system the sources are stored, such that they can be downloaded.
For example: (Also holds for C++)
{
"...
0
votes
2
answers
76
views
How can I access synthetic children whose names have special characters in LLDB?
Consider this program.cpp:
struct Foo {
int field1;
int field2;
};
int main() {
Foo foo{.field1 = -1, .field2 = -2};
return 0;
}
I've implemented a custom LLDB data formatter for the Foo ...
1
vote
0
answers
225
views
lldb can't attach to process directly
I'm having trouble attaching lldb directly to a running process on macOS. When I try lldb -p <PID>, I always get error: Connection shut down by remote side while waiting for reply to initial ...
0
votes
1
answer
158
views
How does Xcode display the recorded stack frame, and can I retrieve it manually using LLDB?
In iOS development, I’ve noticed that when I set a breakpoint on a dispatch_* object (e.g., dispatch_async) in Xcode, it sometimes allows me to trace back to the original caller of the dispatch. In ...
0
votes
0
answers
48
views
Can I pass key presses from LLDB to attached process running on its own separate terminal?
I've a command line process (https://mpv.io) running on its own terminal window on macOS. I'm attaching to it via an ssh'ed lldb -p <PID> and want to be able to control said app via key presses ...
0
votes
1
answer
139
views
[LLDB][RUN][error: execve failed: Permission denied]
I used Clang to compile a large project to Linux X86_64 executable file my_out.
./my_out runs successfully.
When I try to use lldb my_out to debug the execution of my_out.
It can success launch the ...
0
votes
1
answer
71
views
LLDB is invoking Xcode to display source code all of a sudden. How to switch back?
I'm debugging a C project on Mac using LLDB, and the relevant source codes no longer displays inside LLDB commandline, but instead in Xcode.
How do I disable this?
(lldb) version
lldb-1700.0.9.502
...
-1
votes
1
answer
285
views
lldb-dap exception 0x80000003 under Windows 11 / arm64
I just learned about the lldb-dap extension for VSCode and set about using it on a trivial hello world program. Well, things are running, but not comfortably. I set a breakpoint on the printf line, ...
0
votes
0
answers
130
views
Clang&LLDB debug: summary string parsing error
I have set the compilation option -fstandalone-debug, but still cannot view the string content in vscode with clangd & CodeLLDB.
#include <iostream>
#include <string>
using namespace ...
0
votes
1
answer
53
views
Awful lldb Command Indentation
I created a ~/.lldbinit file with only one setting:
settings set prompt "\x1b[0;33m(lldb) \x1b[0m"
hoping only to change the color of prompt. It works, very well, but then there comes an ...
-1
votes
1
answer
40
views
lldb: Error [IRForTarget]: Rewriting an Objective-C constant string requires CFStringCreateWithBytes
I'm start the iPhone Simulator, then debug with lldb:
lldb -n SpringBoard
Then i input: p/x @"Yay! Debugging"
However, lldb throw error:
Error [IRForTarget]: Rewriting an Objective-C ...
0
votes
1
answer
91
views
LLDB breaks on adding a breakpoint using python
I want a LLDB breakpoint callback to add another breakpoint on the next frame in the callstack.
For this I have a file trace_mvp.py with the following code:
import lldb
def syscall_callback(frame: ...
1
vote
1
answer
283
views
How do I start a lldb-dap server while loading some data formatters (pretty printers)?
I am using nvim and nvim-dap for debugging, in particular with Rust. I would like to make use of rust's pretty printers for lldb while debugging in nvim.
Rust provides some pretty printers here: https:...
0
votes
1
answer
184
views
Why does the local variable display in the debugger disappear while debugging Rust in VSCode/LLDB?
I am debugging Rust in VSCode using LLDB.
Why do some of the local variables that appear in the debugger disappear when I place a breakpoint at the end of the scope in the image code?
Is there a ...
2
votes
0
answers
146
views
How to debug coredump file using lldb in vscode?
I use codelldb extension in vscode. Before, this configuration in settings.json worked:
{
"name": "LLDB coredump",
"type": "lldb"...
1
vote
0
answers
57
views
Branch-and-link not jumping when branch does (ARM64 on apple silicon)
New to assembly, trying to write some fibonacci recursive code
.section __TEXT,__text,regular,pure_instructions
_main:
mov X0, 5
bl fib
bl exit
fib_end:
mov X0, 0
b exit
.align 2
fib:
...
1
vote
1
answer
76
views
lldb: how to break at each module change?
In lldb, I need to break everytime I change module (e.g. the stack frame is in a dynamic library instead of the main binary).
How can I do that?
0
votes
1
answer
84
views
How to detect presence of the lldb at runtime?
Please note: this question is not about statically determined conditional code compilation.
My question is: how do I determine at runtime that my process is being debugged by LLDB by analyzing the ...
2
votes
1
answer
307
views
How to create a custom debug visualizer in CLion for a complex container?
I recently made a custom container that stores multiple type arrays in a single contiguous memory block with custom stride mechanism instead of SoA or AoS.
The problem is that all standard debug ...
0
votes
1
answer
63
views
LLDB - how do I import a symbol so I can access a struct definition?
I'm using lldb to debug an application and I have this breakpoint right before a call SCNetworkReachability
imp___stubs__SCNetworkReachabilityCreateWithAddress:
jmp qword [...
3
votes
2
answers
2k
views
"error: unknown option: --interpreter=mi" trying to debug with lldb on Mac
I am receiving the "error: unknown option: --interpreter=mi" when trying to debug with lldb in VS Code on Mac for C++, Clang Compiler, and an OpenMP implementation. I am unable to debug ...
0
votes
1
answer
79
views
LLDB running a Python debugging script. I'm getting error: invalid thread
I'm trying to run a Python debug script in LLDB, but I'm getting invalid thread errors. I'm not sure why.
Here are my programs:
main.c:
#include <stdio.h>
#include <stdlib.h>
int addNumbs(...
0
votes
1
answer
190
views
How can I see the values in dataframe or series when debug rust polars program?
I am using vscode+rust-analyzer+codelldb to debug rust code on Ubuntu server 24.04. I want to easily see values in a Dataframe or Series like what we usually do when debugging python pandas programs, ...
1
vote
1
answer
150
views
How to compile sqlite3 source code for debugging in vscode
I have cloned sqlite3 codebase from github and ran following command on folder.
./configure --disable-amalgamation --debug
After that I have ran following command to build
make sqlite3
sqlite3 is ...
0
votes
1
answer
177
views
LLDB How to remove module is current target list
image add will add a new module to the current target list, but how can I remove a module afterwards?
6
votes
2
answers
201
views
Printing C arrays passed into functions in lldb
Is it ever possible to use lldb's various variable formatting options for arrays that have been passed to a function? I have a simple C array that I pass into a quicksort function like this:
int main(...
2
votes
0
answers
158
views
How can I debug with lldb on windows using the regular clang compiler driver?
This works:
clang-cl -MTd -Z7 -fuse-ld=lld main.c -o main.exe
lldb main.exe
And lldb finds the debug symbols.
But I want to use clang and not clang-cl as its command line syntax is the same on all ...
1
vote
0
answers
319
views
great memory leak on lldb in C++ code on mac
I ran a small C++ program:
#include <iostream>
#include <map>
#include <vector>
using namespace std;
class Solution
{
public:
string minWindow(string s, string t)
{
...
0
votes
0
answers
113
views
How to debug C++ under VSCode under Windows on Apple hardware?
I live on a Macintosh. I want to be able to build and debug my code on Macintosh and Windows both. So I set up my Windows world in a parallels VM running Windows 11, on my Apple Silicon 1 Macintosh. (...
2
votes
2
answers
56
views
How can I print data received by OpenSSL SSL_read() in LLDB?
Printing outgoing data sent with SSL_write() on ARM64 is quite simple:
break set --auto-continue true -n SSL_write
break command add
memory read -f Y -c `$x2` $x1
DONE
The signature of SSL_write()...
1
vote
0
answers
78
views
Can't debug arm64 binary with lldb in MAC m1 (can't revert back to arm64 from i386 in mac m1)
Check this screenshot for reference.
❯ uname -a
Darwin APPLEs-MacBook-Air.local 23.6.0 Darwin Kernel Version 23.6.0: Wed Jul 31 20:49:46 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_ARM64_T8103 ...
0
votes
2
answers
88
views
How can I script LLDB to update an external source code view?
In GDB I have a Python script which uses gdb.prompt_hook to send a command to an open vim session whenever the current file/line number changes. Effectively giving me a "live updating" ...
0
votes
2
answers
337
views
LLDB Python scripting - how to add module or load symbol file at particular address?
In LLDB you can do the following during a debugging session to add missing symbols at particular addresses:
target modules load --file <symbol file> .text 0x<address>
How can you do that ...
0
votes
1
answer
266
views
LLDB how to add symbol files at certain address?
In GDB you can do add-symbol-file <library> <address> to load symbols files at a particular address. What's the equivalent in LLDB?
I have already tried
image add <symbol file>
...
1
vote
0
answers
52
views
next in .lldb init enters to assembly
I often have to reenter the same steps when debugging a program with lldb so I decided to put them into an .lldbinit file:
file main
b ft_printf
run
next
I should automatically load the file, set a ...
0
votes
1
answer
170
views
Asserts emit SIGABRT in debug mode
CLion SIGABRT
I am using CLion 2024.1.6, lldb-1600.0.39.3. In debug mode, the program triggered SIGABRT. It is expected that breakpoints should be triggered here. I want to know what the problem is.
I ...
5
votes
0
answers
253
views
VS Code Rust LLDP Debugger - Hanging on Breakpoints
I have VS Code on an Ubuntu machine configured to debug a Rust application. When running, the debugger will stop at a breakpoint as expected.
The problem is that once it hits the breakpoint, it ...
1
vote
0
answers
100
views
Attach lldb debugger to the compiled program's executable when the main executable is not the compiled program
I am building an MPI C project in Xcode. In order to do run it, I had to:
Specify /path/to/mpiexec in Edit Scheme -> Run -> Info -> Executable, instead of the "default" one, say ...
5
votes
2
answers
562
views
Why is LLDB in C++ able to print my entire data structure but not able to print subcomponents?
I'm using Mac OS Sonoma 14.5 with LLDB 1500.0.404.7 installed via x-code tools. I noticed that my LLDB behaves in a rather confusing way. It is able to print out some std:containers in their entirety ...
1
vote
0
answers
252
views
When using vscode to debug clickhouse, the source code breakpoints will jump to the corresponding assembly code
A problem occurs when I use VSCode to debug clickhouse compiled from source code:
Could not resolve any locations for breakpoint at ~/ClickHouse/programs/local/LocalServer.cpp:480, but found a valid ...
0
votes
1
answer
291
views
How to configure lldb to stop at a breakpoint that is hit by multiple threads, one by one?
I have a simple macOS app that spawns 14 threads running the same function.
If I set a breakpoint within the function, and run the application from within command line lldb, instead of breaking on the ...
3
votes
1
answer
515
views
Debugging inline ASM with LLDB - treat instructions as separate statements for the step command?
In LLDB, the step command steps over a whole asm{} block as a single "statement". Is there a way to make it treat each instruction separately so you don't have to use si to step ...
0
votes
0
answers
141
views
LLDB debugging doesn't work with std::cin
I have written a code like this:
#include <iostream>
int main(){
int a,b;
std::cin >> a >> b;
std::cout << a+b;
}
After running the run command in GDB, I managed ...