Some optimizations for ThreadHandler.
- CreateStackTrace() now takes a parameter indicating whether or not to try and retrieve full frame information. This in turn is passed on to SpecificImageDebugInfo, where e.g. DwarfImageDebugInfo can use it to avoid constructing variables and parameters. This is used by ThreadHandler since, when it requests the top frame for its stepping calculations, this additional data/work is completely unnecessary.
This commit is contained in:
parent
50bd564d06
commit
1167ae5274
@ -94,7 +94,8 @@ Architecture::InitRegisterRules(CfaContext& context) const
|
|||||||
status_t
|
status_t
|
||||||
Architecture::CreateStackTrace(Team* team,
|
Architecture::CreateStackTrace(Team* team,
|
||||||
ImageDebugInfoProvider* imageInfoProvider, CpuState* cpuState,
|
ImageDebugInfoProvider* imageInfoProvider, CpuState* cpuState,
|
||||||
StackTrace*& _stackTrace, int32 maxStackDepth, bool useExistingTrace)
|
StackTrace*& _stackTrace, int32 maxStackDepth, bool useExistingTrace,
|
||||||
|
bool getFullFrameInfo)
|
||||||
{
|
{
|
||||||
BReference<CpuState> cpuStateReference(cpuState);
|
BReference<CpuState> cpuStateReference(cpuState);
|
||||||
|
|
||||||
@ -161,8 +162,8 @@ Architecture::CreateStackTrace(Team* team,
|
|||||||
CpuState* previousCpuState = NULL;
|
CpuState* previousCpuState = NULL;
|
||||||
if (function != NULL) {
|
if (function != NULL) {
|
||||||
status_t error = functionDebugInfo->GetSpecificImageDebugInfo()
|
status_t error = functionDebugInfo->GetSpecificImageDebugInfo()
|
||||||
->CreateFrame(image, function, cpuState, frame,
|
->CreateFrame(image, function, cpuState, getFullFrameInfo,
|
||||||
previousCpuState);
|
frame, previousCpuState);
|
||||||
if (error != B_OK && error != B_UNSUPPORTED)
|
if (error != B_OK && error != B_UNSUPPORTED)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -170,7 +171,8 @@ Architecture::CreateStackTrace(Team* team,
|
|||||||
// If we have no frame yet, let the architecture create it.
|
// If we have no frame yet, let the architecture create it.
|
||||||
if (frame == NULL) {
|
if (frame == NULL) {
|
||||||
status_t error = CreateStackFrame(image, functionDebugInfo,
|
status_t error = CreateStackFrame(image, functionDebugInfo,
|
||||||
cpuState, nextFrame == NULL, frame, previousCpuState);
|
cpuState, nextFrame == NULL, frame,
|
||||||
|
previousCpuState);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,8 @@ public:
|
|||||||
CpuState* cpuState,
|
CpuState* cpuState,
|
||||||
StackTrace*& _stackTrace,
|
StackTrace*& _stackTrace,
|
||||||
int32 maxStackDepth = -1,
|
int32 maxStackDepth = -1,
|
||||||
bool useExistingTrace = false);
|
bool useExistingTrace = false,
|
||||||
|
bool getFullFrameInfo = true);
|
||||||
// team is not locked
|
// team is not locked
|
||||||
|
|
||||||
virtual status_t GetWatchpointDebugCapabilities(
|
virtual status_t GetWatchpointDebugCapabilities(
|
||||||
|
@ -253,7 +253,8 @@ ThreadHandler::HandleThreadAction(uint32 action)
|
|||||||
|
|
||||||
if (stackTrace == NULL && cpuState != NULL) {
|
if (stackTrace == NULL && cpuState != NULL) {
|
||||||
if (fDebuggerInterface->GetArchitecture()->CreateStackTrace(
|
if (fDebuggerInterface->GetArchitecture()->CreateStackTrace(
|
||||||
fThread->GetTeam(), this, cpuState, stackTrace, 1) == B_OK) {
|
fThread->GetTeam(), this, cpuState, stackTrace, 1, false,
|
||||||
|
false) == B_OK) {
|
||||||
stackTraceReference.SetTo(stackTrace, true);
|
stackTraceReference.SetTo(stackTrace, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,8 @@ DebuggerImageDebugInfo::GetAddressSectionType(target_addr_t address)
|
|||||||
status_t
|
status_t
|
||||||
DebuggerImageDebugInfo::CreateFrame(Image* image,
|
DebuggerImageDebugInfo::CreateFrame(Image* image,
|
||||||
FunctionInstance* functionInstance, CpuState* cpuState,
|
FunctionInstance* functionInstance, CpuState* cpuState,
|
||||||
StackFrame*& _previousFrame, CpuState*& _previousCpuState)
|
bool getFullFrameInfo, StackFrame*& _previousFrame,
|
||||||
|
CpuState*& _previousCpuState)
|
||||||
{
|
{
|
||||||
return B_UNSUPPORTED;
|
return B_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ public:
|
|||||||
virtual status_t CreateFrame(Image* image,
|
virtual status_t CreateFrame(Image* image,
|
||||||
FunctionInstance* functionInstance,
|
FunctionInstance* functionInstance,
|
||||||
CpuState* cpuState,
|
CpuState* cpuState,
|
||||||
|
bool getFullFrameInfo,
|
||||||
StackFrame*& _previousFrame,
|
StackFrame*& _previousFrame,
|
||||||
CpuState*& _previousCpuState);
|
CpuState*& _previousCpuState);
|
||||||
virtual status_t GetStatement(FunctionDebugInfo* function,
|
virtual status_t GetStatement(FunctionDebugInfo* function,
|
||||||
|
@ -516,7 +516,7 @@ DwarfImageDebugInfo::GetAddressSectionType(target_addr_t address)
|
|||||||
status_t
|
status_t
|
||||||
DwarfImageDebugInfo::CreateFrame(Image* image,
|
DwarfImageDebugInfo::CreateFrame(Image* image,
|
||||||
FunctionInstance* functionInstance, CpuState* cpuState,
|
FunctionInstance* functionInstance, CpuState* cpuState,
|
||||||
StackFrame*& _frame, CpuState*& _previousCpuState)
|
bool getFullFrameInfo, StackFrame*& _frame, CpuState*& _previousCpuState)
|
||||||
{
|
{
|
||||||
DwarfFunctionDebugInfo* function = dynamic_cast<DwarfFunctionDebugInfo*>(
|
DwarfFunctionDebugInfo* function = dynamic_cast<DwarfFunctionDebugInfo*>(
|
||||||
functionInstance->GetFunctionDebugInfo());
|
functionInstance->GetFunctionDebugInfo());
|
||||||
@ -635,7 +635,7 @@ DwarfImageDebugInfo::CreateFrame(Image* image,
|
|||||||
// The subprogram entry may not be available since this may be a case
|
// The subprogram entry may not be available since this may be a case
|
||||||
// where .eh_frame was used to unwind the stack without other DWARF
|
// where .eh_frame was used to unwind the stack without other DWARF
|
||||||
// info being available.
|
// info being available.
|
||||||
if (subprogramEntry != NULL) {
|
if (subprogramEntry != NULL && getFullFrameInfo) {
|
||||||
// create function parameter objects
|
// create function parameter objects
|
||||||
for (DebugInfoEntryList::ConstIterator it
|
for (DebugInfoEntryList::ConstIterator it
|
||||||
= subprogramEntry->Parameters().GetIterator();
|
= subprogramEntry->Parameters().GetIterator();
|
||||||
|
@ -61,6 +61,7 @@ public:
|
|||||||
virtual status_t CreateFrame(Image* image,
|
virtual status_t CreateFrame(Image* image,
|
||||||
FunctionInstance* functionInstance,
|
FunctionInstance* functionInstance,
|
||||||
CpuState* cpuState,
|
CpuState* cpuState,
|
||||||
|
bool getFullFrameInfo,
|
||||||
StackFrame*& _frame,
|
StackFrame*& _frame,
|
||||||
CpuState*& _previousCpuState);
|
CpuState*& _previousCpuState);
|
||||||
virtual status_t GetStatement(FunctionDebugInfo* function,
|
virtual status_t GetStatement(FunctionDebugInfo* function,
|
||||||
|
@ -55,11 +55,15 @@ public:
|
|||||||
virtual status_t CreateFrame(Image* image,
|
virtual status_t CreateFrame(Image* image,
|
||||||
FunctionInstance* functionInstance,
|
FunctionInstance* functionInstance,
|
||||||
CpuState* cpuState,
|
CpuState* cpuState,
|
||||||
|
bool getFullFrameInfo,
|
||||||
StackFrame*& _Frame,
|
StackFrame*& _Frame,
|
||||||
CpuState*& _previousCpuState) = 0;
|
CpuState*& _previousCpuState) = 0;
|
||||||
// returns reference to previous frame
|
// returns reference to previous frame
|
||||||
// and CPU state; returned CPU state
|
// and CPU state; returned CPU state
|
||||||
// can be NULL; can return B_UNSUPPORTED
|
// can be NULL; can return B_UNSUPPORTED
|
||||||
|
// getFullFrameInfo: try to retrieve
|
||||||
|
// variables/parameters if true
|
||||||
|
// (and supported)
|
||||||
virtual status_t GetStatement(FunctionDebugInfo* function,
|
virtual status_t GetStatement(FunctionDebugInfo* function,
|
||||||
target_addr_t address,
|
target_addr_t address,
|
||||||
Statement*& _statement) = 0;
|
Statement*& _statement) = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user