Hi KidPaddle,
I am interested in using gdb to debug my GP2X programs using freepascal, can you tell me how to do this?
cheers,
Paul.
Hi KidPaddle,
I am interested in using gdb to debug my GP2X programs using freepascal, can you tell me how to do this?
cheers,
Paul.
Games:
Seafox
Pages:
Syntax Error Software
itch.io page
Online Chess
http://gameknot.com/#paul_nicholls
I have download the debugger for gp2x from this site:
http://archive.gp2x.de/cgi-bin/cfile...,0,0,0,14,1655
Put both, debugger and program, into same directory and connect to gp2x with telnet, switch to program directory and call:
./dbg program.gpe
That alls, nothing special. Only you have to remove "-s" option from linker, cause it strip all debug symbols.
Cheers
Thomas
Thanks for the info KidPaddle! :-)
BTW, I have built myself a new crosscompiler using the new freepascal 2.2.0 sources, etc. and have had less issues. After more testing I will upload the new cross-compiler to the fpc4gp2x site.
I have also 'updated' my devkitGP2X sdl libraries from here (http://archive.gp2x.de/cgi-bin/cfile...,0,0,0,19,1875). This includes SDL_mixer 1.2.6 compiled to use libmad and tremor which don't use floating point at all which is much better.
I need to try some sdl mixer stuff to see if that works now :-)
I will keep you posted.
PS according to Eugene Proshkin who helped me get stated with the GP2X programming, you don't need softfloat when building the cross-compiler.
cheers,
Paul.
Games:
Seafox
Pages:
Syntax Error Software
itch.io page
Online Chess
http://gameknot.com/#paul_nicholls
Attention linker "experts":
I have tried compiling a pascal program using the freepascal 2.2.0 cross-compiler I made and using some updated SDL libraries, including an updated SDL_Mixer that uses libmad and trembor? for no floating-point usage.
At the linking stage I get these errors:
Does this mean I have something in the wrong order in the linking process?Code:C:\devkitGP2X\lib\\libSDL_mixer.a(mp3_mad.o): In function `mad_openFileRW': mp3_mad.c:(.text+0x1c): undefined reference to `mad_stream_init' mp3_mad.c:(.text+0x24): undefined reference to `mad_frame_init' mp3_mad.c:(.text+0x30): undefined reference to `mad_synth_init' mp3_mad.c:(.text+0xa0): undefined reference to `mad_timer_zero' C:\devkitGP2X\lib\\libSDL_mixer.a(mp3_mad.o): In function `mad_closeFile': mp3_mad.c:(.text+0xc4): undefined reference to `mad_stream_finish' mp3_mad.c:(.text+0xcc): undefined reference to `mad_frame_finish' C:\devkitGP2X\lib\\libSDL_mixer.a(mp3_mad.o): In function `read_next_frame': mp3_mad.c:(.text+0x150): undefined reference to `mad_frame_decode' mp3_mad.c:(.text+0x17c): undefined reference to `mad_stream_errorstr' mp3_mad.c:(.text+0x24c): undefined reference to `mad_stream_buffer' mp3_mad.c:(.text+0x260): undefined reference to `mad_frame_decode' mp3_mad.c:(.text+0x28c): undefined reference to `mad_timer_add' mp3_mad.c:(.text+0x2f8): undefined reference to `mad_stream_buffer' C:\devkitGP2X\lib\\libSDL_mixer.a(mp3_mad.o): In function `mad_seek': mp3_mad.c:(.text+0x384): undefined reference to `mad_timer_set' mp3_mad.c:(.text+0x390): undefined reference to `mad_timer_compare' mp3_mad.c:(.text+0x3f4): undefined reference to `mad_timer_compare' mp3_mad.c:(.text+0x444): undefined reference to `mad_timer_zero' C:\devkitGP2X\lib\\libSDL_mixer.a(mp3_mad.o): In function `mad_getSamples': mp3_mad.c:(.text+0x5a8): undefined reference to `mad_synth_frame' C:\devkitGP2X\lib\\libSDL_mixer.a(mp3_mad.o): In function `mad_openFile': mp3_mad.c:(.text+0x820): undefined reference to `mad_stream_init' mp3_mad.c:(.text+0x828): undefined reference to `mad_frame_init' mp3_mad.c:(.text+0x834): undefined reference to `mad_synth_init' mp3_mad.c:(.text+0x8a8): undefined reference to `mad_timer_zero'
My linking line in the batch file:
cheers,Code:arm-linux-ld.exe -static --no-warn-mismatch --reduce-memory-overheads --gc-sections -s -L. -o%1.gpe link.res -lpng -lm -lstdc++ -lgcc_eh -lpthread -lvorbisidec -lmikmod -lpng12 -lz -lSDL -ljpeg -lfreetype -lc -lgcc
Paul.
Games:
Seafox
Pages:
Syntax Error Software
itch.io page
Online Chess
http://gameknot.com/#paul_nicholls
Hi Paul,
Great news!
@libmad
There is a missing library libmad, so add -lmad to your linking line.
@SoftFloat
The default DevKit is compiled with hard float, the linker accept this. But Open2x DevKit is compiled with soft float, in this case, i need soft float units. Soft Float is much faster, cause no raised exception, by using floating point opcode, has to be catched by the system, which needs a lot of cpu cycles.
Cheers,
Thomas
Sorry for my bad language, hope you understand what i'm meaning.
[quote="KidPaddle"]Hi Paul,
Great news!
@libmad
There is a missing library libmad, so add -lmad to your ]
@libmad
Thanks, at least it now compiles!
It does crash though (need to debug)
@softfloat
ok, that makes sense.
Your english is very good BTW
cheers,
Paul.
Games:
Seafox
Pages:
Syntax Error Software
itch.io page
Online Chess
http://gameknot.com/#paul_nicholls
Hi KidPaddle, I finally got the gdb working. It gives me this result
Does this mean anything to you? :-)Code:Program received signal SIGSEGV, Segmentation fault. 0x0006e70c in __pthread_initialize_manager () at ../MPEGerror.h:34 34 ../MPEGerror.h: No such file or directory. in ../MPEGerror.h
cheers,
Paul
Games:
Seafox
Pages:
Syntax Error Software
itch.io page
Online Chess
http://gameknot.com/#paul_nicholls
Hi Paul,
it coud be, that i have seen this error in my life before, but ... i'm not sure.
Cheers,
Thomas
Ok, it has nothing to do with sdl_mixer. It happens, when a timer must be initialized.
This code crashed too.Code:program sdlfpc; {$IFNDEF FPC} {$APPTYPE CONSOLE} {$ENDIF} uses SDL; begin WriteLn('Init Timer'); if (SDL_Init(SDL_INIT_TIMER) < 0) then begin WriteLn(SDL_GetError()); end; WriteLn('SDL_INIT_TIMER Done'); SDL_QUIT; end.
Cheers,
Thomas
Ok, next step on the "try and error" way.
Crashed too, there is something wrong with thread management.Code:uses SDL; var thread: PSDL_Thread; returnValue: Integer; function thread_func(): Integer; begin // do threading here WriteLn('Start Thread'); SDL_Delay(5000); WriteLn('End Thread'); result := 1; // thread leaves and return this value end; begin returnValue := 0; thread := SDL_CreateThread(@thread_func, NIL); SDL_WaitThread(thread, returnValue); WriteLn('Thread returns code ',returnValue); SDL_Quit; WriteLn('ByeBye ;)'); end.
Thomas
Bookmarks