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

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

博客园 - 姜伟华

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
就可以了。

爽。