Very much work in progress, not in a particularly working state. Haiku munged

a good part of the source tree, so I rather get those changes into the
repository before continuing.
The general aim of the work is to deal with multiple instances of the same
function, e.g. inlined or non-inlined inline functions or those weird duplicates
gcc (4 at least) seems to be generating for no apparent reason.
* Added classes FunctionInstance (wrapping FunctionDebugInfo) and Function.
  FunctionInstance represents a physical instance of a function (e.g. inlined
  function at a particular address). A Function collects all FunctionInstances
  referring to the same source code location.
* Moved the SourceCode property from FunctionDebugInfo to Function accordingly.
* Since SourceCode is no longer associated with a concrete function instance,
  several methods dealing with statements have been removed and the
  functionality has been provided through other means (e.g. TeamDebugModel or
  SpecificImageDebugModel). This part is not yet completed.
* Introduced UserBreakpoint and UserBreakpointInstance. The user sets a
  breakpoint at a source code location, which is represented by a
  UserBreakpoint. Since that source location can be mapped to one address per
  instance of the respective function, UserBreakpoint has a
  UserBreakpointInstance per such function instance, which in turn refers to a
  Breakpoint (an actual breakpoint at an address).
* Adjusted Breakpoint, BreakpointManager, and TeamDebugger accordingly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31447 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-07-07 20:47:39 +00:00
parent ccf28e4dd1
commit f66bd6256a
54 changed files with 1549 additions and 515 deletions
+13 -12
View File
@@ -15,7 +15,7 @@
#include "BreakpointManager.h"
#include "CpuState.h"
#include "DebuggerInterface.h"
#include "FunctionDebugInfo.h"
#include "FunctionInstance.h"
#include "ImageDebugInfo.h"
#include "InstructionInfo.h"
#include "Jobs.h"
@@ -126,7 +126,7 @@ ThreadHandler::HandleBreakpointHit(BreakpointHitEvent* event)
// spurious breakpoint -- might be a temporary breakpoint, that has
// already been uninstalled
continueThread = true;
} else if (breakpoint->UserState() != USER_BREAKPOINT_ENABLED) {
} else if (breakpoint->HasEnabledUserBreakpoint()) {
// breakpoint of another thread or one that has been disabled in
// the meantime
continueThread = true;
@@ -382,20 +382,21 @@ ThreadHandler::_GetStatementAtInstructionPointer(StackFrame* frame)
{
AutoLocker<TeamDebugModel> locker(fDebugModel);
FunctionDebugInfo* function = frame->Function();
if (function == NULL)
FunctionInstance* functionInstance = frame->Function();
if (functionInstance == NULL)
return NULL;
FunctionDebugInfo* function = functionInstance->GetFunctionDebugInfo();
// If there's source code attached to the function, we can just get the
// statement.
SourceCode* sourceCode = function->GetSourceCode();
if (sourceCode != NULL) {
Statement* statement = sourceCode->StatementAtAddress(
frame->InstructionPointer());
if (statement != NULL)
statement->AddReference();
return statement;
}
// SourceCode* sourceCode = function->GetSourceCode();
// if (sourceCode != NULL) {
// Statement* statement = sourceCode->StatementAtAddress(
// frame->InstructionPointer());
// if (statement != NULL)
// statement->AddReference();
// return statement;
// }
locker.Unlock();