Beispiel #1
0
bool Gdb_MI2::SetBreakpoint(const String& filename, int line, const String& bp)
{
	String file = Filter(host->GetHostPath(NormalizePath(filename)), CharFilterReSlash2);
	
	// gets all breakpoints
	MIValue bps = GetBreakpoints();
	
	// line should start from 1...
	line++;
	
	// check wether we've got already a breakpoint here
	// and remove it
	MIValue brk = pick(bps.FindBreakpoint(file, line));
	if(!brk.IsEmpty())
		if(!MICmd(Format("break-delete %s", brk["number"].Get())))
		{
			Exclamation(t_("Couldn't remove breakpoint"));
			return false;
		}
	
	if(bp.IsEmpty())
		return true;
	else if(bp[0] == 0xe)
		return MICmd(Format("break-insert %s:%d", file, line));
	else
		return MICmd(Format("break-insert -c \"%s\" %s:%d", bp, file, line));
}
void
CMLineIndexTable::UpdateBreakpoints()
{
	itsBPList->RemoveAll();
	GetBreakpoints(itsBPList);
	Refresh();
}
Beispiel #3
0
void BreakptMgr::GetAllMemoryBreakpoints(BreakpointInfoVec_t& memoryBps)
{
    BreakpointInfoVec_t allBps; // Start by finding all on the line
    GetBreakpoints(allBps);
    
    for(size_t i=0; i<allBps.size(); i++) {
        BreakpointInfo &bp = allBps.at(i);
        if ( !bp.memory_address.IsEmpty() ) {
            memoryBps.push_back( bp );
        }
    }
}
Beispiel #4
0
int BreakptMgr::DelBreakpointByAddress(const wxString& address)
{
    std::vector<BreakpointInfo> allBps; // Start by finding all on the line
    GetBreakpoints(allBps);
    
    int breakpointsRemoved = 0;
    for(size_t i=0; i<allBps.size(); i++) {
        BreakpointInfo &bp = allBps.at(i);
        if ( bp.memory_address == address ) {
            int bpId = (bp.debugger_id == -1 ? bp.internal_id : bp.debugger_id );

            if(bpId == wxID_CANCEL || bpId == BP_type_none)
                continue;

            if( DelBreakpoint(bpId) ) {
                breakpointsRemoved++;
            }
        }
    }
    return breakpointsRemoved;
}