[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Texmacs-dev] How to visualize data structures?
From: |
Salman Khilji |
Subject: |
[Texmacs-dev] How to visualize data structures? |
Date: |
Mon, 5 Apr 2004 17:56:46 -0700 |
User-agent: |
KMail/1.5.1 |
I spent a couple of hours today just browsing thru TeXmacs source code.
Unfortunately, in the entire 4 hours, I did not learn even a single thing.
One of the abosolute MUST HAVEs that I consider before attempting to
understand existing code is to compile it in debug, put a break point on a
function, and examine and visualize the values of variables in a debugger.
An excellent example would be the FreeType project. Everything is
crystal clear and visible in the debugger. Another good example is the
source code of the gdb debugger itself. Using the visualization technique,
I was able to modify gdb to extract its symbol table and output it to a file.
So here is what I was trying to do with TeXmacs:
1) put a break point on get_env_path(string which, url def).
2) When I get in there, I want to see what the value of a url is. So here is
what gdb tells me:
(gdb) p *def.rep->t.rep
$14 = {
<concrete_struct> = {
ref_count = 1,
_vptr.concrete_struct = 0x82bc910
},
members of tree_rep:
op = 137
}
The above to totally worthless. The only member that I can look at is 'op'
which has a value of 137. I know I posted this question before, and David
suggested that going thru the debugger is not recommended and a nice printf is
much quicker than trying to use the debugger. But I cannot be expected to
bombard the entire source tree with printf's and recompiling everything I want
to look at something.
Can someone suggest on how to to look at the internals of a TeXmacs object
efficiently?
This reminds of of the entire week that I spent on TeXmacs source code a
couple of months ago and ended up learning nothing whatsoever! Compare this
to the FreeType project and because everything is visualizable, I was able to
spend a week on it and add code to it subset Type1 fonts.
Salman
- [Texmacs-dev] How to visualize data structures?,
Salman Khilji <=