Messages in this thread | | | Date | Tue, 30 Mar 1999 00:42:46 +1000 | From | Andrew Morton <> | Subject | Re: 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/
| |