rtems-addr2line not working on ARM?

Chris Johns chrisj at rtems.org
Fri Sep 6 07:01:43 UTC 2019


On 6/9/19 4:20 pm, Sebastian Huber wrote:
> Hello,
> 
> I tried the rtems-addr2line on ARM and SPARC. On SPARC it seems to work fine,
> however, on ARM I get this:
> 
> rtems-addr2line -e build/arm-rtems5-xilinx_zynq_a9_qemu-everything/media01.exe
> 0x0000135a
> /home/EB/sebastian_h/git-rtems-5/c/src/lib/libbsp/arm/xilinx-zynq/../../../../../../bsps/arm/shared/irq/irq-gic.c:264
> 
> 
> addr2line -e build/arm-rtems5-xilinx_zynq_a9_qemu-everything/media01.exe 0000135a
> /scratch/git-rtems-libbsd/build/arm-rtems5-xilinx_zynq_a9_qemu-everything/../../testsuite/include/rtems/bsd/test/default-network-init.h:179
> 
> 
> The GNU tool is right. It is also considerably faster. 

I would hope it is faster and exact. It has had many years of work on it,
written in C and not a means to test a C++ framework so we can grow an
ecosystem. I have stated its purpose before. I am perplexed by the intent of
this statement.

If you want to compare performance I suggest you try the elftools one? There is
one. It is not built because GNU provides one and good one.

Also be-careful as the exec call is not as fast as Linux on all the hosts we
support.

> The mapping to the function (-f option) get both tools right.

Sorry I do not understand this sentence.

> I don't understand the logic here:
> 
>     bool
>     file::get_source (const unsigned int addr,
>                       std::string&       source_file,
>                       int&               source_line)
>     {
> [...]
>       address match;
> 
>       for (auto& cu : cus)
>       {
>         address line;
>         r = cu.get_source (addr, line);
>         if (r)
>         {
> 
> <-- Why is there a "match = line" in both cases?
> 

Looks like a bug and related to the comment not posted but present in the code ...

      /*
       * Search the CU's collecting the addresses. An address can appear in
       * more than one CU. It may be the last address and the first.
       */

>           if (match.valid () &&
>               (match.is_an_end_sequence () || !!line.is_an_end_sequence ()))
>           {
>             match = line;
>           }
>           else
>           {

I think this is suppose to happen if match is not valid ...

>             match = line;

Chris



More information about the devel mailing list