Debugger: Fix #12940.
- Add new interface TeamFunctionSourceInformation. Currently this
exposes a single function allowing one to query for the currently
active source code given a FunctionDebugInfo instance.
- Implement TeamFunctionSourceInformation on TeamDebugInfo.
- Pass TeamFunctionSourceInformation to Dwarf{Team,Image}DebugInfo.
In turn, make use of it in DwarfImageDebugInfo::GetStatement() in
order to determine whether to return the corresponding assembly
or source statement.
With this piece of information, the debugger is now correctly able to
determine that the user is currently looking at disassembly despite debug
info being available, and consequently adjust its stepping behavior based on
that. Previously, the source code statement was always used, leading to it
not being possible to single step assembly lines in such a circumstance
without manually using run to cursor.
Other related cleanups:
- TeamDebugInfo now inherits BReferenceable directly, rather than relying on
indirectly inheriting it from TeamTypeInformation.
- Remove BReferenceable from TeamTypeInformation. The latter is only an
interface anyways, and inheriting that base class from multiple locations
was causing GCC5 trouble when resolving BReference<TeamDebugInfo>, even
when virtual inheritance was used.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||
* Copyright 2014, Rene Gollent, [email protected].
|
||||
* Copyright 2014-2016, Rene Gollent, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef TEAM_DEBUG_INFO_H
|
||||
@@ -15,9 +15,9 @@
|
||||
|
||||
#include "GlobalTypeLookup.h"
|
||||
#include "ImageInfo.h"
|
||||
#include "TeamFunctionSourceInformation.h"
|
||||
#include "TeamTypeInformation.h"
|
||||
|
||||
|
||||
class Architecture;
|
||||
class DebuggerInterface;
|
||||
class DisassembledCode;
|
||||
@@ -35,7 +35,8 @@ class SourceLocation;
|
||||
class SpecificTeamDebugInfo;
|
||||
|
||||
|
||||
class TeamDebugInfo : public GlobalTypeLookup, public TeamTypeInformation {
|
||||
class TeamDebugInfo : public BReferenceable, public GlobalTypeLookup,
|
||||
public TeamTypeInformation, public TeamFunctionSourceInformation {
|
||||
public:
|
||||
TeamDebugInfo(
|
||||
DebuggerInterface* debuggerInterface,
|
||||
@@ -59,6 +60,9 @@ public:
|
||||
virtual bool TypeExistsByName(const BString& name,
|
||||
const TypeLookupConstraints& constraints);
|
||||
|
||||
virtual status_t GetActiveSourceCode(FunctionDebugInfo* info,
|
||||
SourceCode*& _code);
|
||||
|
||||
status_t LoadImageDebugInfo(const ImageInfo& imageInfo,
|
||||
LocatableFile* imageFile,
|
||||
ImageDebugInfoLoadingState& state,
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright 2016, Rene Gollent, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef TEAM_FUNCTION_SOURCE_INFORMATION_H
|
||||
#define TEAM_FUNCTION_SOURCE_INFORMATION_H
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
class FunctionDebugInfo;
|
||||
class SourceCode;
|
||||
|
||||
|
||||
class TeamFunctionSourceInformation {
|
||||
public:
|
||||
virtual ~TeamFunctionSourceInformation();
|
||||
|
||||
virtual status_t GetActiveSourceCode(FunctionDebugInfo* info,
|
||||
SourceCode*& _code) = 0;
|
||||
// returns reference
|
||||
};
|
||||
|
||||
|
||||
#endif // TEAM_FUNCTION_SOURCE_INFORMATION_H
|
||||
@@ -1,12 +1,11 @@
|
||||
/*
|
||||
* Copyright 2011-2014, Rene Gollent, [email protected].
|
||||
* Copyright 2011-2016, Rene Gollent, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef TEAM_TYPE_INFORMATION_H
|
||||
#define TEAM_TYPE_INFORMATION_H
|
||||
|
||||
|
||||
#include <Referenceable.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
@@ -15,7 +14,7 @@ class Type;
|
||||
class TypeLookupConstraints;
|
||||
|
||||
|
||||
class TeamTypeInformation : public BReferenceable {
|
||||
class TeamTypeInformation {
|
||||
public:
|
||||
virtual ~TeamTypeInformation();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user