0
我已經編譯了一個使用asl_log的小程序,並且在lldb中運行時,雖然我在調試模式下編譯(''),但它無法打印來自'aslclient'類型的全局變量的內容。 -g'標誌)。lldb調試器不能打印結構內容
也許你能告訴我,這是關係到下面的錯誤,以及如何解決這一問題
[lldb-dev] [Bug 16191] New: LLDB fails to evaluate expressions that
dereference a struct when inferior is built with recent Clang
從調試器中輸入:
(lldb) print log_asl_client
(aslclient) $5 = 0x0000000100200000
(lldb) print *log_asl_client
(lldb) print *log_asl_client
error: incomplete type '__asl_object_s' where a complete type is required
note: forward declaration of '__asl_object_s'
error: 1 errors parsing expression
我的編譯命令:
clang -g -c -Wall -DDEBUG=1 example.c -o example.o
clang example.o -o example
該代碼:
aslclient log_asl_client;
...
int main(int argc, char * const *argv) {
...
log_asl_client = asl_open(identity, facility, client_opts);
...
--> at this point i initiate the print command in debug mode.
版本我使用:
clang --version
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix
感謝,