forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

debug symbols

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
sturatt



Joined: 13 Jul 2006
Posts: 46

PostPosted: Fri Jun 27, 2008 6:15 am    Post subject: debug symbols Reply with quote

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
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Sat Jun 28, 2008 2:53 am    Post subject: Reply with quote

Remove -O2 from your CFLAGS, gcc optimises locals to registers which means gdb cannot seem them.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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