1

我知道这应该很容易,并且我已经查看了自述文件和 cgdb 中的其他文件,例如 INSTALL,这些文件谈到了安装 cgdb。我试图安装 cgdb 并且说明说:

$ ./configure --prefix=/usr/local
$ make
$ sudo make install

但是,我通过运行 git clone 命令获得的文件中没有这样的文件。即从运行:

$ git clone git://github.com/cgdb/cgdb.git

我进入该文件查看安装说明,它显示以下内容:

Basic Installation
==================

   These are generic installation instructions.

   The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation.  It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions.  Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').

   If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release.  If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.

   The file `configure.in' is used to create `configure' by a program
called `autoconf'.  You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.

    The simplest way to compile this package is:  

1. `cd' to the directory containing the package's source code and type
     `./configure' to configure the package for your system.  If you're
     using `csh' on an old version of System V, you might need to type
     `sh ./configure' instead to prevent `csh' from trying to execute
     `configure' itself.

     Running `configure' takes awhile.  While running, it prints some
     messages telling which features it is checking for.

  2. Type `make' to compile the package.

  3. Optionally, type `make check' to run any self-tests that come with
     the package.

  4. Type `make install' to install the programs and any data files and
     documentation.

  5. You can remove the program binaries and object files from the
     source code directory by typing `make clean'.  To also remove the
     files that `configure' created (so you can compile the package for
     a different kind of computer), type `make distclean'.  There is
     also a `make maintainer-clean' target, but that is intended mainly
     for the package's developers.  If you use it, you may have to get
     all sorts of other programs in order to regenerate files that came
     with the distribution.

还有更多我没有粘贴。

让我困惑的部分是以下段落:

   The file `configure.in' is used to create `configure' by a program
called `autoconf'.  You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.

这是否意味着我应该运行./configure.in?老实说,我有点害怕运行它,因为我需要以 sudo plus 的形式运行它,该文件甚至不会在我从 git clone 获得的代码中退出。这是我在该目录中所做的:

➜  cgdb git:(master) ls
AUTHORS          Makefile.am      autogen.sh       doc              roadmap.txt
COPYING          NEWS             autorelease.sh   indent.sh        test
ChangeLog        README           cgdb             lib
FAQ              README.md        config           packages
INSTALL          TODO             configure.init   release-todo.txt
➜  cgdb git:(master)

我在该目录中为 config 或 config.in 做了 grep,但它没有产生任何有用的东西。

我也尝试过brew安装它,但遇到了问题。当我cgdb打开文件并点击运行时,它会在打印语句处冻结,而不是像在(gdb). 有谁知道怎么回事?是因为我使用的是 go 源文件吗?

人们做了什么让 cgdb 在 Mac 上工作?

4

3 回答 3

1

忘记配置和依赖库的所有仇恨;安装MacPorts并执行以下操作:

$ sudo port install cgdb

在撰写本文时,他们有 0.6.7。

于 2014-08-09T08:48:12.197 回答
1

Неу,是的,cgdb 的 git 源不附带预构建的配置脚本。(但是,官方发行版确实如此。)

如果您安装了正确的工具,则可以通过运行来解决此问题:

./autogen.sh

这将生成配置脚本,然后您可以像安装任何其他基于 autoconf 的源包一样安装它。

于 2014-08-09T07:56:32.393 回答
1

对我有用的是:

brew install cgdb

然而,对我来说,这还不足以让它继续下去。我需要 sudo 让它运行:

sudo cgdb

我永远不会猜到我需要 sudo 它...我想通了,因为它向我抛出了以下问题中提到的错误:

gdb 因“无法找到进程 ID 的 Mach 任务端口”错误而失败

于 2014-08-09T18:15:30.237 回答