惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
CERT Recently Published Vulnerability Notes
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed
Security Latest
Security Latest
P
Privacy International News Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
AI
AI
Cisco Talos Blog
Cisco Talos Blog
K
Kaspersky official blog
S
Secure Thoughts
PCI Perspectives
PCI Perspectives
Simon Willison's Weblog
Simon Willison's Weblog
D
DataBreaches.Net
GbyAI
GbyAI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
罗磊的独立博客
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
V
V2EX
Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tenable Blog
T
Threat Research - Cisco Blogs
T
Troy Hunt's Blog
V2EX - 技术
V2EX - 技术
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
L
Lohrmann on Cybersecurity
F
Full Disclosure
H
Help Net Security
博客园 - Franky
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
Engineering at Meta
Engineering at Meta
A
Arctic Wolf
O
OpenAI News
S
Securelist

博客园 - 姜伟华

HBase的内存使用 我常用的软件列表 How can I handle a destructor that fails 让windows explorer总是打开文件夹视图的方法 转一个windows "无法停止‘通用卷’设备"的解决方法 终于看到外界宣传我们的产品 Intel XML Software Suite了。 将PDF文件放大缩小 一篇非常不错的探讨pure virtual function call错误的文章。 D-LINK DI-524无线路由器变身DI-624,解决BT断线问题 Emacs在FreeNX下不工作 我的GVIM配置 开始写XML Code了 终于毕业了 放弃office,拥抱latex 终于选定了编辑器了 郁闷的夏天 Jikes RVM中 Java 循环的识别 在PearPC上安装Mandrake 9.1 for PPC的经历 今天复旦软院的第一届学生就要毕业了
gdb中如何使用shell环境变量
姜伟华 · 2007-06-13 · via 博客园 - 姜伟华

gdb中如何使用shell环境变量

我的可执行程序在一个很深的目录中,平时开发时都是用一个环境变量CSRC指向的。但在GDB里这样就很不爽了。因为GDB命令是不支持shell环境变量的。所以
            file $CSRC/bin/xpath2cmddt.exe
会报告说文件找不到。但每次打长长一串路径实在是很痛苦。

在GDB的mailing-list问到了一个方法:可以用下面的gdb命令序列迂回得到所要的效果:
    shell echo file $CSRC/bin/xpath2cmddt.exe >/tmp/tmp.csrcxpath
    source /tmp/tmp.csrcxpath
    shell rm /tmp/tmp.csrcxpath

不过每次都打这么一串命令也太麻烦了。所以,我在$HOME/.gdbinit中定义了一个自定义命令:
define loadxpath
    shell echo file $CSRC/bin/xpath2cmddt.exe >/tmp/tmp.csrcxpath
    shell echo cd $CSRC/bin >>/tmp/tmp.csrcxpath
    source /tmp/tmp.csrcxpath
    shell rm /tmp/tmp.csrcxpath
end

这样进了gdb之后只要打
       loadxpath
就可以了。

爽。