X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=debugger%2Fmcs51%2Fbreak.c;h=ea19450fa2ed503066ca82f1b769184aa7b2eadc;hb=6c78bc0cba530b6d01daaedcbb327a1f06013c27;hp=0637661932aaf1ad4edf63fe4384114dfa1cd90a;hpb=f3a44fc094dc5ce393e2029d3c7c6587a4b1a835;p=fw%2Fsdcc diff --git a/debugger/mcs51/break.c b/debugger/mcs51/break.c index 06376619..ea19450f 100644 --- a/debugger/mcs51/break.c +++ b/debugger/mcs51/break.c @@ -31,9 +31,6 @@ hTab *bptable = NULL; char doingSteps = 0; char userBpPresent = 0; -/* call stack can be 1024 deep */ -STACK_DCL(callStack,function *,1024); - #ifdef SDCDB_DEBUG char *debug_bp_type_strings[] = {"ERR-0", @@ -111,14 +108,11 @@ int setBreakPoint (unsigned addr, char addrType, char bpType, userBpPresent++; } - if (bpType != STEP && bpType != NEXT) - { - /* if a break point does not already exist then - send command to simulator to add one */ - if (!hTabSearch(bptable,addr)) - /* send the break command to the simulator */ - simSetBP (addr); - } + /* if a break point does not already exist then + send command to simulator to add one */ + if (!hTabSearch(bptable,addr)) + /* send the break command to the simulator */ + simSetBP (addr); /* now add the break point to list */ hTabAddItem(&bptable,addr,bp); @@ -143,6 +137,7 @@ void deleteSTEPbp () /* if this is a step then delete */ if (bp->bpType == STEP) { + simClearBP(bp->addr); hTabDeleteItem(&bptable,bp->addr,bp,DELETE_ITEM,NULL); Safe_free(bp); } @@ -421,59 +416,6 @@ int dispatchCB (unsigned addr, context *ctxt) return rv; } -/*-----------------------------------------------------------------*/ -/* fentryCB - callback function for function entry */ -/*-----------------------------------------------------------------*/ -BP_CALLBACK(fentryCB) -{ - function *func; - - /* we save the value of SP - which will be used to display the value of local variables - and parameters on the stack */ - ctxt->func->stkaddr = simGetValue (0x81,'I',1); - - Dprintf(D_break, ("break: fentryCB: BP_CALLBACK entry %s sp=0x%02x %p\n", - ctxt->func->sym->name, - ctxt->func->stkaddr, p_callStack)); - - /* and set laddr of calling function to return addr from stack */ - if ((func = STACK_PEEK(callStack))) - { - /* extern stack ?? 'A' */ - func->laddr = simGetValue (ctxt->func->stkaddr-1,'B',2); - } - /* add the current function into the call stack */ - STACK_PUSH(callStack,ctxt->func); - - return 0; -} - -/*-----------------------------------------------------------------*/ -/* fexitCB - call back for function exit */ -/*-----------------------------------------------------------------*/ -BP_CALLBACK(fexitCB) -{ - function *func; - /* pop the top most from the call stack */ - func = STACK_POP(callStack); - - if (!func) - { - fprintf(stdout, "Stack underflow\n"); - return 1; - } - - Dprintf(D_break, ("break: fexitCB: BP_CALLBACK entry %s %p\n", func->sym->name, p_callStack)); - - /* check main function */ - if ( !strcmp(func->sym->name, "main")) - { - fprintf(stdout, "Program exited with code %lu.\n", simGetValue (0x82,'I',2)); - return 1; - } - return 0; -} /*-----------------------------------------------------------------*/ /* userBpCB - call back function for user break points */ /*-----------------------------------------------------------------*/