imac 终端中安装Home brew 并通过Home brew安装gdb

一、安装Home brew

terminal中输入:

localhost:~ shikaixun$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

效果:

==> This script will install:

/usr/local/bin/brew

/usr/local/share/doc/homebrew

/usr/local/share/man/man1/brew.1

/usr/local/share/zsh/site-functions/_brew

/usr/local/etc/bash_completion.d/brew

/usr/local/Homebrew

==> The following new directories will be created:

/usr/local/Cellar

/usr/local/Homebrew

/usr/local/Frameworks

/usr/local/bin

/usr/local/etc

/usr/local/include

/usr/local/lib

/usr/local/opt

/usr/local/sbin

/usr/local/share

/usr/local/share/zsh

/usr/local/share/zsh/site-functions

/usr/local/var

==> The Xcode Command Line Tools will be installed.

···

···

==> Next steps:

- Run `brew help` to get started

- Further documentation: 

    https://docs.brew.sh

二、安装gdb

terminal中输入:

localhost:~ shikaixun$ brew install gdb

效果:

==> Downloading https://homebrew.bintray.com/bottles/gdb-8.1.high_sierra.bottle.

######################################################################## 100.0%

==> Pouring gdb-8.1.high_sierra.bottle.tar.gz

==> Caveats

gdb requires special privileges to access Mach ports.

You will need to codesign the binary. For instructions, see:

 

  https://sourceware.org/gdb/wiki/BuildingOnDarwin

 

On 10.12 (Sierra) or later with SIP, you need to run this:

 

  echo "set startup-with-shell off" >> ~/.gdbinit

==> Summary

?  /usr/local/Cellar/gdb/8.1: 53 files, 9.9MB

验证:

输入man gdb

显示:

GDB(1)                       GNU Development Tools                      GDB(1)

 

NAME

       gdb - The GNU Debugger

 

SYNOPSIS

       gdb [-help] [-nh] [-nx] [-q] [-batch] [-cd=dir] [-f] [-b bps]

           [-tty=dev] [-s symfile] [-e prog] [-se prog] [-c core] [-p procID]

           [-x cmds] [-d dir] [prog|prog procID|prog core]

 

DESCRIPTION

       The purpose of a debugger such as GDB is to allow you to see what is

       going on "inside" another program while it executes -- or what another

       program was doing at the moment it crashed.

 

       GDB can do four main kinds of things (plus other things in support of

       these) to help you catch bugs in the act:

 

       o   Start your program, specifying anything that might affect its

           behavior.

 

       o   Make your program stop on specified conditions.

 

:

OK!bingo!

转载于:https://www.cnblogs.com/skxabc/p/9247844.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值