GCC Question

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
linverse
Posts: 1
Joined: Tue Nov 09, 2004 8:00 am

GCC Question

Post by linverse »

Is there a way to output c++ code and it's final assembled version like Visual Studio can do. x86 ex:

Code: Select all

; 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
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

To spit out unassembled code, use:

gcc -S

I think. :)
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

Post by pixel »

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.
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Stop that! You make me sad!
Guest

Post by Guest »

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.
Post Reply