[haiku-commits] haiku: hrev48494 - in src/apps/debugger: debug_info user_interface/gui/team_window

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 12 Dec 2014 23:06:25 +0100 (CET)

hrev48494 adds 2 changesets to branch 'master'
old head: 18bd706d850718e9aade57e676bca2627891136c
new head: 40d79c05877ca364e0d38d74ede4a9025c6aff7c
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=40d79c0+%5E18bd706

----------------------------------------------------------------------------

1c1ffc4: Debugger: Minor tweak to DwarfType.
  
  - When creating a derived type, adjust the name accordingly to indicate
    the additional qualifiers. Fixes a problem where casted type names would be
    displayed as their base type only, even if they included pointers or array
    subscripts.

40d79c0: Debugger: Fix type value display in VariablesView.
  
  - When retrieving the type to display for a given model node, ask its
    underlying value node for its corresponding type rather than relying
    on the one initially stored in the model, as the latter can change
    as a result of typecasts.

                                         [ Rene Gollent <rene@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

2 files changed, 12 insertions(+), 4 deletions(-)
src/apps/debugger/debug_info/DwarfTypes.cpp               | 11 ++++++++---
.../user_interface/gui/team_window/VariablesView.cpp      |  5 ++++-

############################################################################

Commit:      1c1ffc46d517963f8ed7a317092bb2a5ea3cd2db
URL:         http://cgit.haiku-os.org/haiku/commit/?id=1c1ffc4
Author:      Rene Gollent <rene@xxxxxxxxxxx>
Date:        Fri Dec 12 21:57:32 2014 UTC

Debugger: Minor tweak to DwarfType.

- When creating a derived type, adjust the name accordingly to indicate
  the additional qualifiers. Fixes a problem where casted type names would be
  displayed as their base type only, even if they included pointers or array
  subscripts.

----------------------------------------------------------------------------

diff --git a/src/apps/debugger/debug_info/DwarfTypes.cpp 
b/src/apps/debugger/debug_info/DwarfTypes.cpp
index 9b32231..641c7d8 100644
--- a/src/apps/debugger/debug_info/DwarfTypes.cpp
+++ b/src/apps/debugger/debug_info/DwarfTypes.cpp
@@ -1,6 +1,6 @@
 /*
  * Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@xxxxxx.
- * Copryight 2012-2013, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copryight 2012-2014, Rene Gollent, rene@xxxxxxxxxxx.
  * Distributed under the terms of the MIT License.
  */
 
@@ -242,8 +242,11 @@ status_t
 DwarfType::CreateDerivedAddressType(address_type_kind addressType,
        AddressType*& _resultType)
 {
+       BString derivedName;
+       derivedName.SetToFormat("%s%c", fName.String(),
+               addressType == DERIVED_TYPE_POINTER ? '*' : '&');
        DwarfAddressType* resultType = new(std::nothrow)
-               DwarfAddressType(fTypeContext, fName, NULL, addressType, this);
+               DwarfAddressType(fTypeContext, derivedName, NULL, addressType, 
this);
 
        if (resultType == NULL)
                return B_NO_MEMORY;
@@ -265,8 +268,10 @@ DwarfType::CreateDerivedArrayType(int64 lowerBound, int64 
elementCount,
                resultType = dynamic_cast<DwarfArrayType*>(this);
 
        if (resultType == NULL) {
+               BString derivedName;
+               derivedName.SetToFormat("%s[]", fName.String());
                resultType = new(std::nothrow)
-                       DwarfArrayType(fTypeContext, fName, NULL, this);
+                       DwarfArrayType(fTypeContext, derivedName, NULL, this);
                baseTypeReference.SetTo(resultType, true);
        }
 

############################################################################

Revision:    hrev48494
Commit:      40d79c05877ca364e0d38d74ede4a9025c6aff7c
URL:         http://cgit.haiku-os.org/haiku/commit/?id=40d79c0
Author:      Rene Gollent <rene@xxxxxxxxxxx>
Date:        Fri Dec 12 21:59:28 2014 UTC

Debugger: Fix type value display in VariablesView.

- When retrieving the type to display for a given model node, ask its
  underlying value node for its corresponding type rather than relying
  on the one initially stored in the model, as the latter can change
  as a result of typecasts.

----------------------------------------------------------------------------

diff --git a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp 
b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp
index 8ad4e3f..45c6ddd 100644
--- a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp
+++ b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp
@@ -1428,7 +1428,10 @@ VariablesView::VariableTableModel::GetValueAt(void* 
object, int32 columnIndex,
                        return true;
                case 2:
                {
-                       Type* type = node->GetType();
+                       // use the type of the underlying value node, as it may
+                       // be different from the initially assigned top level 
type
+                       // due to casting
+                       Type* type = node->NodeChild()->Node()->GetType();
                        if (type == NULL)
                                return false;
 


Other related posts:

  • » [haiku-commits] haiku: hrev48494 - in src/apps/debugger: debug_info user_interface/gui/team_window - anevilyak