我编写了一个使用第三方库的 iPhone 应用程序。我成功交叉编译了这个库,一切都很顺利。但是当我想调试应用程序时,也能够调试库是有意义的。所以我还用调试信息编译了外部库(使用 gcc 选项 -ggdb)。但是当我想调试它时,我得到了正确的符号名称,但位置总是错误/非常奇怪(locale_facets.tcc:2505 或 iostream:76)。例如,堆栈跟踪可能如下所示:
#0 0x000045e8 in zorba::serialization::SerializeBaseClass::SerializeBaseClass () at iostream:76
#1 0x0001d990 in zorba::RCObject::RCObject () at iostream:76
#2 0x00025187 in zorba::xqpStringStore::xqpStringStore () at iostream:76
#3 0x000719e4 in zorba::String::String () at locale_facets.tcc:2505
#4 0x00030513 in iphone::iLabelModule::getURI (this=0x533f710) at /Users/sausalito/eth/izorba/sandbox/ilabel.cpp:19
#5 0x00356766 in zorba::static_context::bind_external_module () at locale_facets.tcc:2505
#6 0x0006139d in zorba::StaticContextImpl::registerModule () at locale_facets.tcc:2505
#7 0x000333e5 in -[ZorbaCaller init] (self=0x53405c0, _cmd=0x95583398) at /Users/sausalito/eth/izorba/sandbox/ZorbaCaller.mm:61
#8 0x00033180 in +[ZorbaCaller instance] (self=0x11dc2bc, _cmd=0x93679591) at /Users/sausalito/eth/izorba/sandbox/ZorbaCaller.mm:37
#9 0x0003d998 in -[testOne execute:] (self=0x530d560, _cmd=0x9366b126, sender=0x5121da0) at /Users/sausalito/eth/izorba/sandbox/generator/testOne.mm:13
#10 0x01a21405 in -[UIApplication sendAction:to:from:forEvent:] ()
#11 0x01a84b4e in -[UIControl sendAction:to:forEvent:] ()
#12 0x01a86d6f in -[UIControl(Internal) _sendActionsForEvents:withEvent:] ()
#13 0x01a85abb in -[UIControl touchesEnded:withEvent:] ()
#14 0x01a3addf in -[UIWindow _sendTouchesForEvent:] ()
#15 0x01a247c8 in -[UIApplication sendEvent:] ()
#16 0x01a2b061 in _UIApplicationHandleEvent ()
#17 0x03b6fd59 in PurpleEventCallback ()
#18 0x034a8b80 in CFRunLoopRunSpecific ()
#19 0x034a7c48 in CFRunLoopRunInMode ()
#20 0x03b6e615 in GSEventRunModal ()
#21 0x03b6e6da in GSEventRun ()
#22 0x01a2bfaf in UIApplicationMain ()
#23 0x0002dd7e in main (argc=1, argv=0xbffff044) at /Users/sausalito/eth/izorba/sandbox/main.m:16
有谁知道这些错误的位置来自哪里?