This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [objdump Question] How to sort assembly code by each line number ?


Hi Nick,

I'm sorry for my tardy response.
Thank you so much !! for your detailed answer !

Thanks,
Taeung

On 02/21/2017 06:53 PM, Nick Clifton wrote:
Hi Taeung,

If objdump has the option sorting assembly code according to line numbers,
I want to use the option.

Sorry - objdump has no such option.

For example,
I want to sort the below output.
(especially parts of assembly code of line number 34)

The problem is that the same line of source code can appear in lots of places
in the assembler (for example because of macros, inline functions, templates, etc).
Plus compiler optimizations like loop unrolling can replicate the same line
of source code multiple times in the assembler output.  So there really is no
easy way to produce *meaningful* disassembly sorted by line number.

If there isn't the option for it, I'd manually parse the output from 'objdump -dl'..

You can of course write a script to perform this sorting for you, so that you
do not have to do it by hand every time.

Cheers
  Nick




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]