public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [objdump Question] How to sort assembly code by each line number ?
@ 2017-02-21  6:01 Taeung Song
  2017-02-21  9:53 ` Nick Clifton
  0 siblings, 1 reply; 5+ messages in thread
From: Taeung Song @ 2017-02-21  6:01 UTC (permalink / raw)
  To: binutils

Hi all :)

I'm modifying perf-annotate (that are Linux kernel : tools/perf)
a perf tool use objdump with -d and -l or -S.

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

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

--

Disassembly of section .text:

0000000000400966 <get_cond_maxprice>:
get_cond_maxprice():

...

/home/taeung/workspace/perf-test/old_pack_knapsack.c:32
   40098d:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%rbp)
/home/taeung/workspace/perf-test/old_pack_knapsack.c:34
   400994:	c7 45 ec 01 00 00 00 	movl   $0x1,-0x14(%rbp)
   40099b:	eb 4d                	jmp    4009ea <get_cond_maxprice+0x84>
/home/taeung/workspace/perf-test/old_pack_knapsack.c:37
   40099d:	8b 55 dc             	mov    -0x24(%rbp),%edx

...

/home/taeung/workspace/perf-test/old_pack_knapsack.c:34 (discriminator 2)
   4009e6:	83 45 ec 01          	addl   $0x1,-0x14(%rbp)
/home/taeung/workspace/perf-test/old_pack_knapsack.c:34 (discriminator 1)
   4009ea:	8b 45 ec             	mov    -0x14(%rbp),%eax
   4009ed:	3b 45 f4             	cmp    -0xc(%rbp),%eax
   4009f0:	76 ab                	jbe    40099d

...

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

Thanks,
Taeung

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-02-22  8:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-21  6:01 [objdump Question] How to sort assembly code by each line number ? Taeung Song
2017-02-21  9:53 ` Nick Clifton
2017-02-21 12:27   ` Pedro Alves
2017-02-22  8:22     ` Taeung Song
2017-02-22  8:13   ` Taeung Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).