This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Printing out type tree using objdump...


> > 4 Type tree in objdump
> > objdump will provide for perl functionality to
> print
> > out the type tree. 
> > ?objdump --print_c_type_tree_for_perl? will print
> out
> > type tree. Type tree is the next step from perl
> module
> > called ?pstruct? ? pstruct allowed to parse stabs
> > debugging information and generate appropriate
> > functions for filling out necessary C structures.
> Type
> > tree assumes that no code will be generated and
> > developer can perform necessary structure
> generation
> > using type tree. Additional perl module,
> > encode_decode.pm will be supplied with tree
> walking
> > support.
> 
> Unfortunately, I have a hard time understanding
> this.
Ok, may be I need to provide some background support?
Tell me which terms here you don't understand, I will
try to clarify the issue.


> Is pstruct a standard perl module?
Yes, but I had some problems with using it, my best
guess is that gcc's stabs debug information has
changed or stabs parser does not work correctly.


>  If not, does
> this dump information
> actually have anything to do with Perl?
It doesn't.... Ok, I have to include reasoning for
using perl, here you go:

-------------------------------------------
3.1	Programming language
Currently I see several alternatives ? perl, C#, C++,
C. I?ve decided to start from perl, because it does
not needs to be compiled and its architecture allows
much more simpler tree structures handling than any
other language.
Perl will be used as a primary language, for secondary
will be chosen plain C, because of its portability.
Also without the need to recompile the whole
application the testing and iteration sequence goes
much faster.
-------------------------------------------

But basically after type tree is loaded in perl it can
be written back to C. I just don't want to play with
xmalloc and other allocation libraries, I want to have
a toy language in use...


> > ?MyStruct? =>
> > {
> >    ?type? => ?structure?,
> > 
> > 	?elements? =>
> > 	[
> > 		?test1? => 
> > 		[ 
> > 				?type? => ?uint8?
> > 		],
> > 	]
> > };
> 
> Can we specify this more formally?  Or is this some
> sort of Perl
> syntax?  (It's been many years since I've used
> Perl).

Ok you need to have a good knowledge of perl, 
see for more details perldsc, perlreftut, perlref,
perllol tutorials.

for example from here:
http://webmaster.iu.edu/perl56/pod/perldsc.html

Shortly ...  [1 , 2 , 3] is an array of items '1', '2'
and '3'. { 'a' => 1, 'b' => 2} is a hash of a=1, b=2.
(~aka structure)


--
    Have a nice day!
        Tarmo.


	
		
______________________________________________________ 
Yahoo! for Good 
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/ 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]