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",
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);
/* 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);
}
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 */
/*-----------------------------------------------------------------*/