我想我已经找到了问题的答案,但实际上它只会引发更多问题。看Xcode 相当于 Visual Studio 的“查找源” https://stackoverflow.com/questions/25376333/xcode-equivalent-of-visual-studios-find-source?rq=1.
我在想也许我的程序或者我的 Qt 版本doesn't有符号,或者符号少于必要的符号。特别是,这里的输出target modules lookup --address <address> --verbose
(image
是 lldb 的同义词target modules
)在那个链接的SO问题中:
(lldb) image lookup -va main
Address: hello[0x0000000100000f40] (hello.__TEXT.__text + 0)
Summary: hello`main at hello.c:5
Module: file = "/private/tmp/hello", arch = "x86_64"
CompileUnit: id = {0x00000000}, file = "/tmp/hello.c", language = "ISO C:1999"
Function: id = {0x00000026}, name = "main", range = [0x0000000100000f40-0x0000000100000f6d)
FuncType: id = {0x00000026}, decl = hello.c:4, clang_type = "int (void)"
Blocks: id = {0x00000026}, range = [0x100000f40-0x100000f6d)
LineEntry: [0x0000000100000f40-0x0000000100000f56): /tmp/hello.c:5
Symbol: id = {0x00000004}, range = [0x0000000100000f40-0x0000000100000f6d), name="main"
这是来自 LLVM 网页“The LLDB Debugger”的示例(http://lldb.llvm.org/symbolication.html http://lldb.llvm.org/symbolication.html):
>(lldb) image lookup --address 0x100123aa3 --verbose
Address: a.out[0x0000000100000aa3] (a.out.__TEXT.__text + 110)
Summary: a.out`main + 50 at main.c:13
Module: file = "/tmp/a.out", arch = "x86_64"
CompileUnit: id = {0x00000000}, file = "/tmp/main.c", language = "ISO C:1999"
Function: id = {0x0000004f}, name = "main", range = [0x0000000100000bc0-0x0000000100000dc9)
FuncType: id = {0x0000004f}, decl = main.c:9, clang_type = "int (int, const char **, const char **, const char **)"
Blocks: id = {0x0000004f}, range = [0x100000bc0-0x100000dc9)
id = {0x000000ae}, range = [0x100000bf2-0x100000dc4)
LineEntry: [0x0000000100000bf2-0x0000000100000bfa): /tmp/main.c:13:23
Symbol: id = {0x00000004}, range = [0x0000000100000bc0-0x0000000100000dc9), name="main"
Variable: id = {0x000000bf}, name = "path", type= "char [1024]", location = DW_OP_fbreg(-1072), decl = main.c:28
Variable: id = {0x00000072}, name = "argc", type= "int", location = r13, decl = main.c:8
Variable: id = {0x00000081}, name = "argv", type= "const char **", location = r12, decl = main.c:8
Variable: id = {0x00000090}, name = "envp", type= "const char **", location = r15, decl = main.c:8
Variable: id = {0x0000009f}, name = "aapl", type= "const char **", location = rbx, decl = main.c:8
这是我的 Qt5Widgets QMenuBar 地址的输出:
(lldb) image lookup --address 0x103058d57 --verbose
Address: libQt5Widgets_debug.5.dylib[0x000000000026dd57] (libQt5Widgets_debug.5.dylib.__TEXT.__text + 2525127)
Summary: libQt5Widgets_debug.5.dylib`QMenuBar::actionEvent(QActionEvent*) + 711
Module: file = "/Users/ted/Documents/Projects/work/third_party/qt/5.3.2/osx/x86_64/lib/libQt5Widgets_debug.5.dylib", arch = "x86_64"
Symbol: id = {0x0000c190}, range = [0x0000000103058a90-0x0000000103059260), name="QMenuBar::actionEvent(QActionEvent*)", mangled="_ZN8QMenuBar11actionEventEP12QActionEvent"
确认!源文件(CompileUnit)参考在哪里?感谢@vsoftco 的建议以及看到这个问题的其他人。我将不得不深入研究 Qt5 构建系统并找出这些符号的去向。