The problem is that i don't know how to set a breakpoint. Can you tell me how to do it?Flumminator wrote:Obvious errors like this one can (and should) easily be detected during compilation.
Why not set a breakpoint on 'Error'?
Can't start sdl version
Moderators: Flumminator, Zomis
Code: Select all
lxuser@localhost lxuser $ rocksndiamonds.sdl -v
rocksndiamonds.sdl: warning: cannot open configuration file '/home/lxuser/.rocksndiamonds/editorsetup.conf'
rocksndiamonds.sdl: gadget incomplete (missing Bitmap)
rocksndiamonds.sdl: aborting
[No idea why I posted my last post as "Guest". Probably I logged out without noticing... ;-) ]
> Obvious errors like this one can (and should) easily be detected during compilation.
Yes, that's right of course. But I think it should only generate a warning, but not an error, as it is a semantical error, but not a syntactical error. (And strictly speaking not even a semantical error...) But compiler creators probably know better -- until now, it was just an easy way to get a stack trace if the target audience may have no deeper knowledge on debugger handling...
> Why not set a breakpoint on 'Error'?
For developers, this would be the obvious thing to do, yes. :-)
> There is no editorsetup.conf on my entire hd.
That's no problem -- if there's no editorsetup, then reliable defaults are used. Therefore, only a warning is generated. (Probably this should better be "info" log level rather than "warning" ...)
> Obvious errors like this one can (and should) easily be detected during compilation.
Yes, that's right of course. But I think it should only generate a warning, but not an error, as it is a semantical error, but not a syntactical error. (And strictly speaking not even a semantical error...) But compiler creators probably know better -- until now, it was just an easy way to get a stack trace if the target audience may have no deeper knowledge on debugger handling...
> Why not set a breakpoint on 'Error'?
For developers, this would be the obvious thing to do, yes. :-)
> There is no editorsetup.conf on my entire hd.
That's no problem -- if there's no editorsetup, then reliable defaults are used. Therefore, only a warning is generated. (Probably this should better be "info" log level rather than "warning" ...)
> Tell me how to set a breakpoint.
First make sure that R'n'D was compiled with the "-g" switch to include debugging symbols in the program binary. To achieve this, go to the R'n'D base directory and change the line "# DEBUG = -DDEBUG -g" in "src/Makefile" to "DEBUG = -DDEBUG -g". Then type "make clean; make sdl". This should recompile the game, but now with debugging symbols.
Run R'n'D in "gdb", the GNU debugger, by starting it with "gdb ./rocksndiamonds" in the R'n'D directory. Set the breakpoint by typing the following: "break gadgets.c:992". Then run the game, by typing "run -v". (The "-v" is just the R'n'D "verbose messages" switch.)
Instead of terminating, the debugger should stop at that line. Now you can type "bt" to get the program stack backtrace.
First make sure that R'n'D was compiled with the "-g" switch to include debugging symbols in the program binary. To achieve this, go to the R'n'D base directory and change the line "# DEBUG = -DDEBUG -g" in "src/Makefile" to "DEBUG = -DDEBUG -g". Then type "make clean; make sdl". This should recompile the game, but now with debugging symbols.
Run R'n'D in "gdb", the GNU debugger, by starting it with "gdb ./rocksndiamonds" in the R'n'D directory. Set the breakpoint by typing the following: "break gadgets.c:992". Then run the game, by typing "run -v". (The "-v" is just the R'n'D "verbose messages" switch.)
Instead of terminating, the debugger should stop at that line. Now you can type "bt" to get the program stack backtrace.
> This is weird, now i compile without uncommentig the debug line and it works, don't know
> what i did.
So you haven't changed the "src/Makefile" at all, but just recompiled by "make clean; make sdl"?
That's strange -- but I'm glad to hear that it works now.
> At least i've learnt how to set a breakpoint.
:-)
> what i did.
So you haven't changed the "src/Makefile" at all, but just recompiled by "make clean; make sdl"?
That's strange -- but I'm glad to hear that it works now.
> At least i've learnt how to set a breakpoint.
:-)
I can't strat too. WINDOWS Version 3.10, unpacked from zip archive. If I try to start it, i got this:
C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: warning: cannot open configuration file 'C:\My Documents/Rocks'n'Diamonds/setup.conf'
C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: warning: using default setup values
C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: SDL_DisplayFormat() failed: Out of memory
C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: aborting
HOW TO START???
C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: warning: cannot open configuration file 'C:\My Documents/Rocks'n'Diamonds/setup.conf'
C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: warning: using default setup values
C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: SDL_DisplayFormat() failed: Out of memory
C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: aborting
HOW TO START???
> C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: warning: cannot open
> configuration file 'C:\My Documents/Rocks'n'Diamonds/setup.conf'
> C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: warning: using default setup values
These warnings can safely be ignored.
> C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: SDL_DisplayFormat() failed: Out of memory
> C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: aborting
Here we have the reason why you cannot start R'n'D: You ran out of free memory!
How much memory (RAM) have you installed on your computer?
> configuration file 'C:\My Documents/Rocks'n'Diamonds/setup.conf'
> C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: warning: using default setup values
These warnings can safely be ignored.
> C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: SDL_DisplayFormat() failed: Out of memory
> C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: aborting
Here we have the reason why you cannot start R'n'D: You ran out of free memory!
How much memory (RAM) have you installed on your computer?
> FREE??? But where I can see free memory, not full?
You mean there is no way to view the currently used and free memory under Windows???
What about the task manager? I think it also shows the memory usage of each process...
Besides that, the SDL version of R'n'D (and therefore the Windows version) seems to eat up quite some memory -- when loading the BD2K3 level set, it uses nearly 100 MB memory (which is also strange to me). When not loading sets with custom artwork, it needs something around 30-40 MB, which should work fine on your system.
You can make R'n'D use less memory for graphics by using 16 bit color depth instead of 32 bit color depth on the desktop, btw...
But it seems that I should further investigate the memory hunger of R'n'D...
You mean there is no way to view the currently used and free memory under Windows???
What about the task manager? I think it also shows the memory usage of each process...
Besides that, the SDL version of R'n'D (and therefore the Windows version) seems to eat up quite some memory -- when loading the BD2K3 level set, it uses nearly 100 MB memory (which is also strange to me). When not loading sets with custom artwork, it needs something around 30-40 MB, which should work fine on your system.
You can make R'n'D use less memory for graphics by using 16 bit color depth instead of 32 bit color depth on the desktop, btw...
But it seems that I should further investigate the memory hunger of R'n'D...