我有一个第三方库,我在该库上进行了绑定,并为使用 XCode 进行归档而构建。我在我的 C# Xamarin 应用程序中使用它。尽管如此,我还是遇到了无法通过 Xamarin Studio 调试的本机崩溃。我尝试将 gdb 附加到该进程,但收到以下警告:
warning: Could not find object file "/var/folders/mf/w59_1t797k3cfrp7hdmncvt40000gn/T/tmp42fc77da.tmp/libCouchCocoa.a(CouchEmbeddedServer.o)" - no debug information available for "CouchEmbeddedServer.m".
warning: Could not find object file "/var/folders/mf/w59_1t797k3cfrp7hdmncvt40000gn/T/tmp42fc77da.tmp/libCouchCocoa.a(CouchTouchDBDatabase.o)" - no debug information available for "CouchTouchDBDatabase.m".
[...]
然后,当 SIGSEGV 发生时,我使用 bt 函数并且我没有关于库中发生的事情的信息。我认为这与警告有关。
(gdb) continue
Continuing.
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000008
[Switching to process 98604 thread 0x28403]
0x0438509b in objc_msgSend ()
(gdb) bt
#0 0x0438509b in objc_msgSend ()
#1 0x112924f0 in ?? ()
#2 0x1714fdb0 in ?? ()
#3 0x17555a9c in ?? ()
#4 0x175557f6 in ?? ()
#5 0x17555200 in ?? ()
#6 0x17554c48 in ?? ()
#7 0x17554b4c in ?? ()
#8 0x17554af0 in ?? ()
#9 0x17554aac in ?? ()
#10 0x1718fb1c in ?? ()
#11 0x1718f6dc in ?? ()
#12 0x1718f5d8 in ?? ()
#13 0x0b6c0c8e in ?? ()
#14 0x000a3172 in mono_jit_runtime_invoke (method=0xca60dac, obj=0x10ec7490, params=0xb0974eec, exc=0xb0974ef4) at mini.c:5804
#15 0x0020840e in mono_runtime_invoke (method=0xca60dac, obj=0x10ec7490, params=0xb0974eec, exc=0xb0974ef4) at object.c:2790
#16 0x0020857c in mono_runtime_delegate_invoke (delegate=0x10ec7490, params=0xb0974eec, exc=0xb0974ef4) at object.c:3462
#17 0x002629b4 in mono_async_invoke [inlined] () at :626
#18 0x002629b4 in async_invoke_thread (data=0xc71f870) at threadpool.c:1443
#19 0x00268756 in start_wrapper_internal [inlined] () at :784
#20 0x00268756 in start_wrapper (data=0x1128e680) at threads.c:832
#21 0x0029a69a in thread_start_routine (args=0xfa46204) at wthreads.c:287
#22 0x00245540 in gc_start_thread (arg=0x112922a0) at sgen-gc.c:6280
#23 0x98a89ed9 in _pthread_start ()
#24 0x98a8d6de in thread_start ()
(gdb)
我应该如何构建我的第三方库,以便 gdb 设法找到有关它们的调试信息?
编辑:使用 p mono_pmip,我设法获得了去符号化的方法名称,但是有没有办法不必这样做并拥有调试符号?