diff options
| author | Enrico Granata <egranata@apple.com> | 2013-06-11 18:47:55 +0000 |
|---|---|---|
| committer | Enrico Granata <egranata@apple.com> | 2013-06-11 18:47:55 +0000 |
| commit | 7bd2bbb9acba9b1a199252d661872182921edf73 (patch) | |
| tree | 74137f9ae55eb381a64c855251261a96e0ed67ed /lldb/source/Commands | |
| parent | b5f4a1b0ba74977a24614f6206efe21e304bbdee (diff) | |
| download | bcm5719-llvm-7bd2bbb9acba9b1a199252d661872182921edf73.tar.gz bcm5719-llvm-7bd2bbb9acba9b1a199252d661872182921edf73.zip | |
<rdar://problem/13779789>
Allow memory read -t to take persistent types (those defined with expression struct $....)
llvm-svn: 183766
Diffstat (limited to 'lldb/source/Commands')
| -rw-r--r-- | lldb/source/Commands/CommandObjectMemory.cpp | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index fe44ad052ab..97ab957ff73 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -521,17 +521,31 @@ protected: type_list); } - if (type_list.GetSize() == 0) + if (type_list.GetSize() == 0 && lookup_type_name.GetCString() && *lookup_type_name.GetCString() == '$') { - result.AppendErrorWithFormat ("unable to find any types that match the raw type '%s' for full type '%s'\n", - lookup_type_name.GetCString(), - view_as_type_cstr); - result.SetStatus(eReturnStatusFailed); - return false; + clang::TypeDecl *tdecl = target->GetPersistentVariables().GetPersistentType(ConstString(lookup_type_name)); + if (tdecl) + { + clang_ast_type.SetClangType(&tdecl->getASTContext(),(lldb::clang_type_t)tdecl->getTypeForDecl()); + } } - TypeSP type_sp (type_list.GetTypeAtIndex(0)); - clang_ast_type.SetClangType (type_sp->GetClangAST(), type_sp->GetClangFullType()); + if (clang_ast_type.IsValid() == false) + { + if (type_list.GetSize() == 0) + { + result.AppendErrorWithFormat ("unable to find any types that match the raw type '%s' for full type '%s'\n", + lookup_type_name.GetCString(), + view_as_type_cstr); + result.SetStatus(eReturnStatusFailed); + return false; + } + else + { + TypeSP type_sp (type_list.GetTypeAtIndex(0)); + clang_ast_type.SetClangType (type_sp->GetClangAST(), type_sp->GetClangFullType()); + } + } while (pointer_count > 0) { |

