Some work towards getting stack traces:

* Added a virtual Architecture::CreateStackTrace() and added a basic
  implementation in ArchitectureX86. Fleshed out StackTrace/StackFrame a bit
  and added StackFrameX86. This needs to be organized differently, though, so
  that we can get the maximum available information for each stack frame,
  depending on what info is available for the respective function.
* Added job to get the stack trace for a thread.
* Added stack trace related handling in TeamDebugger. Reorganized the thread
  state/CPU state/stack trace change handling a bit -- we're using a
  Team::Listener now, and do things asynchronously.
* Added a StackTraceView to display the stack trace of the current thread. No
  function name available yet, otherwise working fine.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31126 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-06-19 22:13:32 +00:00
parent 1ae2cffc83
commit 15f040e596
19 changed files with 727 additions and 37 deletions
+9 -9
View File
@@ -13,6 +13,8 @@
#include <Application.h>
#include <Message.h>
#include <ObjectList.h>
#include "debug_utils.h"
#include "TeamDebugger.h"
@@ -216,7 +218,7 @@ printf("loading program: \"%s\" ...\n", options.commandLineArgv[0]);
stopInMain = true;
}
// If we've got
// If we've got
if (team < 0) {
printf("no team yet, getting thread info...\n");
thread_info threadInfo;
@@ -245,12 +247,10 @@ printf("There's already a debugger for team: %ld\n", team);
fprintf(stderr, "Error: Out of memory!\n");
}
if (debugger->Init(team, thread, stopInMain) == B_OK)
{
if (debugger->Init(team, thread, stopInMain) == B_OK
&& fTeamDebuggers.AddItem(debugger)) {
printf("debugger for team %ld created and initialized successfully!\n", team);
fTeamDebuggers.Add(debugger);
}
else
} else
delete debugger;
}
@@ -261,13 +261,13 @@ printf("debugger for team %ld created and initialized successfully!\n", team);
}
private:
typedef DoublyLinkedList<TeamDebugger> TeamDebuggerList;
typedef BObjectList<TeamDebugger> TeamDebuggerList;
private:
TeamDebugger* _TeamDebuggerForTeam(team_id teamID) const
{
for (TeamDebuggerList::ConstIterator it = fTeamDebuggers.GetIterator();
TeamDebugger* debugger = it.Next();) {
for (int32 i = 0; TeamDebugger* debugger = fTeamDebuggers.ItemAt(i);
i++) {
if (debugger->TeamID() == teamID)
return debugger;
}