aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRene Gollent <anevilyak@gmail.com>2012-07-18 18:42:25 -0400
committerRene Gollent <anevilyak@gmail.com>2012-07-18 18:44:56 -0400
commit3a5779744ed04ad4dd000e1680e0872b3b99b56e (patch)
treecc92336a6724b9d3dc6dab31b0584e05a14a4b68
parent666222d3fd5bb1964565da7875df2570a0783673 (diff)
Handle compound node values in variables view.hrev44351
- If the node we're looking at is a compound node, retrieve its location and show that as the value with an indicator to clarify that it's an object. - Minor tweaks to tooltip format. - Style cleanups.
-rw-r--r--src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp65
1 files changed, 47 insertions, 18 deletions
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 ece58364d8..b0beb9c0e9 100644
--- a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp
+++ b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp
@@ -314,10 +314,12 @@ protected:
targetView);
return;
}
+ } else if (value.Type() == B_STRING_TYPE) {
+ fField.SetString(value.ToString());
+ } else {
+ // fall back to drawing an empty string
+ fField.SetString("");
}
-
- // fall back to drawing an empty string
- fField.SetString("");
fField.SetWidth(Width());
fColumn.DrawField(&fField, rect, targetView);
}
@@ -1112,8 +1114,29 @@ VariablesView::VariableTableModel::GetValueAt(void* object, int32 columnIndex,
_value.SetTo(node->Name(), B_VARIANT_DONT_COPY_DATA);
return true;
case 1:
- if (node->GetValue() == NULL)
+ if (node->GetValue() == NULL) {
+ ValueLocation* location = node->NodeChild()->Location();
+ if (location == NULL)
+ return false;
+
+ Type* nodeChildRawType = node->NodeChild()->Node()->GetType()
+ ->ResolveRawType(false);
+ if (nodeChildRawType->Kind() == TYPE_COMPOUND)
+ {
+ if (location->CountPieces() > 1)
+ return false;
+
+ BString data;
+ ValuePieceLocation piece = location->PieceAt(0);
+ if (piece.type != VALUE_PIECE_LOCATION_MEMORY)
+ return false;
+
+ data.SetToFormat("[@ 0x%llx]", piece.address);
+ _value.SetTo(data);
+ return true;
+ }
return false;
+ }
_value.SetTo(node, VALUE_NODE_TYPE);
return true;
@@ -1178,29 +1201,35 @@ VariablesView::VariableTableModel::GetToolTipForTablePath(
return false;
ValueLocation* location = node->NodeChild()->Location();
- BString tipData("Location piece(s):");
+ BString tipData;
for (int32 i = 0; i < location->CountPieces(); i++) {
ValuePieceLocation piece = location->PieceAt(i);
BString pieceData;
switch (piece.type) {
- case VALUE_PIECE_LOCATION_MEMORY:
- pieceData.SetToFormat("\n\t(%ld): Address: 0x%llx, Size: "
- "%lld bytes", i, piece.address, piece.size);
- break;
- case VALUE_PIECE_LOCATION_REGISTER:
- {
- Architecture* architecture = fThread->GetTeam()->GetArchitecture();
- pieceData.SetToFormat("\n\t(%ld): Register (%s)",
- i, architecture->Registers()[piece.reg].Name());
+ case VALUE_PIECE_LOCATION_MEMORY:
+ pieceData.SetToFormat("(%ld): Address: 0x%llx, Size: "
+ "%lld bytes", i, piece.address, piece.size);
+ break;
+ case VALUE_PIECE_LOCATION_REGISTER:
+ {
+ Architecture* architecture = fThread->GetTeam()->GetArchitecture();
+ pieceData.SetToFormat("(%ld): Register (%s)",
+ i, architecture->Registers()[piece.reg].Name());
- break;
- }
- default:
- break;
+ break;
+ }
+ default:
+ break;
}
+
tipData += pieceData;
+ if (i < location->CountPieces() - 1)
+ tipData += "\n";
}
+ if (tipData.IsEmpty())
+ return false;
+
*_tip = new(std::nothrow) BTextToolTip(tipData);
if (*_tip == NULL)
return false;