 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
sturatt
Joined: 13 Jul 2006 Posts: 46
|
Posted: Fri Jun 27, 2008 6:15 am Post subject: debug symbols |
|
|
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: | #include <pspkernel.h>
#include <pspdebug.h>
PSP_MODULE_INFO("HelloWorld_cpp",0,1,1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER);
#define printf pspDebugScreenPrintf
int global = 0;
int main() {
int var1=0;
pspDebugScreenInit();
printf("Hello World\n");
var1 = 1;
var1 = 2;
global = 2;
printf("after vars\n");
return 0;
} |
| Code: | TARGET = helloworld
OBJS = main.o
CFLAGS = -g -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LIBS = -lm -lpspaudio -lpspgu -lpsppower -lpsprtc -lstdc++
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Hello World
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak |
|
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Sat Jun 28, 2008 2:53 am Post subject: |
|
|
| Remove -O2 from your CFLAGS, gcc optimises locals to registers which means gdb cannot seem them. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|