简体   繁体   English

在mac os x上安装cgdb

[英]Installing cgdb on a mac os x

I know that this should probably be very easy, and I have looked into the read me files and other files in cgdb like INSTALL that talk about isntalling cgdb. 我知道这应该是非常容易的,我已经查看了读取文件和cgdb中的其他文件,如INSTALL,谈论isntalling cgdb。 I was trying to install cgdb and the instructions said: 我试图安装cgdb,说明说:

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

However, there is no such file inside of the file I got from running the git clone command. 但是,我从运行git clone命令获得的文件中没有这样的文件。 ie from running: 即从跑步:

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

I went inside that file to see the installation instructions and it says the following: 我进入该文件以查看安装说明,并说明如下:

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.

and there is more I didn't paste. 还有更多我没有粘贴。

The part that confuses me is the following paragraph: 令我困惑的部分是以下段落:

   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'.

does it mean I should run ./configure.in? 这是否意味着我应该运行./configure.in? I am honeslty a little scared of running it because I need to run it in as sudo plus, that file doesn't even exit in the code I got from git clone. 我有点害怕运行它因为我需要以sudo plus运行它,该文件甚至不会从我从git clone获得的代码中退出。 This is what I do have in that directory: 这就是我在该目录中所拥有的:

➜  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)

I did grep for config or config.in in that directory and it didn't yield anything useful. 我在该目录中为config或config.in做了grep,它没有产生任何有用的东西。

I have also tried brew installing it but I ran into problems. 我也试过brew安装它,但我遇到了问题。 When I cgdb the file and hit run it frozen at a print statment instead of moving on to the next command prompt for gdb as in (gdb) . 当我cgdb文件并点击运行它冻结在打印状态而不是继续gdb的下一个命令提示符,如(gdb) Anyone knows whats up? 谁知道什么了? Is it because I am using go source file? 是因为我正在使用go源文件吗?

What have people done to have cgdb working on a mac? 人们做了什么让cgdb在mac上工作?

Неу, yeah, the git source for cgdb doesn't come with the configure script pre-built. Неу,是的,cgdb的git源没有预先构建的配置脚本。 (The official release distributions do, however.) (然而,官方发布版本确实如此。)

If you have the right tools installed, you can fix this by running: 如果安装了正确的工具,可以通过运行以下方法解决此问题:

./autogen.sh

This will generate the configure script, and then you can install it as you would any other autoconf-based source package. 这将生成配置脚本,然后您可以像安装任何其他基于autoconf的源包一样安装它。

Forget about all that aggro with configuration and dependency libraries; 忘记配置和依赖库的所有aggro; install MacPorts and do: 安装MacPorts并执行:

$ sudo port install cgdb

They have 0.6.7 at the time of writing. 在撰写本文时,他们有0.6.7。

What worked for me was doing: 对我有用的是:

brew install cgdb

However, for me that was not enough to get it going. 然而,对我而言,这还不足以让它继续下去。 I needed to sudo it for it to run: 我需要sudo它才能运行:

sudo cgdb

I would have never guessed I needed to sudo it...I figured it out because it was throwing me the error talked about in the following question: 我永远不会猜到我需要sudo它...我想通了,因为它让我误解了以下问题:

gdb fails with "Unable to find Mach task port for process-id" error gdb失败,出现“无法找到process-id的Mach任务端口”错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM