Как использовать GDB (скомпилированный в OSX) для отладки двоичных файлов Mach-O? - PullRequest
0 голосов
/ 28 марта 2019

Скомпилировав gdb из исходного кода на OSX, я хочу отлаживать приложения Mach-O.Однако при открытии двоичного файла Mach-O отображается следующая ошибка:

"/Users/nlykkei/Projects/test": not in executable format: file format not recognized

Я знаю, что port (MacPorts) имеет доступную для загрузки версию GDB для Apple, но она ужасно старая.

Как настроить gdb, чтобы он мог распознавать двоичные файлы Mach-O?

Полный вывод:

nicolass-mbp:gdb nlykkei$ ./gdb ~/Projects/test
Python Exception <type 'exceptions.ImportError'> No module named gdb: 
./gdb: warning: 
Could not load the Python gdb module from `/usr/local/share/gdb/python'.
Limited Python support is available from the _gdb module.
Suggest passing --data-directory=/path/to/gdb/data-directory.

GNU gdb (GDB) 8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin18.5.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
BFD: /Users/nlykkei/Projects/test: unknown load command 0x32
BFD: /Users/nlykkei/Projects/test: unknown load command 0x32
"/Users/nlykkei/Projects/test": not in executable format: file format not recognized
...