Intermixing source code with disassembly

Teng Chee Wan Philip tcheewan at ntu.edu.sg
Sat Apr 5 03:04:26 UTC 2008


The app.exe was not stripped.  I was using the Makefile template to
compile the application.  There were no other compile options that I
set.  I also linked in the math library using -lm.

Objdump was able to intermix the source for the RTEMS OS though, but not
for the application source code.  I tried the --source and the
--include=/home/PhilipTeng/app option too.

Interestingly, when I try the objdump -d -S on the ticker application,
it works fine.  Both the RTEMS and application source code were
intermixed into the disassembled code.  The only difference between the
two is that app.exe is a much bigger application with many source files.

Regards,
Philip

-----Original Message-----
From: Joel Sherrill [mailto:joel.sherrill at oarcorp.com] 
Sent: Friday, April 04, 2008 9:10 PM
To: Teng Chee Wan Philip
Cc: rtems-users at rtems.com
Subject: Re: Intermixing source code with disassembly

Teng Chee Wan Philip wrote:
>
> Hi,
>
> I was trying to disassemble my executable and intermix source code 
> with the disassembly, but objdump did not managed to find the source 
> code.  Does anyone have any suggestions why this could be so?  Are 
> there any limitations on objdump or specific way that objdump uses to 
> search for the source code?
>
> $ sparc-rtems4.8-objdump -d -S app.exe
>
Is app.exe stripped or in some other format that doesn't include
symbols?

Has the .exe been moved from its build location?  Sometimes you have to
tell objdump (and gdb) where the real source is located.  Use the
--source
option.

I use objdump to do what you are doing and it does work.  Here's an
example
fragment:

RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
  Chain_Control *the_chain
)
{
  the_chain->first          = _Chain_Tail(the_chain);
 2003a00:       c2 20 7f fc     st  %g1, [ %g1 + -4 ]
 2003a04:       82 00 7f fc     add  %g1, -4, %g1
  the_chain->permanent_null = NULL;
  the_chain->last           = _Chain_Head(the_chain);
 2003a08:       c2 20 60 08     st  %g1, [ %g1 + 8 ]

> Regards,
> Philip
>


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985





More information about the users mailing list