"Fossies" - the Fresh Open Source Software Archive 
Member "ncc-2.8/nccnav/README" (12 Sep 2006, 6316 Bytes) of package /linux/privat/old/ncc-2.8.tar.gz:
As a special service "Fossies" has tried to format the requested text file into HTML format (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
1
2 nccnav is used explore the output of ncc in a convenient manner for
3 hacking.
4
5 INSTALL & EXTERNAL VIEWER
6 =========================
7
8 As of version 1.3 of ncc, nccnav can invoke an external viewer to browse
9 source code.
10
11 To install nccnav, copy the file nccnav to /usr/bin.
12 Then make a symbolic link nccnavi -> nccnav
13
14 If called as "nccnav" the source code will be viewed with "less".
15 If called as "nccnavi" the source will be automatically indented
16 and viewed with "indent -kr -st | less"
17
18 INPUT
19 =====
20
21 Supposing you've compiled the linux kernel with ncc.
22 Collecting all the .nccout files can be done with :
23
24 find . -name \*.nccout | xargs cat > kernel.map
25
26 You can use the pathremover which is found in the
27 current directory to truncate long paths in `kernel.map'.
28 If you want to compile and install pathremover, the above
29 command will be something like:
30
31 find . -name \*.nccout | xargs cat | pathremover /mnt/src/hacks/linux-2.4.10/ > kernel.map
32
33 Then, that's viewed with:
34
35 nccnav kernel.map
36
37 DISPLAY
38 =======
39
40 nccnav is designed to run in a text console. The ideal display
41 is a black&white framebuffer 132x50 text mode. Of course, it can
42 be executed in an xterm window, but this usually sucks.
43
44 In the framebuffer case, the colors are different from the normal
45 text mode. DIM white is missing.
46
47 INITIAL SCREENS
48 ===============
49
50 Initially, nccnav displays a list of all the source files.
51 Pressing 'O' shows a list of all the functions and BACKSPACE or 'q' goes
52 back to the source files.
53 Pressing 'E' shows a list of all the functions not called by any other
54 function (which are supposed to be interface entry functions).
55 Pressing 'G' shows a list of all the global variables.
56
57 Pressing any letter (except 'q') in the list of functions will
58 get the cursor to the closest function beginning with that letter.
59
60 Movement is possible with the arrow keys and page-up/down.
61
62 Pressing <enter> on a file or function or variable goes to MODE 2.
63
64 MODE 2
65 ======
66
67 This mode is oriented around a resource which can be a:
68
69 file, function, global variable, member of structure, structure
70
71 For any of the above, all the related resources are listed.
72 For example, in the case of a <function> there are:
73
74 1. File(s) with <function> definition (may not exist)
75 2. Functions calling <function> (Blue)
76 3. Global variables used by <function> (Red)
77 4. <function-herself>
78 5. Functions called by <function>
79 Dim grey: functions that do not call any other functions.
80 Brown: functions that do call other functions.
81 Red: Recursion detector alert (if enabled)
82 6. Structure members used by <function> (Dark grey)
83
84 Selecting something from 1, 2, 3, 5, 6 and pressing enter, will recursively
85 enter MODE 2 for that resource.
86 Pressing enter on 4 or typing 'q' will return to the previous screen.
87 Pressing BACKSPACE will get you to the INITIAL SCREENS with a longjmp.
88 Pressing '<' will get you to the HISTORY MODE.
89 Pressing 'r' on a red 5 get you to the UNROLL MODE.
90 Pressing 'm' on a function will get you to the POP-UP MODE
91 Pressing 'C' will run system("bash")
92
93 FUNCTION CODE
94 =============
95
96 Pressing <space> on a function will show the function text as found in
97 the file which is known to include the function definition.
98 This means that, nccnav must be in the correct root directory
99 or paths should be absolute. The ncc option -ncfabs is rather useful.
100
101 Pressing 'v' on a function will show the function text with "vi"
102 (after extracting it from its file and saving it to a temporary
103 file), colorized with C syntax.
104
105 Note that external library functions, obviously have no file.
106
107 Also note that if a function reports to be defined in more than one
108 files, this will probably fail. This happens because ncc does
109 not distinguish different static functions with the same name.
110 They are considered the same thing and their resources are
111 mixed in nccnav. Currently, if nccnav detects more than one
112 files for a function it will issue a warning.
113
114 Pressing <space> or <enter> will get you to the previous screen if
115 you are using the internal source viewer. Otherwise, exit the
116 external application by it's custom way of doing so.
117
118 MORE CODE
119 =========
120
121 Pressing <space> on a file in MODE 2 will display the entire file.
122 Pressing 'v' on a file in MODE 2 will *edit the original* file with vi
123 (":q\n" to exit)
124
125 Pressing <space> or 'v' on a structure will extract and show the
126 structure declaration text.
127
128 RECURSION DETECTOR
129 ==================
130
131 The recursion detector is by default enabled.
132 It can be disabled by pressing 'R' while in MODE 2. (it's supposed to be
133 expensive and may be confusing)
134
135 The recursion detector works in MODE 2 and if the current resource is a
136 function. In this case it will paint RED all the functions called by the
137 current function, which will eventually lead back to it by some way of
138 recursion.
139
140 Pressing 'r' on one of the red ones will display one of the possible paths
141 through which recursion can happen. Currently there is no way to view
142 alternative paths.
143
144 In this mode, 'q' will get you back while enter will proceed ahead deeper
145 into MODE 2 for the selected resource.
146
147 POP-UP MODE
148 ===========
149
150 This is an alternative way to browse the call flow and is entered by
151 pressing 'm' on a function in MODE 2.
152
153 Pop-up menus are generated, where the top element is a function and
154 below it all the functions called by it. Movement is possible
155 with the UP/DOWN arrows.
156
157 <enter> or RIGHT will expand a new pop-up for the current function.
158 'q' or LEFT will close the current pop-up and activate the previous one.
159 SPACE is available to view the source code.
160 BACKSPACE will close all the popups and return to MODE 2.
161
162 Pressing '2' will enter MODE 2 for the current selected element.
163 In this case, HISTORY and BACKSPACE are set at this breakpoint.
164
165 HISTORY MODE
166 ============
167
168 At any time you can press '<' and '>' to browse through all the previous
169 screens. <enter> on one of them will jump back to that screen. Any other
170 key will exit the HISTORY MODE.
171
172 WHAT TO DO IF YOU'RE STUCK
173 ==========================
174
175 Nothing. Stay calm and do not panic.
176 Remember: The user is the only person responsible for any damages.
177
178 FINALLY
179 =======
180
181 Except from hacking unknown projects, ncc together with valgrind are
182 an excellent debugging platform for discovering and fixing bugs in
183 zero time.
184
185 Happy hacking!