debug symbols

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
sturatt
Posts: 46
Joined: Thu Jul 13, 2006 4:21 pm

debug symbols

Post by sturatt »

I am having some trouble with psp-gdb. I am trying to debug a simple hello world app just to get things setup. I cant seem to get this to compile with debug symbols though. Whenever I start debugging and type "info locals" while I am in main, it tells me "No locals." Am I doing something wrong? When I compile the sprite sample with -g and debug it, the symbols show up fine when I type "info locals" in main.

Code: Select all

#include <pspkernel.h>
#include <pspdebug.h>

PSP_MODULE_INFO&#40;"HelloWorld_cpp",0,1,1&#41;;
PSP_MAIN_THREAD_ATTR&#40;THREAD_ATTR_USER&#41;;

#define printf pspDebugScreenPrintf

int global = 0;


int main&#40;&#41; &#123;

	int var1=0;

    pspDebugScreenInit&#40;&#41;;

    printf&#40;"Hello World\n"&#41;;

	var1 = 1;
	var1 = 2;
	global = 2;

	printf&#40;"after vars\n"&#41;;

    return 0;
&#125;

Code: Select all

TARGET = helloworld
OBJS = main.o

CFLAGS = -g -O2 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

LIBDIR =
LIBS = -lm -lpspaudio -lpspgu -lpsppower -lpsprtc -lstdc++ 
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Hello World

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Remove -O2 from your CFLAGS, gcc optimises locals to registers which means gdb cannot seem them.
Post Reply