6 #ifndef CDB_DEBUGGER_COMMANDS_H 7 #define CDB_DEBUGGER_COMMANDS_H 22 static wxRegEx reBT1(
_T(
"([0-9]+) ([A-Fa-f0-9]+) ([A-Fa-f0-9]+) ([^[]*)"));
26 static wxRegEx reBT2(
_T(
"\\[(.+)[ \\t]@[ \\t]([0-9]+)\\][ \\t]*"));
38 static wxRegEx reSwitchFrame(
wxT(
"[ \\t]*([0-9]+)[ \\t]([0-9a-z]+)[ \\t](.+)[ \\t]\\[(.+)[ \\t]@[ \\t]([0-9]+)\\][ \\t]*"));
50 m_Cmd <<
_T(
"directory ") << dir;
96 m_Cmd <<
_T(
"add-symbol-file ") << file;
124 m_Cmd <<
_T(
"set args ") << args;
149 for (
unsigned int i = 0; i < lines.
GetCount(); ++i)
156 if (hexID.
ToLong(&pid,16))
187 for (
unsigned int i = 0; i < lines.
GetCount(); ++i)
189 if (lines[i].StartsWith(
_T(
"Attaching")))
194 else if (lines[i].StartsWith(
_T(
"Can't ")))
256 bp->index = m_lastIndex++;
265 if (bp->func.IsEmpty())
269 bp->alreadySet =
true;
280 for (
unsigned int i = 0; i < lines.
GetCount(); ++i)
282 if (lines[i].StartsWith(
_T(
"*** ")))
287 cb::shared_ptr<DebuggerBreakpoint>
m_BP;
290 int CdbCmd_AddBreakpoint::m_lastIndex = 1;
315 cb::shared_ptr<DebuggerBreakpoint>
m_BP;
330 m_watch->GetSymbol(symbol);
339 m_watch->GetSymbol(symbol);
340 wxString const &msg =
wxT(
"Parsing CDB output failed for '") + symbol +
wxT(
"'!");
341 m_watch->SetValue(msg);
406 m_SwitchToFirst(switchToFirst)
423 if (!lines.
GetCount() || !lines[0].Contains(
_T(
"ChildEBP")))
426 bool firstValid =
true;
427 bool sourceValid =
false;
431 for (
unsigned int i = 1; i < lines.
GetCount(); ++i)
453 if (m_SwitchToFirst && sf.
IsValid() && firstValid)
462 if (!firstValid && sourceValid)
493 for (
unsigned ii = 0; ii < lines.
GetCount(); ++ii)
495 if (lines[ii].Contains(
wxT(
"ChildEBP")))
502 if (!line_str.
empty())
546 for (
unsigned int i = 0; i < lines.
GetCount(); ++i)
565 m_Cmd <<
_T(
"uf ") << StopAddress;
578 for (
unsigned int i = 0; i < lines.
GetCount(); ++i)
612 for (
unsigned int i = 0; i < lines.
GetCount(); ++i)
614 if (lines[i].Contains(
_T(
"ChildEBP")))
624 offsetStr.
ToLong(&offset, 16);
625 if (addr != LastAddr)
651 #endif // DEBUGGER_COMMANDS_H wxString AfterLast(wxUniChar ch) const
CdbCmd_AddSymbolFile(DebuggerDriver *driver, const wxString &file)
DLLIMPORT wxArrayString GetArrayFromString(const wxString &text, const wxString &separator=DEFAULT_ARRAY_SEP, bool trimSpaces=true)
static wxRegEx reDisassembly(_T("^[0-9]+[ \+([A-Fa-f0-9]+)[ \+[A-Fa-f0-9]+[ \+(.*)$"))
CdbCmd_Watch(DebuggerDriver *driver, cb::shared_ptr< GDBWatch > const &watch)
Command to remove a breakpoint.
CdbCmd_AttachToProcess(DebuggerDriver *driver, int pid)
void SetCursor(const Cursor &cursor)
Set debugger's cursor.
void NotifyCursorChanged()
Called by implementations to notify cursor changes.
const wxString & GetLine() const
static wxRegEx reProcessInf(_T("id:[ \+([A-Fa-f0-9]+)[ \+create"))
Command to set the arguments to the debuggee.
CdbCmd_AddSourceDir(DebuggerDriver *driver, const wxString &dir)
If dir is empty, resets all search dirs to $cdir:$cwd, the default.
Command to the add symbol files.
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
Base class for all Continue type of commands.
cb::shared_ptr< DebuggerBreakpoint > m_BP
static wxRegEx reBT2(_T("\(.+)[ \]@[ \]([0-9]+)\[ \]*"))
Command to continue execution and notify the debugger plugin.
static wxRegEx reSwitchFrame(wxT("[ \]*([0-9]+)[ \]([0-9a-z]+)[ \](.+)[ \]\(.+)[ \]@[ \]([0-9]+)\[ \]*"))
Command to run a disassembly.
cb::shared_ptr< GDBWatch > m_watch
wxString m_Cmd
the actual command
CdbCmd_DisassemblyInit(DebuggerDriver *driver)
cbCPURegistersDlg * GetCPURegistersDialog()
Returns a pointer to the CPU registers dialog.
bool Matches(const wxString &text, int flags=0) const
static wxRegEx reDisassemblyFunc(_T("^\([A-Fa-f0-9]+)\[ \+"))
void ParseOutput(const wxString &output)
Parses the command's output.
wxString BeforeLast(wxUniChar ch, wxString *rest=NULL) const
void ParseOutput(const wxString &output)
Parses the command's output.
void ParseOutput(const wxString &output)
Parses the command's output.
static wxRegEx reBT1(_T("([0-9]+) ([A-Fa-f0-9]+) ([A-Fa-f0-9]+) ([^[]*)"))
long int line
If -1, no line info.
void Log(const wxString &msg)
wxString AfterFirst(wxUniChar ch) const
CdbCmd_Disassembly(DebuggerDriver *driver, const wxString &StopAddress)
static wxRegEx reWatch(_T("(\0x[A-Fa-f0-9]+ )"))
Command to the set the file to be debugged.
Command to run a backtrace.
const StackFrameContainer & GetStackFrames() const
returns the container with the current backtrace
void SetAddress(uint64_t address)
void LogError(const wxString &msg, int i=app_log)
void ParseOutput(cb_unused const wxString &output)
wxString BeforeFirst(wxUniChar ch, wxString *rest=NULL) const
virtual void ParseOutput(const wxString &output)
Parses the command's output.
void ParseOutput(const wxString &output)
Parses the command's output.
void ParseOutput(const wxString &output)
Parses the command's output.
DebuggerManager * GetDebuggerManager() const
CdbCmd_Continue(DebuggerDriver *driver)
CdbCmd_SetDebuggee(DebuggerDriver *driver, const wxString &file)
Command to find the PID of the active child.
Command to add a search directory for source files in debugger's paths.
cbDisassemblyDlg * GetDisassemblyDialog()
Returns a pointer to the disassembly dialog.
DebuggerCmd(DebuggerDriver *driver, const wxString &cmd=_T(""), bool logToNormalLog=false)
const wxString & GetFilename() const
size_t Replace(const wxString &strOld, const wxString &strNew, bool replaceAll=true)
virtual bool SetActiveAddress(uint64_t addr)=0
void NotifyDebuggeeContinued()
void SetChildPID(long pid)
Set child PID (debuggee's).
CdbCmd_InfoRegisters(DebuggerDriver *driver)
bool GetMatch(size_t *start, size_t *len, size_t index=0) const
virtual void Action()
Executes an action.
LogManager * GetLogManager() const
Command to the attach to a process.
const wxString & GetSymbol() const
virtual void SetRegisterValue(const wxString ®_name, const wxString &hexValue, const wxString &interpreted)=0
CdbCmd_Backtrace(DebuggerDriver *driver, bool switchToFirst)
void QueueCommand(DebuggerCmd *dcmd, QueuePriority prio=Low)
add a command in the queue. The DebuggerCmd will be deleted automatically when finished.
static wxRegEx reDisassemblyFile(_T("[0-9]+[ \+([A-Fa-f0-9]+)[ \+[A-Fa-f0-9]+[ \+(.*)\([A-z]:)(.*) @ ([0-9]+)\"))
void SetNumber(int number)
CdbCmd_Detach(DebuggerDriver *driver)
virtual void Clear(const cbStackFrame &frame)=0
DLLIMPORT uint64_t cbDebuggerStringToAddress(const wxString &address)
Convert a string in hex form to a uint64_t number.
void ParseOutput(const wxString &output)
Parses the command's output.
Command to get info about a watched variable.
Command to run a disassembly.
DLLIMPORT void QuoteStringIfNeeded(wxString &str)
void ParseOutput(const wxString &output)
Parses the command's output.
bool ToLong(long *val, int base=10) const
CdbCmd_SetArguments(DebuggerDriver *driver, const wxString &args)
wxString GetAddressAsString() const
virtual void AddAssemblerLine(uint64_t addr, const wxString &line)=0
cbBacktraceDlg * GetBacktraceDialog()
void ParseOutput(const wxString &output)
Parses the command's output.
void ParseOutput(const wxString &output)
Parses the command's output.
Command to add a breakpoint.
CdbCmd_AddBreakpoint(DebuggerDriver *driver, cb::shared_ptr< DebuggerBreakpoint > bp)
void ParseOutput(const wxString &output)
Parses the command's output.
void MakeValid(bool flag)
void SetFile(const wxString &filename, const wxString &line)
DebuggerDriver * m_pDriver
the driver
bool ParseCDBWatchValue(cb::shared_ptr< GDBWatch > watch, wxString const &value)
CdbCmd_GetPID(DebuggerDriver *driver)
bool StartsWith(const wxString &prefix, wxString *rest=NULL) const
void ParseOutput(const wxString &output)
Parses the command's output.
CdbCmd_RemoveBreakpoint(DebuggerDriver *driver, cb::shared_ptr< DebuggerBreakpoint > bp)
CdbCmd_SwitchFrame(DebuggerDriver *driver, int frameNumber)
void ParseOutput(const wxString &output)
Parses the command's output.
void SetSymbol(const wxString &symbol)
Basic interface for debugger commands.
void ParseOutput(const wxString &output)
Parses the command's output.
static wxString Format(const wxString &format,...)
Command to run a disassembly.
Command to the detach from the process.
cb::shared_ptr< DebuggerBreakpoint > m_BP