GDB debug setting for lazarus

GDB_on_OS_X_Mavericks_or_newer_and_Xcode_5_or_newer

Codesigning gdb

https://sourceware.org/gdb/wiki/BuildingOnDarwin#Method_for_Mac_OS_X_10.5_.28Leopard.29_and_later

Mac(os x)下使用gdb的问题

codesign 之后,运行出现

sudo codesign -fs gdb-cert /usr/local/bin/gdb

The GDB command:
"-gdb-set confirm off"
did not return any result.

终端执行gdb

dyld: Library not loaded: /usr/local/opt/mpfr/lib/libmpfr.6.dylib
Referenced from: /usr/local/bin/gdb
Reason: image not found
[1] 25803 trace trap gdb

参考:
cannot run gdb on mac's terminal even after codesign

build gdb from source

  1. download source from
    ftp://sourceware.org/pub/gdb/releases/
  2. build

    ./configure
    make
    sudo make install

    build error

probe.c:63:28: error: default initialization of an object of const type 'const any_static_probe_ops' without a user-provided default

https://news.ycombinator.com/item?id=16275140

fixed: remove const

- const any_static_probe_ops any_static_probe_ops;
+ any_static_probe_ops any_static_probe_ops;