Code::Blocks  SVN r11506
cdb_commands.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
3  * http://www.gnu.org/licenses/gpl-3.0.html
4  */
5 
6 #ifndef CDB_DEBUGGER_COMMANDS_H
7 #define CDB_DEBUGGER_COMMANDS_H
8 
9 #include <wx/string.h>
10 #include <wx/regex.h>
11 #include <wx/tipwin.h>
12 #include <globals.h>
13 #include <manager.h>
14 #include <cbdebugger_interfaces.h>
15 #include "debugger_defs.h"
16 #include "debuggergdb.h"
17 #include "debuggermanager.h"
18 #include "parsewatchvalue.h"
19 
20 static wxRegEx reProcessInf(_T("id:[ \t]+([A-Fa-f0-9]+)[ \t]+create"));
21 static wxRegEx reWatch(_T("(\\+0x[A-Fa-f0-9]+ )"));
22 static wxRegEx reBT1(_T("([0-9]+) ([A-Fa-f0-9]+) ([A-Fa-f0-9]+) ([^[]*)"));
23 
24 // Match lines like:
25 // 0018ff38 004013ef dbgtest!main+0x3 [main.cpp @ 8]
26 static wxRegEx reBT2(_T("\\[(.+)[ \\t]@[ \\t]([0-9]+)\\][ \\t]*"));
27 
28 // 15 00401020 55 push ebp
29 // 61 004010f9 ff15dcc24000 call dword ptr [Win32GUI!_imp__GetMessageA (0040c2dc)]
30 // 71 0040111f c21000 ret 0x10
31 static wxRegEx reDisassembly(_T("^[0-9]+[ \t]+([A-Fa-f0-9]+)[ \t]+[A-Fa-f0-9]+[ \t]+(.*)$"));
32 // # ChildEBP RetAddr
33 // 00 0012fe98 00401426 Win32GUI!WinMain+0x89 [c:\devel\tmp\win32 test\main.cpp @ 55]
34 static wxRegEx reDisassemblyFile(_T("[0-9]+[ \t]+([A-Fa-f0-9]+)[ \t]+[A-Fa-f0-9]+[ \t]+(.*)\\[([A-z]:)(.*) @ ([0-9]+)\\]"));
35 static wxRegEx reDisassemblyFunc(_T("^\\(([A-Fa-f0-9]+)\\)[ \t]+"));
36 
37 // 01 0012ff68 00404168 cdb_test!main+0xae [c:\dev\projects\tests\cdb_test\main.cpp @ 21]
38 static wxRegEx reSwitchFrame(wxT("[ \\t]*([0-9]+)[ \\t]([0-9a-z]+)[ \\t](.+)[ \\t]\\[(.+)[ \\t]@[ \\t]([0-9]+)\\][ \\t]*"));
39 
44 {
45  public:
48  : DebuggerCmd(driver)
49  {
50  m_Cmd << _T("directory ") << dir;
51  }
52  void ParseOutput(const wxString& output)
53  {
54  // Output:
55  // Warning: C:\Devel\tmp\console\111: No such file or directory.
56  // Source directories searched: <dir>;$cdir;$cwd
57  if (output.StartsWith(_T("Warning: ")))
58  m_pDriver->Log(output.BeforeFirst(_T('\n')));
59  }
60 };
61 
66 {
67  public:
70  : DebuggerCmd(driver)
71  {
72  m_Cmd << _T("file ") << file;
73  }
74  void ParseOutput(const wxString& output)
75  {
76  // Output:
77  // Reading symbols from C:\Devel\tmp\console/console.exe...done.
78  // or if it doesn't exist:
79  // console.exe: No such file or directory.
80 
81  // just log everything before the prompt
82  m_pDriver->Log(output.BeforeFirst(_T('\n')));
83  }
84 };
85 
90 {
91  public:
94  : DebuggerCmd(driver)
95  {
96  m_Cmd << _T("add-symbol-file ") << file;
97  }
98  void ParseOutput(const wxString& output)
99  {
100  // Output:
101  //
102  // add symbol table from file "console.exe" at
103  // Reading symbols from C:\Devel\tmp\console/console.exe...done.
104  //
105  // or if it doesn't exist:
106  // add symbol table from file "console.exe" at
107  // console.exe: No such file or directory.
108 
109  // just ignore the "add symbol" line and log the rest before the prompt
110  m_pDriver->Log(output.AfterFirst(_T('\n')).BeforeLast(_T('\n')));
111  }
112 };
113 
118 {
119  public:
122  : DebuggerCmd(driver)
123  {
124  m_Cmd << _T("set args ") << args;
125  }
126  void ParseOutput(cb_unused const wxString& output)
127  {
128  // No output
129  }
130 };
131 
136 {
137  public:
140  : DebuggerCmd(driver)
141  {
142  m_Cmd << _T("|.");
143  }
144  void ParseOutput(const wxString& output)
145  {
146  // Output:
147  // <decimal process num> id: <hex PID> create name: <process name>
148  wxArrayString lines = GetArrayFromString(output, _T('\n'));
149  for (unsigned int i = 0; i < lines.GetCount(); ++i)
150  {
151  if (reProcessInf.Matches(lines[i]))
152  {
153  wxString hexID = reProcessInf.GetMatch(lines[i],1);
154 
155  long pid;
156  if (hexID.ToLong(&pid,16))
157  {
158  m_pDriver->SetChildPID(pid);
159  }
160  }
161  }
162  }
163 };
164 
169 {
170  private:
171  int m_pid;
172  public:
175  : DebuggerCmd(driver),
176  m_pid(pid)
177  {
178  m_Cmd << _T("attach ") << wxString::Format(_T("%d"), pid);
179  }
180  void ParseOutput(const wxString& output)
181  {
182  // Output:
183  // Attaching to process <pid>
184  // or,
185  // Can't attach to process.
186  wxArrayString lines = GetArrayFromString(output, _T('\n'));
187  for (unsigned int i = 0; i < lines.GetCount(); ++i)
188  {
189  if (lines[i].StartsWith(_T("Attaching")))
190  {
191  m_pDriver->Log(lines[i]);
192  m_pDriver->SetChildPID(m_pid);
193  }
194  else if (lines[i].StartsWith(_T("Can't ")))
195  {
196  // log this and quit debugging
197  m_pDriver->Log(lines[i]);
199  }
200 // m_pDriver->DebugLog(lines[i]);
201  }
202  }
203 };
204 
209 {
210  public:
213  : DebuggerCmd(driver)
214  {
215  m_Cmd << _T(".detach");
216  }
217  void ParseOutput(const wxString& output)
218  {
219  // output any return, usually "Detached"
220  m_pDriver->Log(output);
221  }
222 };
223 
228 {
229  public:
232  : DebuggerContinueBaseCmd(driver,_T("g"))
233  {
234  }
235  virtual void Action()
236  {
238  }
239 };
240 
245 {
246  static int m_lastIndex;
247  public:
249  CdbCmd_AddBreakpoint(DebuggerDriver* driver, cb::shared_ptr<DebuggerBreakpoint> bp)
250  : DebuggerCmd(driver),
251  m_BP(bp)
252  {
253  if (bp->enabled)
254  {
255  if (bp->index==-1)
256  bp->index = m_lastIndex++;
257 
258  wxString out = m_BP->filename;
259 // DebuggerGDB::ConvertToGDBFile(out);
260  QuoteStringIfNeeded(out);
261  // we add one to line, because scintilla uses 0-based line numbers, while cdb uses 1-based
262  m_Cmd << _T("bu") << wxString::Format(_T("%ld"), (int) bp->index) << _T(' ');
263  if (m_BP->temporary)
264  m_Cmd << _T("/1 ");
265  if (bp->func.IsEmpty())
266  m_Cmd << _T('`') << out << _T(":") << wxString::Format(_T("%d"), bp->line) << _T('`');
267  else
268  m_Cmd << bp->func;
269  bp->alreadySet = true;
270  }
271  }
272  void ParseOutput(const wxString& output)
273  {
274  // possible outputs (only output lines starting with ***):
275  //
276  // *** WARNING: Unable to verify checksum for Win32GUI.exe
277  // *** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\WINDOWS\system32\USER32.dll -
278  // *** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\WINDOWS\system32\GDI32.dll -
279  wxArrayString lines = GetArrayFromString(output, _T('\n'));
280  for (unsigned int i = 0; i < lines.GetCount(); ++i)
281  {
282  if (lines[i].StartsWith(_T("*** ")))
283  m_pDriver->Log(lines[i]);
284  }
285  }
286 
287  cb::shared_ptr<DebuggerBreakpoint> m_BP;
288 };
289 
290 int CdbCmd_AddBreakpoint::m_lastIndex = 1;
291 
296 {
297  public:
299  CdbCmd_RemoveBreakpoint(DebuggerDriver* driver, cb::shared_ptr<DebuggerBreakpoint> bp)
300  : DebuggerCmd(driver),
301  m_BP(bp)
302  {
303  if (!bp)
304  m_Cmd << _T("bc *");
305  else
306  m_Cmd << _T("bc ") << wxString::Format(_T("%d"), (int) bp->index);
307  }
308  void ParseOutput(const wxString& output)
309  {
310  // usually no output, so display whatever comes in
311  if (!output.IsEmpty())
312  m_pDriver->Log(output);
313  }
314 
315  cb::shared_ptr<DebuggerBreakpoint> m_BP;
316 };
317 
321 class CdbCmd_Watch : public DebuggerCmd
322 {
323  cb::shared_ptr<GDBWatch> m_watch;
324  public:
325  CdbCmd_Watch(DebuggerDriver* driver, cb::shared_ptr<GDBWatch> const &watch)
326  : DebuggerCmd(driver),
327  m_watch(watch)
328  {
329  wxString symbol;
330  m_watch->GetSymbol(symbol);
331  m_Cmd << wxT("?? ") << symbol;
332  }
333 
334  void ParseOutput(const wxString& output)
335  {
336  if(!ParseCDBWatchValue(m_watch, output))
337  {
338  wxString symbol;
339  m_watch->GetSymbol(symbol);
340  wxString const &msg = wxT("Parsing CDB output failed for '") + symbol + wxT("'!");
341  m_watch->SetValue(msg);
343  }
344  }
345 };
346 
351 {
355  public:
360  CdbCmd_TooltipEvaluation(DebuggerDriver* driver, const wxString& what, const wxRect& tiprect)
361  : DebuggerCmd(driver),
362  m_pWin(0),
363  m_WinRect(tiprect),
364  m_What(what)
365  {
366  m_Cmd << _T("?? ") << what;
367  }
368  void ParseOutput(const wxString& output)
369  {
370 // struct HWND__ * 0x7ffd8000
371 //
372 // struct tagWNDCLASSEXA
373 // +0x000 cbSize : 0x7c8021b5
374 // +0x004 style : 0x7c802011
375 // +0x008 lpfnWndProc : 0x7c80b529 kernel32!GetModuleHandleA+0
376 // +0x00c cbClsExtra : 0
377 // +0x010 cbWndExtra : 2147319808
378 // +0x014 hInstance : 0x00400000
379 // +0x018 hIcon : 0x0012fe88
380 // +0x01c hCursor : 0x0040a104
381 // +0x020 hbrBackground : 0x689fa962
382 // +0x024 lpszMenuName : 0x004028ae "???"
383 // +0x028 lpszClassName : 0x0040aa30 "CodeBlocksWindowsApp"
384 // +0x02c hIconSm : (null)
385 //
386 // char * 0x0040aa30
387 // "CodeBlocksWindowsApp"
388  wxString tip = m_What + _T("=") + output;
389 
390  if (m_pWin)
391  (m_pWin)->Destroy();
392  m_pWin = new wxTipWindow((wxWindow*)Manager::Get()->GetAppWindow(), tip, 640, &m_pWin, &m_WinRect);
393 // m_pDriver->DebugLog(output);
394  }
395 };
396 
401 {
402  public:
404  CdbCmd_Backtrace(DebuggerDriver* driver, bool switchToFirst)
405  : DebuggerCmd(driver),
406  m_SwitchToFirst(switchToFirst)
407  {
408  m_Cmd << _T("k n");
409  }
410  void ParseOutput(const wxString& output)
411  {
412  // output is:
413  // # ChildEBP RetAddr
414  // 00 0012fe98 00401426 Win32GUI!WinMain+0x89 [c:\devel\tmp\win32 test\main.cpp @ 55]
415  // 00 0012fe98 00401426 Win32GUI!WinMain+0x89
416  //
417  // so we have a two-steps process:
418  // 1) Get match for the second version (without file/line info)
419  // 2) See if we have file/line info and read it
420  m_pDriver->GetStackFrames().clear();
421 
422  wxArrayString lines = GetArrayFromString(output, _T('\n'));
423  if (!lines.GetCount() || !lines[0].Contains(_T("ChildEBP")))
424  return;
425 
426  bool firstValid = true;
427  bool sourceValid = false;
428  cbStackFrame frameToSwitch;
429 
430  // start from line 1
431  for (unsigned int i = 1; i < lines.GetCount(); ++i)
432  {
433  if (reBT1.Matches(lines[i]))
434  {
435  cbStackFrame sf;
436  sf.MakeValid(true);
437 
438  long int number;
439  reBT1.GetMatch(lines[i], 1).ToLong(&number);
440 
441  sf.SetNumber(number);
443  sf.SetSymbol(reBT1.GetMatch(lines[i], 4));
444  // do we have file/line info?
445  if (reBT2.Matches(lines[i]))
446  {
447  sf.SetFile(reBT2.GetMatch(lines[i], 1), reBT2.GetMatch(lines[i], 2));
448  if (firstValid)
449  sourceValid = true;
450  }
451  m_pDriver->GetStackFrames().push_back(cb::shared_ptr<cbStackFrame>(new cbStackFrame(sf)));
452 
453  if (m_SwitchToFirst && sf.IsValid() && firstValid)
454  {
455  firstValid = false;
456  frameToSwitch = sf;
457  }
458  }
459  }
461 
462  if (!firstValid && sourceValid)
463  {
464  Cursor cursor;
465  cursor.file = frameToSwitch.GetFilename();
466  frameToSwitch.GetLine().ToLong(&cursor.line);
467  cursor.address = frameToSwitch.GetAddressAsString();
468  cursor.changed = true;
469  m_pDriver->SetCursor(cursor);
471  }
472  }
473  private:
475 };
476 
478 {
479  public:
480  CdbCmd_SwitchFrame(DebuggerDriver *driver, int frameNumber) :
481  DebuggerCmd(driver)
482  {
483  if (frameNumber < 0)
484  m_Cmd = wxT("k n 1");
485  else
486  m_Cmd = wxString::Format(wxT(".frame %d"), frameNumber);
487  }
488 
489  virtual void ParseOutput(const wxString& output)
490  {
491  wxArrayString lines = GetArrayFromString(output, wxT('\n'));
492 
493  for (unsigned ii = 0; ii < lines.GetCount(); ++ii)
494  {
495  if (lines[ii].Contains(wxT("ChildEBP")))
496  continue;
497  else if (reSwitchFrame.Matches(lines[ii]))
498  {
499  Cursor cursor;
500  cursor.file = reSwitchFrame.GetMatch(lines[ii], 4);
501  wxString const &line_str = reSwitchFrame.GetMatch(lines[ii], 5);
502  if (!line_str.empty())
503  line_str.ToLong(&cursor.line);
504  else
505  cursor.line = -1;
506 
507  cursor.address = reSwitchFrame.GetMatch(lines[ii], 1);
508  cursor.changed = true;
509  m_pDriver->SetCursor(cursor);
512  break;
513  }
514  else
515  break;
516  }
517  }
518 };
519 
524 {
525  public:
528  : DebuggerCmd(driver)
529  {
530  m_Cmd << _T("r");
531  }
532  void ParseOutput(const wxString& output)
533  {
534  // output is:
535  //
536  // eax=00400000 ebx=7ffd9000 ecx=00000065 edx=7c97e4c0 esi=00000000 edi=7c80b529
537  // eip=0040102c esp=0012fe48 ebp=0012fe98 iopl=0 nv up ei pl nz na po nc
538  // cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000206
539 
541 
542  wxString tmp = output;
543  while (tmp.Replace(_T("\n"), _T(" ")))
544  ;
545  wxArrayString lines = GetArrayFromString(tmp, _T(' '));
546  for (unsigned int i = 0; i < lines.GetCount(); ++i)
547  {
548  wxString reg = lines[i].BeforeFirst(_T('='));
549  wxString addr = lines[i].AfterFirst(_T('='));
550  if (!reg.IsEmpty() && !addr.IsEmpty())
551  dialog->SetRegisterValue(reg, addr, wxEmptyString);
552  }
553  }
554 };
555 
560 {
561  public:
562  CdbCmd_Disassembly(DebuggerDriver* driver, const wxString& StopAddress)
563  : DebuggerCmd(driver)
564  {
565  m_Cmd << _T("uf ") << StopAddress;
566  }
567  void ParseOutput(const wxString& output)
568  {
569  // output is a series of:
570  //
571  // Win32GUI!WinMain [c:\devel\tmp\win32 test\main.cpp @ 15]:
572  // 15 00401020 55 push ebp
573  // ...
574 
576 
577  wxArrayString lines = GetArrayFromString(output, _T('\n'));
578  for (unsigned int i = 0; i < lines.GetCount(); ++i)
579  {
580  if (reDisassembly.Matches(lines[i]))
581  {
582  uint64_t addr = cbDebuggerStringToAddress(reDisassembly.GetMatch(lines[i], 1));
583  dialog->AddAssemblerLine(addr, reDisassembly.GetMatch(lines[i], 2));
584  }
585  }
586 // m_pDlg->Show(true);
587 // m_pDriver->DebugLog(output);
588  }
589 };
590 
595 {
597  public:
599  : DebuggerCmd(driver)
600  {
601  // print stack frame and nearest symbol (start of function)
602  m_Cmd << _T("k n 1; ln");
603  }
604  void ParseOutput(const wxString& output)
605  {
606 // m_pDriver->QueueCommand(new CdbCmd_Disassembly(m_pDriver, m_pDlg, StopAddress)); // chain call
607 
609 
610  long int offset = 0;
611  wxArrayString lines = GetArrayFromString(output, _T('\n'));
612  for (unsigned int i = 0; i < lines.GetCount(); ++i)
613  {
614  if (lines[i].Contains(_T("ChildEBP")))
615  {
616  if (reDisassemblyFile.Matches(lines[i + 1]))
617  {
618  ++i; // we 're interested in the next line
619  cbStackFrame sf;
620  wxString addr = reDisassemblyFile.GetMatch(lines[i], 1);
621  sf.SetSymbol(reDisassemblyFile.GetMatch(lines[i], 2));
622  wxString offsetStr = sf.GetSymbol().AfterLast(_T('+'));
623  if (!offsetStr.IsEmpty())
624  offsetStr.ToLong(&offset, 16);
625  if (addr != LastAddr)
626  {
627  LastAddr = addr;
629  sf.MakeValid(true);
630  dialog->Clear(sf);
631  m_pDriver->QueueCommand(new CdbCmd_Disassembly(m_pDriver, sf.GetSymbol())); // chain call
632 // break;
633  }
634  }
635  }
636  else
637  {
638  m_pDriver->Log(_T("Checking for current function start"));
639  if (reDisassemblyFunc.Matches(lines[i]))
640  {
641  uint64_t start = cbDebuggerStringToAddress(reDisassemblyFunc.GetMatch(lines[i], 1));
642  // FIXME (obfuscated#): the offset is wrong type, probably should be fixed.
643  dialog->SetActiveAddress(start + offset);
644  }
645  }
646  }
647  }
648 };
650 
651 #endif // DEBUGGER_COMMANDS_H
wxString AfterLast(wxUniChar ch) const
CdbCmd_AddSymbolFile(DebuggerDriver *driver, const wxString &file)
Definition: cdb_commands.h:93
DLLIMPORT wxArrayString GetArrayFromString(const wxString &text, const wxString &separator=DEFAULT_ARRAY_SEP, bool trimSpaces=true)
Definition: globals.cpp:134
static wxRegEx reDisassembly(_T("^[0-9]+[ \+([A-Fa-f0-9]+)[ \+[A-Fa-f0-9]+[ \+(.*)$"))
CdbCmd_Watch(DebuggerDriver *driver, cb::shared_ptr< GDBWatch > const &watch)
Definition: cdb_commands.h:325
Command to remove a breakpoint.
Definition: cdb_commands.h:295
CdbCmd_AttachToProcess(DebuggerDriver *driver, int pid)
Definition: cdb_commands.h:174
void ParseOutput(const wxString &output)
Parses the command&#39;s output.
Definition: cdb_commands.h:368
void SetCursor(const Cursor &cursor)
Set debugger&#39;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.
Definition: cdb_commands.h:117
CdbCmd_AddSourceDir(DebuggerDriver *driver, const wxString &dir)
If dir is empty, resets all search dirs to $cdir:$cwd, the default.
Definition: cdb_commands.h:47
Command to the add symbol files.
Definition: cdb_commands.h:89
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
Definition: manager.cpp:182
Base class for all Continue type of commands.
cb::shared_ptr< DebuggerBreakpoint > m_BP
Definition: cdb_commands.h:315
static wxRegEx reBT2(_T("\(.+)[ \]@[ \]([0-9]+)\[ \]*"))
Command to continue execution and notify the debugger plugin.
Definition: cdb_commands.h:227
static wxRegEx reSwitchFrame(wxT("[ \]*([0-9]+)[ \]([0-9a-z]+)[ \](.+)[ \]\(.+)[ \]@[ \]([0-9]+)\[ \]*"))
Command to run a disassembly.
Definition: cdb_commands.h:559
cb::shared_ptr< GDBWatch > m_watch
Definition: cdb_commands.h:323
wxString m_Cmd
the actual command
Definition: debugger_defs.h:77
CdbCmd_DisassemblyInit(DebuggerDriver *driver)
Definition: cdb_commands.h:598
cbCPURegistersDlg * GetCPURegistersDialog()
Returns a pointer to the CPU registers dialog.
bool Matches(const wxString &text, int flags=0) const
static int m_lastIndex
Definition: cdb_commands.h:246
static wxRegEx reDisassemblyFunc(_T("^\([A-Fa-f0-9]+)\[ \+"))
#define _T(string)
void ParseOutput(const wxString &output)
Parses the command&#39;s output.
Definition: cdb_commands.h:334
Command to display a tooltip about a variables value.
Definition: cdb_commands.h:350
wxString BeforeLast(wxUniChar ch, wxString *rest=NULL) const
void ParseOutput(const wxString &output)
Parses the command&#39;s output.
Definition: cdb_commands.h:604
void ParseOutput(const wxString &output)
Parses the command&#39;s output.
Definition: cdb_commands.h:98
static wxRegEx reBT1(_T("([0-9]+) ([A-Fa-f0-9]+) ([A-Fa-f0-9]+) ([^[]*)"))
long int line
If -1, no line info.
Definition: debugger_defs.h:32
void Log(const wxString &msg)
wxString AfterFirst(wxUniChar ch) const
CdbCmd_Disassembly(DebuggerDriver *driver, const wxString &StopAddress)
Definition: cdb_commands.h:562
#define wxT(string)
static wxRegEx reWatch(_T("(\0x[A-Fa-f0-9]+ )"))
Command to the set the file to be debugged.
Definition: cdb_commands.h:65
Command to run a backtrace.
Definition: cdb_commands.h:400
bool empty() const
virtual void Reload()=0
bool IsValid() const
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)
Definition: logmanager.h:142
void ParseOutput(cb_unused const wxString &output)
Definition: cdb_commands.h:126
wxString BeforeFirst(wxUniChar ch, wxString *rest=NULL) const
virtual void ParseOutput(const wxString &output)
Parses the command&#39;s output.
Definition: cdb_commands.h:489
bool changed
Definition: debugger_defs.h:33
void ParseOutput(const wxString &output)
Parses the command&#39;s output.
Definition: cdb_commands.h:272
void ParseOutput(const wxString &output)
Parses the command&#39;s output.
Definition: cdb_commands.h:144
DebuggerManager * GetDebuggerManager() const
Definition: manager.cpp:484
CdbCmd_Continue(DebuggerDriver *driver)
Definition: cdb_commands.h:231
CdbCmd_SetDebuggee(DebuggerDriver *driver, const wxString &file)
Definition: cdb_commands.h:69
Command to find the PID of the active child.
Definition: cdb_commands.h:135
static wxString LastAddr
Definition: cdb_commands.h:596
Command to add a search directory for source files in debugger&#39;s paths.
Definition: cdb_commands.h:43
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&#39;s).
CdbCmd_InfoRegisters(DebuggerDriver *driver)
Definition: cdb_commands.h:527
bool GetMatch(size_t *start, size_t *len, size_t index=0) const
virtual void Action()
Executes an action.
Definition: cdb_commands.h:235
LogManager * GetLogManager() const
Definition: manager.cpp:439
Command to the attach to a process.
Definition: cdb_commands.h:168
const wxString & GetSymbol() const
virtual void SetRegisterValue(const wxString &reg_name, const wxString &hexValue, const wxString &interpreted)=0
CdbCmd_Backtrace(DebuggerDriver *driver, bool switchToFirst)
Definition: cdb_commands.h:404
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)
Definition: cdb_commands.h:212
wxString wxEmptyString
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&#39;s output.
Definition: cdb_commands.h:308
Command to get info about a watched variable.
Definition: cdb_commands.h:321
Command to run a disassembly.
Definition: cdb_commands.h:594
DLLIMPORT void QuoteStringIfNeeded(wxString &str)
Definition: globals.cpp:260
void ParseOutput(const wxString &output)
Parses the command&#39;s output.
Definition: cdb_commands.h:567
bool ToLong(long *val, int base=10) const
CdbCmd_SetArguments(DebuggerDriver *driver, const wxString &args)
Definition: cdb_commands.h:121
wxString GetAddressAsString() const
bool IsEmpty() const
Debugger cursor info.
Definition: debugger_defs.h:26
virtual void AddAssemblerLine(uint64_t addr, const wxString &line)=0
cbBacktraceDlg * GetBacktraceDialog()
void ParseOutput(const wxString &output)
Parses the command&#39;s output.
Definition: cdb_commands.h:74
void ParseOutput(const wxString &output)
Parses the command&#39;s output.
Definition: cdb_commands.h:52
Command to add a breakpoint.
Definition: cdb_commands.h:244
CdbCmd_AddBreakpoint(DebuggerDriver *driver, cb::shared_ptr< DebuggerBreakpoint > bp)
Definition: cdb_commands.h:249
void ParseOutput(const wxString &output)
Parses the command&#39;s output.
Definition: cdb_commands.h:410
void MakeValid(bool flag)
void SetFile(const wxString &filename, const wxString &line)
DebuggerDriver * m_pDriver
the driver
Definition: debugger_defs.h:79
bool ParseCDBWatchValue(cb::shared_ptr< GDBWatch > watch, wxString const &value)
CdbCmd_GetPID(DebuggerDriver *driver)
Definition: cdb_commands.h:139
bool StartsWith(const wxString &prefix, wxString *rest=NULL) const
wxString file
Definition: debugger_defs.h:29
void ParseOutput(const wxString &output)
Parses the command&#39;s output.
Definition: cdb_commands.h:217
size_t GetCount() const
CdbCmd_RemoveBreakpoint(DebuggerDriver *driver, cb::shared_ptr< DebuggerBreakpoint > bp)
Definition: cdb_commands.h:299
CdbCmd_TooltipEvaluation(DebuggerDriver *driver, const wxString &what, const wxRect &tiprect)
Definition: cdb_commands.h:360
wxString address
Definition: debugger_defs.h:30
CdbCmd_SwitchFrame(DebuggerDriver *driver, int frameNumber)
Definition: cdb_commands.h:480
void ParseOutput(const wxString &output)
Parses the command&#39;s output.
Definition: cdb_commands.h:532
void SetSymbol(const wxString &symbol)
Basic interface for debugger commands.
Definition: debugger_defs.h:49
void ParseOutput(const wxString &output)
Parses the command&#39;s output.
Definition: cdb_commands.h:180
static wxString Format(const wxString &format,...)
Command to run a disassembly.
Definition: cdb_commands.h:523
Command to the detach from the process.
Definition: cdb_commands.h:208
cb::shared_ptr< DebuggerBreakpoint > m_BP
Definition: cdb_commands.h:287