Commit Graph

63 Commits

Author SHA1 Message Date
Rene Gollent
cf2e209b2d More improvements to return value handling.
- 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.
2012-12-31 20:25:11 -05:00
Rene Gollent
ada60b4e3d Rework handling of template parameters.
- 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.
2012-12-03 20:58:09 -05:00
Rene Gollent
ce6b908edb Extend CompoundType to handle template parameters.
- Adjust CompoundType to add accessors for template type and value
  parameters.
- Add DwarfCompoundType/DwarfTypeFactory handling for template
  template type parameters.
2012-12-02 22:09:24 -05:00
Rene Gollent
f1ea2af3e7 Check that both state and reason are the same.
- 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.
2012-11-24 12:49:07 -05:00
Rene Gollent
248c2ff45c Rework control flow for debug report generator.
- 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.
2012-11-24 00:44:00 -05:00
Rene Gollent
12c53499e7 More UI support for watchpointgs.
- BreakpointTableModel now encapsulates both breakpoints and watchpoints.
- Extended BreakpointView and TeamWindow to handle enable/disable/removing
  watchpoints as well.
2012-11-07 14:52:00 +01:00
Rene Gollent
4235cb3e33 Start adding the underlying infrastructure for watchpoint support. 2012-11-06 11:46:27 +01:00
Rene Gollent
ab7a2ea818 Add support for creating derived types to DwarfType. 2012-11-05 17:55:17 +01:00
Ingo Weinhold
7483c98dec Debugger (and some friends): 64 bit fixes 2012-08-05 23:58:25 +02:00
Rene Gollent
aeadcf457d Partially fix #8710.
- 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.
2012-07-11 23:37:36 -04:00
Rene Gollent
973ec3b1ac Fix naming. 2011-12-16 08:38:09 -05:00
Rene Gollent
a9bec97e47 Add previous CPU state member and associated accessors.
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.
2011-12-15 22:40:32 -05:00
Rene Gollent
be63c91230 Fix incomplete/incorrect type lookup.
- 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.
2011-12-07 21:54:44 -05:00
Ingo Weinhold
9395c27062 Move Debugger's Array class to headers/shared 2011-11-25 06:18:52 +01:00
Rene Gollent
d012351656 Add TODO note.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42376 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-07-04 16:52:19 +00:00
Rene Gollent
e5519ef504 Add a constraint field which allows one to specify a particular base type name.
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
2011-07-04 14:55:13 +00:00
Rene Gollent
8ac3d9fe39 Resolved TODO: made TeamMemory and TeamTypeInformation BReferenceable.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42359 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-07-01 21:40:32 +00:00
Rene Gollent
698ad09748 * Add interface TeamTypeInformation and implement in TeamDebugInfo. Pass along
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
2011-07-01 02:36:32 +00:00
Rene Gollent
185d2cdcb9 * 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
2011-06-30 22:30:48 +00:00
Rene Gollent
348e6deb98 * Move expression evaluation to the inspector window.
* 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
2011-06-14 02:28:55 +00:00
Rene Gollent
62e1d169f8 * TeamMemoryBlock: Now stores whether or not the block it represents is writable.
* 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
2011-06-12 20:51:27 +00:00
Rene Gollent
d73d70971b * Various cleanups prompted by previous commit review:
- 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
2011-06-10 22:20:39 +00:00
Rene Gollent
3e3ce16f5e * Introduce TeamMemoryBlock[Manager]. These provide an interface to raw memory
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
2011-06-10 01:58:39 +00:00
Ingo Weinhold
c3e066cf6d Replaced uses of obsolescent BReference[able] API.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39869 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-16 13:50:30 +00:00
Rene Gollent
8d8864e162 Add WriteMemory hooks to TeamMemory / DebuggerInterface to go with ReadMemory.
Will be used in the (eventual) memory inspection tool.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39844 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-13 23:33:29 +00:00
Rene Gollent
bcb394d6b1 Bugfix: ReadMemoryString() never actually copied the data into the passed in string.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39354 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-08 02:40:15 +00:00
Ingo Weinhold
59ea286fac * EnumerationValue -> EnumeratorValue
* 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
2009-11-05 18:15:21 +00:00
Ingo Weinhold
1851e9f3e0 * Added a stopped reason and additional info to Thread. ThreadHandler sets
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
2009-10-15 04:40:33 +00:00
Ingo Weinhold
c4a5ca9322 Added ReadMemoryString(), reading a string from the team's memory.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33589 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-15 04:34:59 +00:00
Ingo Weinhold
0fc8a75c02 * Moved TargetAddressTableColumn into own source file in gui/util.
* 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
2009-10-14 05:03:00 +00:00
Ingo Weinhold
9f018b7c77 Fixed typos and indentation.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33511 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-11 05:40:51 +00:00
Ingo Weinhold
d054be0d8c * 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
2009-10-10 05:05:33 +00:00
Ingo Weinhold
e10cb2838b * ArrayIndexPath::SetTo(): Changed return type from bool to status_t.
* 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
2009-10-05 03:12:16 +00:00
Ingo Weinhold
9e4a5c5fdc Since arrays can be multi-dimensional, a single index does not suffice to
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
2009-10-01 09:40:41 +00:00
Ingo Weinhold
e82b494112 * ValueLocation:
- 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
2009-09-27 04:52:43 +00:00
Ingo Weinhold
6e72ebfce3 * More work on retrieving local variable values. Address and compound types can
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
2009-09-21 04:39:40 +00:00
Stephan Aßmus
5147963dcd headers/private/kernel/util/OpenHashTable.h, Hugo's version, is a bit nicer than
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
2009-07-27 00:39:12 +00:00
Ingo Weinhold
2bf55b39a5 * 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
2009-07-24 02:35:30 +00:00
Ingo Weinhold
a5e1e7ceba Refactoring: Moved TeamDebugModel functionality into Team and got rid of the
former.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31705 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-22 19:20:06 +00:00
Ingo Weinhold
25598171b1 GetStatementAtAddress(): Terminate, if we couldn't get the statement from the
disassembled code of the function.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31685 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-22 01:53:59 +00:00
Ingo Weinhold
da4d62db94 * Worker:
- 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
2009-07-18 23:52:16 +00:00
Ingo Weinhold
d315bfd510 * Added class ValueLocation to represent a location of a value on the target
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
2009-07-17 01:54:43 +00:00
Rene Gollent
3c0955a1ce * Removed no longer needed workaround for mouse wheel messages (thanks Axel!).
* 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
2009-07-15 12:52:18 +00:00
Ingo Weinhold
fd1f509330 Skeleton for source language abstraction. There's SourceLanguage with several
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
2009-07-13 20:45:15 +00:00
Ingo Weinhold
18ca318a3d * 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
2009-07-11 00:05:26 +00:00
Ingo Weinhold
a4b0c19209 * Finished the transformation of the SourceCode interface:
- 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
2009-07-10 00:08:45 +00:00
Ingo Weinhold
f66bd6256a 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
2009-07-07 20:47:39 +00:00
Ingo Weinhold
d9b10dea3b * Extended ImageInfo and Image so they know the image type.
* 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
2009-07-03 14:23:19 +00:00
Ingo Weinhold
593fa6776a * DWARF:
- 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
2009-07-03 00:56:39 +00:00
Ingo Weinhold
3c5dbb462d * Moved Array.h to new directory "types".
* 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
2009-07-01 22:09:33 +00:00