简体   繁体   English

emacs的GDB版本设置

[英]GDB version settings for emacs

I use emacs version 23.1 for C/C++ debugging. 我使用emacs版本23.1进行C / C ++调试。 The GDB version this version of emacs picks by default is 5.2.1. 这个版本的emacs默认选择的GDB版本是5.2.1。 I would like to use GDB version 7.0. 我想使用GDB 7.0版。

I have tried the following options :- 我尝试了以下选项: -

  1. Make an Alias(in ~/.alias) for gdb to the desired location of gdb (ie. location of gdb version 7.0.) 为gdb创建一个别名(在〜/ .alias中)到gdb的所需位置(即gdb 7.0版的位置)。

  2. Add the line (setq gdb-command-name "/grid/common/bin/gdb") to the ~/.emacs file. 将行(setq gdb-command-name“/ grid / common / bin / gdb”)添加到〜/ .emacs文件中。

Both the above options don't work. 以上两个选项都不起作用。 Can anyone please help ? 有人可以帮忙吗?

rob, I tried your 2nd option as well, but it didn't work. 抢,我也尝试了你的第二个选项,但它没有用。 I then took a suggestion from dicroce and just changed the variable from gdb-command-name to gud-gdb-command-name and that did it. 然后我从dicroce那里得到了一个建议,只是将变量从gdb-command-name更改为gud-gdb-command-name ,就这样做了。 So here's what I put in my .emacs file: 所以这就是我放在.emacs文件中的内容:

; Attempt to reassign the default gdb command to point to gdb64
(setq gud-gdb-command-name "/apps/gdb64/bin/gdb --annotate=3")

This combination worked for me: 这个组合对我有用:

(defvar gud-gdb-command-name "arm-none-linux-gnueabi-gdb")
(setq gud-gdb-command-name "arm-none-linux-gnueabi-gdb --annotate=3")

Without the defvar, it didn't work. 没有defvar,它没有用。

did you try setting up your PATH so that the gdb you want is the first one found (prior to starting emacs, of course)? 您是否尝试设置PATH以便您想要的gdb是第一个找到的(当然,在启动emacs之前)? (by the way, i don't even see a "gdb-command-name" variable). (顺便说一句,我甚至没有看到“gdb-command-name”变量)。

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

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