Exemplo n.º 1
0
void ProjectManager::replaceBreakpoint(qint64 const oldPosition, qint64 const newPosition) {
	if(oldPosition != newPosition) {
		removeBreakpoint(oldPosition);
		addBreakpoint(newPosition);
		saved = false;
		emit breakpointsChanged();
	}
}
void BreakpointListView::toggleBreakpoint(const QString& filePath, int line)
{
  BreakpointListViewItem*  item = findBreakpoint(filePath, line);
  if(item) {
    removeBreakpoint(item->breakpoint());
  } else {
    addBreakpoint(filePath, line);
  }
}
Exemplo n.º 3
0
/*
 * native implementation of EmuAddBpt.  Adds an emulator breakpoint
 * at the specified address.
 */
static error_t idaapi idc_emu_addbpt(idc_value_t *argv, idc_value_t *res) {
   res->vtype = VT_LONG;
   if (argv[0].vtype == VT_LONG) {
      unsigned int addr = (unsigned int)argv[0].num;
      addBreakpoint(addr);
      res->num = 1;
   }
   else {
      res->num = 0;
   }
   return eOk;
}
void BreakpointListView::toggleBreakpoint(const KURL& url, int line, bool enabled)
{
  BreakpointListViewItem*  item = findBreakpoint(url, line);
  if(item)
  {
    removeBreakpoint(item->breakpoint());
  }
  else
  {
    addBreakpoint(url, line, enabled);
  }
}
Exemplo n.º 5
0
//=============================================================================
// METHOD    : SPELLbreakpoint::setBreakpoint()
//=============================================================================
bool SPELLbreakpoint::setBreakpoint( const std::string& file,
		                             unsigned int line,
		                             const SPELLbreakpointType type )
{
	if (type == UNKNOWN)
	{
		removeBreakpoint(file,line);
		return false;
	}
	else
	{
		addBreakpoint(file,line,type);
		return true;
	}
}
Exemplo n.º 6
0
static void parseBreakpoint(PluginData* data, const char* res, PDWriter* writer)
{
	Breakpoint* bp = 0;

	// TODO: loop, look for more breakpoints

    const char* breakStrOffset = strstr(res, "BREAK:");

	if (!breakStrOffset) 
		return;

	int id = atoi(breakStrOffset + 7);

    const char* address = strstr(breakStrOffset, "C:$");

	if (!findBreakpointById(data, &bp, id))
	{
		bp = createBreakpoint();
		addBreakpoint(data, bp);
	}

	bp->id = id;

	if (address)
		bp->address = (uint16_t)strtol(address + 3, 0, 16);

	// add data or update existing

	PDWrite_eventBegin(writer, PDEventType_replyBreakpoint);
	PDWrite_u64(writer, "address", bp->address);
	PDWrite_u32(writer, "id", (uint32_t)id);
	PDWrite_eventEnd(writer);

	printf("sending reply back: breakpoint %x - %d\n", bp->address, id);

	// TODO: Condition

	//if (bp->condition)
	//	free(bp->condition);

	//if (condition)
	//	bp->condition = strdup(condition);
	// else
	// bp->condition = 0;
}
Exemplo n.º 7
0
/*!
  Defines the actions used by the BreakpointsTreeView context menu.
  */
void BreakpointsTreeView::createActions()
{
  /* Go to file action */
  mpGotoFileAction = new QAction(QIcon(":/Resources/icons/next.svg"), tr("Go to File"), this);
  mpGotoFileAction->setStatusTip(tr("Goto file location"));
  connect(mpGotoFileAction, SIGNAL(triggered()), SLOT(gotoFile()));
  /* Add breakpoint action */
  mpAddBreakpointAction = new QAction(QIcon(":/Resources/icons/add-icon.svg"), Helper::add, this);
  mpAddBreakpointAction->setStatusTip(tr("Adds a breakpoint"));
  connect(mpAddBreakpointAction, SIGNAL(triggered()), SLOT(addBreakpoint()));
  /* Edit breakpoint action */
  mpEditBreakpointAction = new QAction(QIcon(":/Resources/icons/edit-icon.svg"), Helper::edit, this);
  mpEditBreakpointAction->setStatusTip(tr("Edits a breakpoint"));
  connect(mpEditBreakpointAction, SIGNAL(triggered()), SLOT(editBreakpoint()));
  /* Remove breakpoint action */
  mpDeleteBreakpointAction = new QAction(QIcon(":/Resources/icons/delete.svg"), Helper::deleteStr, this);
  mpDeleteBreakpointAction->setStatusTip(tr("Deletes a breakpoint"));
  connect(mpDeleteBreakpointAction, SIGNAL(triggered()), SLOT(deleteBreakpoint()));
  /* remove all breakpoints action */
  mpDeleteAllBreakpointsAction = new QAction(tr("Delete All"), this);
  mpDeleteAllBreakpointsAction->setStatusTip(tr("Deletes all the breakpoints"));
  connect(mpDeleteAllBreakpointsAction, SIGNAL(triggered()), SLOT(deleteAllBreakpoints()));
}
Exemplo n.º 8
0
void CpuRiscV_Functional::updateDebugPort() {
    CpuContextType *pContext = getpContext();
    DsuMapType::udbg_type::debug_region_type::control_reg ctrl;
    DebugPortTransactionType *trans = dport.trans;
    trans->rdata = 0;
    switch (trans->region) {
    case 0:     // CSR
        trans->rdata = pContext->csr[trans->addr];
        if (trans->write) {
            pContext->csr[trans->addr] = trans->wdata;
        }
        break;
    case 1:     // IRegs
        if (trans->addr < Reg_Total) { 
            trans->rdata = pContext->regs[trans->addr];
            if (trans->write) {
                pContext->regs[trans->addr] = trans->wdata;
            }
        } else if (trans->addr == Reg_Total) {
            /** Read only register */
            trans->rdata = pContext->pc;
        } else if (trans->addr == (Reg_Total + 1)) {
            trans->rdata = pContext->npc;
            if (trans->write) {
                pContext->npc = trans->wdata;
            }
        }
        break;
    case 2:     // Control
        switch (trans->addr) {
        case 0:
            ctrl.val = trans->wdata;
            if (trans->write) {
                if (ctrl.bits.halt) {
                    halt();
                } else if (ctrl.bits.stepping) {
                    step(dport.stepping_mode_steps);
                } else {
                    go();
                }
            } else {
                ctrl.val = 0;
                ctrl.bits.halt = isHalt() ? 1: 0;
                ctrl.bits.core_id = 0;
            }
            trans->rdata = ctrl.val;
            break;
        case 1:
            trans->rdata = dport.stepping_mode_steps;
            if (trans->write) {
                dport.stepping_mode_steps = trans->wdata;
            }
            break;
        case 2:
            trans->rdata = pContext->step_cnt;
            break;
        case 3:
            trans->rdata = pContext->step_cnt;
            break;
        case 4:
            if (trans->write) {
                addBreakpoint(trans->wdata);
            }
            break;
        case 5:
            if (trans->write) {
                removeBreakpoint(trans->wdata);
            }
            break;
        default:;
        }
        break;
    default:;
    }
    dport.cb->nb_response_debug_port(dport.trans);
}