From 55c1477fbca7d378c6d77f2efe27b183d49683cf Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sat, 27 Jun 2015 12:41:17 -0400 Subject: [PATCH] Debugger: Minor adjustment to address value node. AddressValueNode: - If the address node is pointing to a function, don't bother creating a child, as there isn't really any useful information that can be displayed for such a node besides its target address, which is already shown by the address node anyways. --- .../debugger/value/value_nodes/AddressValueNode.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/apps/debugger/value/value_nodes/AddressValueNode.cpp b/src/apps/debugger/value/value_nodes/AddressValueNode.cpp index 3b85465f5a..3131d217b5 100644 --- a/src/apps/debugger/value/value_nodes/AddressValueNode.cpp +++ b/src/apps/debugger/value/value_nodes/AddressValueNode.cpp @@ -93,13 +93,24 @@ AddressValueNode::CreateChildren(TeamTypeInformation* info) if (fChild != NULL) return B_OK; + // For function pointers, don't bother creating a child, as there + // currently isn't any useful information that can be presented there, + // and the address node's value already indicates the instruction pointer + // of the target function. + // TODO: an eventual future possibility might be for a child node to + // indicate the name of the function being pointed to, if target address + // is valid. + Type* baseType = fType->BaseType(); + if (baseType != NULL && baseType->Kind() == TYPE_FUNCTION) + return B_OK; + // construct name BString name = "*"; name << Name(); // create the child fChild = new(std::nothrow) AddressValueNodeChild(this, name, - fType->BaseType()); + baseType); if (fChild == NULL) return B_NO_MEMORY;