[eresi-dev] Is etrace able to trace (GCC)c++ simbols ?

Groleo Marius groleo at gmail.com
Tue Sep 15 19:38:09 UTC 2009


I tried a C program this time, but etrace kept complaining about missing
sections. Could it be a
bug in section searching function(s) ?


----->8--------------
~/work/eresi > cat 1.c
void foo() {}
int main() {}
~/work/eresi > gcc -g 1.c
~/work/eresi > etrace


         The Embedded ELF Tracer 0.82 (32 bits built) .::.

         .::. This software is under the General Public License V.2
         .::. Please visit http://www.gnu.org

~quiet
 [*] Set ELFsh default color theme (use nocolor to disable)

 [*] /home/mariusn/.etracerc sourcing -OK-
 [*] Type help for regular commands

(etrace-0.82-b2-dev at local) load a.out


 [*] Tue Sep 15 22:30:26 2009 - New object loaded : a.out
 [*] New object dependences loaded : /lib/libc.so.6
 [*] New object dependences loaded : /lib/ld-linux.so.2

(etrace-0.82-b2-dev at local) traces add foo

        [*] Unable to add func at 0x08048394 into trace
        [*] Added function foo successfully into trace global
(etrace-0.82-b2-dev at local) tracerun

found relgotname = .elfsh.reldyn
 [E] Failed to run current trace
---------------------------->8--------------------------------


  * If I enable profiling I get a lot of output like the one below.
---------------------------->8--------------------------------
[W]             <elfsh_get_section_by_type_withlist at section.c:363> Section
not found ..
 [W]            <elfsh_get_section_by_type at section.c:410>  Section remained
unfound
 [W]           <elfsh_get_reloc at reloc.c:279>              Unable to get
reloc section
 [W]              <elfsh_get_section_by_name_withlist at section.c:264> Section
not found
 [W]             <elfsh_get_section_by_name at section.c:302>  Section not
found
 [W]            <elfsh_get_dwarf_macinfo at dwarf.c:301>      Unable to find
Dwarf abbrev table
 [W]             <elfsh_get_section_by_name_withlist at section.c:264> Section
not found
 [W]            <elfsh_get_section_by_name at section.c:302>  Section not found
 [W]           <elfsh_get_stab at stab.c:63>                 Unable to get
STABS by name
 [W]             <elfsh_get_section_by_name_withlist at section.c:264> Section
not found
 [W]            <elfsh_get_section_by_name at section.c:302>  Section not found
 [W]           <elfsh_get_stab at stab.c:63>                 Unable to get
STABS by name
 [W]             <elfsh_get_section_by_type_withlist at section.c:363> Section
not found ..
 [W]            <elfsh_get_section_by_type at section.c:410>  Section remained
unfound
 [W]           <elfsh_get_verdeftab at version.c:1408>       Unable to find
Definition Version section
 [W]           <elfsh_get_notes at notes.c:59>               Corrupted Notes
section
 [W]            <elfsh_get_sym_by_value at sym_common.c:308>  No exact symbol
matching
 [W]          <elfsh_get_dynsymbol_by_name at dynsym.c:386> Symbol not found
 [W]          <elfsh_get_dynsymbol_by_name at dynsym.c:386> Symbol not found
 [W]          <elfsh_get_dynsymbol_by_name at dynsym.c:386> Symbol not found
 [W]          <elfsh_get_dynsymbol_by_name at dynsym.c:386> Symbol not found
 [W]          <elfsh_get_dynsymbol_by_name at dynsym.c:386> Symbol not found
 [W]          <elfsh_get_dynsymbol_by_name at dynsym.c:386> Symbol not found
 [W]          <elfsh_get_dynsymbol_by_name at dynsym.c:386> Symbol not found
 [W]          <elfsh_get_dynsymbol_by_name at dynsym.c:386> Symbol not found
 [W]               <elfsh_load_pht at pht.c:402>                 No PHT
 [W]              <elfsh_get_parent_segment at pht.c:465>       Unable to get
parent PHDR
 [W]               <elfsh_load_pht at pht.c:402>                 No PHT
 [W]              <elfsh_get_parent_segment at pht.c:465>       Unable to get
parent PHDR
 [W]               <elfsh_load_pht at pht.c:402>                 No PHT
 [W]              <elfsh_get_parent_segment at pht.c:465>       Unable to get
parent PHDR
 [W]               <elfsh_load_pht at pht.c:402>                 No PHT
 [W]              <elfsh_get_parent_segment at pht.c:465>       Unable to get
parent PHDR
 [W]               <elfsh_load_pht at pht.c:402>                 No PHT
........




*  This time the function name is not mangled
---------------------------->8--------------------------------
 [065] 0x08048394 FUNCTION foo
size:0000000005 foffset:000916 scope:Global sctndx:13 => .text + 180
 [066] 0x0804A008 NOTYPE   __data_start
size:0000000004 foffset:004104 scope:Global sctndx:23 => .data
 [067] 0x0804A00C VARIABLE __dso_handle
size:0000000000 foffset:004108 scope:Global sctndx:23 => .data + 4
 [068] 0x08049F18 VARIABLE __DTOR_END__
size:0000000000 foffset:003864 scope:Global sctndx:18 => .dtors + 4
 [069] 0x080483D0 FUNCTION __libc_csu_init
size:0000000090 foffset:000976 scope:Global sctndx:13 => .text + 240
 [070] 0x0804A010 NOTYPE   __bss_start
size:0000000000 foffset:004112 scope:Global sctndx:65522 => .bss
 [W]   <elfsh_get_parent_section at section.c:619>   Unable to get parent
section
 [W]   <elfsh_get_section_by_index at section.c:447> Cannot find section
 [071] 0x0804A018 NOTYPE   _end
size:0000000000 foffset:000000 scope:Global sctndx:65521 => (NULL)
 [072] 0x0804A010 NOTYPE   _edata
size:0000000000 foffset:004112 scope:Global sctndx:65522 => .bss
 [073] 0x0804842A FUNCTION __i686.get_pc_thunk.bx
size:0000000000 foffset:001066 scope:Global sctndx:13 => .text + 330
 [074] 0x08048399 FUNCTION main
size:0000000026 foffset:000921 scope:Global sctndx:13 => .text + 185
 [075] 0x08048274 FUNCTION _init
size:0000000000 foffset:000628 scope:Global sctndx:11 => .init



On Tue, Sep 15, 2009 at 8:59 PM, Julien Vanegue <julien.vanegue at gmail.com>wrote:

> Etrace has never been tested on C++ and the reason why it doesnt work I
> think is because mangled symbols, for which we have no support.
>
> I guess supporting a C++ aware  e2dbg/etrace would be a nice project but we
> have no resource for it by now!
>
> Julien
>
> On Tue, Sep 15, 2009 at 1:10 AM, Groleo Marius <groleo at gmail.com> wrote:
>
>> Hi,
>>
>> I've checked out the svn tree and run a simple test to see if etrace can
>> trace a foo() function inside a c++ program. I tried to trace using
>> the _Z encoded function name but with no luck; does etrace support
>> tracing c++ symbols ?
>>
>> --
>> Regards, Groleo!
>>
>> _______________________________________________
>> eresi-dev mailing list
>> eresi-dev at lists.einherjar.de
>> http://lists.einherjar.de/mailman/listinfo/eresi-dev
>>
>>
>
> _______________________________________________
> eresi-dev mailing list
> eresi-dev at lists.einherjar.de
> http://lists.einherjar.de/mailman/listinfo/eresi-dev
>
>


-- 
Regards, Groleo!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.einherjar.de/pipermail/eresi-dev/attachments/20090915/70ef1437/attachment.html>


More information about the eresi-dev mailing list