[Gambas-devel] System error... (42)

Benoît Minisini gambas at ...1...
Fri Dec 31 14:40:16 CET 2010


> Benoît,
> 
> trying to debug this problem, but if I follow your instructions, I get
> this right away.. are you sure they are correct?
> 
> on at ...218...:~/domotiga/DomotiGaServer$ gdb gbx2
> GNU gdb (GDB) 7.1-ubuntu
> Copyright (C) 2010 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html> This is free software: you are free to
> change and redistribute it. There is NO WARRANTY, to the extent permitted
> by law.  Type "show copying" and "show warranty" for details.
> This GDB was configured as "i486-linux-gnu".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from /usr/local/bin/gbx2...done.
> (gdb) break THROW
> Breakpoint 1 at 0x804be2e: file gb_error.c, line 273.
> (gdb) run
> Starting program: /usr/local/bin/gbx2
> [Thread debugging using libthread_db enabled]
> 
> Breakpoint 1, THROW (code=13) at gb_error.c:273
> 273	void THROW(int code, ...)
> (gdb) bt
> #0  THROW (code=13) at gb_error.c:273
> #1  0x08057162 in get_stream (value=0x807fad0, can_default=<value
> optimized out>) at gbx_subr_file.c:146
> #2  0x0805717c in SUBR_close () at gbx_subr_file.c:187
> #3  0x0806b0f3 in EXEC_loop () at gbx_exec_loop.c:476
> #4  0x0804f533 in EXEC_function_loop () at gbx_exec.c:703
> #5  0x0804f809 in EXEC_function_real () at gbx_exec.c:690
> #6  0x08061c29 in main (argc=134739048, argv=0xbffff544) at gbx.c:349
> 
> I guess it stops at every error now, even known ones...
> 
> Regards,
> Ron_2nd.
> 

This is not your error (42). THROW is raised a lot of time, but you may not 
see it because a TRY or a CATCH can intercept it, or because the interpreter 
internally catches it.

To catch only system errors. Add that to the THROW() function, in gb_error.c, 
at line 278:

	if (code == 42) BREAKPOINT();

Compile and install again.

Then run your program into gdb until it stops at that line.

Once done, don't forget to remove that line, otherwise your program will stop 
at that line even outside of the debugger.

Regards,





-- 
Benoît Minisini




More information about the Devel mailing list