Re:TinyVM: A lightweight, fast virtual machine in < 500 l...
by leon_ on Sunday July 03, 2011 @04:01AM
(#2723320)
find main() and follow the parts that interest you - that's how I start with reading a new codebase
[ Parent
| on HN ]
Re:TinyVM: A lightweight, fast virtual machine in < 500 l...
by saintfiends on Sunday July 03, 2011 @05:19AM
(#2723396)
first thing I did. Opened the main.c, tried to follow the include files. That's where the problem starts, as it branches out I start to lose track.
When ever I start reading code, my confidence hits rock bottom. Seriously, I just feel really bad about myself and just walk away.
Re:TinyVM: A lightweight, fast virtual machine in < 500 l...
by rat on Sunday July 03, 2011 @07:52AM
(#2723533)
Try opening it up in an editor/ide with ctrl+click to step into function or similar like gvim or eclipse(and hopefully a way to jump back. eclipse also has a nice expand macro feature which lets you look at macros fully expanded and at different expansion stages.
Re:TinyVM: A lightweight, fast virtual machine in < 500 l...
by saintfiends on Sunday July 03, 2011 @09:43AM
(#2723668)
you are a life saver. Kind of embarrassed that I didn't do a Google search on that one.
I just found ctags. :D !
Re:TinyVM: A lightweight, fast virtual machine in < 500 l...
by rat on Sunday July 03, 2011 @09:57AM
(#2723692)
darn forgot to mention ctags.
If you are up for it supposedly scope is better but I couldn't get it set up. I don't know of any vim plugin for eclipse like macro expansion but if you see hairy macros you can always do gcc -E |vim - (gcc -E does full includes so macro expansion + importing of all headers)and search for your code or jump to the bottom.