[INTERPRETER]

* BUG: Forbid continuing and stay in debugger when an unhandled error is raised. This prevent crashes when an error occurs during variable initialization.


git-svn-id: svn://localhost/gambas/trunk@8031 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2016-12-31 12:02:58 +00:00
parent 4e887b93b3
commit c4d22f9d24
4 changed files with 16 additions and 13 deletions

View File

@ -1014,24 +1014,33 @@ void EXEC_function_loop()
if (EXEC_debug && !STACK_has_error_handler())
{
ERROR_hook();
DEBUG.Main(TRUE);
for(;;)
DEBUG.Main(TRUE);
if (TP && TC)
/*if (TP && TC)
{
ERROR_lock();
while (BP > TP)
{
EXEC_leave_drop();
if (!PC)
STACK_pop_frame(&EXEC_current);
break;
}
while (SP > TP)
POP();
if (!PC)
{
ERROR_unlock();
STACK_pop_frame(&EXEC_current);
PROPAGATE();
}
POP();
PC = TC;
ERROR_unlock();
}
retry = TRUE;
retry = TRUE;*/
}
else
{

View File

@ -139,10 +139,6 @@ extern EXEC_GLOBAL EXEC;
#define EC EXEC_current.ec
// Save register for TRY
#define ET EXEC_current.et
// Last break in the function
#define TC EXEC_current.tc
// Stack at the last break in the function
#define TP EXEC_current.tp
// GoSub stack
#define GP EXEC_current.gp

View File

@ -3748,8 +3748,8 @@ static void _break(ushort code)
{
if (EXEC_debug)
{
TC = PC + 1;
TP = SP;
/*TC = PC + 1;
TP = SP;*/
//fprintf(stderr, "%s\n", DEBUG_get_current_position());

View File

@ -49,8 +49,6 @@ typedef
PCODE *pc; // instruction
PCODE *ec; // instruction if error
PCODE *et; // TRY save
PCODE *tc; // Last break in the function
VALUE *tp; // Stack at the last break in the function
VALUE *gp; // GOSUB stack pointer
}
STACK_CONTEXT;