Setting up Eclipse remote debugging

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

Moderators: cheriff, TyRaNiD

Post Reply
SkyWhy
Posts: 4
Joined: Fri May 22, 2009 3:12 am

Setting up Eclipse remote debugging

Post by SkyWhy »

I'm currently trying to setup the eclipse remote debugging for PSP but honestly it's going nowhere. I followed the steps here: http://sourceforge.net/project/showfile ... _id=662590

I have the usbhostfs up and running, it connects to psp telling me "connected to device" and I've got the pspsh up and running too. So basically I have the PSPLink, drivers and the two external tools installed. But when I'm actually trying to debug, all hell breaks loose.

My main.cpp

Code: Select all

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

#define 	printf 			pspDebugScreenPrintf
#define 	SCREEN_WIDTH 	480
#define 	SCREEN_HEIGHT 	272

PSP_MODULE_INFO &#40; "SDL", 0, 1, 1 &#41;;
PSP_HEAP_SIZE_KB&#40; 20480 &#41;;
PSP_MAIN_THREAD_ATTR&#40; PSP_THREAD_ATTR_USER|PSP_THREAD_ATTR_VFPU &#41;;


int exit_callback&#40; int arg1, int arg2, void *common &#41;
&#123;
        sceKernelExitGame&#40; &#41;;
        return 0;
&#125;

int CallbackThread&#40; SceSize args, void *argp &#41;
&#123;
        int cbid = sceKernelCreateCallback&#40; "Exit Callback", exit_callback, NULL &#41;;
        sceKernelRegisterExitCallback&#40; cbid &#41;;
        sceKernelSleepThreadCB&#40; &#41;;
        
        return 0;
&#125;

int SetupCallbacks&#40; void &#41;
&#123;

        int thid = 0;
        thid = sceKernelCreateThread&#40; "update_thread", CallbackThread, 0x11, 0xFA0, 0, 0 &#41;;
        
        if&#40;thid >= 0&#41;
                sceKernelStartThread&#40; thid, 0, 0 &#41;;
        
        return 0;
&#125;




int InitVideo&#40; &#41;
&#123;
         if &#40;SDL_Init&#40; SDL_INIT_VIDEO &#41; != 0&#41;
         &#123;
                printf&#40; "SDL_Init&#40;&#41;&#58; %s\n", SDL_GetError&#40;&#41; &#41;;
                SDL_Quit&#40; &#41;;
                return 1;
         &#125;
         else
        	 return 0;
&#125;

int main&#40; int argc, char **argv &#41;
&#123;
        pspDebugScreenInit&#40; &#41;;
        SetupCallbacks&#40; &#41;;

        SDL_Surface *screen;
        InitVideo&#40;&#41;;

        screen = SDL_SetVideoMode&#40; SCREEN_WIDTH, SCREEN_HEIGHT, 32, SDL_FULLSCREEN | SDL_DOUBLEBUF | SDL_HWSURFACE &#41;;

        SDL_Surface *image;
        SDL_Surface *temp;

        temp = SDL_LoadBMP&#40; "cat.bmp" &#41;;

        if&#40; temp == NULL &#41;
			printf&#40; "SDL_LoadBMP&#40;&#41;&#58; %s\n", SDL_GetError&#40; &#41; &#41;;

        image = SDL_DisplayFormat&#40; temp &#41;;

        if&#40; image == NULL &#41;
        	printf&#40; "SDL_DisplayFormat&#40; &#41;&#58; %s\n", SDL_GetError&#40; &#41; &#41;;

        SDL_FreeSurface&#40; temp &#41;;

        SDL_Rect src;

        src.x = 0;
        src.y = 0;
        src.w = image->w;
        src.h = image->h;

        SDL_BlitSurface&#40; image, NULL, screen, &src&#41;;

        SDL_Flip&#40; screen &#41;;
        SDL_Delay&#40; 2500 &#41;;

        SDL_FreeSurface&#40; image &#41;;

        return 0;
&#125;
Makefile:

Code: Select all

TARGET = hello
OBJS = main.o

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

EXTRA_TARGETS = EBOOT.PBP
LIBS = -lSDL -lGL -lz -lpng -lm -ljpeg -lpsppower_driver -lpspvfpu -lpsphprm -lpsprtc -lpspaudio -lpspgu -lpspirkeyb -lpsppower
PSP_EBOOT_TITLE = Test SDL

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak
And yes, there is loads of libraries linked. Don't worry about that.

Nothing too hardcore there, just setting up SDL, callbacks and stuff. It works BUT it freezes my PSP after it has displayed the image. So I'm guessing something dodgy is going on with my callbacks, but not to start analysing that too deeply, I would like to debug the problem. That would give me a lot better feel on what is going on. I would like the program just to display the simple image and then exit back to psp menu.

So after I've compiled my program, started PSPLink on PSP, started the two external tools and press the "debug"-button in Eclipse (the bug icon) all hell breaks loose, it just hangs for a while and Eclipse tells me this:
Image

Any ideas what is causing the problem?

I think I got the tools setup correctly, atleast I followed the tutorial and they seem to "respond" when I start them but that's about it then...

If more information is required, I'm happy to provide it, just shoot away.
Any ideas anyone?



Thanks.
tmaster
Posts: 11
Joined: Fri Oct 21, 2005 5:32 am
Location: Ireland

Post by tmaster »

before you hit the debug button.

did you type "debug hello.prx" in the console window the bottom.
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

so when hell broke loose your were sure to put it back right
slasher2661996
Posts: 91
Joined: Sun Feb 22, 2009 8:32 am
Location: Melbourne Australia ZOMG

Post by slasher2661996 »

And this is relevant how...
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

i was boared as a plank
Post Reply