Intermixing source code with disassembly

Joel Sherrill joel.sherrill at
Fri Apr 4 13:09:41 UTC 2008

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

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

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        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