-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[lldb][Formatters] Add --pointer-match-depth option to type summary add command.
#138209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,9 +76,10 @@ class FormattersMatchCandidate { | |
|
|
||
| FormattersMatchCandidate(ConstString name, | ||
| ScriptInterpreter *script_interpreter, TypeImpl type, | ||
| Flags flags) | ||
| Flags flags, uint32_t ptr_stripped_depth = 0) | ||
| : m_type_name(name), m_script_interpreter(script_interpreter), | ||
| m_type(type), m_flags(flags) {} | ||
| m_type(type), m_flags(flags), m_ptr_stripped_depth(ptr_stripped_depth) { | ||
| } | ||
|
|
||
| ~FormattersMatchCandidate() = default; | ||
|
|
||
|
|
@@ -96,6 +97,8 @@ class FormattersMatchCandidate { | |
|
|
||
| bool DidStripTypedef() const { return m_flags.stripped_typedef; } | ||
|
|
||
| uint32_t GetPtrStrippedDepth() const { return m_ptr_stripped_depth; } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this reads better as GetPtrStrippingDepth than GetPtrStrippedDepth. You aren't asking about something that has been done, but about a thing you are planning to do, so active seems more appropriate.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I meant this |
||
|
|
||
| template <class Formatter> | ||
| bool IsMatch(const std::shared_ptr<Formatter> &formatter_sp) const { | ||
| if (!formatter_sp) | ||
|
|
@@ -104,6 +107,8 @@ class FormattersMatchCandidate { | |
| return false; | ||
| if (formatter_sp->SkipsPointers() && DidStripPointer()) | ||
| return false; | ||
| if (formatter_sp->GetPtrMatchDepth() < GetPtrStrippedDepth()) | ||
| return false; | ||
| if (formatter_sp->SkipsReferences() && DidStripReference()) | ||
| return false; | ||
| return true; | ||
|
|
@@ -116,6 +121,7 @@ class FormattersMatchCandidate { | |
| ScriptInterpreter *m_script_interpreter; | ||
| TypeImpl m_type; | ||
| Flags m_flags; | ||
| uint32_t m_ptr_stripped_depth; | ||
| }; | ||
|
|
||
| typedef std::vector<FormattersMatchCandidate> FormattersMatchVector; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.