bool DebuggerShell::clearBreakpoint(const std::string& file, int line) { intptr_t sourceID; if (!resolveFileName(file, &sourceID)) { return false; } return breakpoints_.erase(SourceLine(sourceID, line)) != 0; }
bool DebuggerShell::setBreakpoint(const std::string& file, int line) { intptr_t sourceID; if (!resolveFileName(file, &sourceID)) { return false; } breakpoints_.insert(SourceLine(sourceID, line)); return true; }
bool DebuggerShell::currentlyOnBreakpoint() { // check to see if this line has a breakpoint set. BTFrame& current_frame = backtrace_.back(); BreakpointSet::iterator it = breakpoints_.find(SourceLine(current_frame.sourceID, current_frame.lineNumber)); if (it != breakpoints_.end()) { return true; } return false; }
void GpsimDebugger::associateLine( const QString & sourceFile, int sourceLine, const QString & assemblyFile, int assemblyLine ) { if ( assemblyLine < 0 || sourceLine < 0 ) { qWarning() << "Invalid lines: assemblyLine="<<assemblyLine<<" sourceLine="<<sourceLine<<endl; return; } SourceLine hllSource = SourceLine( sourceFile, sourceLine ); SourceLine asmSource = SourceLine( assemblyFile, assemblyLine ); if ( m_sourceLineMap.contains(asmSource) ) { qWarning() << "Already have an association for assembly (\""<<assemblyFile<<"\","<<assemblyLine<<")"<<endl; return; } m_sourceLineMap[asmSource] = hllSource; }
std::string SourceLocation::position() const { std::string position(source_file_->filename()); SourceFile::Position pos; SourceLine(&pos); position.push_back(':'); position.append(std::to_string(pos.line)); position.push_back(':'); position.append(std::to_string(pos.column)); return position; }
SourceLine GpsimDebugger::currentLine() { DebugLine * dl = currentDebugLine(); return dl ? *dl : SourceLine(); }