Debugger: Beginning of core file support

* DebuggerInterface: Add method IsPostMortem() to be able to
  descriminate between live and post mortem debugging.
* Add DebuggerInterface implementation CoreFileDebuggerInterface which
  provides information from a core file.
* TeamDebugger: Don't start the debug event thread when debugging post
  mortem.
* Debugger: New command line variant "Debugger --core <file path>",
  which starts a team debugger using the core file.

There are a few issues:
* I didn't see an easy way to integrate with the new
  TargetHostInterface framework and I didn't want to get into Rene's
  way changing stuff. As a side effect core file debug windows are not
  counted and Debugger will quit when only those are left, respectively
  will additionally open a teams window on start-up.
* There aren't any symbols yet. We can't use the debug kit
  functionality, since it isn't bitness/endianess agnostic. So either
  it needs to be adjusted or ported over to Debugger.
This commit is contained in:
Ingo Weinhold
2016-04-24 18:48:37 +02:00
parent 3d26e83096
commit 1a899ed474
7 changed files with 603 additions and 19 deletions
+12 -10
View File
@@ -496,16 +496,18 @@ TeamDebugger::Init(DebuggerInterface* interface, thread_id threadID, int argc,
}
}
// create the debug event listener
char buffer[128];
snprintf(buffer, sizeof(buffer), "team %" B_PRId32 " debug listener",
fTeamID);
fDebugEventListener = spawn_thread(_DebugEventListenerEntry, buffer,
B_NORMAL_PRIORITY, this);
if (fDebugEventListener < 0)
return fDebugEventListener;
// create the debug event listener (for live debugging only)
if (!fDebuggerInterface->IsPostMortem()) {
char buffer[128];
snprintf(buffer, sizeof(buffer), "team %" B_PRId32 " debug listener",
fTeamID);
fDebugEventListener = spawn_thread(_DebugEventListenerEntry, buffer,
B_NORMAL_PRIORITY, this);
if (fDebugEventListener < 0)
return fDebugEventListener;
resume_thread(fDebugEventListener);
resume_thread(fDebugEventListener);
}
// run looper
thread_id looperThread = Run();
@@ -520,7 +522,7 @@ TeamDebugger::Init(DebuggerInterface* interface, thread_id threadID, int argc,
}
// if requested, stop the given thread
if (threadID >= 0) {
if (threadID >= 0 && !fDebuggerInterface->IsPostMortem()) {
if (stopInMain) {
SymbolInfo symbolInfo;
if (appImage != NULL && mainThreadHandler != NULL