- Thread now has a data member indicating if a subroutine was
executed during the last set of steps.
- ThreadHandler now sets the aforementioned state appropriate during
Step Over/Step Out.
- Architecture::CreateStackTrace() now takes a parameter indicating
whether return value retrieval is desired (based on aforementioned
thread value). Adjust callers accordingly.
- DwarfImageDebugInfo: If return value retrieval is requested, loop
backwards from the current IP to find the call instruction.
- Keep a unified list in DIEClassBaseType so that the order
of template parameters is preserved in cases when type and
value parameters are mixed. Thanks Ingo for the hint.
- Introduce new base Type TemplateParameter, which represents either
a template type or template value parameter, a list of which is
attached to CompoundType.
- Add DwarfTemplateParameter implementing subclass of TemplateParameter
and adjust DwarfTypeFactory accordingly for the above changes.
- Adjust CompoundType to add accessors for template type and value
parameters.
- Add DwarfCompoundType/DwarfTypeFactory handling for template
template type parameters.
- If a thread was already in a stopped state, but we received
an update that indicated something more specific, it would be
ignored, i.e. changing
from simply being in a debugged state to specifying a debugger
call + message. We now check both state and reason before ignoring
the update. Fixes debug reports not receiving the debugger call
message properly when intercepting an actual crash as opposed to
an app running inside the debugger.
- DebugReportGenerator is now its own BLooper that generates reports asynchronously
instead of in TeamDebugger's message loop.
- If a stack trace isn't yet available, DebugReportGenerator now waits for it to
be generated.
- Extended Team to add a listener event for report generation completing. DebugReportGenerator
now generates such an event when it has finished writing a report.
- BreakpointTableModel now encapsulates both breakpoints and watchpoints.
- Extended BreakpointView and TeamWindow to handle enable/disable/removing
watchpoints as well.
- When an image was unloaded, its corresponding image info was never
removed from TeamDebugInfo's list, leading to the latter containing
a deleted object, resulting in various random crashes.
Used to store the unwound state of the CPU from this frame,
which will form the actual state of the following frame. Needed
in order to properly support continuation of unwinding from a
partial stack trace.
- Add accesor to CompoundType to expose the particular compound kind.
- Implement aforementioned accessor in DwarfCompoundType, and ensure
DwarfTypeFactory populates it appropriately.
- Modify GlobalTypeLookup to make use of the address and compound
subtype kinds when trying to match a type.
Due to the lack of matching against the subtype, we would previously wind
up matching anonymous compound types against those of their parents, resulting
in the wrong type getting assigned to their value nodes.
Fixes#8190.
This is necessary for looking up pointer and array types.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42373 a95241bf-73f2-0310-859d-f6bbb57e9c96
to various classes that need a reference to it in order to allow value nodes
to look up type information from the target team.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42354 a95241bf-73f2-0310-859d-f6bbb57e9c96
* 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
* Actually start rendering the memory data. Still has some drawing glitches
when scrolling though, will look into those tomorrow. Also doesn't yet
highlight the location which the target address actually points to within
the block.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42167 a95241bf-73f2-0310-859d-f6bbb57e9c96
* RetrieveMemoryBlockJob: Make use of get_memory_properties() to retrieve the
block's protection bits and mark it appropriately.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42132 a95241bf-73f2-0310-859d-f6bbb57e9c96
- Introduce TeamMemoryBlockOwner to act as an interface for blocks to
remove themselves from the manager when they expire. Consequently remove
TeamMemoryBlock's direct reference to the block manager.
- Simplify GetBlock() to remove unnecessary recursion.
- Store dead blocks in a doubly linked list instead of another hash table.
- Minor style fixes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42090 a95241bf-73f2-0310-859d-f6bbb57e9c96
page data of the target team.
* Jobs: Add RetrieveMemoryBlockJob which performs a background read of the
target team's memory. Used by InspectRequested() to perform the actual work.
* TeamDebugger: Added InspectRequested() hooks to allow clients to ask for
a memory read to be performed.
* Introduce InspectorWindow and MemoryView to form the basis of a memory inspector.
As yet these are more or less stubs and not yet hooked in.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42080 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Since some types don't have names (e.g. pointer types or anonymous structs or
unions), each type does now also have a unique ID. The global type cache
registers types by ID and by name (if they have one). This fixes clashes of
types with empty names.
* Completely refactored the code dealing with variable values. Formerly we had
Variable and TypeComponentPath to navigate to a component, mapped to a
BVariant representing the value. Now we have:
* Interface Value with various subclasses (BoolValue, IntegerValue, etc.) to
represent a value, with the flexibility for more esoteric values.
* A tree of ValueNode+ValueNodeChild objects to represent the components of a
variable. On top of each ValueNodeChild sits a ValueNode representing the
value of the component, potentially having ValueNodeChild children. This
should allow casting a component value, simply by replacing its ValueNode.
* Interface ValueHandler and various implementations for the different value
types. It is basically a factory for classes allowing to format/display a
value.
* ValueHandlerRoster -- a registry for ValueHandlers, finding the best one
for a given value.
* Interface TypeHandler and various implementions for the different type
kinds (primitive, compound, address, etc.). It is basically a factory for
ValueNodes for that type.
* TypeHandlerRoster -- a registry for TypeHandlers, finding the best one
for a given type.
That's still a bit work in progress. It introduces at least one regression:
The VariablesView doesn't save/restore its state anymore. Will take a while
until that is added back.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33907 a95241bf-73f2-0310-859d-f6bbb57e9c96
both accordingly.
* The threads view shows the thread states now. Also added tool tips with
additional info.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33591 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Fixed misspelled MSG_*_BREAKPONT constants.
* model/Team: Added separate event class UserBreakpointEvent for user
breakpoints.
* SourceView::MarkerManager: Invalidate the markers when new source code is
set.
* Added breakpoints view.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33578 a95241bf-73f2-0310-859d-f6bbb57e9c96
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
* Finished support for retrieving and displaying array element values.
* Added work-around for pointer types, if the base type isn't specified in the
debug info (as it should per specification).
* Added support for unspecified types, function types, and pointer to member
types. All types relevant for C++ should be supported now. There are still
quite a few TODOs, though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33434 a95241bf-73f2-0310-859d-f6bbb57e9c96
identify an element. We use the name string of the TypeComponent as index path.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33395 a95241bf-73f2-0310-859d-f6bbb57e9c96
- Changed the bit{Offset,Size} semantics. It's now more or less
aligned with the semantics of the respective DWARF DIE attributes.
DwarfStackFrameDebugInfo does now correctly translate the ValueLocations
returned by the DWARF layer (the bit piece location expression semantics is
different for some reason).
- ValueLocation is now aware of the target's endianess. The SetTo() method
needs that information to correctly meddle with the pieces.
- Support normalizing the pieces.
* Fixed retrieving the values of bit fields in various places. We still don't
handle the bit offset/size attributes of types correctly, but I haven't seen
those in actual debug info yet.
* Added support for enumerations. The variable view shows the enumerator names,
when available.
* Added partial support for subrange types. C++ doesn't have those -- we only
need them for array dimensions.
* Started adding support for array types. Still work in progress.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33314 a95241bf-73f2-0310-859d-f6bbb57e9c96
now be inspected. Still work in progress -- bit fields and arrays don't work
correctly yet nor does type lookup beyond the current compilation unit.
* Made most of the debugger output configurable via a config header. By default
it's much less noisy now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33217 a95241bf-73f2-0310-859d-f6bbb57e9c96
Tracker's OpenHashTable.h which it should eventually replace. We've renamed the
class to BOpenHashTable and changed the interface slightly so that HashTableLink
became superfluous.
Adapted all the code that used it. Since the OpenHashTables no longer clash,
this should fix the GCC4 build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31791 a95241bf-73f2-0310-859d-f6bbb57e9c96
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
- Made Job Referenceable.
- Turned JobKey into an abstract base class to add flexibility. The new
SimpleJobKey is a subclass with the former functionality.
* TeamWindow: Removed the TeamWindow* parameter from the listener hooks. The
TeamDebugger knows anyway.
* Added IDs to Variable, Function, and FunctionInstance. The latter two generate
the ID on the fly, Variable stores it.
* SpecificImageDebugInfo::CreateFrame(): Changed FunctionDebugInfo* debug
parameter to FunctionInstance* to provide more info (the function ID).
* DwarfInterfaceFactory/DwarfImageDebugInfo:
- Added class DwarfFunctionParameterID, an ID class implementation for
function parameters and set the IDs on the parameter objects.
- Retrieve the size of a type (i.e. the size of its objects) and store it in
DwarfType.
- If a parameter's ValueLocation doesn't have a size, set that of the
respective type.
- Map the register indicies in the parameters' ValueLocations from DWARF to
our indices.
* Added class TypeComponentPath for identifying subcomponents in types.
* Added class StackFrameValues, a container associating variables and their
subcomponents with values.
* StackFrame does now have a StackFrameValues object for parameters and local
variables and a mechanism to notify listeners when values have been retrieved.
* Added GetStackFrameValueJob to retrieve variable values. Lots of functionality
is missing yet. Most notably it doesn't retrieves values for subcomponents.
* Wired everything to trigger loading of variable values and getting notified
when done.
* VariablesView: Added a value column. This is all very basic and has to be
done differently, but at least values for the parameters can be seen already.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31636 a95241bf-73f2-0310-859d-f6bbb57e9c96
machine.
* DWARF:
- Various additions to the DIE classes.
- DwarfExpressionEvaluationContext:
- Added support for location expressions and thus the missing DW_OP_piece
and DW_OP_bit_piece operations.
- Fixed some deviations from the specs.
- Added debug output.
- DwarfFile:
- Added missing evaluation of CFA expression rules.
- Added service methods to evaluate expressions, location expressions,
and constant and dynamic values.
* Added model classes for representing types and variables. Particularly the
types part is not finished yet.
* StackFrame does now contain parameters and local variables.
* Added DwarfInterfaceFactory, which creates implementation objects for the
types, as well as variables objects. It's even less finished.
* DwarfImageDebugInfo::CreateFrame(): Resolve function parameters and add them
to the stack frame. No local variables yet.
* Added the beginnings of a variables view. Only lists the names of parameters
and local variables (of understood types) ATM.
* Renamed RegisterView to RegistersView.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31614 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Introduced SourceCode::LineLengthAt(index) and respective implementations in FileSourceCode and DisassembledCode for getting the cached length of the line at the given index.
* Use LineLengthAt in various places in SourceView::TextView to avoid having to calculate string lengths on the fly.
* Clamp the size of the drag and drop rect to the window size. Otherwise in cases of large selections, said rect would get quite large.
* Add support for double click word and triple click line selection.
* Fix problems with tracking state which would erroneously cause the mouse entering the view while dragging on a scroll bar to initiate a drag and drop if there was selected text.
* Add Select All menu/keyboard shortcut and implement corresponding functionality in SourceView::TextView.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31587 a95241bf-73f2-0310-859d-f6bbb57e9c96
subclasses, though they don't do much yet. SourceCode is now associated with a
SourceLanguage.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31544 a95241bf-73f2-0310-859d-f6bbb57e9c96
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
- Replaced StatementAtLine() by GetStatementLocationRange(), which doesn't
return a statement (i.e. also target addresses), but just a range in the
source code. This can also be implemented by FileSourceCode, which can
therefore be used for more than one instance of a function.
- Added GetStatementAtLocation() which kind of is also a replacement for
StatementAtLine(), but is optional and only provided by
DisassembledSourceCode.
- Added GetSourceFile(), which has to be provided when
GetStatementAtLocation() is not implemented.
- Kicked the statement stuff out of FileSourceCode. It only knows source
ranges, now.
* Team: Added GetStatementAtSourceLocation(), which is the real replacement for
SourceCode::StatementAtLine() in cases where a statement is actually
needed. It uses SourceCode::GetStatementAtLocation(), if available and
otherwise finds a function at the source location, and gets a statement for
one of its instances.
* TeamDebugInfo: Does now manage a source file -> functions map allowing to
look up functions at source file locations.
* DwarfImageDebugInfo:
- Switched the path in the source code hash table key for a LocatableFile,
which is cheaper to hash and to compare.
- Fixed bugs where the relocation delta was ignored.
- Replace a -1 in the SourceLocation column component by 0 to avoid
mismatches.
* SourceLocation: Changed component types from uint32 to int32. Otherwise -1 is
not representable.
Things mostly work as before starting the refactoring to support function
instances. All is not well yet, though. E.g. we don't merge the source code
information for common source files (like headers) provided by different
compilation units (or even images) yet. We need to do that, since the debug
info for a compilation unit only contains line number information for inline
functions (in headers) that are actually used.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31495 a95241bf-73f2-0310-859d-f6bbb57e9c96
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
* Added DebuggerInterface::GetSymbolInfo().
* Implementing stopping the thread in main() when the debugger started the
debugged program.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31393 a95241bf-73f2-0310-859d-f6bbb57e9c96
- DwarfUtils::GetDeclarationLocation(): Line/column numbers are one-based.
- Added line number program interpretation (LineNumberProgram).
* FunctionDebugInfo: Return the source file (LocatableFile) instead of the
file name.
* FileManager/LocatableEntry: Fixed handling when a LocatableEntry is
unreferenced. There was a race condition before, since an unreferenced entry
could be referenced and unreferenced again before removing it from the hash
table, which could lead to double deletion. Now we never reuse an unreferenced
entry and just remove it from the hash table when encountering one.
* FileManager/SourceFile: Added class SourceFile which loads a source file from
disk and slices it into lines. Managed by FileManager.
* Added class FileSourceCode, a SourceCode implementation using a SourceFile as
line provider. The statement management works pretty much exactly as in
DissassembledCode.
* DwarfImageDebugInfo: Implemented LoadSourceCode for real. It creates a
FileSourceCode and uses the DWARF line number information for the statement
information. This basically gets the source level view going, though there
are still several problems -- stepping doesn't work perfectly yet, the source
isn't found for all functions, there's no handling of duplicate functions (no
idea why gcc generates them in the first place), etc.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31382 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added StringUtils with string hash functions.
* Added Locatable{Entry,File,Directory} and FileManager classes to manage the
mapping from debug info/target file names to local file names.
* Image does now have a LocatableFile referring to the image's shared object
file. Added listening to location changes of these files to TeamDebugger. No
action is taken yet (should trigger reloading the debug info).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31368 a95241bf-73f2-0310-859d-f6bbb57e9c96