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?
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.
And of course your'e asking about feature in the IDE itself so please disregard my answer. :)
Yeah, the -S switch to gcc makes it output assembly code, but I've no idea about that IDE, I'm afraid.
leblane, are you sure? -S switch means "compile only, do not assemble or link". I guess what he is looking for is the
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
Code:
switch.-save-temps
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
Decipher: ah, yup, you're right. -S does spit out the asm file, but it stops after that.
gcc -S gives the assembly code as said leblane, isn't that what texel wants?
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.
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.
Don't forget to add -masm=intel too, unless you are some crazy dude that likes AT&T syntax.
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...
I usually use objdump -D or objdump -D -S.