2011-06-24 01:59:56 +08:00
|
|
|
//===-- FormatManager.cpp -------------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2012-12-05 08:20:57 +08:00
|
|
|
#include "lldb/lldb-python.h"
|
|
|
|
|
2013-01-29 07:47:25 +08:00
|
|
|
#include "lldb/DataFormatters/FormatManager.h"
|
2011-06-24 01:59:56 +08:00
|
|
|
|
|
|
|
// C Includes
|
|
|
|
// C++ Includes
|
|
|
|
// Other libraries and framework includes
|
|
|
|
// Project includes
|
|
|
|
|
2011-07-15 10:26:42 +08:00
|
|
|
#include "lldb/Core/Debugger.h"
|
2013-01-29 07:47:25 +08:00
|
|
|
#include "lldb/DataFormatters/CXXFormatterFunctions.h"
|
|
|
|
#include "lldb/Interpreter/ScriptInterpreterPython.h"
|
|
|
|
#include "lldb/Target/ExecutionContext.h"
|
|
|
|
#include "lldb/Target/Platform.h"
|
2011-07-15 10:26:42 +08:00
|
|
|
|
2011-06-24 01:59:56 +08:00
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
2011-06-24 05:22:24 +08:00
|
|
|
|
|
|
|
struct FormatInfo
|
|
|
|
{
|
|
|
|
Format format;
|
|
|
|
const char format_char; // One or more format characters that can be used for this format.
|
|
|
|
const char *format_name; // Long format name that can be used to specify the current format
|
|
|
|
};
|
|
|
|
|
|
|
|
static FormatInfo
|
|
|
|
g_format_infos[] =
|
|
|
|
{
|
|
|
|
{ eFormatDefault , '\0' , "default" },
|
|
|
|
{ eFormatBoolean , 'B' , "boolean" },
|
|
|
|
{ eFormatBinary , 'b' , "binary" },
|
|
|
|
{ eFormatBytes , 'y' , "bytes" },
|
|
|
|
{ eFormatBytesWithASCII , 'Y' , "bytes with ASCII" },
|
|
|
|
{ eFormatChar , 'c' , "character" },
|
|
|
|
{ eFormatCharPrintable , 'C' , "printable character" },
|
|
|
|
{ eFormatComplexFloat , 'F' , "complex float" },
|
|
|
|
{ eFormatCString , 's' , "c-string" },
|
Added support for the new ".apple_objc" accelerator tables. These tables are
in the same hashed format as the ".apple_names", but they map objective C
class names to all of the methods and class functions. We need to do this
because in the DWARF the methods for Objective C are never contained in the
class definition, they are scattered about at the translation unit level and
they don't even have attributes that say the are contained within the class
itself.
Added 3 new formats which can be used to display data:
eFormatAddressInfo
eFormatHexFloat
eFormatInstruction
eFormatAddressInfo describes an address such as function+offset and file+line,
or symbol + offset, or constant data (c string, 2, 4, 8, or 16 byte constants).
The format character for this is "A", the long format is "address".
eFormatHexFloat will print out the hex float format that compilers tend to use.
The format character for this is "X", the long format is "hex float".
eFormatInstruction will print out disassembly with bytes and it will use the
current target's architecture. The format character for this is "i" (which
used to be being used for the integer format, but the integer format also has
"d", so we gave the "i" format to disassembly), the long format is
"instruction".
Mate the lldb::FormatterChoiceCriterion enumeration private as it should have
been from the start. It is very specialized and doesn't belong in the public
API.
llvm-svn: 143114
2011-10-28 01:55:14 +08:00
|
|
|
{ eFormatDecimal , 'd' , "decimal" },
|
2011-06-24 05:22:24 +08:00
|
|
|
{ eFormatEnum , 'E' , "enumeration" },
|
|
|
|
{ eFormatHex , 'x' , "hex" },
|
2012-08-10 03:33:34 +08:00
|
|
|
{ eFormatHexUppercase , 'X' , "uppercase hex" },
|
2011-06-24 05:22:24 +08:00
|
|
|
{ eFormatFloat , 'f' , "float" },
|
|
|
|
{ eFormatOctal , 'o' , "octal" },
|
|
|
|
{ eFormatOSType , 'O' , "OSType" },
|
|
|
|
{ eFormatUnicode16 , 'U' , "unicode16" },
|
|
|
|
{ eFormatUnicode32 , '\0' , "unicode32" },
|
|
|
|
{ eFormatUnsigned , 'u' , "unsigned decimal" },
|
|
|
|
{ eFormatPointer , 'p' , "pointer" },
|
|
|
|
{ eFormatVectorOfChar , '\0' , "char[]" },
|
|
|
|
{ eFormatVectorOfSInt8 , '\0' , "int8_t[]" },
|
|
|
|
{ eFormatVectorOfUInt8 , '\0' , "uint8_t[]" },
|
|
|
|
{ eFormatVectorOfSInt16 , '\0' , "int16_t[]" },
|
|
|
|
{ eFormatVectorOfUInt16 , '\0' , "uint16_t[]" },
|
2011-07-06 23:56:06 +08:00
|
|
|
{ eFormatVectorOfSInt32 , '\0' , "int32_t[]" },
|
|
|
|
{ eFormatVectorOfUInt32 , '\0' , "uint32_t[]" },
|
|
|
|
{ eFormatVectorOfSInt64 , '\0' , "int64_t[]" },
|
|
|
|
{ eFormatVectorOfUInt64 , '\0' , "uint64_t[]" },
|
2011-06-24 05:22:24 +08:00
|
|
|
{ eFormatVectorOfFloat32, '\0' , "float32[]" },
|
|
|
|
{ eFormatVectorOfFloat64, '\0' , "float64[]" },
|
|
|
|
{ eFormatVectorOfUInt128, '\0' , "uint128_t[]" },
|
|
|
|
{ eFormatComplexInteger , 'I' , "complex integer" },
|
Added support for the new ".apple_objc" accelerator tables. These tables are
in the same hashed format as the ".apple_names", but they map objective C
class names to all of the methods and class functions. We need to do this
because in the DWARF the methods for Objective C are never contained in the
class definition, they are scattered about at the translation unit level and
they don't even have attributes that say the are contained within the class
itself.
Added 3 new formats which can be used to display data:
eFormatAddressInfo
eFormatHexFloat
eFormatInstruction
eFormatAddressInfo describes an address such as function+offset and file+line,
or symbol + offset, or constant data (c string, 2, 4, 8, or 16 byte constants).
The format character for this is "A", the long format is "address".
eFormatHexFloat will print out the hex float format that compilers tend to use.
The format character for this is "X", the long format is "hex float".
eFormatInstruction will print out disassembly with bytes and it will use the
current target's architecture. The format character for this is "i" (which
used to be being used for the integer format, but the integer format also has
"d", so we gave the "i" format to disassembly), the long format is
"instruction".
Mate the lldb::FormatterChoiceCriterion enumeration private as it should have
been from the start. It is very specialized and doesn't belong in the public
API.
llvm-svn: 143114
2011-10-28 01:55:14 +08:00
|
|
|
{ eFormatCharArray , 'a' , "character array" },
|
|
|
|
{ eFormatAddressInfo , 'A' , "address" },
|
2012-08-10 03:33:34 +08:00
|
|
|
{ eFormatHexFloat , '\0' , "hex float" },
|
2012-08-09 01:35:10 +08:00
|
|
|
{ eFormatInstruction , 'i' , "instruction" },
|
|
|
|
{ eFormatVoid , 'v' , "void" }
|
2011-06-24 05:22:24 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static uint32_t
|
|
|
|
g_num_format_infos = sizeof(g_format_infos)/sizeof(FormatInfo);
|
|
|
|
|
|
|
|
static bool
|
|
|
|
GetFormatFromFormatChar (char format_char, Format &format)
|
|
|
|
{
|
|
|
|
for (uint32_t i=0; i<g_num_format_infos; ++i)
|
|
|
|
{
|
|
|
|
if (g_format_infos[i].format_char == format_char)
|
|
|
|
{
|
|
|
|
format = g_format_infos[i].format;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
format = eFormatInvalid;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
GetFormatFromFormatName (const char *format_name, bool partial_match_ok, Format &format)
|
|
|
|
{
|
|
|
|
uint32_t i;
|
|
|
|
for (i=0; i<g_num_format_infos; ++i)
|
|
|
|
{
|
|
|
|
if (strcasecmp (g_format_infos[i].format_name, format_name) == 0)
|
|
|
|
{
|
|
|
|
format = g_format_infos[i].format;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (partial_match_ok)
|
|
|
|
{
|
|
|
|
for (i=0; i<g_num_format_infos; ++i)
|
|
|
|
{
|
|
|
|
if (strcasestr (g_format_infos[i].format_name, format_name) == g_format_infos[i].format_name)
|
|
|
|
{
|
|
|
|
format = g_format_infos[i].format;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
format = eFormatInvalid;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
FormatManager::GetFormatFromCString (const char *format_cstr,
|
|
|
|
bool partial_match_ok,
|
|
|
|
lldb::Format &format)
|
|
|
|
{
|
|
|
|
bool success = false;
|
|
|
|
if (format_cstr && format_cstr[0])
|
|
|
|
{
|
|
|
|
if (format_cstr[1] == '\0')
|
|
|
|
{
|
|
|
|
success = GetFormatFromFormatChar (format_cstr[0], format);
|
|
|
|
if (success)
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
success = GetFormatFromFormatName (format_cstr, partial_match_ok, format);
|
|
|
|
}
|
|
|
|
if (!success)
|
|
|
|
format = eFormatInvalid;
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
char
|
|
|
|
FormatManager::GetFormatAsFormatChar (lldb::Format format)
|
|
|
|
{
|
|
|
|
for (uint32_t i=0; i<g_num_format_infos; ++i)
|
|
|
|
{
|
|
|
|
if (g_format_infos[i].format == format)
|
|
|
|
return g_format_infos[i].format_char;
|
|
|
|
}
|
|
|
|
return '\0';
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
|
|
|
FormatManager::GetFormatAsCString (Format format)
|
|
|
|
{
|
|
|
|
if (format >= eFormatDefault && format < kNumFormats)
|
|
|
|
return g_format_infos[format].format_name;
|
|
|
|
return NULL;
|
|
|
|
}
|
2011-07-02 08:25:22 +08:00
|
|
|
|
2012-05-09 05:49:57 +08:00
|
|
|
lldb::TypeSummaryImplSP
|
|
|
|
FormatManager::GetSummaryForType (lldb::TypeNameSpecifierImplSP type_sp)
|
|
|
|
{
|
|
|
|
if (!type_sp)
|
|
|
|
return lldb::TypeSummaryImplSP();
|
|
|
|
lldb::TypeSummaryImplSP summary_chosen_sp;
|
|
|
|
uint32_t num_categories = m_categories_map.GetCount();
|
|
|
|
lldb::TypeCategoryImplSP category_sp;
|
|
|
|
uint32_t prio_category = UINT32_MAX;
|
|
|
|
for (uint32_t category_id = 0;
|
|
|
|
category_id < num_categories;
|
|
|
|
category_id++)
|
|
|
|
{
|
|
|
|
category_sp = GetCategoryAtIndex(category_id);
|
|
|
|
if (category_sp->IsEnabled() == false)
|
|
|
|
continue;
|
|
|
|
lldb::TypeSummaryImplSP summary_current_sp = category_sp->GetSummaryForType(type_sp);
|
|
|
|
if (summary_current_sp && (summary_chosen_sp.get() == NULL || (prio_category > category_sp->GetEnabledPosition())))
|
|
|
|
{
|
|
|
|
prio_category = category_sp->GetEnabledPosition();
|
|
|
|
summary_chosen_sp = summary_current_sp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return summary_chosen_sp;
|
|
|
|
}
|
|
|
|
|
|
|
|
lldb::TypeFilterImplSP
|
|
|
|
FormatManager::GetFilterForType (lldb::TypeNameSpecifierImplSP type_sp)
|
|
|
|
{
|
|
|
|
if (!type_sp)
|
|
|
|
return lldb::TypeFilterImplSP();
|
|
|
|
lldb::TypeFilterImplSP filter_chosen_sp;
|
|
|
|
uint32_t num_categories = m_categories_map.GetCount();
|
|
|
|
lldb::TypeCategoryImplSP category_sp;
|
|
|
|
uint32_t prio_category = UINT32_MAX;
|
|
|
|
for (uint32_t category_id = 0;
|
|
|
|
category_id < num_categories;
|
|
|
|
category_id++)
|
|
|
|
{
|
|
|
|
category_sp = GetCategoryAtIndex(category_id);
|
|
|
|
if (category_sp->IsEnabled() == false)
|
|
|
|
continue;
|
|
|
|
lldb::TypeFilterImplSP filter_current_sp((TypeFilterImpl*)category_sp->GetFilterForType(type_sp).get());
|
|
|
|
if (filter_current_sp && (filter_chosen_sp.get() == NULL || (prio_category > category_sp->GetEnabledPosition())))
|
|
|
|
{
|
|
|
|
prio_category = category_sp->GetEnabledPosition();
|
|
|
|
filter_chosen_sp = filter_current_sp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return filter_chosen_sp;
|
|
|
|
}
|
|
|
|
|
2012-05-16 08:38:08 +08:00
|
|
|
#ifndef LLDB_DISABLE_PYTHON
|
2013-01-29 07:47:25 +08:00
|
|
|
lldb::ScriptedSyntheticChildrenSP
|
2012-05-09 05:49:57 +08:00
|
|
|
FormatManager::GetSyntheticForType (lldb::TypeNameSpecifierImplSP type_sp)
|
|
|
|
{
|
|
|
|
if (!type_sp)
|
2013-01-29 07:47:25 +08:00
|
|
|
return lldb::ScriptedSyntheticChildrenSP();
|
|
|
|
lldb::ScriptedSyntheticChildrenSP synth_chosen_sp;
|
2012-05-09 05:49:57 +08:00
|
|
|
uint32_t num_categories = m_categories_map.GetCount();
|
|
|
|
lldb::TypeCategoryImplSP category_sp;
|
|
|
|
uint32_t prio_category = UINT32_MAX;
|
|
|
|
for (uint32_t category_id = 0;
|
|
|
|
category_id < num_categories;
|
|
|
|
category_id++)
|
|
|
|
{
|
|
|
|
category_sp = GetCategoryAtIndex(category_id);
|
|
|
|
if (category_sp->IsEnabled() == false)
|
|
|
|
continue;
|
2013-01-29 07:47:25 +08:00
|
|
|
lldb::ScriptedSyntheticChildrenSP synth_current_sp((ScriptedSyntheticChildren*)category_sp->GetSyntheticForType(type_sp).get());
|
2012-05-09 05:49:57 +08:00
|
|
|
if (synth_current_sp && (synth_chosen_sp.get() == NULL || (prio_category > category_sp->GetEnabledPosition())))
|
|
|
|
{
|
|
|
|
prio_category = category_sp->GetEnabledPosition();
|
|
|
|
synth_chosen_sp = synth_current_sp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return synth_chosen_sp;
|
|
|
|
}
|
2012-05-16 08:38:08 +08:00
|
|
|
#endif
|
2012-05-09 05:49:57 +08:00
|
|
|
|
2012-05-16 08:38:08 +08:00
|
|
|
#ifndef LLDB_DISABLE_PYTHON
|
2012-05-09 05:49:57 +08:00
|
|
|
lldb::SyntheticChildrenSP
|
|
|
|
FormatManager::GetSyntheticChildrenForType (lldb::TypeNameSpecifierImplSP type_sp)
|
|
|
|
{
|
|
|
|
if (!type_sp)
|
|
|
|
return lldb::SyntheticChildrenSP();
|
|
|
|
lldb::TypeFilterImplSP filter_sp = GetFilterForType(type_sp);
|
2013-01-29 07:47:25 +08:00
|
|
|
lldb::ScriptedSyntheticChildrenSP synth_sp = GetSyntheticForType(type_sp);
|
2012-05-09 05:49:57 +08:00
|
|
|
if (filter_sp->GetRevision() > synth_sp->GetRevision())
|
|
|
|
return lldb::SyntheticChildrenSP(filter_sp.get());
|
|
|
|
else
|
|
|
|
return lldb::SyntheticChildrenSP(synth_sp.get());
|
|
|
|
}
|
2012-05-16 08:38:08 +08:00
|
|
|
#endif
|
2012-05-09 05:49:57 +08:00
|
|
|
|
2012-02-15 10:34:21 +08:00
|
|
|
lldb::TypeCategoryImplSP
|
Redesign of the interaction between Python and frozen objects:
- introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from
a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored
in frozen objects ; now such reads transparently move from host to target as required
- as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also
removed code that enabled to recognize an expression result VO as such
- introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO
representing a T* or T[], and doing dereferences transparently
in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData
- as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it
en lieu of doing the raw read itself
- introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers,
this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory)
in public layer this returns an SBData, just like GetPointeeData()
- introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData
the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any
of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values
- added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing
Solved a bug where global pointers to global variables were not dereferenced correctly for display
New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128
Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command
Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type
of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file
addresses that generate file address children UNLESS we have a live process)
Updated help text for summary-string
Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers
Edited the syntax and help for some commands to have proper argument types
llvm-svn: 139160
2011-09-07 03:20:51 +08:00
|
|
|
FormatManager::GetCategory (const ConstString& category_name,
|
2011-08-23 08:32:52 +08:00
|
|
|
bool can_create)
|
|
|
|
{
|
|
|
|
if (!category_name)
|
Redesign of the interaction between Python and frozen objects:
- introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from
a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored
in frozen objects ; now such reads transparently move from host to target as required
- as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also
removed code that enabled to recognize an expression result VO as such
- introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO
representing a T* or T[], and doing dereferences transparently
in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData
- as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it
en lieu of doing the raw read itself
- introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers,
this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory)
in public layer this returns an SBData, just like GetPointeeData()
- introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData
the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any
of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values
- added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing
Solved a bug where global pointers to global variables were not dereferenced correctly for display
New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128
Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command
Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type
of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file
addresses that generate file address children UNLESS we have a live process)
Updated help text for summary-string
Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers
Edited the syntax and help for some commands to have proper argument types
llvm-svn: 139160
2011-09-07 03:20:51 +08:00
|
|
|
return GetCategory(m_default_category_name);
|
2012-02-15 10:34:21 +08:00
|
|
|
lldb::TypeCategoryImplSP category;
|
2011-08-23 08:32:52 +08:00
|
|
|
if (m_categories_map.Get(category_name, category))
|
|
|
|
return category;
|
|
|
|
|
|
|
|
if (!can_create)
|
2012-02-15 10:34:21 +08:00
|
|
|
return lldb::TypeCategoryImplSP();
|
2011-08-23 08:32:52 +08:00
|
|
|
|
2012-02-15 10:34:21 +08:00
|
|
|
m_categories_map.Add(category_name,lldb::TypeCategoryImplSP(new TypeCategoryImpl(this, category_name)));
|
Redesign of the interaction between Python and frozen objects:
- introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from
a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored
in frozen objects ; now such reads transparently move from host to target as required
- as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also
removed code that enabled to recognize an expression result VO as such
- introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO
representing a T* or T[], and doing dereferences transparently
in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData
- as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it
en lieu of doing the raw read itself
- introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers,
this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory)
in public layer this returns an SBData, just like GetPointeeData()
- introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData
the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any
of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values
- added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing
Solved a bug where global pointers to global variables were not dereferenced correctly for display
New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128
Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command
Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type
of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file
addresses that generate file address children UNLESS we have a live process)
Updated help text for summary-string
Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers
Edited the syntax and help for some commands to have proper argument types
llvm-svn: 139160
2011-09-07 03:20:51 +08:00
|
|
|
return GetCategory(category_name);
|
2011-08-23 08:32:52 +08:00
|
|
|
}
|
|
|
|
|
2011-07-13 06:56:10 +08:00
|
|
|
lldb::Format
|
|
|
|
FormatManager::GetSingleItemFormat(lldb::Format vector_format)
|
|
|
|
{
|
|
|
|
switch(vector_format)
|
|
|
|
{
|
|
|
|
case eFormatVectorOfChar:
|
|
|
|
return eFormatCharArray;
|
|
|
|
|
|
|
|
case eFormatVectorOfSInt8:
|
|
|
|
case eFormatVectorOfSInt16:
|
|
|
|
case eFormatVectorOfSInt32:
|
|
|
|
case eFormatVectorOfSInt64:
|
|
|
|
return eFormatDecimal;
|
|
|
|
|
|
|
|
case eFormatVectorOfUInt8:
|
|
|
|
case eFormatVectorOfUInt16:
|
|
|
|
case eFormatVectorOfUInt32:
|
|
|
|
case eFormatVectorOfUInt64:
|
|
|
|
case eFormatVectorOfUInt128:
|
|
|
|
return eFormatHex;
|
|
|
|
|
|
|
|
case eFormatVectorOfFloat32:
|
|
|
|
case eFormatVectorOfFloat64:
|
|
|
|
return eFormatFloat;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return lldb::eFormatInvalid;
|
|
|
|
}
|
2011-08-10 10:10:13 +08:00
|
|
|
}
|
2011-08-18 06:13:59 +08:00
|
|
|
|
2011-08-19 09:14:49 +08:00
|
|
|
ConstString
|
|
|
|
FormatManager::GetValidTypeName (const ConstString& type)
|
|
|
|
{
|
|
|
|
return ::GetValidTypeName_Impl(type);
|
|
|
|
}
|
|
|
|
|
2013-01-29 07:47:25 +08:00
|
|
|
ConstString
|
|
|
|
GetTypeForCache (ValueObject& valobj,
|
|
|
|
lldb::DynamicValueType use_dynamic)
|
|
|
|
{
|
|
|
|
if (use_dynamic == lldb::eNoDynamicValues)
|
|
|
|
{
|
|
|
|
if (valobj.IsDynamic())
|
|
|
|
{
|
|
|
|
if (valobj.GetStaticValue())
|
|
|
|
return valobj.GetStaticValue()->GetQualifiedTypeName();
|
|
|
|
else
|
|
|
|
return ConstString();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return valobj.GetQualifiedTypeName();
|
|
|
|
}
|
|
|
|
if (valobj.IsDynamic())
|
|
|
|
return valobj.GetQualifiedTypeName();
|
|
|
|
if (valobj.GetDynamicValue(use_dynamic))
|
|
|
|
return valobj.GetDynamicValue(use_dynamic)->GetQualifiedTypeName();
|
|
|
|
return ConstString();
|
|
|
|
}
|
|
|
|
|
|
|
|
lldb::TypeSummaryImplSP
|
|
|
|
FormatManager::GetSummaryFormat (ValueObject& valobj,
|
|
|
|
lldb::DynamicValueType use_dynamic)
|
|
|
|
{
|
|
|
|
TypeSummaryImplSP retval;
|
2013-03-28 07:08:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
|
2013-01-29 07:47:25 +08:00
|
|
|
ConstString valobj_type(GetTypeForCache(valobj, use_dynamic));
|
|
|
|
if (valobj_type)
|
|
|
|
{
|
|
|
|
if (log)
|
2013-06-19 02:23:07 +08:00
|
|
|
log->Printf("\n\n[FormatManager::GetSummaryFormat] Looking into cache for type %s", valobj_type.AsCString("<invalid>"));
|
2013-01-29 07:47:25 +08:00
|
|
|
if (m_format_cache.GetSummary(valobj_type,retval))
|
2013-06-19 02:23:07 +08:00
|
|
|
{
|
|
|
|
if (log)
|
|
|
|
{
|
|
|
|
log->Printf("[FormatManager::GetSummaryFormat] Cache search success. Returning.");
|
2013-06-26 09:03:38 +08:00
|
|
|
if (log->GetDebug())
|
2013-08-08 03:05:15 +08:00
|
|
|
log->Printf("[FormatManager::GetSummaryFormat] Cache hits: %" PRIu64 " - Cache Misses: %" PRIu64, m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses());
|
2013-06-19 02:23:07 +08:00
|
|
|
}
|
2013-01-29 07:47:25 +08:00
|
|
|
return retval;
|
2013-06-19 02:23:07 +08:00
|
|
|
}
|
2013-01-29 07:47:25 +08:00
|
|
|
if (log)
|
|
|
|
log->Printf("[FormatManager::GetSummaryFormat] Cache search failed. Going normal route");
|
|
|
|
}
|
|
|
|
retval = m_categories_map.GetSummaryFormat(valobj, use_dynamic);
|
|
|
|
if (valobj_type)
|
|
|
|
{
|
|
|
|
if (log)
|
|
|
|
log->Printf("[FormatManager::GetSummaryFormat] Caching %p for type %s",retval.get(),valobj_type.AsCString("<invalid>"));
|
|
|
|
m_format_cache.SetSummary(valobj_type,retval);
|
|
|
|
}
|
2013-06-26 09:03:38 +08:00
|
|
|
if (log && log->GetDebug())
|
2013-08-08 03:05:15 +08:00
|
|
|
log->Printf("[FormatManager::GetSummaryFormat] Cache hits: %" PRIu64 " - Cache Misses: %" PRIu64, m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses());
|
2013-01-29 07:47:25 +08:00
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifndef LLDB_DISABLE_PYTHON
|
|
|
|
lldb::SyntheticChildrenSP
|
|
|
|
FormatManager::GetSyntheticChildren (ValueObject& valobj,
|
2013-06-26 09:03:38 +08:00
|
|
|
lldb::DynamicValueType use_dynamic)
|
2013-01-29 07:47:25 +08:00
|
|
|
{
|
|
|
|
SyntheticChildrenSP retval;
|
2013-03-28 07:08:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
|
2013-01-29 07:47:25 +08:00
|
|
|
ConstString valobj_type(GetTypeForCache(valobj, use_dynamic));
|
|
|
|
if (valobj_type)
|
|
|
|
{
|
|
|
|
if (log)
|
2013-06-19 02:23:07 +08:00
|
|
|
log->Printf("\n\n[FormatManager::GetSyntheticChildren] Looking into cache for type %s", valobj_type.AsCString("<invalid>"));
|
2013-01-29 07:47:25 +08:00
|
|
|
if (m_format_cache.GetSynthetic(valobj_type,retval))
|
2013-06-19 02:23:07 +08:00
|
|
|
{
|
|
|
|
if (log)
|
|
|
|
{
|
|
|
|
log->Printf("[FormatManager::GetSyntheticChildren] Cache search success. Returning.");
|
2013-06-26 09:03:38 +08:00
|
|
|
if (log->GetDebug())
|
2013-08-08 03:05:15 +08:00
|
|
|
log->Printf("[FormatManager::GetSyntheticChildren] Cache hits: %" PRIu64 " - Cache Misses: %" PRIu64, m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses());
|
2013-06-19 02:23:07 +08:00
|
|
|
}
|
2013-01-29 07:47:25 +08:00
|
|
|
return retval;
|
2013-06-19 02:23:07 +08:00
|
|
|
}
|
2013-01-29 07:47:25 +08:00
|
|
|
if (log)
|
2013-06-19 02:23:07 +08:00
|
|
|
log->Printf("[FormatManager::GetSyntheticChildren] Cache search failed. Going normal route");
|
2013-01-29 07:47:25 +08:00
|
|
|
}
|
|
|
|
retval = m_categories_map.GetSyntheticChildren(valobj, use_dynamic);
|
|
|
|
if (valobj_type)
|
|
|
|
{
|
|
|
|
if (log)
|
2013-06-19 02:23:07 +08:00
|
|
|
log->Printf("[FormatManager::GetSyntheticChildren] Caching %p for type %s",retval.get(),valobj_type.AsCString("<invalid>"));
|
2013-01-29 07:47:25 +08:00
|
|
|
m_format_cache.SetSynthetic(valobj_type,retval);
|
|
|
|
}
|
2013-06-26 09:03:38 +08:00
|
|
|
if (log && log->GetDebug())
|
2013-08-08 03:05:15 +08:00
|
|
|
log->Printf("[FormatManager::GetSyntheticChildren] Cache hits: %" PRIu64 " - Cache Misses: %" PRIu64, m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses());
|
2013-01-29 07:47:25 +08:00
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
FormatManager::FormatManager() :
|
|
|
|
m_format_cache(),
|
2011-08-18 06:13:59 +08:00
|
|
|
m_value_nav("format",this),
|
|
|
|
m_named_summaries_map(this),
|
|
|
|
m_last_revision(0),
|
|
|
|
m_categories_map(this),
|
2011-08-23 02:36:52 +08:00
|
|
|
m_default_category_name(ConstString("default")),
|
|
|
|
m_system_category_name(ConstString("system")),
|
2012-02-01 01:01:51 +08:00
|
|
|
m_gnu_cpp_category_name(ConstString("gnu-libstdc++")),
|
2012-03-13 03:47:17 +08:00
|
|
|
m_libcxx_category_name(ConstString("libcxx")),
|
2012-02-17 11:18:30 +08:00
|
|
|
m_objc_category_name(ConstString("objc")),
|
|
|
|
m_corefoundation_category_name(ConstString("CoreFoundation")),
|
|
|
|
m_coregraphics_category_name(ConstString("CoreGraphics")),
|
|
|
|
m_coreservices_category_name(ConstString("CoreServices")),
|
2012-02-24 07:10:03 +08:00
|
|
|
m_vectortypes_category_name(ConstString("VectorTypes")),
|
|
|
|
m_appkit_category_name(ConstString("AppKit"))
|
2011-08-18 06:13:59 +08:00
|
|
|
{
|
2012-02-17 11:18:30 +08:00
|
|
|
LoadSystemFormatters();
|
2013-01-12 09:22:57 +08:00
|
|
|
LoadLibStdcppFormatters();
|
2012-03-13 03:47:17 +08:00
|
|
|
LoadLibcxxFormatters();
|
2012-02-17 11:18:30 +08:00
|
|
|
LoadObjCFormatters();
|
2011-08-18 06:13:59 +08:00
|
|
|
|
2013-01-29 07:47:25 +08:00
|
|
|
EnableCategory(m_objc_category_name,TypeCategoryMap::Last);
|
|
|
|
EnableCategory(m_corefoundation_category_name,TypeCategoryMap::Last);
|
|
|
|
EnableCategory(m_appkit_category_name,TypeCategoryMap::Last);
|
|
|
|
EnableCategory(m_coreservices_category_name,TypeCategoryMap::Last);
|
|
|
|
EnableCategory(m_coregraphics_category_name,TypeCategoryMap::Last);
|
|
|
|
EnableCategory(m_gnu_cpp_category_name,TypeCategoryMap::Last);
|
|
|
|
EnableCategory(m_libcxx_category_name,TypeCategoryMap::Last);
|
|
|
|
EnableCategory(m_vectortypes_category_name,TypeCategoryMap::Last);
|
|
|
|
EnableCategory(m_system_category_name,TypeCategoryMap::Last);
|
2012-02-17 11:18:30 +08:00
|
|
|
}
|
|
|
|
|
2013-01-11 06:08:35 +08:00
|
|
|
static void
|
|
|
|
AddStringSummary(TypeCategoryImpl::SharedPointer category_sp,
|
|
|
|
const char* string,
|
|
|
|
ConstString type_name,
|
2013-02-22 03:57:10 +08:00
|
|
|
TypeSummaryImpl::Flags flags,
|
|
|
|
bool regex = false)
|
2013-01-11 06:08:35 +08:00
|
|
|
{
|
|
|
|
lldb::TypeSummaryImplSP summary_sp(new StringSummaryFormat(flags,
|
|
|
|
string));
|
2013-02-22 03:57:10 +08:00
|
|
|
|
|
|
|
if (regex)
|
2013-05-07 02:55:52 +08:00
|
|
|
category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())),summary_sp);
|
2013-02-22 03:57:10 +08:00
|
|
|
else
|
|
|
|
category_sp->GetSummaryNavigator()->Add(type_name, summary_sp);
|
2013-01-11 06:08:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifndef LLDB_DISABLE_PYTHON
|
|
|
|
static void
|
|
|
|
AddScriptSummary(TypeCategoryImpl::SharedPointer category_sp,
|
|
|
|
const char* funct_name,
|
|
|
|
ConstString type_name,
|
2013-02-22 03:57:10 +08:00
|
|
|
TypeSummaryImpl::Flags flags,
|
|
|
|
bool regex = false)
|
2013-01-11 06:08:35 +08:00
|
|
|
{
|
|
|
|
|
|
|
|
std::string code(" ");
|
|
|
|
code.append(funct_name).append("(valobj,internal_dict)");
|
|
|
|
|
|
|
|
lldb::TypeSummaryImplSP summary_sp(new ScriptSummaryFormat(flags,
|
|
|
|
funct_name,
|
|
|
|
code.c_str()));
|
2013-02-22 03:57:10 +08:00
|
|
|
if (regex)
|
2013-05-07 02:55:52 +08:00
|
|
|
category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())),summary_sp);
|
2013-02-22 03:57:10 +08:00
|
|
|
else
|
|
|
|
category_sp->GetSummaryNavigator()->Add(type_name, summary_sp);
|
2013-01-11 06:08:35 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef LLDB_DISABLE_PYTHON
|
|
|
|
static void
|
|
|
|
AddCXXSummary (TypeCategoryImpl::SharedPointer category_sp,
|
|
|
|
CXXFunctionSummaryFormat::Callback funct,
|
|
|
|
const char* description,
|
|
|
|
ConstString type_name,
|
2013-02-22 03:57:10 +08:00
|
|
|
TypeSummaryImpl::Flags flags,
|
|
|
|
bool regex = false)
|
2013-01-11 06:08:35 +08:00
|
|
|
{
|
|
|
|
lldb::TypeSummaryImplSP summary_sp(new CXXFunctionSummaryFormat(flags,funct,description));
|
2013-02-22 03:57:10 +08:00
|
|
|
if (regex)
|
2013-05-07 02:55:52 +08:00
|
|
|
category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())),summary_sp);
|
2013-02-22 03:57:10 +08:00
|
|
|
else
|
|
|
|
category_sp->GetSummaryNavigator()->Add(type_name, summary_sp);
|
2013-01-11 06:08:35 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef LLDB_DISABLE_PYTHON
|
|
|
|
static void AddCXXSynthetic (TypeCategoryImpl::SharedPointer category_sp,
|
|
|
|
CXXSyntheticChildren::CreateFrontEndCallback generator,
|
|
|
|
const char* description,
|
|
|
|
ConstString type_name,
|
2013-02-22 03:57:10 +08:00
|
|
|
ScriptedSyntheticChildren::Flags flags,
|
|
|
|
bool regex = false)
|
2013-01-11 06:08:35 +08:00
|
|
|
{
|
|
|
|
lldb::SyntheticChildrenSP synth_sp(new CXXSyntheticChildren(flags,description,generator));
|
2013-02-22 03:57:10 +08:00
|
|
|
if (regex)
|
|
|
|
category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())), synth_sp);
|
|
|
|
else
|
|
|
|
category_sp->GetSyntheticNavigator()->Add(type_name,synth_sp);
|
2013-01-11 06:08:35 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-02-17 11:18:30 +08:00
|
|
|
void
|
2013-01-12 09:22:57 +08:00
|
|
|
FormatManager::LoadLibStdcppFormatters()
|
2012-02-17 11:18:30 +08:00
|
|
|
{
|
2012-03-02 08:55:53 +08:00
|
|
|
TypeSummaryImpl::Flags stl_summary_flags;
|
|
|
|
stl_summary_flags.SetCascades(true)
|
|
|
|
.SetSkipPointers(false)
|
|
|
|
.SetSkipReferences(false)
|
|
|
|
.SetDontShowChildren(true)
|
|
|
|
.SetDontShowValue(true)
|
|
|
|
.SetShowMembersOneLiner(false)
|
|
|
|
.SetHideItemNames(false);
|
|
|
|
|
|
|
|
lldb::TypeSummaryImplSP std_string_summary_sp(new StringSummaryFormat(stl_summary_flags,
|
2012-02-15 10:34:21 +08:00
|
|
|
"${var._M_dataplus._M_p}"));
|
Redesign of the interaction between Python and frozen objects:
- introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from
a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored
in frozen objects ; now such reads transparently move from host to target as required
- as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also
removed code that enabled to recognize an expression result VO as such
- introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO
representing a T* or T[], and doing dereferences transparently
in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData
- as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it
en lieu of doing the raw read itself
- introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers,
this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory)
in public layer this returns an SBData, just like GetPointeeData()
- introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData
the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any
of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values
- added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing
Solved a bug where global pointers to global variables were not dereferenced correctly for display
New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128
Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command
Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type
of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file
addresses that generate file address children UNLESS we have a live process)
Updated help text for summary-string
Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers
Edited the syntax and help for some commands to have proper argument types
llvm-svn: 139160
2011-09-07 03:20:51 +08:00
|
|
|
|
2012-02-15 10:34:21 +08:00
|
|
|
TypeCategoryImpl::SharedPointer gnu_category_sp = GetCategory(m_gnu_cpp_category_name);
|
Redesign of the interaction between Python and frozen objects:
- introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from
a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored
in frozen objects ; now such reads transparently move from host to target as required
- as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also
removed code that enabled to recognize an expression result VO as such
- introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO
representing a T* or T[], and doing dereferences transparently
in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData
- as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it
en lieu of doing the raw read itself
- introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers,
this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory)
in public layer this returns an SBData, just like GetPointeeData()
- introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData
the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any
of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values
- added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing
Solved a bug where global pointers to global variables were not dereferenced correctly for display
New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128
Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command
Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type
of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file
addresses that generate file address children UNLESS we have a live process)
Updated help text for summary-string
Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers
Edited the syntax and help for some commands to have proper argument types
llvm-svn: 139160
2011-09-07 03:20:51 +08:00
|
|
|
|
|
|
|
gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::string"),
|
|
|
|
std_string_summary_sp);
|
|
|
|
gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<char>"),
|
|
|
|
std_string_summary_sp);
|
|
|
|
gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<char,std::char_traits<char>,std::allocator<char> >"),
|
|
|
|
std_string_summary_sp);
|
2012-03-27 07:03:23 +08:00
|
|
|
gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<char, std::char_traits<char>, std::allocator<char> >"),
|
Added a new --omit-names (-O, uppercase letter o) option to "type summary add".
When used in conjunction with --inline-children, this option will cause the names of the values to be omitted from the output. This can be beneficial in cases such as vFloat, where it will compact the representation from
([0]=1,[1]=2,[2]=3,[3]=4) to (1, 2, 3, 4).
Added a test case to check that the new option works correctly.
Also took some time to revisit SummaryFormat and related classes and tweak them for added readability and maintainability.
Finally, added a new class name to which the std::string summary should be applied.
llvm-svn: 149644
2012-02-03 07:34:52 +08:00
|
|
|
std_string_summary_sp);
|
2012-02-17 11:18:30 +08:00
|
|
|
|
2013-01-12 09:22:57 +08:00
|
|
|
// making sure we force-pick the summary for printing wstring (_M_p is a wchar_t*)
|
|
|
|
lldb::TypeSummaryImplSP std_wstring_summary_sp(new StringSummaryFormat(stl_summary_flags,
|
|
|
|
"${var._M_dataplus._M_p%S}"));
|
|
|
|
|
|
|
|
gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::wstring"),
|
|
|
|
std_wstring_summary_sp);
|
|
|
|
gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<wchar_t>"),
|
|
|
|
std_wstring_summary_sp);
|
|
|
|
gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >"),
|
|
|
|
std_wstring_summary_sp);
|
|
|
|
gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >"),
|
|
|
|
std_wstring_summary_sp);
|
|
|
|
|
Redesign of the interaction between Python and frozen objects:
- introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from
a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored
in frozen objects ; now such reads transparently move from host to target as required
- as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also
removed code that enabled to recognize an expression result VO as such
- introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO
representing a T* or T[], and doing dereferences transparently
in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData
- as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it
en lieu of doing the raw read itself
- introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers,
this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory)
in public layer this returns an SBData, just like GetPointeeData()
- introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData
the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any
of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values
- added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing
Solved a bug where global pointers to global variables were not dereferenced correctly for display
New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128
Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command
Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type
of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file
addresses that generate file address children UNLESS we have a live process)
Updated help text for summary-string
Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers
Edited the syntax and help for some commands to have proper argument types
llvm-svn: 139160
2011-09-07 03:20:51 +08:00
|
|
|
|
2011-11-04 11:34:56 +08:00
|
|
|
#ifndef LLDB_DISABLE_PYTHON
|
2012-02-15 10:34:21 +08:00
|
|
|
|
|
|
|
SyntheticChildren::Flags stl_synth_flags;
|
|
|
|
stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(false);
|
|
|
|
|
2012-03-27 10:35:13 +08:00
|
|
|
gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::vector<.+>(( )?&)?$")),
|
2013-01-29 07:47:25 +08:00
|
|
|
SyntheticChildrenSP(new ScriptedSyntheticChildren(stl_synth_flags,
|
2012-04-26 01:53:41 +08:00
|
|
|
"lldb.formatters.cpp.gnu_libstdcpp.StdVectorSynthProvider")));
|
2012-03-27 10:35:13 +08:00
|
|
|
gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::map<.+> >(( )?&)?$")),
|
2013-01-29 07:47:25 +08:00
|
|
|
SyntheticChildrenSP(new ScriptedSyntheticChildren(stl_synth_flags,
|
2012-04-26 01:53:41 +08:00
|
|
|
"lldb.formatters.cpp.gnu_libstdcpp.StdMapSynthProvider")));
|
2012-03-27 10:35:13 +08:00
|
|
|
gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::list<.+>(( )?&)?$")),
|
2013-01-29 07:47:25 +08:00
|
|
|
SyntheticChildrenSP(new ScriptedSyntheticChildren(stl_synth_flags,
|
2012-04-26 01:53:41 +08:00
|
|
|
"lldb.formatters.cpp.gnu_libstdcpp.StdListSynthProvider")));
|
2012-03-02 08:55:53 +08:00
|
|
|
|
2013-04-25 05:52:24 +08:00
|
|
|
stl_summary_flags.SetDontShowChildren(false);stl_summary_flags.SetSkipPointers(true);
|
2012-03-27 10:35:13 +08:00
|
|
|
gnu_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::vector<.+>(( )?&)?$")),
|
|
|
|
TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags,
|
|
|
|
"size=${svar%#}")));
|
|
|
|
gnu_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::map<.+> >(( )?&)?$")),
|
|
|
|
TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags,
|
|
|
|
"size=${svar%#}")));
|
|
|
|
gnu_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::list<.+>(( )?&)?$")),
|
2012-03-02 08:55:53 +08:00
|
|
|
TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags,
|
|
|
|
"size=${svar%#}")));
|
2013-02-22 03:57:10 +08:00
|
|
|
|
|
|
|
AddCXXSynthetic(gnu_category_sp, lldb_private::formatters::LibStdcppVectorIteratorSyntheticFrontEndCreator, "std::vector iterator synthetic children", ConstString("^__gnu_cxx::__normal_iterator<.+>$"), stl_synth_flags, true);
|
|
|
|
|
|
|
|
AddCXXSynthetic(gnu_category_sp, lldb_private::formatters::LibstdcppMapIteratorSyntheticFrontEndCreator, "std::map iterator synthetic children", ConstString("^std::_Rb_tree_iterator<.+>$"), stl_synth_flags, true);
|
2013-02-05 06:54:42 +08:00
|
|
|
|
|
|
|
gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::vector<std::allocator<bool> >"),
|
|
|
|
TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags, "size=${svar%#}")));
|
|
|
|
|
|
|
|
gnu_category_sp->GetSyntheticNavigator()->Add(ConstString("std::vector<std::allocator<bool> >"),
|
|
|
|
SyntheticChildrenSP(new CXXSyntheticChildren(stl_synth_flags,"libc++ std::vector<bool> synthetic children",lldb_private::formatters::LibstdcppVectorBoolSyntheticFrontEndCreator)));
|
|
|
|
|
2012-02-17 11:18:30 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2012-03-13 03:47:17 +08:00
|
|
|
void
|
|
|
|
FormatManager::LoadLibcxxFormatters()
|
|
|
|
{
|
|
|
|
TypeSummaryImpl::Flags stl_summary_flags;
|
|
|
|
stl_summary_flags.SetCascades(true)
|
|
|
|
.SetSkipPointers(false)
|
|
|
|
.SetSkipReferences(false)
|
|
|
|
.SetDontShowChildren(true)
|
|
|
|
.SetDontShowValue(true)
|
|
|
|
.SetShowMembersOneLiner(false)
|
|
|
|
.SetHideItemNames(false);
|
|
|
|
|
2012-03-13 09:19:42 +08:00
|
|
|
#ifndef LLDB_DISABLE_PYTHON
|
2013-01-12 09:00:22 +08:00
|
|
|
//std::string code(" lldb.formatters.cpp.libcxx.stdstring_SummaryProvider(valobj,internal_dict)");
|
|
|
|
//lldb::TypeSummaryImplSP std_string_summary_sp(new ScriptSummaryFormat(stl_summary_flags, "lldb.formatters.cpp.libcxx.stdstring_SummaryProvider",code.c_str()));
|
2012-03-13 03:47:17 +08:00
|
|
|
|
2013-01-12 09:00:22 +08:00
|
|
|
lldb::TypeSummaryImplSP std_string_summary_sp(new CXXFunctionSummaryFormat(stl_summary_flags, lldb_private::formatters::LibcxxStringSummaryProvider, "std::string summary provider"));
|
|
|
|
lldb::TypeSummaryImplSP std_wstring_summary_sp(new CXXFunctionSummaryFormat(stl_summary_flags, lldb_private::formatters::LibcxxWStringSummaryProvider, "std::wstring summary provider"));
|
|
|
|
|
2012-03-13 03:47:17 +08:00
|
|
|
TypeCategoryImpl::SharedPointer libcxx_category_sp = GetCategory(m_libcxx_category_name);
|
|
|
|
|
|
|
|
libcxx_category_sp->GetSummaryNavigator()->Add(ConstString("std::__1::string"),
|
|
|
|
std_string_summary_sp);
|
2012-03-27 07:03:23 +08:00
|
|
|
libcxx_category_sp->GetSummaryNavigator()->Add(ConstString("std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >"),
|
2012-03-13 03:47:17 +08:00
|
|
|
std_string_summary_sp);
|
2012-03-13 09:19:42 +08:00
|
|
|
|
2013-01-12 09:00:22 +08:00
|
|
|
libcxx_category_sp->GetSummaryNavigator()->Add(ConstString("std::__1::wstring"),
|
|
|
|
std_wstring_summary_sp);
|
|
|
|
libcxx_category_sp->GetSummaryNavigator()->Add(ConstString("std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >"),
|
|
|
|
std_wstring_summary_sp);
|
|
|
|
|
2012-03-13 03:47:17 +08:00
|
|
|
SyntheticChildren::Flags stl_synth_flags;
|
|
|
|
stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(false);
|
|
|
|
|
2013-03-20 06:58:48 +08:00
|
|
|
AddCXXSynthetic(libcxx_category_sp, lldb_private::formatters::LibcxxStdVectorSyntheticFrontEndCreator, "libc++ std::vector synthetic children", ConstString("^std::__1::vector<.+>(( )?&)?$"), stl_synth_flags, true);
|
|
|
|
AddCXXSynthetic(libcxx_category_sp, lldb_private::formatters::LibcxxStdListSyntheticFrontEndCreator, "libc++ std::list synthetic children", ConstString("^std::__1::list<.+>(( )?&)?$"), stl_synth_flags, true);
|
|
|
|
AddCXXSynthetic(libcxx_category_sp, lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator, "libc++ std::map synthetic children", ConstString("^std::__1::map<.+> >(( )?&)?$"), stl_synth_flags, true);
|
2013-05-07 02:55:52 +08:00
|
|
|
AddCXXSynthetic(libcxx_category_sp, lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEndCreator, "libc++ std::vector<bool> synthetic children", ConstString("std::__1::vector<std::__1::allocator<bool> >"), stl_synth_flags);
|
2013-06-06 01:47:23 +08:00
|
|
|
AddCXXSynthetic(libcxx_category_sp, lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator, "libc++ std::set synthetic children", ConstString("^std::__1::set<.+> >(( )?&)?$"), stl_synth_flags, true);
|
|
|
|
AddCXXSynthetic(libcxx_category_sp, lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator, "libc++ std::multiset synthetic children", ConstString("^std::__1::multiset<.+> >(( )?&)?$"), stl_synth_flags, true);
|
|
|
|
AddCXXSynthetic(libcxx_category_sp, lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator, "libc++ std::multimap synthetic children", ConstString("^std::__1::multimap<.+> >(( )?&)?$"), stl_synth_flags, true);
|
2013-03-20 06:58:48 +08:00
|
|
|
|
2012-08-28 01:42:50 +08:00
|
|
|
libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::__1::)deque<.+>(( )?&)?$")),
|
2013-01-29 07:47:25 +08:00
|
|
|
SyntheticChildrenSP(new ScriptedSyntheticChildren(stl_synth_flags,
|
2012-08-28 01:42:50 +08:00
|
|
|
"lldb.formatters.cpp.libcxx.stddeque_SynthProvider")));
|
2013-03-20 06:58:48 +08:00
|
|
|
|
|
|
|
AddCXXSynthetic(libcxx_category_sp, lldb_private::formatters::LibcxxSharedPtrSyntheticFrontEndCreator, "shared_ptr synthetic children", ConstString("^(std::__1::)shared_ptr<.+>(( )?&)?$"), stl_synth_flags, true);
|
|
|
|
AddCXXSynthetic(libcxx_category_sp, lldb_private::formatters::LibcxxSharedPtrSyntheticFrontEndCreator, "weak_ptr synthetic children", ConstString("^(std::__1::)weak_ptr<.+>(( )?&)?$"), stl_synth_flags, true);
|
2012-08-28 01:42:50 +08:00
|
|
|
|
2013-05-07 02:55:52 +08:00
|
|
|
stl_summary_flags.SetDontShowChildren(false);stl_summary_flags.SetSkipPointers(false);
|
|
|
|
|
|
|
|
AddCXXSummary(libcxx_category_sp, lldb_private::formatters::LibcxxContainerSummaryProvider, "libc++ std::vector summary provider", ConstString("^std::__1::vector<.+>(( )?&)?$"), stl_summary_flags, true);
|
|
|
|
AddCXXSummary(libcxx_category_sp, lldb_private::formatters::LibcxxContainerSummaryProvider, "libc++ std::list summary provider", ConstString("^std::__1::list<.+>(( )?&)?$"), stl_summary_flags, true);
|
|
|
|
AddCXXSummary(libcxx_category_sp, lldb_private::formatters::LibcxxContainerSummaryProvider, "libc++ std::map summary provider", ConstString("^std::__1::map<.+>(( )?&)?$"), stl_summary_flags, true);
|
|
|
|
AddCXXSummary(libcxx_category_sp, lldb_private::formatters::LibcxxContainerSummaryProvider, "libc++ std::deque summary provider", ConstString("^std::__1::deque<.+>(( )?&)?$"), stl_summary_flags, true);
|
|
|
|
AddCXXSummary(libcxx_category_sp, lldb_private::formatters::LibcxxContainerSummaryProvider, "libc++ std::vector<bool> summary provider", ConstString("std::__1::vector<std::__1::allocator<bool> >"), stl_summary_flags);
|
2013-06-06 01:47:23 +08:00
|
|
|
AddCXXSummary(libcxx_category_sp, lldb_private::formatters::LibcxxContainerSummaryProvider, "libc++ std::set summary provider", ConstString("^std::__1::set<.+>(( )?&)?$"), stl_summary_flags, true);
|
|
|
|
AddCXXSummary(libcxx_category_sp, lldb_private::formatters::LibcxxContainerSummaryProvider, "libc++ std::multiset summary provider", ConstString("^std::__1::multiset<.+>(( )?&)?$"), stl_summary_flags, true);
|
|
|
|
AddCXXSummary(libcxx_category_sp, lldb_private::formatters::LibcxxContainerSummaryProvider, "libc++ std::multimap summary provider", ConstString("^std::__1::multimap<.+>(( )?&)?$"), stl_summary_flags, true);
|
2013-05-07 02:55:52 +08:00
|
|
|
|
|
|
|
stl_summary_flags.SetSkipPointers(true);
|
|
|
|
AddStringSummary(libcxx_category_sp, "{${var.__ptr_%S}} (strong=${var.count} weak=${var.weak_count})}", ConstString("^std::__1::shared_ptr<.+>(( )?&)?$"), stl_summary_flags, true);
|
|
|
|
AddStringSummary(libcxx_category_sp, "{${var.__ptr_%S}} (strong=${var.count} weak=${var.weak_count})}", ConstString("^std::__1::weak_ptr<.+>(( )?&)?$"), stl_summary_flags, true);
|
2013-02-22 03:57:10 +08:00
|
|
|
|
|
|
|
AddCXXSynthetic(libcxx_category_sp, lldb_private::formatters::LibCxxVectorIteratorSyntheticFrontEndCreator, "std::vector iterator synthetic children", ConstString("^std::__1::__wrap_iter<.+>$"), stl_synth_flags, true);
|
|
|
|
|
|
|
|
AddCXXSynthetic(libcxx_category_sp, lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEndCreator, "std::map iterator synthetic children", ConstString("^std::__1::__map_iterator<.+>$"), stl_synth_flags, true);
|
2013-01-17 07:17:30 +08:00
|
|
|
|
2012-03-13 03:47:17 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2012-02-17 11:18:30 +08:00
|
|
|
void
|
|
|
|
FormatManager::LoadSystemFormatters()
|
|
|
|
{
|
2013-01-11 06:08:35 +08:00
|
|
|
|
|
|
|
TypeSummaryImpl::Flags string_flags;
|
2013-02-22 08:37:31 +08:00
|
|
|
string_flags.SetCascades(true)
|
2013-01-11 06:08:35 +08:00
|
|
|
.SetSkipPointers(true)
|
|
|
|
.SetSkipReferences(false)
|
|
|
|
.SetDontShowChildren(true)
|
|
|
|
.SetDontShowValue(false)
|
|
|
|
.SetShowMembersOneLiner(false)
|
|
|
|
.SetHideItemNames(false);
|
|
|
|
|
|
|
|
lldb::TypeSummaryImplSP string_format(new StringSummaryFormat(string_flags, "${var%s}"));
|
2012-02-17 11:18:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
lldb::TypeSummaryImplSP string_array_format(new StringSummaryFormat(TypeSummaryImpl::Flags().SetCascades(false)
|
|
|
|
.SetSkipPointers(true)
|
|
|
|
.SetSkipReferences(false)
|
2013-03-29 05:36:58 +08:00
|
|
|
.SetDontShowChildren(true)
|
2012-02-17 11:18:30 +08:00
|
|
|
.SetDontShowValue(true)
|
|
|
|
.SetShowMembersOneLiner(false)
|
|
|
|
.SetHideItemNames(false),
|
|
|
|
"${var%s}"));
|
|
|
|
|
|
|
|
lldb::RegularExpressionSP any_size_char_arr(new RegularExpression("char \\[[0-9]+\\]"));
|
|
|
|
|
|
|
|
TypeCategoryImpl::SharedPointer sys_category_sp = GetCategory(m_system_category_name);
|
|
|
|
|
|
|
|
sys_category_sp->GetSummaryNavigator()->Add(ConstString("char *"), string_format);
|
2013-06-05 05:53:55 +08:00
|
|
|
sys_category_sp->GetSummaryNavigator()->Add(ConstString("unsigned char *"), string_format);
|
2012-02-17 11:18:30 +08:00
|
|
|
sys_category_sp->GetRegexSummaryNavigator()->Add(any_size_char_arr, string_array_format);
|
2012-07-14 02:54:40 +08:00
|
|
|
|
|
|
|
lldb::TypeSummaryImplSP ostype_summary(new StringSummaryFormat(TypeSummaryImpl::Flags().SetCascades(false)
|
|
|
|
.SetSkipPointers(true)
|
|
|
|
.SetSkipReferences(true)
|
|
|
|
.SetDontShowChildren(true)
|
|
|
|
.SetDontShowValue(false)
|
|
|
|
.SetShowMembersOneLiner(false)
|
|
|
|
.SetHideItemNames(false),
|
|
|
|
"${var%O}"));
|
|
|
|
|
|
|
|
sys_category_sp->GetSummaryNavigator()->Add(ConstString("OSType"), ostype_summary);
|
2012-02-24 07:10:03 +08:00
|
|
|
|
2013-01-12 12:24:50 +08:00
|
|
|
#ifndef LLDB_DISABLE_PYTHON
|
2013-01-11 06:08:35 +08:00
|
|
|
// FIXME because of a bug in the FormatNavigator we need to add a summary for both X* and const X* (<rdar://problem/12717717>)
|
|
|
|
AddCXXSummary(sys_category_sp, lldb_private::formatters::Char16StringSummaryProvider, "char16_t * summary provider", ConstString("char16_t *"), string_flags);
|
2012-02-24 07:10:03 +08:00
|
|
|
|
2013-01-11 06:08:35 +08:00
|
|
|
AddCXXSummary(sys_category_sp, lldb_private::formatters::Char32StringSummaryProvider, "char32_t * summary provider", ConstString("char32_t *"), string_flags);
|
2013-01-11 10:44:00 +08:00
|
|
|
|
|
|
|
AddCXXSummary(sys_category_sp, lldb_private::formatters::WCharStringSummaryProvider, "wchar_t * summary provider", ConstString("wchar_t *"), string_flags);
|
2013-01-15 07:53:26 +08:00
|
|
|
|
|
|
|
AddCXXSummary(sys_category_sp, lldb_private::formatters::Char16StringSummaryProvider, "unichar * summary provider", ConstString("unichar *"), string_flags);
|
|
|
|
|
|
|
|
TypeSummaryImpl::Flags widechar_flags;
|
|
|
|
widechar_flags.SetDontShowValue(true)
|
|
|
|
.SetSkipPointers(true)
|
|
|
|
.SetSkipReferences(false)
|
|
|
|
.SetCascades(true)
|
|
|
|
.SetDontShowChildren(true)
|
|
|
|
.SetHideItemNames(true)
|
|
|
|
.SetShowMembersOneLiner(false);
|
|
|
|
|
|
|
|
AddCXXSummary(sys_category_sp, lldb_private::formatters::Char16SummaryProvider, "char16_t summary provider", ConstString("char16_t"), widechar_flags);
|
|
|
|
AddCXXSummary(sys_category_sp, lldb_private::formatters::Char32SummaryProvider, "char32_t summary provider", ConstString("char32_t"), widechar_flags);
|
|
|
|
AddCXXSummary(sys_category_sp, lldb_private::formatters::WCharSummaryProvider, "wchar_t summary provider", ConstString("wchar_t"), widechar_flags);
|
|
|
|
|
|
|
|
AddCXXSummary(sys_category_sp, lldb_private::formatters::Char16SummaryProvider, "unichar summary provider", ConstString("unichar"), widechar_flags);
|
|
|
|
|
2013-01-12 12:24:50 +08:00
|
|
|
#endif
|
2012-02-24 07:10:03 +08:00
|
|
|
}
|
2012-09-14 02:27:09 +08:00
|
|
|
|
2012-02-17 11:18:30 +08:00
|
|
|
void
|
|
|
|
FormatManager::LoadObjCFormatters()
|
|
|
|
{
|
|
|
|
TypeSummaryImpl::Flags objc_flags;
|
|
|
|
objc_flags.SetCascades(false)
|
2012-07-14 02:55:41 +08:00
|
|
|
.SetSkipPointers(true)
|
|
|
|
.SetSkipReferences(true)
|
2012-02-17 11:18:30 +08:00
|
|
|
.SetDontShowChildren(true)
|
|
|
|
.SetDontShowValue(true)
|
|
|
|
.SetShowMembersOneLiner(false)
|
|
|
|
.SetHideItemNames(false);
|
2012-09-05 06:04:50 +08:00
|
|
|
|
|
|
|
TypeCategoryImpl::SharedPointer objc_category_sp = GetCategory(m_objc_category_name);
|
2012-02-17 11:18:30 +08:00
|
|
|
|
2012-10-30 05:18:03 +08:00
|
|
|
lldb::TypeSummaryImplSP ObjC_BOOL_summary(new CXXFunctionSummaryFormat(objc_flags, lldb_private::formatters::ObjCBOOLSummaryProvider,""));
|
2012-02-01 01:01:51 +08:00
|
|
|
objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL"),
|
|
|
|
ObjC_BOOL_summary);
|
2012-07-14 02:55:41 +08:00
|
|
|
objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL &"),
|
2012-10-30 05:18:03 +08:00
|
|
|
ObjC_BOOL_summary);
|
2012-07-14 02:55:41 +08:00
|
|
|
objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL *"),
|
2012-10-30 05:18:03 +08:00
|
|
|
ObjC_BOOL_summary);
|
|
|
|
|
2012-11-02 07:35:19 +08:00
|
|
|
#ifndef LLDB_DISABLE_PYTHON
|
2012-03-02 08:55:53 +08:00
|
|
|
// we need to skip pointers here since we are special casing a SEL* when retrieving its value
|
|
|
|
objc_flags.SetSkipPointers(true);
|
2013-01-11 06:08:35 +08:00
|
|
|
AddCXXSummary(objc_category_sp, lldb_private::formatters::ObjCSELSummaryProvider<false>, "SEL summary provider", ConstString("SEL"), objc_flags);
|
|
|
|
AddCXXSummary(objc_category_sp, lldb_private::formatters::ObjCSELSummaryProvider<false>, "SEL summary provider", ConstString("struct objc_selector"), objc_flags);
|
|
|
|
AddCXXSummary(objc_category_sp, lldb_private::formatters::ObjCSELSummaryProvider<false>, "SEL summary provider", ConstString("objc_selector"), objc_flags);
|
|
|
|
AddCXXSummary(objc_category_sp, lldb_private::formatters::ObjCSELSummaryProvider<true>, "SEL summary provider", ConstString("objc_selector *"), objc_flags);
|
2013-02-15 08:06:04 +08:00
|
|
|
AddCXXSummary(objc_category_sp, lldb_private::formatters::ObjCSELSummaryProvider<true>, "SEL summary provider", ConstString("SEL *"), objc_flags);
|
2012-10-30 05:18:03 +08:00
|
|
|
|
2013-03-16 02:55:30 +08:00
|
|
|
AddCXXSummary(objc_category_sp, lldb_private::formatters::ObjCClassSummaryProvider, "Class summary provider", ConstString("Class"), objc_flags);
|
2013-04-26 08:59:02 +08:00
|
|
|
|
|
|
|
SyntheticChildren::Flags class_synth_flags;
|
|
|
|
class_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(false);
|
|
|
|
|
|
|
|
AddCXXSynthetic(objc_category_sp, lldb_private::formatters::ObjCClassSyntheticFrontEndCreator, "Class synthetic children", ConstString("Class"), class_synth_flags);
|
2012-09-05 06:04:50 +08:00
|
|
|
#endif // LLDB_DISABLE_PYTHON
|
2012-03-02 08:55:53 +08:00
|
|
|
|
2012-10-30 05:18:03 +08:00
|
|
|
objc_flags.SetSkipPointers(false);
|
2013-07-11 02:25:45 +08:00
|
|
|
objc_flags.SetCascades(true);
|
|
|
|
objc_flags.SetSkipReferences(false);
|
|
|
|
|
|
|
|
AddStringSummary (objc_category_sp,
|
|
|
|
"${var.__FuncPtr%A}",
|
|
|
|
ConstString("__block_literal_generic"),
|
|
|
|
objc_flags);
|
2012-10-30 05:18:03 +08:00
|
|
|
|
2012-02-17 11:18:30 +08:00
|
|
|
TypeCategoryImpl::SharedPointer corefoundation_category_sp = GetCategory(m_corefoundation_category_name);
|
|
|
|
|
2012-12-11 07:30:25 +08:00
|
|
|
AddStringSummary(corefoundation_category_sp,
|
|
|
|
"${var.years} years, ${var.months} months, ${var.days} days, ${var.hours} hours, ${var.minutes} minutes ${var.seconds} seconds",
|
|
|
|
ConstString("CFGregorianUnits"),
|
|
|
|
objc_flags);
|
|
|
|
AddStringSummary(corefoundation_category_sp,
|
|
|
|
"location=${var.location} length=${var.length}",
|
|
|
|
ConstString("CFRange"),
|
|
|
|
objc_flags);
|
|
|
|
AddStringSummary(corefoundation_category_sp,
|
|
|
|
"(x=${var.x}, y=${var.y})",
|
|
|
|
ConstString("NSPoint"),
|
|
|
|
objc_flags);
|
|
|
|
AddStringSummary(corefoundation_category_sp,
|
|
|
|
"location=${var.location}, length=${var.length}",
|
|
|
|
ConstString("NSRange"),
|
|
|
|
objc_flags);
|
|
|
|
AddStringSummary(corefoundation_category_sp,
|
|
|
|
"${var.origin}, ${var.size}",
|
|
|
|
ConstString("NSRect"),
|
|
|
|
objc_flags);
|
|
|
|
AddStringSummary(corefoundation_category_sp,
|
|
|
|
"(${var.origin}, ${var.size}), ...",
|
|
|
|
ConstString("NSRectArray"),
|
|
|
|
objc_flags);
|
|
|
|
AddStringSummary(objc_category_sp,
|
|
|
|
"(width=${var.width}, height=${var.height})",
|
|
|
|
ConstString("NSSize"),
|
|
|
|
objc_flags);
|
2012-02-17 11:18:30 +08:00
|
|
|
|
|
|
|
TypeCategoryImpl::SharedPointer coregraphics_category_sp = GetCategory(m_coregraphics_category_name);
|
|
|
|
|
2012-12-11 07:30:25 +08:00
|
|
|
AddStringSummary(coregraphics_category_sp,
|
|
|
|
"(width=${var.width}, height=${var.height})",
|
|
|
|
ConstString("CGSize"),
|
|
|
|
objc_flags);
|
|
|
|
AddStringSummary(coregraphics_category_sp,
|
|
|
|
"(x=${var.x}, y=${var.y})",
|
|
|
|
ConstString("CGPoint"),
|
|
|
|
objc_flags);
|
|
|
|
AddStringSummary(coregraphics_category_sp,
|
|
|
|
"origin=${var.origin} size=${var.size}",
|
|
|
|
ConstString("CGRect"),
|
|
|
|
objc_flags);
|
2012-02-17 11:18:30 +08:00
|
|
|
|
|
|
|
TypeCategoryImpl::SharedPointer coreservices_category_sp = GetCategory(m_coreservices_category_name);
|
|
|
|
|
2012-12-11 07:30:25 +08:00
|
|
|
AddStringSummary(coreservices_category_sp,
|
|
|
|
"red=${var.red} green=${var.green} blue=${var.blue}",
|
|
|
|
ConstString("RGBColor"),
|
|
|
|
objc_flags);
|
|
|
|
AddStringSummary(coreservices_category_sp,
|
|
|
|
"(t=${var.top}, l=${var.left}, b=${var.bottom}, r=${var.right})",
|
|
|
|
ConstString("Rect"),
|
|
|
|
objc_flags);
|
|
|
|
AddStringSummary(coreservices_category_sp,
|
|
|
|
"(v=${var.v}, h=${var.h})",
|
|
|
|
ConstString("Point"),
|
|
|
|
objc_flags);
|
|
|
|
AddStringSummary(coreservices_category_sp,
|
|
|
|
"${var.month}/${var.day}/${var.year} ${var.hour} :${var.minute} :${var.second} dayOfWeek:${var.dayOfWeek}",
|
|
|
|
ConstString("DateTimeRect *"),
|
|
|
|
objc_flags);
|
|
|
|
AddStringSummary(coreservices_category_sp,
|
|
|
|
"${var.ld.month}/${var.ld.day}/${var.ld.year} ${var.ld.hour} :${var.ld.minute} :${var.ld.second} dayOfWeek:${var.ld.dayOfWeek}",
|
|
|
|
ConstString("LongDateRect"),
|
|
|
|
objc_flags);
|
|
|
|
AddStringSummary(coreservices_category_sp,
|
|
|
|
"(x=${var.x}, y=${var.y})",
|
|
|
|
ConstString("HIPoint"),
|
|
|
|
objc_flags);
|
|
|
|
AddStringSummary(coreservices_category_sp,
|
|
|
|
"origin=${var.origin} size=${var.size}",
|
|
|
|
ConstString("HIRect"),
|
|
|
|
objc_flags);
|
2012-02-17 11:18:30 +08:00
|
|
|
|
2012-02-24 07:10:03 +08:00
|
|
|
TypeCategoryImpl::SharedPointer appkit_category_sp = GetCategory(m_appkit_category_name);
|
|
|
|
|
|
|
|
TypeSummaryImpl::Flags appkit_flags;
|
|
|
|
appkit_flags.SetCascades(true)
|
|
|
|
.SetSkipPointers(false)
|
|
|
|
.SetSkipReferences(false)
|
|
|
|
.SetDontShowChildren(true)
|
|
|
|
.SetDontShowValue(false)
|
|
|
|
.SetShowMembersOneLiner(false)
|
|
|
|
.SetHideItemNames(false);
|
|
|
|
|
2012-09-14 02:27:09 +08:00
|
|
|
appkit_flags.SetDontShowChildren(false);
|
|
|
|
|
2012-09-15 09:59:02 +08:00
|
|
|
|
2012-09-20 14:06:59 +08:00
|
|
|
#ifndef LLDB_DISABLE_PYTHON
|
2012-09-14 02:27:09 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", ConstString("NSArray"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", ConstString("NSMutableArray"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", ConstString("__NSArrayI"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", ConstString("__NSArrayM"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", ConstString("__NSCFArray"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", ConstString("CFArrayRef"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", ConstString("CFMutableArrayRef"), appkit_flags);
|
|
|
|
|
2012-09-19 01:43:16 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDictionarySummaryProvider<false>, "NSDictionary summary provider", ConstString("NSDictionary"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDictionarySummaryProvider<false>, "NSDictionary summary provider", ConstString("NSMutableDictionary"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDictionarySummaryProvider<false>, "NSDictionary summary provider", ConstString("__NSCFDictionary"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDictionarySummaryProvider<false>, "NSDictionary summary provider", ConstString("__NSDictionaryI"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDictionarySummaryProvider<false>, "NSDictionary summary provider", ConstString("__NSDictionaryM"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDictionarySummaryProvider<true>, "NSDictionary summary provider", ConstString("CFDictionaryRef"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDictionarySummaryProvider<true>, "NSDictionary summary provider", ConstString("CFMutableDictionaryRef"), appkit_flags);
|
|
|
|
|
2013-02-19 07:16:23 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSSetSummaryProvider<false>, "NSSet summary", ConstString("NSSet"), appkit_flags);
|
2013-04-27 08:27:20 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSSetSummaryProvider<false>, "NSMutableSet summary", ConstString("NSMutableSet"), appkit_flags);
|
2013-02-19 07:16:23 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSSetSummaryProvider<true>, "CFSetRef summary", ConstString("CFSetRef"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSSetSummaryProvider<true>, "CFMutableSetRef summary", ConstString("CFMutableSetRef"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSSetSummaryProvider<false>, "__NSCFSet summary", ConstString("__NSCFSet"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSSetSummaryProvider<false>, "__NSSetI summary", ConstString("__NSSetI"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSSetSummaryProvider<false>, "__NSSetM summary", ConstString("__NSSetM"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSSetSummaryProvider<false>, "NSCountedSet summary", ConstString("NSCountedSet"), appkit_flags);
|
2013-04-27 08:27:20 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSSetSummaryProvider<false>, "NSMutableSet summary", ConstString("NSMutableSet"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSSetSummaryProvider<false>, "NSOrderedSet summary", ConstString("NSOrderedSet"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSSetSummaryProvider<false>, "__NSOrderedSetI summary", ConstString("__NSOrderedSetI"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSSetSummaryProvider<false>, "__NSOrderedSetM summary", ConstString("__NSOrderedSetM"), appkit_flags);
|
|
|
|
|
2012-09-19 01:43:16 +08:00
|
|
|
// AddSummary(appkit_category_sp, "${var.key%@} -> ${var.value%@}", ConstString("$_lldb_typegen_nspair"), appkit_flags);
|
|
|
|
|
2012-09-14 02:27:09 +08:00
|
|
|
appkit_flags.SetDontShowChildren(true);
|
|
|
|
|
2013-01-29 07:47:25 +08:00
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("__NSArrayM"), ScriptedSyntheticChildren::Flags());
|
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("__NSArrayI"), ScriptedSyntheticChildren::Flags());
|
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("NSArray"), ScriptedSyntheticChildren::Flags());
|
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("NSMutableArray"), ScriptedSyntheticChildren::Flags());
|
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("__NSCFArray"), ScriptedSyntheticChildren::Flags());
|
2013-04-23 09:13:50 +08:00
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("CFMutableArrayRef"), ScriptedSyntheticChildren::Flags());
|
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("CFArrayRef"), ScriptedSyntheticChildren::Flags());
|
2012-04-26 01:53:41 +08:00
|
|
|
|
2013-01-29 07:47:25 +08:00
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("__NSDictionaryM"), ScriptedSyntheticChildren::Flags());
|
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("__NSDictionaryI"), ScriptedSyntheticChildren::Flags());
|
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("NSDictionary"), ScriptedSyntheticChildren::Flags());
|
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("NSMutableDictionary"), ScriptedSyntheticChildren::Flags());
|
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("CFDictionaryRef"), ScriptedSyntheticChildren::Flags());
|
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("CFMutableDictionaryRef"), ScriptedSyntheticChildren::Flags());
|
2012-09-19 01:43:16 +08:00
|
|
|
|
2013-02-19 07:16:23 +08:00
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSSetSyntheticFrontEndCreator, "NSSet synthetic children", ConstString("NSSet"), ScriptedSyntheticChildren::Flags());
|
2013-04-27 08:27:20 +08:00
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSSetSyntheticFrontEndCreator, "__NSSetI synthetic children", ConstString("__NSSetI"), ScriptedSyntheticChildren::Flags());
|
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSSetSyntheticFrontEndCreator, "__NSSetM synthetic children", ConstString("__NSSetM"), ScriptedSyntheticChildren::Flags());
|
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSSetSyntheticFrontEndCreator, "NSMutableSet synthetic children", ConstString("NSMutableSet"), ScriptedSyntheticChildren::Flags());
|
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSSetSyntheticFrontEndCreator, "NSOrderedSet synthetic children", ConstString("NSOrderedSet"), ScriptedSyntheticChildren::Flags());
|
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSSetSyntheticFrontEndCreator, "__NSOrderedSetI synthetic children", ConstString("__NSOrderedSetI"), ScriptedSyntheticChildren::Flags());
|
|
|
|
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSSetSyntheticFrontEndCreator, "__NSOrderedSetM synthetic children", ConstString("__NSOrderedSetM"), ScriptedSyntheticChildren::Flags());
|
|
|
|
|
2013-03-16 02:44:08 +08:00
|
|
|
AddCXXSummary(appkit_category_sp,lldb_private::formatters::CFBagSummaryProvider, "CFBag summary provider", ConstString("CFBagRef"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp,lldb_private::formatters::CFBagSummaryProvider, "CFBag summary provider", ConstString("__CFBag"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp,lldb_private::formatters::CFBagSummaryProvider, "CFBag summary provider", ConstString("const struct __CFBag"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp,lldb_private::formatters::CFBagSummaryProvider, "CFBag summary provider", ConstString("CFMutableBagRef"), appkit_flags);
|
2012-04-26 01:53:41 +08:00
|
|
|
|
2013-03-16 08:50:25 +08:00
|
|
|
AddCXXSummary(appkit_category_sp,lldb_private::formatters::CFBinaryHeapSummaryProvider, "CFBinaryHeap summary provider", ConstString("CFBinaryHeapRef"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp,lldb_private::formatters::CFBinaryHeapSummaryProvider, "CFBinaryHeap summary provider", ConstString("__CFBinaryHeap"), appkit_flags);
|
2012-04-26 01:53:41 +08:00
|
|
|
|
2012-09-14 02:27:09 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSStringSummaryProvider, "NSString summary provider", ConstString("NSString"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSStringSummaryProvider, "NSString summary provider", ConstString("CFStringRef"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSStringSummaryProvider, "NSString summary provider", ConstString("CFMutableStringRef"), appkit_flags);
|
2013-02-08 09:55:46 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSStringSummaryProvider, "NSString summary provider", ConstString("NSMutableString"), appkit_flags);
|
2012-09-14 02:27:09 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSStringSummaryProvider, "NSString summary provider", ConstString("__NSCFConstantString"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSStringSummaryProvider, "NSString summary provider", ConstString("__NSCFString"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSStringSummaryProvider, "NSString summary provider", ConstString("NSCFConstantString"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSStringSummaryProvider, "NSString summary provider", ConstString("NSCFString"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSStringSummaryProvider, "NSString summary provider", ConstString("NSPathStore2"), appkit_flags);
|
2012-09-05 02:47:54 +08:00
|
|
|
|
2013-02-08 09:55:46 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSAttributedStringSummaryProvider, "NSAttributedString summary provider", ConstString("NSAttributedString"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSMutableAttributedStringSummaryProvider, "NSMutableAttributedString summary provider", ConstString("NSMutableAttributedString"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSMutableAttributedStringSummaryProvider, "NSMutableAttributedString summary provider", ConstString("NSConcreteMutableAttributedString"), appkit_flags);
|
|
|
|
|
2013-03-16 02:44:08 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSBundleSummaryProvider, "NSBundle summary provider", ConstString("NSBundle"), appkit_flags);
|
2012-09-05 06:04:50 +08:00
|
|
|
|
2012-09-14 02:27:09 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDataSummaryProvider<false>, "NSData summary provider", ConstString("NSData"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDataSummaryProvider<false>, "NSData summary provider", ConstString("NSConcreteData"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDataSummaryProvider<false>, "NSData summary provider", ConstString("NSConcreteMutableData"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDataSummaryProvider<false>, "NSData summary provider", ConstString("__NSCFData"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDataSummaryProvider<true>, "NSData summary provider", ConstString("CFDataRef"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDataSummaryProvider<true>, "NSData summary provider", ConstString("CFMutableDataRef"), appkit_flags);
|
2012-04-26 01:53:41 +08:00
|
|
|
|
2013-03-16 08:50:25 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSMachPortSummaryProvider, "NSMachPort summary provider", ConstString("NSMachPort"), appkit_flags);
|
|
|
|
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNotificationSummaryProvider, "NSNotification summary provider", ConstString("NSNotification"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNotificationSummaryProvider, "NSNotification summary provider", ConstString("NSConcreteNotification"), appkit_flags);
|
2012-04-26 01:53:41 +08:00
|
|
|
|
2012-12-11 07:30:25 +08:00
|
|
|
AddStringSummary(appkit_category_sp, "domain: ${var._domain} - code: ${var._code}", ConstString("NSError"), appkit_flags);
|
2013-01-29 07:47:25 +08:00
|
|
|
AddStringSummary(appkit_category_sp,"name:${var.name%S} reason:${var.reason%S}",ConstString("NSException"),appkit_flags);
|
|
|
|
|
2012-09-14 02:27:09 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNumberSummaryProvider, "NSNumber summary provider", ConstString("NSNumber"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNumberSummaryProvider, "NSNumber summary provider", ConstString("__NSCFBoolean"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNumberSummaryProvider, "NSNumber summary provider", ConstString("__NSCFNumber"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNumberSummaryProvider, "NSNumber summary provider", ConstString("NSCFBoolean"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNumberSummaryProvider, "NSNumber summary provider", ConstString("NSCFNumber"), appkit_flags);
|
2012-10-04 07:53:45 +08:00
|
|
|
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::RuntimeSpecificDescriptionSummaryProvider, "NSDecimalNumber summary provider", ConstString("NSDecimalNumber"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::RuntimeSpecificDescriptionSummaryProvider, "NSHost summary provider", ConstString("NSHost"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::RuntimeSpecificDescriptionSummaryProvider, "NSTask summary provider", ConstString("NSTask"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::RuntimeSpecificDescriptionSummaryProvider, "NSValue summary provider", ConstString("NSValue"), appkit_flags);
|
2013-02-16 07:38:37 +08:00
|
|
|
|
2013-02-09 03:28:04 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSURLSummaryProvider, "NSURL summary provider", ConstString("NSURL"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSURLSummaryProvider, "NSURL summary provider", ConstString("CFURLRef"), appkit_flags);
|
2012-04-26 01:53:41 +08:00
|
|
|
|
2013-03-19 08:27:22 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDateSummaryProvider, "NSDate summary provider", ConstString("NSDate"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDateSummaryProvider, "NSDate summary provider", ConstString("__NSDate"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDateSummaryProvider, "NSDate summary provider", ConstString("__NSTaggedDate"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDateSummaryProvider, "NSDate summary provider", ConstString("NSCalendarDate"), appkit_flags);
|
2012-04-26 01:53:41 +08:00
|
|
|
|
2013-03-16 09:50:07 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSTimeZoneSummaryProvider, "NSTimeZone summary provider", ConstString("NSTimeZone"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSTimeZoneSummaryProvider, "NSTimeZone summary provider", ConstString("CFTimeZoneRef"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSTimeZoneSummaryProvider, "NSTimeZone summary provider", ConstString("__NSTimeZone"), appkit_flags);
|
2012-03-02 08:55:53 +08:00
|
|
|
|
2012-03-02 03:32:33 +08:00
|
|
|
// CFAbsoluteTime is actually a double rather than a pointer to an object
|
|
|
|
// we do not care about the numeric value, since it is probably meaningless to users
|
|
|
|
appkit_flags.SetDontShowValue(true);
|
2013-03-19 08:27:22 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::CFAbsoluteTimeSummaryProvider, "CFAbsoluteTime summary provider", ConstString("CFAbsoluteTime"), appkit_flags);
|
2012-03-02 03:32:33 +08:00
|
|
|
appkit_flags.SetDontShowValue(false);
|
|
|
|
|
2013-03-16 09:18:00 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSIndexSetSummaryProvider, "NSIndexSet summary provider", ConstString("NSIndexSet"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSIndexSetSummaryProvider, "NSIndexSet summary provider", ConstString("NSMutableIndexSet"), appkit_flags);
|
2012-03-02 03:32:33 +08:00
|
|
|
|
2012-12-11 07:30:25 +08:00
|
|
|
AddStringSummary(appkit_category_sp,
|
|
|
|
"@\"${var.month%d}/${var.day%d}/${var.year%d} ${var.hour%d}:${var.minute%d}:${var.second}\"",
|
|
|
|
ConstString("CFGregorianDate"),
|
|
|
|
appkit_flags);
|
2012-03-02 08:55:53 +08:00
|
|
|
|
2013-03-16 09:50:07 +08:00
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::CFBitVectorSummaryProvider, "CFBitVector summary provider", ConstString("CFBitVectorRef"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::CFBitVectorSummaryProvider, "CFBitVector summary provider", ConstString("CFMutableBitVectorRef"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::CFBitVectorSummaryProvider, "CFBitVector summary provider", ConstString("__CFBitVector"), appkit_flags);
|
|
|
|
AddCXXSummary(appkit_category_sp, lldb_private::formatters::CFBitVectorSummaryProvider, "CFBitVector summary provider", ConstString("__CFMutableBitVector"), appkit_flags);
|
2012-09-05 06:04:50 +08:00
|
|
|
#endif // LLDB_DISABLE_PYTHON
|
|
|
|
|
2012-02-17 11:18:30 +08:00
|
|
|
TypeCategoryImpl::SharedPointer vectors_category_sp = GetCategory(m_vectortypes_category_name);
|
|
|
|
|
|
|
|
TypeSummaryImpl::Flags vector_flags;
|
|
|
|
vector_flags.SetCascades(true)
|
|
|
|
.SetSkipPointers(true)
|
|
|
|
.SetSkipReferences(false)
|
|
|
|
.SetDontShowChildren(true)
|
|
|
|
.SetDontShowValue(false)
|
|
|
|
.SetShowMembersOneLiner(true)
|
|
|
|
.SetHideItemNames(true);
|
|
|
|
|
2012-12-11 07:30:25 +08:00
|
|
|
AddStringSummary(vectors_category_sp,
|
|
|
|
"${var.uint128}",
|
|
|
|
ConstString("builtin_type_vec128"),
|
|
|
|
objc_flags);
|
|
|
|
|
|
|
|
AddStringSummary(vectors_category_sp,
|
|
|
|
"",
|
|
|
|
ConstString("float [4]"),
|
|
|
|
vector_flags);
|
|
|
|
AddStringSummary(vectors_category_sp,
|
|
|
|
"",
|
|
|
|
ConstString("int32_t [4]"),
|
|
|
|
vector_flags);
|
|
|
|
AddStringSummary(vectors_category_sp,
|
|
|
|
"",
|
|
|
|
ConstString("int16_t [8]"),
|
|
|
|
vector_flags);
|
|
|
|
AddStringSummary(vectors_category_sp,
|
|
|
|
"",
|
|
|
|
ConstString("vDouble"),
|
|
|
|
vector_flags);
|
|
|
|
AddStringSummary(vectors_category_sp,
|
|
|
|
"",
|
|
|
|
ConstString("vFloat"),
|
|
|
|
vector_flags);
|
|
|
|
AddStringSummary(vectors_category_sp,
|
|
|
|
"",
|
|
|
|
ConstString("vSInt8"),
|
|
|
|
vector_flags);
|
|
|
|
AddStringSummary(vectors_category_sp,
|
|
|
|
"",
|
|
|
|
ConstString("vSInt16"),
|
|
|
|
vector_flags);
|
|
|
|
AddStringSummary(vectors_category_sp,
|
|
|
|
"",
|
|
|
|
ConstString("vSInt32"),
|
|
|
|
vector_flags);
|
|
|
|
AddStringSummary(vectors_category_sp,
|
|
|
|
"",
|
|
|
|
ConstString("vUInt16"),
|
|
|
|
vector_flags);
|
|
|
|
AddStringSummary(vectors_category_sp,
|
|
|
|
"",
|
|
|
|
ConstString("vUInt8"),
|
|
|
|
vector_flags);
|
|
|
|
AddStringSummary(vectors_category_sp,
|
|
|
|
"",
|
|
|
|
ConstString("vUInt16"),
|
|
|
|
vector_flags);
|
|
|
|
AddStringSummary(vectors_category_sp,
|
|
|
|
"",
|
|
|
|
ConstString("vUInt32"),
|
|
|
|
vector_flags);
|
|
|
|
AddStringSummary(vectors_category_sp,
|
|
|
|
"",
|
|
|
|
ConstString("vBool32"),
|
|
|
|
vector_flags);
|
2011-10-12 08:53:29 +08:00
|
|
|
}
|