Commit Graph

22 Commits

Author SHA1 Message Date
Arnaldo Carvalho de Melo 9bb29daac4 base_type: Don't combine names with attributes
Such as signed, etc. This is in preparation for using directly ctf_strings.
Instead of duplicating it in the global strings table.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-04-02 16:12:36 -03:00
Arnaldo Carvalho de Melo deb509cf6c libctf: Ignore hidden symbols
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-04-01 14:03:04 -03:00
Arnaldo Carvalho de Melo 9f4cedc61d ctf_encoder: ctf__ignore_symtab_object should ignore symbols with dots
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-31 18:19:19 -03:00
Arnaldo Carvalho de Melo d7d419f6ab ctf_encoder: Create objects section (data/variables)
Encoding all the non UNDEF OBJECT entries in the symtab. Some must be filtered
in upcoming patches, but for at least kernel/sched.o it works just fine.

To test it I used DaveM's ctfdump and also pdwtags on a --strip-debug, pahole
-Z CTF encoded object.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-31 16:12:00 -03:00
Arnaldo Carvalho de Melo 83d2438698 gobuffer: Introduce gobuffer__copy
To replace some long open coded sequences.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-31 15:54:53 -03:00
Arnaldo Carvalho de Melo 3b530f8f14 ctf_loader: Load the function section
Iterating thru the symtab and getting the missing info from
ctf_header->ctf_func_off.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-30 22:52:37 -03:00
Arnaldo Carvalho de Melo 0a924bf4eb ctf_encoder: Interface to encode functions
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-30 22:49:13 -03:00
Arnaldo Carvalho de Melo 0f97ea0329 libctf: fix ctf__delete
It should free ->filename and only close the file and call
elf_end if it was opened at ctf__new.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-30 22:05:54 -03:00
Arnaldo Carvalho de Melo 60e76245b8 core: Allow cachine an open Elf file handle for reuse
pahole --ctf_encode being the first to put this to good use.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-30 22:00:39 -03:00
Arnaldo Carvalho de Melo ed0c3ae7d1 ctf: Move ctf_format_flt_attrs from the loader to libctf
It is not glue from CTF to the core, it is pure CTF stuff.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-25 11:29:13 -03:00
Arnaldo Carvalho de Melo 2fd3936a9d ctf: combine the structs ctf_state and ctf
Moving more CTF only stuff out of the dwarves land and into something that can
be more easily stolen by other projects not interested in funny named stuff
such as pahole.

This also will help with encoding, as we will normally be recoding data from
DWARF, so the ELF file will be available and we will just add a new section to
it.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-24 18:12:11 -03:00
Arnaldo Carvalho de Melo 49f590e3b9 libctf: Adopt ctf__string from ctf_loader.c
The ctf_loader.c file should be a direct counterpart to dwarf_loader,
that is, it should have just use what is in libctf to decode the CTF
sections and convert it to the core format in dwarves.[ch].

Also introduce a ctf__string32 for the very common idiom:

ctf_string(ctf__get32(sp->ctf, &tp->base.ctf_name), sp);

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-24 17:13:40 -03:00
Arnaldo Carvalho de Melo da177f87a3 ctf_encoder: Check if something was encoded before saving the info
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-20 13:20:24 -03:00
Arnaldo Carvalho de Melo ce97ac9a26 ctf_encoder: Allow encoding a bit_size in enumeration types
As we have to support enum bitfields, so remember the bit_size.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-20 12:51:30 -03:00
Arnaldo Carvalho de Melo fedbfb60ff libctf: Encode VARARGS an extra 0 short at the end of the parm list
We'll see if this is how things should be, but its good enough for me 8)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-19 20:10:33 -03:00
Arnaldo Carvalho de Melo dcef613288 libctf: give up "for now" on using libelf to add a section to an existing file
And use what worked so far, that is: if the section is already there,
replacing its contents works, because probably all the relocation was
done... If not, be a chicken and call system("objcopy..."), but...
I'llll be bahck!

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-19 19:41:14 -03:00
Arnaldo Carvalho de Melo f2495cd1a6 libctf: comment out some debug messages
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-19 19:17:41 -03:00
Arnaldo Carvalho de Melo feab8aa5e3 ctf: Include the initial implementation of a ctf encoder
"pahole -Z foo" will create foo.SUNW_ctf, that if objcopy
--add-section'ed to the right word-sized object will work, sans VARARGS,
that will get fixed soon (as in, probably, tomorrow).

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-19 12:16:07 -03:00
Arnaldo Carvalho de Melo f7a428ef24 ctf: Add a filename member to struct ctf
That will be later used when encoding the CTF info.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-19 12:14:01 -03:00
Arnaldo Carvalho de Melo 7dfd45ffea libctf: The constructor should load only if a buffer is passed
So that we can create a ctf object and then populate it, to do the
encoding.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-25 16:25:06 -03:00
Arnaldo Carvalho de Melo 36f454820e libctf: Use the same coding style as the dwarves
Use __ as a separator for the method names, self, new/delete, use
stdint.h types, etc.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-25 16:01:26 -03:00
Arnaldo Carvalho de Melo 2dfa5fe6ea [DWARVES]: Initial CTF support
Using a library written by David S. Miller.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-03-04 15:37:02 -03:00