History log of /haiku-fatelf/src/apps/debugger/debug_info/ImageDebugInfo.cpp
Revision Date Author Comments
# 185d2cdc 30-Jun-2011 Rene Gollent <anevilyak@gmail.com>

* Add model class TypeLookupConstraints.
* Create and pass constraints to type lookup requests to ensure
that the type we get back is in fact the one we wanted, and not
a different one that happened to have a similar name.

Resolves ticket #5495.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42348 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c3e066cf 16-Dec-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Replaced uses of obsolescent BReference[able] API.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39869 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 958cc95d 12-Dec-2010 Rene Gollent <anevilyak@gmail.com>

Implement support for detecting if a given target address is in a Procedure
Linkage Table section. Use that additional information to skip PLT entries
while stepping. Fixes #6974.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39823 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d054be0d 09-Oct-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved the data location resolution methods from StackFrameDebugInfo to the
respective Type classes. StackFrameDebugInfo is pretty much out of work now,
but maybe something comes up later.
* Renamed GlobalTypeLookupContext to GlobalTypeCache and renamed its methods.
* A TeamDebugInfo does now have a GlobalTypeCache which is used for resolving
types. Formerly it was created per stack frame, so all types had to be
resolved after each single step. Single-stepping is usably fast again.
The disadvantage is that DWARF theoretically allows types properties to
depend on instruction/frame/frame base pointer and we don't support that
anymore. I can't think of a reasonable application for that feature, though.
* Refactored DwarfStackFrameDebugInfo:
- Moved the type classes into new DwarfTypes.{h,cpp}.
- Moved the creation of types into new class DwarfTypeFactory.
- Added class DwarfTypeContext which bundles all the dependencies of the type
classes.
* Made DwarfFile a BReferenceable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33495 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 71f75cdc 06-Oct-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* WIP regarding non comilation unit local types:
- Introduced GlobalTypeLookup interface and GlobalTypeLookupContext to look
up types by name and cache them.
- TeamDebugInfo implementes GlobalTypeLookup iterating through all
ImageDebugInfos, which in turn iterate through all SpecificImageDebugInfos.
- DwarfImageDebugInfo iterates through all compilation units, using
a temporary DwarfStackFrameDebugInfo to create the type.
- DwarfStackFrameDebugInfo no longer caches the types itself, but uses
GlobalTypeLookupContext. It uses GlobalTypeLookup to look up types not
defined in the compilation unit.
- DwarfFile: Made expression evaluation more robust, so that it also works,
when no subroutine entry, frame pointer, and instruction pointer are
available (and not used by the expression).
Basically works already, although the wrong compilation unit might be used
when resolving values for global types. It's also horribly slow, when there
are many types in the stack frame.
* DwarfStackFrameDebugInfo::ResolveArrayElementLocation(): The element location
piece size was set incorrectly (multiplied by 8, although bytes were
expected).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33477 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2bf55b39 23-Jul-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Made FunctionID abstract. There are now two implementing subclasses,
SourceFunctionID (where we know the souce location of the function) and
ImageFunctionID (where we don't know the source location). Made the
classes archivable.
* Added support to find functions by ID.
* Improved user breakpoint handling. We can now "install" a breakpoint before we
even know the function instances in which to install it. Whenever image debug
information become available, breakpoints are installed in the concerned
function instances of the respective image.
* Always trigger loading image debug info as soon as we become aware of an
image.
* Implemented a settings management mechanism. ATM only the breakpoint
locations for debugged teams are persisted. This seriously improves the
debugging fun, though. :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31728 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 18ca318a 10-Jul-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Since disassembled code is actually function instance specific,
FunctionInstance does now also have a (DisassembledCode) source code
attribute. Function keeps its attribute, but it explicitly is a
FileSourceCode now.
* SourceCode:
- Removed GetStatementAtLocation(). Instead DisassembledCode has a
StatementAtLocation() now. As well as a StatementAtAddress() and
StatementAddressRange(). Rather cast to the subclass (in two instances)
instead of having those methods in the base class. In most cases we already
have the subclasses now, anyway.
- Added Lock()/Unlock(), which are implemented in FileSourceCode. The
statement ranges are no longer immutable, so we have to lock.
* TeamDebugModel:
- Revived GetBreakpointsInAddressRange().
- GetBreakpointsForSourceCode(): Optimized for DisassembledCode and fixed
in the FileSourceCode case. We need to compare with the functions' source
file instead of their source code, since they might not have the source
code set yet. Fixed two instances of the same problem in SourceView. Setting
breakpoints in functions that have no associated source code yet, works now.
* Team:
- GetStatementAtAddress(): Optimized by using the DisassembledCode, if
available.
- GetStatementAtSourceLocation(): If the supplied source code is
DisassembledCode, we have to get the statement from it directly, since
we can't get that information from the image debug info.
* TeamDebugInfo: Added LoadSourceCode() and DisassembleFunction(), the new way
to get FileSourceCode respectively DisassembledCode. SpecificTeamDebugInfo
has lost LoadSourceCode() and gained service methods AddSourceCodeInfo() and
ReadCode(). This avoids unnecessary code duplication in the subclasses.
Moreover it allows for joining source location info source files from
different images (and compilation units) -- interesting for inline functions
in headers.
* Adjusted LoadSourceCodeJob and TeamDebugger::FunctionSourceCodeRequested()
accordingly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31514 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f66bd625 07-Jul-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

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


# 671ef9b0 27-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Some moving and renaming.
* Added TeamDebugInfo which serves as factory for ImageDebugInfos.
* Added the DWARF code to the build again. It's not used yet, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31278 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 125e089e 26-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

ImageDebugInfo does now gather function debug infos from all available sources
on init, keeping the most expressive one for each function. The interface
changed accordingly, i.e. it is now possible to iterate through the functions
and FindFunction() is now called FunctionAtAddress(), not returning a reference
anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31251 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0b60fa86 20-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added DebuggerInterface::GetSymbolInfos() to get the symbols for an image.
* Added the beginnings of the debug info abstraction. Currently we can only load
the symbols via the debugger.
* Added a job to retrieve debug info for an image. Extended the GetStackTraceJob
to support waiting for image debug info to be loaded.
* Extended ImageInfo by text/data address and size.
* Removed StackFrameX86 and made StackFrame a simple non-polymorphic class
featuring all the needed data. The really architecture-dependent is in the
referenced CpuState already. Added Image* and FunctionDebugInfo* attributes,
referring to the image respectively debug info for the function hit by the
instruction pointer.
* Switched StrackTrace's StackFrame management from DoublyLinkedList to
BObjectList. This makes it more comfortable to use.
* Changed the code for creating stack traces:
- The creation of the StackTrace object and the main loop to collect the
frames are now located in the no longer virtual
Architecture::CreateStackTrace().
- The decision how to create a StackFrame is based on the instruction pointer.
If it hit a function for which debug info is available, the respective
DebugInfo::CreateStackFrame() is used, otherwise we fall back to the new
virtual Architecture::CreateStackFrame().
* Adjusted the stack trace view to also show function names (mangled ATM).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31142 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 185d2cdcb9b3af20ad0e9cce53ed7e5bafe2e962 30-Jun-2011 Rene Gollent <anevilyak@gmail.com>

* Add model class TypeLookupConstraints.
* Create and pass constraints to type lookup requests to ensure
that the type we get back is in fact the one we wanted, and not
a different one that happened to have a similar name.

Resolves ticket #5495.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42348 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c3e066cf6d35a86d29396d4e740f9811e506b66c 16-Dec-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Replaced uses of obsolescent BReference[able] API.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39869 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 958cc95d32c96d15a32a8994c27ed1a960b72997 12-Dec-2010 Rene Gollent <anevilyak@gmail.com>

Implement support for detecting if a given target address is in a Procedure
Linkage Table section. Use that additional information to skip PLT entries
while stepping. Fixes #6974.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39823 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d054be0d8c41431d611f41171232b0f75ec6f30f 09-Oct-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved the data location resolution methods from StackFrameDebugInfo to the
respective Type classes. StackFrameDebugInfo is pretty much out of work now,
but maybe something comes up later.
* Renamed GlobalTypeLookupContext to GlobalTypeCache and renamed its methods.
* A TeamDebugInfo does now have a GlobalTypeCache which is used for resolving
types. Formerly it was created per stack frame, so all types had to be
resolved after each single step. Single-stepping is usably fast again.
The disadvantage is that DWARF theoretically allows types properties to
depend on instruction/frame/frame base pointer and we don't support that
anymore. I can't think of a reasonable application for that feature, though.
* Refactored DwarfStackFrameDebugInfo:
- Moved the type classes into new DwarfTypes.{h,cpp}.
- Moved the creation of types into new class DwarfTypeFactory.
- Added class DwarfTypeContext which bundles all the dependencies of the type
classes.
* Made DwarfFile a BReferenceable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33495 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 71f75cdcdee748eb5e0841f8868ab8f477c0ee75 06-Oct-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* WIP regarding non comilation unit local types:
- Introduced GlobalTypeLookup interface and GlobalTypeLookupContext to look
up types by name and cache them.
- TeamDebugInfo implementes GlobalTypeLookup iterating through all
ImageDebugInfos, which in turn iterate through all SpecificImageDebugInfos.
- DwarfImageDebugInfo iterates through all compilation units, using
a temporary DwarfStackFrameDebugInfo to create the type.
- DwarfStackFrameDebugInfo no longer caches the types itself, but uses
GlobalTypeLookupContext. It uses GlobalTypeLookup to look up types not
defined in the compilation unit.
- DwarfFile: Made expression evaluation more robust, so that it also works,
when no subroutine entry, frame pointer, and instruction pointer are
available (and not used by the expression).
Basically works already, although the wrong compilation unit might be used
when resolving values for global types. It's also horribly slow, when there
are many types in the stack frame.
* DwarfStackFrameDebugInfo::ResolveArrayElementLocation(): The element location
piece size was set incorrectly (multiplied by 8, although bytes were
expected).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33477 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2bf55b39a5119e092a52d9e50da6efcb38393d54 23-Jul-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Made FunctionID abstract. There are now two implementing subclasses,
SourceFunctionID (where we know the souce location of the function) and
ImageFunctionID (where we don't know the source location). Made the
classes archivable.
* Added support to find functions by ID.
* Improved user breakpoint handling. We can now "install" a breakpoint before we
even know the function instances in which to install it. Whenever image debug
information become available, breakpoints are installed in the concerned
function instances of the respective image.
* Always trigger loading image debug info as soon as we become aware of an
image.
* Implemented a settings management mechanism. ATM only the breakpoint
locations for debugged teams are persisted. This seriously improves the
debugging fun, though. :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31728 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 18ca318a3d814fb5c61218b6097db8dd6b4fe0a4 10-Jul-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Since disassembled code is actually function instance specific,
FunctionInstance does now also have a (DisassembledCode) source code
attribute. Function keeps its attribute, but it explicitly is a
FileSourceCode now.
* SourceCode:
- Removed GetStatementAtLocation(). Instead DisassembledCode has a
StatementAtLocation() now. As well as a StatementAtAddress() and
StatementAddressRange(). Rather cast to the subclass (in two instances)
instead of having those methods in the base class. In most cases we already
have the subclasses now, anyway.
- Added Lock()/Unlock(), which are implemented in FileSourceCode. The
statement ranges are no longer immutable, so we have to lock.
* TeamDebugModel:
- Revived GetBreakpointsInAddressRange().
- GetBreakpointsForSourceCode(): Optimized for DisassembledCode and fixed
in the FileSourceCode case. We need to compare with the functions' source
file instead of their source code, since they might not have the source
code set yet. Fixed two instances of the same problem in SourceView. Setting
breakpoints in functions that have no associated source code yet, works now.
* Team:
- GetStatementAtAddress(): Optimized by using the DisassembledCode, if
available.
- GetStatementAtSourceLocation(): If the supplied source code is
DisassembledCode, we have to get the statement from it directly, since
we can't get that information from the image debug info.
* TeamDebugInfo: Added LoadSourceCode() and DisassembleFunction(), the new way
to get FileSourceCode respectively DisassembledCode. SpecificTeamDebugInfo
has lost LoadSourceCode() and gained service methods AddSourceCodeInfo() and
ReadCode(). This avoids unnecessary code duplication in the subclasses.
Moreover it allows for joining source location info source files from
different images (and compilation units) -- interesting for inline functions
in headers.
* Adjusted LoadSourceCodeJob and TeamDebugger::FunctionSourceCodeRequested()
accordingly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31514 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f66bd6256a87005ccaa493859ede2ca1601b8560 07-Jul-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

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


# 671ef9b08426d9131bbea63d1ba4177c6f497d70 27-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Some moving and renaming.
* Added TeamDebugInfo which serves as factory for ImageDebugInfos.
* Added the DWARF code to the build again. It's not used yet, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31278 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 125e089e1a1a17b89ea7537d9265634ea873333a 26-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

ImageDebugInfo does now gather function debug infos from all available sources
on init, keeping the most expressive one for each function. The interface
changed accordingly, i.e. it is now possible to iterate through the functions
and FindFunction() is now called FunctionAtAddress(), not returning a reference
anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31251 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0b60fa86e977411b90631a7a177c4b93c18106e1 20-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added DebuggerInterface::GetSymbolInfos() to get the symbols for an image.
* Added the beginnings of the debug info abstraction. Currently we can only load
the symbols via the debugger.
* Added a job to retrieve debug info for an image. Extended the GetStackTraceJob
to support waiting for image debug info to be loaded.
* Extended ImageInfo by text/data address and size.
* Removed StackFrameX86 and made StackFrame a simple non-polymorphic class
featuring all the needed data. The really architecture-dependent is in the
referenced CpuState already. Added Image* and FunctionDebugInfo* attributes,
referring to the image respectively debug info for the function hit by the
instruction pointer.
* Switched StrackTrace's StackFrame management from DoublyLinkedList to
BObjectList. This makes it more comfortable to use.
* Changed the code for creating stack traces:
- The creation of the StackTrace object and the main loop to collect the
frames are now located in the no longer virtual
Architecture::CreateStackTrace().
- The decision how to create a StackFrame is based on the instruction pointer.
If it hit a function for which debug info is available, the respective
DebugInfo::CreateStackFrame() is used, otherwise we fall back to the new
virtual Architecture::CreateStackFrame().
* Adjusted the stack trace view to also show function names (mangled ATM).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31142 a95241bf-73f2-0310-859d-f6bbb57e9c96