Current revision do not use lldb type summaries for simple types with no children (like function pointers). So this patch makes MI use lldb type summaries for evaluation of all types of objects, so MI own formatters are no longer needed.
Details
- Reviewers
abidh ki.stfu granata.enrico - Commits
- rGb91779eb28c4: [lldb-mi] display summary for simple types + refactor (use lldb formatting for…
rLLDB251082: [lldb-mi] display summary for simple types + refactor (use lldb formatting for…
rL251082: [lldb-mi] display summary for simple types + refactor (use lldb formatting…
Diff Detail
- Repository
- rL LLVM
Event Timeline
tools/lldb-mi/MICmnLLDBDebugger.cpp | ||
---|---|---|
37 ↗ | (On Diff #37489) | I would definitely not stop the revision for this but I wonder if it would make sense to try and discover whether "char" is signed or unsigned from the type itself? |
835 ↗ | (On Diff #37489) | Should you also cover "signed char" and "unsigned char" here? |
tools/lldb-mi/MICmnLLDBDebugger.cpp | ||
---|---|---|
835 ↗ | (On Diff #37489) | Hmm. I thought that if regex is false, exact match will be done, won't it? If yes than simple char type should be signed, right? |
tools/lldb-mi/MICmnLLDBDebugger.cpp | ||
---|---|---|
37 ↗ | (On Diff #37489) | To my understanding this is not needed (see comment below) |
835 ↗ | (On Diff #37489) | unsigned - not. signed -yes. One question: if I register summary for "char" - it will not be called for "unsigned char" and "signed char", right? |
tools/lldb-mi/MICmnLLDBDebugger.cpp | ||
---|---|---|
835 ↗ | (On Diff #37489) | I think the signedness of char depends on the implementation. Which means that "char" will cover one of them, but not the other. Which is why I was suggesting adding "char", "signed char" and "unsigned char". Just to cover all bases. |
835 ↗ | (On Diff #37489) | Correct. It will only be called for an exactly matching type name. We strip "useless" qualifiers like "volatile" and "restrict" before doing format matching. But, for obvious reasons, not signed and unsigned. Well, if you add separate formatters for signed char vs. unsigned char, then they will know of course |
Please also indicate if a revision is dependent on some other revisions that has not yet been committed as this one is on D13657.
tools/lldb-mi/MICmnLLDBUtilSBValue.cpp | ||
---|---|---|
126 ↗ | (On Diff #37489) | As the condition is changed, can you explain a little bit in which scenario, you want to pass true/false here for first parameter. |
131 ↗ | (On Diff #37489) | Same as above. |
tools/lldb-mi/MICmnLLDBUtilSBValue.cpp | ||
---|---|---|
126 ↗ | (On Diff #37489) | This is "get summary whenever possible, unless explicitly told otherwise". So false is only passed when character type is evaluated and m_bHandleCharType is false. I do not fully understand why this boolean flag exists - may be performance reasons? |
131 ↗ | (On Diff #37489) | In case one day someone create summary provider for some pointer type which is not char*, wchar_t* and related, it will be handled by MI correctly. The only exception is if we have char pointer and explicitly told not to handle char type |
Review updated to reflect Enrico comments regarding signed/unsigned char.
Now all character types are evaluated as ASCII code (signed or unsigned) + value.
Additional method introduced to SBValue to check if type is signed or unsigned integer
include/lldb/API/SBValue.h | ||
---|---|---|
372 ↗ | (On Diff #37733) | Greg pointed me to SBType::GetBasicType() - this will return to you one of eBasicTypeSignedChar, eBasicTypeUnsignedChar, such that you don't need to add new API to get this information Also, even if this were necessary, it would go on SBType, definitely not SBValue |
include/lldb/API/SBValue.h | ||
---|---|---|
372 ↗ | (On Diff #37733) | This method exists in ValueObject, so I thought it makes sense having it in SBValue also. But ok, let's use GetBasicType |
Apart from some inline comments, looks ok to me.
tools/lldb-mi/MICmnLLDBDebugger.cpp | ||
---|---|---|
839 ↗ | (On Diff #37888) | Please change it to 'true' and 'false'. |