binutils, bfd library, debug.h/c files and so on...

Tarmo Pikaro tapika@yahoo.com
Fri Sep 30 01:33:00 GMT 2005


Hi !

Continuing digging deeper...
After closer consideration I've decided that I don't
need to use debug.h/c from C++, and if I'll do, I will
wrap debug* into my own .c/h and from there into
c++....  No need to change your code.

Checked out objdump --debugging, pretty much what I
need, already extracted parts from objdump. Coded
typedump.c :) (Ok, so we can end-up having additional
utility in binutils, so what? :) )

About printing out structures - debug_write does not
seems to be feasible for my needs, I will probably
recosider by tampering into debug.c directly...
My idea was that I will make debugex.c which will
#include "debug.c" and I will add needed functions
there.

By doing so I will not tamper your code. (my proposal)

libdwarf developer did not yet reply to me, so I think
I will stick to binutils. :)

About what will be printed out...
I will try to form suitable for perl output and use
DataDumper module to reserse engeneere printed
lines...
so from perl code would look like this:
my $print=`typedump.exe myexe.exe`;
$type_tree=eval($print);

Here is a little bit more of design issues:
---------------------------------------------
3.2 Type tree
Each type definition or structure name is unique;
there cannot be two structures with the same name in
application. (In plain C, C++ allows namespaces usage)
For developer name of field in structure is like a
handle to structure variable – it’s simple to use.
ThatÂ’s why structure name will be acting like a key in
type tree.
typedef struct
{
    uint8 test1;
}MyStruct;
Will produce following tree:

‘MyStruct’ =>
{
   ‘type’ => ‘structure’,

	‘elements’ =>
	[
		‘test1’ => 
		[ 
				‘type’ => ‘uint8’
		],
	]
};

Lower case letters will be used to simplify writing.

3.3 Terminology

Structure (C, C++)Alias: Sequence, Complex type
(XML)Alias: Element (RelaxNG)

(People, this is ridiculous! Just by renaming the
type, you wonÂ’t get anything newer.)
Refers to a structure, an array of elements.

Comments are welcomed...




--
    Have a nice day!
        Tarmo.


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com



More information about the Binutils mailing list