 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
SkyWhy
Joined: 22 May 2009 Posts: 4
|
Posted: Sun May 24, 2009 2:24 am Post subject: Setting up Eclipse remote debugging |
|
|
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/showfiles.php?group_id=223830&package_id=310967&release_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: | #include <SDL/SDL.h>
#include <pspdebug.h>
#include <pspkernel.h>
#define printf pspDebugScreenPrintf
#define SCREEN_WIDTH 480
#define SCREEN_HEIGHT 272
PSP_MODULE_INFO ( "SDL", 0, 1, 1 );
PSP_HEAP_SIZE_KB( 20480 );
PSP_MAIN_THREAD_ATTR( PSP_THREAD_ATTR_USER|PSP_THREAD_ATTR_VFPU );
int exit_callback( int arg1, int arg2, void *common )
{
sceKernelExitGame( );
return 0;
}
int CallbackThread( SceSize args, void *argp )
{
int cbid = sceKernelCreateCallback( "Exit Callback", exit_callback, NULL );
sceKernelRegisterExitCallback( cbid );
sceKernelSleepThreadCB( );
return 0;
}
int SetupCallbacks( void )
{
int thid = 0;
thid = sceKernelCreateThread( "update_thread", CallbackThread, 0x11, 0xFA0, 0, 0 );
if(thid >= 0)
sceKernelStartThread( thid, 0, 0 );
return 0;
}
int InitVideo( )
{
if (SDL_Init( SDL_INIT_VIDEO ) != 0)
{
printf( "SDL_Init(): %s\n", SDL_GetError() );
SDL_Quit( );
return 1;
}
else
return 0;
}
int main( int argc, char **argv )
{
pspDebugScreenInit( );
SetupCallbacks( );
SDL_Surface *screen;
InitVideo();
screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, 32, SDL_FULLSCREEN | SDL_DOUBLEBUF | SDL_HWSURFACE );
SDL_Surface *image;
SDL_Surface *temp;
temp = SDL_LoadBMP( "cat.bmp" );
if( temp == NULL )
printf( "SDL_LoadBMP(): %s\n", SDL_GetError( ) );
image = SDL_DisplayFormat( temp );
if( image == NULL )
printf( "SDL_DisplayFormat( ): %s\n", SDL_GetError( ) );
SDL_FreeSurface( temp );
SDL_Rect src;
src.x = 0;
src.y = 0;
src.w = image->w;
src.h = image->h;
SDL_BlitSurface( image, NULL, screen, &src);
SDL_Flip( screen );
SDL_Delay( 2500 );
SDL_FreeSurface( image );
return 0;
}
|
Makefile:
| Code: |
TARGET = hello
OBJS = main.o
CFLAGS = -O2 -G0 -Wall -g
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
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=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/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:
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. |
|
| Back to top |
|
 |
tmaster
Joined: 21 Oct 2005 Posts: 12 Location: Ireland
|
Posted: Wed Jul 01, 2009 3:20 am Post subject: |
|
|
before you hit the debug button.
did you type "debug hello.prx" in the console window the bottom. |
|
| Back to top |
|
 |
coolkehon
Joined: 20 Oct 2008 Posts: 355
|
Posted: Wed Jul 01, 2009 3:36 am Post subject: |
|
|
| so when hell broke loose your were sure to put it back right |
|
| Back to top |
|
 |
slasher2661996
Joined: 22 Feb 2009 Posts: 91 Location: Melbourne Australia ZOMG
|
Posted: Fri Jul 03, 2009 6:51 pm Post subject: |
|
|
| And this is relevant how... |
|
| Back to top |
|
 |
coolkehon
Joined: 20 Oct 2008 Posts: 355
|
Posted: Fri Jul 03, 2009 7:27 pm Post subject: |
|
|
| i was boared as a plank |
|
| 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
|