This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: binutils, bfd library, debug.h/c files and so on...
- From: Tarmo Pikaro <tapika at yahoo dot com>
- To: Ian Lance Taylor <ian at airs dot com>
- Cc: Daniel Jacobowitz <drow at false dot org>, binutils at sourceware dot org
- Date: Thu, 29 Sep 2005 14:04:34 -0700 (PDT)
- Subject: Re: binutils, bfd library, debug.h/c files and so on...
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