Also, add summaries for SmallVector and ArrayRef,
and fix the StringRef summary provider so it doesn't ignore the Length field.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for doing this! I have not used PointerIntPair or PointerUnion, but I will take a look at those types. I take it these expression evaluations are necessary?
llvm/utils/lldbDataFormatters.py | ||
---|---|---|
176–179 | when the string length is greater than max_length, it would be nice for the returned string to indicate truncation. I just checked a long std::string and the output was: "really long string"... Also the max length for std::string is 1024, should StringRef use 1024 too? | |
186–187 | should this print an error message? | |
188 | what's the best way to handle quotes inside the string? A quick search shows this could use json (a hack): return json.dumps(string) for example: json.dumps('hello world') # '"hello world"' json.dumps('hello "quoted" world') # '"hello \\"quoted\\" world"' |
Well, I think they are. There is too much template magic behind figuring out how many bits in the pointer we use to store an additional integer value.
Expression evaluations are not only slow, but they also prevent us from formatting nested PointerIntPairs, since the expression path is modified and doesn't correspond to the actual implementation anymore, therefore evaluating expressions down the tree will not work.
But I guess we can live with that for now.
llvm/utils/lldbDataFormatters.py | ||
---|---|---|
176–179 | LLDB supports the max-string-summary-length setting, but unfortunately there is no way to get the value of that setting through Python API. |
But I guess we can live with that for now.
That's fair. Thanks again for adding more llvm formatters.
llvm/utils/lldbDataFormatters.py | ||
---|---|---|
185 | For some binary strings, decode will thrown an exception. |
@broadwaylamb hi, have you been using the PointerUnion formatter? We have seen a variety of issues, which don't seem to have easy fixes. If you're not using it, I will disable it. Alternatively, I propose creating a separate file that you and others could choose to import separately from lldbDataFormatters.py.
Thanks, I will disable these for now, and see what can be done to address the issues we've seen.
when the string length is greater than max_length, it would be nice for the returned string to indicate truncation. I just checked a long std::string and the output was:
Also the max length for std::string is 1024, should StringRef use 1024 too?