From e8daa2f843e280607db9e5c8ca1b72db1f62c21e Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Sat, 17 May 2014 19:14:17 +0000 Subject: Introduce the concept of a "display name" for types Rationale: Pretty simply, the idea is that sometimes type names are way too long and contain way too many details for the average developer to care about. For instance, a plain ol' vector of int might be shown as std::__1::vector form, which is what most developers would actually type in their code Proposed solution: Introduce a notion of "display name" and a corresponding API GetDisplayTypeName() to return such a crafted for visual representation type name Obviously, the display name and the fully qualified (or "true") name are not necessarily the same - that's the whole point LLDB could choose to pick the "display name" as its one true notion of a type name, and if somebody really needs the fully qualified version of it, let them deal with the problem Or, LLDB could rename what it currently calls the "type name" to be the "display name", and add new APIs for the fully qualified name, making the display name the default choice The choice that I am making here is that the type name will keep meaning the same, and people who want a type name suited for display will explicitly ask for one It is the less risky/disruptive choice - and it should eventually make it fairly obvious when someone is asking for the wrong type Caveats: - for now, GetDisplayTypeName() == GetTypeName(), there is no logic to produce customized display type names yet. - while the fully-qualified type name is still the main key to the kingdom of data formatters, if we start showing custom names to people, those should match formatters llvm-svn: 209072 --- lldb/scripts/Python/interface/SBType.i | 5 ++++- lldb/scripts/Python/interface/SBValue.i | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'lldb/scripts/Python/interface') diff --git a/lldb/scripts/Python/interface/SBType.i b/lldb/scripts/Python/interface/SBType.i index 936bf2ccf27..8a0ad6e508b 100644 --- a/lldb/scripts/Python/interface/SBType.i +++ b/lldb/scripts/Python/interface/SBType.i @@ -27,7 +27,7 @@ public: const char * GetName (); - + lldb::SBType GetType (); @@ -216,6 +216,9 @@ public: const char* GetName(); + const char * + GetDisplayTypeName (); + lldb::TypeClass GetTypeClass (); diff --git a/lldb/scripts/Python/interface/SBValue.i b/lldb/scripts/Python/interface/SBValue.i index 4cfafa3f4d8..78e7605224e 100644 --- a/lldb/scripts/Python/interface/SBValue.i +++ b/lldb/scripts/Python/interface/SBValue.i @@ -81,6 +81,9 @@ public: const char * GetTypeName (); + + const char * + GetDisplayTypeName (); size_t GetByteSize (); -- cgit v1.2.3