`
isiqi
  • 浏览: 16694442 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

源代码查看工具 Source Navigator 使用心得

阅读更多

在ubuntu 10.04下试用了Source Navigator,有条件还是装Source insight吧,不是一个级别的,非常不方便。

Source Navigator 是Red Hat出品的一款查看源代码的工具,非常好用,与Windows下的Source Insight有一敌。但是它的界面不怎么好看,用的不是GTK图形库,所以界面风格与Gnome不一致,操作上也有些不同。除了这些,其它功能都非常强大,细数如下。里面的一些简写约定如下:

Code Area

cl Classes

con Constants

e Enums

ec Enum Values

fd Function Declarations

fr friends

fu Functions

gv Global Variables

iv Instance Variables

ma Macros

md Method Definitions

mi Method Implementations

t Typedefs

un Unions

lv Local variables

ud Undefined

Cross-Reference

r Read

w Written

p Passed

u Unused

SNav的代码窗口有6个标签页,它们分别是

“Edit”

“Hierarchy”

“Class”

“Xref”

“Retriever”

“Grep”

其中, Edit区是代码显示和修改的区域,是工作的主要区域;“Hierarchy”和“Class”是C++代码的组织工具;“Xref”是最强大的一个工具,它会把一个函数中的所有用到的变量,调用的函数,用到的结构全记录并展现出来;“Retriever”也是一个非常有用的工具,用于把一个库代码包中的所有定义的符号列出来,并记录相应的属性;“Grep”用于查找某一个符号,可指定搜索的范围,既可全局查找也可部分文件查找。阅读代码时常用到的一些键值组合:

Ctrl+leftarrow | rightarrow | uparrow | downarrow 以词的形式移动光标

Ctrl+Alt+leftarrow | rightarrow | uparrow | downarrow 以词的形式移动光标并选择走过的区域

Ctrl+Shift+D 查看选定符号的声明

Ctrl+Shift+I 查看选定符号的定义代码窗口的工具栏上有7个元素,分别是

“回退跳转”

“前进跳转”

“光标处所在的函数名或结构名”

“选定并要操作(比如查找)的字符串”

“在本文件中查找选定的字符串”(比Ctrl+F查找功能好使)

“在整个工程中查找与选定字符串匹配的代码”

“在整个工程中以Grep的方式查找与选定字符串匹配的代码”(会跳到Grep标签页中显示结果)注意:snavigator在导入目录时,目录名中间不能出现空格。

三、在ubuntu中安装 Source-Navigator及使用手册

2009-09-25 23:19

from : http://hi.baidu.com/xiaohu_tiger/blog/item/66d207888431d6b40f2444ec.html

1 通过apt-get安装(版本较旧)

安装命令:sudo apt-get install sourcenav

启动命令:snavigator

2 手动安装最新版本

1)到官方网站获取软件包

http://sourceforge.net/project/showfiles.php?group_id=51180

2)解压缩

tar zxvf s ourcenav-6.0.tar.gz

./configure --prefix=/opt/sourcenav (install 文件推荐参数)

make

make install

ps:如果出现权限问题,前面加sudo

3)如果碰到下述错误

/root/tk8.4.16/unix/../generic/tk3d.c:1279: error: ‘TkBorder’ has no member named ‘resourceRefCount’

/root/tk8.4.16/unix/../generic/tk3d.c:1280: error: ‘Tk_FakeWin’ has no member named ‘display’

/root/tk8.4.16/unix/../generic/tk3d.c:1280: error: ‘Tk_FakeWin’ has no member named ‘screenNum’

/root/tk8.4.16/unix/../generic/tk3d.c:1280: error: ‘TkBorder’ has no member named ‘screen’

/root/tk8.4.16/unix/../generic/tk3d.c:1281: error: ‘Tk_FakeWin’ has no member named ‘atts’

/root/tk8.4.16/unix/../generic/tk3d.c:1281: error: ‘TkBorder’ has no member named ‘colormap’

/root/tk8.4.16/unix/../generic/tk3d.c:1301: error: ‘TkDisplay’ has no member named ‘borderTable’

/root/tk8.4.16/unix/../generic/tk3d.c:1301: error: ‘TkDisplay’ has no member named ‘borderTable’

/root/tk8.4.16/unix/../generic/tk3d.c:1306: error: ‘TkBorder’ has no member named ‘nextPtr’

。。。。。。

则在终端是输入:sudo apt-get install libx11-dev

4) 启动snavigator

在终端直接输入:snavigator

5) 使用手册(user manual)

http://sourcenav.sourceforge.net/online-docs/userguide/index_ug.html

还有一个 source insight 和source navigator的比较的帖子:

http://fky168.blog.163.com/blog/static/3786097200831033957620/

========================================================

运行source navigator的问题

方法一、(转载)

安装完成后运行 snavigator 提示

[root@MagicLinux sourcenav-6.0]# snavigator

Can't find a usable tk.tcl in the following directories:

/usr/local/share/tk8.3

/usr/local/share/tk8.3/tk.tcl: no event type or button # or keysym

no event type or button # or keysym

while executing

"bind Listbox {

%W yview scroll [expr {- (%D / 120) * 4}] units

}"

(file "/usr/local/share/tk8.3/listbox.tcl" line 182)

invoked from within

"source [file join $tk_library listbox.tcl]"

invoked from within

"if {[string compare $tcl_platform(platform) "macintosh"] && \

[string compare {} $tk_library]} {

source [file join $tk_library button.tcl]

so..."

(file "/usr/local/share/tk8.3/tk.tcl" line 30

invoked from within

"source /usr/local/share/tk8.3/tk.tcl"

("uplevel" body line 1)

invoked from within

"uplevel \#0 [list source $file]"

This probably means that tk wasn't installed properly.

不知其所以然,重新安装tk8.3无效,升级到tk8.5无效

后来在网上发现需要给下载的Source-Navigator 6.0打补丁

到http://bugs.gentoo.org/show_bug.cgi?id=225999 找到 tk-8.4-lastevent.patch 补丁

将补丁粘贴到source navigator 源码目录 sourcenav-6.0/tk目录下,再cd 到sourcenav-6.0/ tk 的源码目录

patch -p0 -i tk-8.4-lastevent.patch

删除安装,重新安装,可以运行了(我试了一下不行)。

方法二、(转载)

有找到解法:

(http://forums.fedoraforum.org/showthread.php?t=213441)

注掉 lines 182-184 in the file /opt/sourcenav/share/tk8.3/listbox.tcl

注掉 lines 457-459 in the file /opt/sourcenav/share/tk8.3/text.tcl

在panel中添加Launcher,在Command中添加/opt/sourcenav/bin/snavigator

====== 安装完后在桌面增加捷径的方法 ======

我要做捷径的目标是/opt/sourcenav/bin/snavigator (这是个sh script)

里面要改一行

#snbindir=`dirname $0`

snbindir=/opt/sourcenav/bin

这样再建一个捷径到桌面即可:

ln -s /opt/sourcenav/bin/snavigator ~/Desktop/

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/dian_technology/archive/2010/07/23/5757884.aspx

分享到:
评论

相关推荐

    Source Navigator(Windows版)

    **Source Navigator(Windows版)** Source Navigator是一款广受赞誉的开源软件,专为Windows平台设计,用于高效地浏览和...通过持续的更新和社区的支持,Source Navigator始终保持了其在代码查看工具领域的领先地位。

    source navigator

    Source Navigator,简称为SN,是一款高效且功能丰富的代码浏览器和编辑工具,其版本sourcenavigator-NG4.5-i686-opt专为i686架构优化,为程序员提供了一种深入理解、分析和修改源代码的强大手段。本文将详细探讨...

    Source Navigator 6.0

    **Source Navigator 6.0** 是一款强大的源代码分析和浏览工具,专为软件开发者设计,帮助他们理解和管理复杂的代码库。它提供了丰富的功能,包括查看类图、追踪继承关系以及代码导航,使得代码的维护和理解变得更为...

    SourceNavigator_6.0

    Source-Navigator is a source code analysis tool. With it, you can edit your source code, display relationships between classes and functions and members, and display call trees. You can also build ...

    Souce Insight替代品 source Navigator windows

    总结来说,Source Navigator 作为一个免费且开源的源代码分析工具,虽然在某些高级功能上可能不及Source Insight,但对于个人开发者和小型团队来说,它提供了足够的功能来管理和理解代码。其便捷的安装和使用方式,...

    Source-Navigator Tutorial

    Source-Navigator是原来redhat开发的一个源代码管理分析工具,它可以在Windows,Linux等多种平台下工作。功能类似于windows下的Sourceinsight,它可以显示类,函数以及成员之间的关系,对阅读分析源代码机器有用。 ...

    sourcenavigator-NG4.5.tar.bz2

    sourcenavigator-NG4.5.tar.bz2 源代码

    Source Navigator 5

    Source Navigator 5是一款强大的开源源代码阅读和分析工具,它支持在Windows和Linux操作系统上运行,为程序员提供了高效且便捷的代码浏览和理解环境。作为Source Insight的免费替代品,Source Navigator 5在功能上...

    source navigator NG-4.4 windows版

    源码导航器NG(Source Navigator NG)是一款强大的源代码分析和管理工具,尤其适用于替代SourceInsight等传统的代码阅读和理解工具。它提供了对多种编程语言的支持,包括C、C++、Java、Python、Ada等,帮助程序员更...

    tools-SourceNavigator-NG:Source Navigator NG基于RedHat的Source Navigator。 Source Navigator是一个源代码分析工具。 使用它,您可以编辑源代码,显示类与函数和成员之间的关系,并显示调用树。 发展状况-System source code development

    工具-SourceNavigator-NG 这是Source-Navigator NG,它是C / C ++ / Fortran / Java / Tcl / PHP / Python的IDE,以及许多其他语言。 它包括强大的源代码理解功能,可帮助开发人员了解程序源代码元素之间的复杂关系...

    Source-Navigator

    Red Hat Source-Navigator TM is a powerful code analysis and comprehention tool that provides a graphic framework for understanding and reengineering large or complex software projects. Source-...

    sourcenavigator-NG4.4.tar.bz2

    Linux下的源代码查看器sourceav的升级版

    sourcenavigator-NG4.4-i686-opt.tar.bz2

    sourcenavigator-NG4.4的386二进制安装文件。

    delphi 销售系统源代码

    本篇文章将深入探讨使用Delphi编写的销售系统源代码,帮助开发者理解其核心概念、设计模式以及与Access数据库的交互方式。 1. Delphi编程基础 Delphi是基于Object Pascal语言的IDE,它提供了直观的可视化组件库,...

    Source Navigator for Verilog-开源

    用于Verilog的Source Navigator是一个Verilog解析器,它允许Source Navigator与Verilog硬件描述语言一起使用。 http://sources.redhat.com/sourcenav

    领航者Navigator2-1用户使用手册

    领航者Navigator2-1用户使用手册

    RCP的Navigator例子源代码(包括修改默认的new右键菜单)

    在RCP中,Navigator是用户界面的一个关键组件,它提供了类似于资源管理器的视图,允许用户浏览和操作项目。这个压缩包包含了RCP应用中关于Navigator的一个示例,以及如何自定义“新建”(New) 右键菜单的操作。 在...

    LJ-Navigator基恩士项目实例使用方案

    《LJ-Navigator基恩士项目实例使用方案》是一篇关于如何使用特定软件和设备进行2D扫描仪操作,以及如何将读取的数据记录到数据库中的技术文档。通过这篇文档,我们可以学习到一系列有关于自动化检测、数据记录和程序...

    source navigator的tk补丁

    This probably means that tk wasn't installed properly.

    WinCC技术手册——WinCC/WebNavigator 使用入门(中文)

    《WinCC技术手册——WinCC/WebNavigator 使用入门》是一份专为中文用户设计的详细指南,旨在帮助读者理解和掌握Siemens的WinCC监控与控制系统以及WebNavigator模块的使用方法。WinCC是西门子推出的一款强大的人机...

Global site tag (gtag.js) - Google Analytics