| View previous topic :: View next topic |
| Author |
Message |
linverse
Joined: 09 Nov 2004 Posts: 1
|
Posted: Tue Nov 09, 2004 8:40 am Post subject: GCC Question |
|
|
Is there a way to output c++ code and it's final assembled version like Visual Studio can do. x86 ex:
| Code: |
; 41 : void statsClose() {
sub esp, 8
push esi
push edi
; 42 : time_t t;
; 43 : FILE *f;
; 44 :
; 45 : t = time(NULL) - vsyncTime;
push 0
call _time
mov edi, eax
sub edi, DWORD PTR _vsyncTime
|
LInverse |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Tue Nov 09, 2004 9:06 am Post subject: |
|
|
To spit out unassembled code, use:
gcc -S
I think. :) |
|
| Back to top |
|
 |
pixel
Joined: 30 Jan 2004 Posts: 791
|
Posted: Tue Nov 09, 2004 9:54 am Post subject: |
|
|
Well, this won't "interlace" source code... _________________ pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department. |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Tue Nov 09, 2004 10:43 am Post subject: |
|
|
| Stop that! You make me sad! |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Nov 09, 2004 1:45 pm Post subject: |
|
|
| pixel wrote: | | Well, this won't "interlace" source code... |
This actually sounds like it could be a cool feature, but I guess that GCC doesn't have it ?
Of course, optimization would wreak havoc, but the same issues exist for and haven't stopped optimization being used in conjunction with debugging turned on.
Objdump lets debugging information be printed along with disassembly, including sourcefile names and line numbers, and also I think including source code, but thats done on already compiled binaries that hopefully had debug turned on and source files laying around.
My advice to the original poster - check the objdump command. It comes with the gcc distribution. |
|
| Back to top |
|
 |
|