pouët.net

Code::Blocks / gcc / Windows question

category: general [glöplog]
 
How to see the generated asm code for a function? I suppose it is part of the debugger, maybe... but I've never used a debbuger, so, where should I click?
added on the 2008-12-25 18:41:50 by texel texel
I'm quite sure gcc has a command line switch to output assembly to stdout or a text file but I can't recall it right now. Maybe you should check gcc's manpages.
added on the 2008-12-25 19:16:18 by masterm masterm
And of course your'e asking about feature in the IDE itself so please disregard my answer. :)
added on the 2008-12-25 19:17:18 by masterm masterm
Yeah, the -S switch to gcc makes it output assembly code, but I've no idea about that IDE, I'm afraid.
added on the 2008-12-25 19:24:04 by leblane leblane
leblane, are you sure? -S switch means "compile only, do not assemble or link". I guess what he is looking for is the
Code:-save-temps
switch.

As for the Code::Blocks part, from Project -> Build options... -> Compiler settings tab -> Other options sub-tab; there, type -save-temps. It should do the trick
added on the 2008-12-25 20:05:33 by decipher decipher
Decipher: ah, yup, you're right. -S does spit out the asm file, but it stops after that.
added on the 2008-12-25 20:15:58 by leblane leblane
gcc -S gives the assembly code as said leblane, isn't that what texel wants?
added on the 2008-12-25 21:03:23 by baah baah
Well, if it gives the assembly code it's ok. I will try. Thanks so much :)

I want to try to understand why some little modifications -like switching the order of some assignemts- in my C code make it much faster.
added on the 2008-12-25 21:06:59 by texel texel
Don't forget to add -masm=intel too, unless you are some crazy dude that likes AT&T syntax.
added on the 2008-12-25 22:17:24 by fr33ke fr33ke
fr33ke: I prefer intel syntax, but I learnt the AT&T syntax too - before knowing of that option -, so now I don't really care about it...
added on the 2008-12-25 22:21:34 by texel texel
I usually use objdump -D or objdump -D -S.

login