如何在 Unix 中更改 gdb 路径?

发布于 2024-09-29 05:42:05 字数 524 浏览 1 评论 0原文

我的教授本周在网上发布了这个实验室的内容,但我错过了该教程并且没有找到如何做到这一点。有谁知道吗?这只是一个简单的命令行事情,但我一直在寻找,似乎无法弄清楚...

大家好,

新版本的 gdb(版本 6.8)已安装在服务器 csb 和 csg 上(但是不是 csh)。这个新版本似乎避免了人们在旧版本中遇到的问题,例如调试器无法识别标签。

新版本的 gdb 安装在 /usr/local/bin/gdb 中,而旧版本(版本 6.2.1)仍保留在 /opt/sfw/bin/gdb 中。您可能需要创建别名或将路径设置为指向 Unix 命令 shell 中的新版本。您始终可以通过在命令行中输入以下内容来检查 gdb 的版本号: gdb -version

我通过 ssh 连接到服务器,并检查了我的版本实际上是较旧的版本。

我知道这在技术上是一个“超级用户”问题,但它确实与编程(调试器配置...)有关,而且我已经询问了超级用户,但没有人回应。希望其他程序员能够得到答案:)

任何帮助将不胜感激!

谢谢,

坏熊猫

My professor posted this online for a lab this week, but I missed the tutorial and didn't find how to do this. Does anyone know? It is just a simple command line thing, but I have been hunting around and can't seem to figure it out...

Hi everyone,

A new version of gdb (version 6.8) has been installed on the servers csb and csg (but not csh). This new version seems to avoid the problems people have been experiencing with the old version, such as labels not being recognized by the debugger.

The new version of gdb is installed in /usr/local/bin/gdb, while the old version (version 6.2.1) still remains in /opt/sfw/bin/gdb. You may want to create an alias or set your path to point to the new version in your Unix command shell. You can always check the version number of gdb by entering the following at the command line: gdb -version

I am ssh-ing on to the server, and have checked that my version is, in fact, the older one.

I know this is technically a 'superuser' question, but it does have to do with programming (debugger configuration...), and I have asked on superuser and no one responded. Hopefully, fellow programmers will have an answer :)

Any help would be much appreciated!

Thanks,

badPanda

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

江挽川 2024-10-06 05:42:05

您可以创建别名:

alias gdb /usr/local/bin/gdb

您不更改“GDB 搜索路径”,而是更改可执行文件搜索路径。

export PATH=/usr/local/bin/:$PATH

您可以将这两个文件添加到您的 .bash_profile 或 .bashrc 中,

我可能会使用别名。

编辑:这都是假设 bash。它也应该在 tcsh 中工作

You can create an alias:

alias gdb /usr/local/bin/gdb

You don't change the "GDB search path", you change the executable search path.

export PATH=/usr/local/bin/:$PATH

You can both of these to your .bash_profile or .bashrc

I would probably go with the alias.

Edit: this is all assuming bash. It should work in tcsh too

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文