lkml.org 
[lkml]   [1999]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: asm debugger for linux?
Brian Gerst wrote:
>
> Siddharth Srivastava wrote:
> >
> > are there any asm debuggers avaliable for linux??
> > i need it badly for some code optimization
>
> Three possibilities:
> 1) gcc -S file.c (creates file.s)
> 2) gdb
> 3) objdump --disassemble

4) mix!

A little toy I wrote when I was doing a gcc port many moons ago. It
still seems to work.

You compile something with 'gcc -S -g foo.c' then run 'mix foo.s' and it
spits out a nice mixture of the C and assembly.

main()
{
p1();
p2(2);
p3("s");
}


gives

;0002 foo.c
;0002 {
.LM1:
pushl %ebp
movl %esp,%ebp
;0003 p1();
.LM2:
.LBB2:
call p1
;0004 p2(2);
.LM3:
pushl $2
call p2
addl $4,%esp
;0005 p3("s");
.LM4:
pushl $.LC0
call p3
addl $4,%esp
;0006 }

it's at http://www.uow.edu.au/~andrewm/mix.c


--
--------------
Andrew Morton
mailto:andrewm@uow.edu.au
http://www.uow.edu.au/~andrewm

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.828 / U:0.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site