gdb run命令在Mac Mojave上失败

时间:2019-07-13 10:45:20

标签: c++ macos debugging gdb

我正在使用Mac Mojave 10.14.5。

以前我遇到过codesign问题,并从link解决了。

解决了codesign问题后,当我运行gdb时,程序如下所示停止。

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from CIRMERGE...
Reading symbols from /Users/___/Project/CIRMERGE.dSYM/Contents/Resources/DWARF/CIRMERGE...
(gdb) run
Starting program: /Users/___/Project/CIRMERGE 
[New Thread 0x1703 of process 601]
[New Thread 0x1903 of process 601]

首先,我按照上面链接中给出的相同说明进行了删除 set startup-with-shell enable from〜/ .gdbinit。 (它是空的,我也尝试过禁用选项)

第二,我发现有人和我在一起similar problem,因此尝试重新安装gdb head,但是用--HEAD安装gdb失败,如下所示

==> make
Last 15 lines from /Users/sean/Library/Logs/Homebrew/gdb/02.make:
darwin-nat-info.c:620:25: error: use of undeclared identifier 'target_gdbarch'
  if (gdbarch_addr_bit (target_gdbarch ()) <= 32)
                        ^
darwin-nat-info.c:657:35: error: use of undeclared identifier 'target_gdbarch'
        uiout->field_core_addr ("start", target_gdbarch (), r_start);
                                         ^
  CXX    disasm.o
darwin-nat-info.c:658:33: error: use of undeclared identifier 'target_gdbarch'
        uiout->field_core_addr ("end", target_gdbarch (), r_start + r_size);

这是我的gdb配置。

This GDB was configured as follows:
   configure --host=x86_64-apple-darwin18.5.0 --target=x86_64-apple-darwin18.5.0
             --with-auto-load-dir=:${prefix}/share/auto-load
             --with-auto-load-safe-path=:${prefix}/share/auto-load
             --with-expat
             --with-gdb-datadir=/usr/local/Cellar/gdb/8.3/share/gdb (relocatable)
             --with-jit-reader-dir=/usr/local/Cellar/gdb/8.3/lib/gdb (relocatable)
             --without-libunwind-ia64
             --without-lzma
             --without-babeltrace
             --without-intel-pt
             --disable-libmcheck
             --without-mpfr
             --with-python=/System/Library/Frameworks/Python.framework/Versions/2.7
             --without-guile
             --disable-source-highlight
             --with-separate-debug-dir=/usr/local/Cellar/gdb/8.3/lib/debug (relocatable)

我试图调试cpp代码数小时,因此将不胜感激。

0 个答案:

没有答案