[Lldb-commits] [PATCH] D64194: [lldb] Fix crash due to unicode characters and dollars in variable names.

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 8 18:44:45 PDT 2019


teemperor updated this revision to Diff 208569.
teemperor retitled this revision from "[lldb] Fix crash due to dollar character in variable names." to "[lldb] Fix crash due to unicode characters and dollars in variable names.".
teemperor edited the summary of this revision.
teemperor added a comment.

- Rewrote the patch to use the Clang lexer, dropped our ad-hoc lexer.
- Make sure we only lex the expression once, not for each local variable.
- Added tests for unicode characters and a bunch of dollar-related corner cases. The current behavior seems reasonable and what people expect in the comments, so I just keep them around.

I would prefer if we could just consider this patch as a regression fix and not some official support for dollar-variables in user code (which seems like a mess to define properly). I added some tests that at least make sure the current behavior is tested, we can decide later if that's really what we want to do (but the current behavior seems quite reasonable and similar to what people suggest).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64194/new/

https://reviews.llvm.org/D64194

Files:
  lldb/packages/Python/lldbsuite/test/expression_command/dollar-in-variable/Makefile
  lldb/packages/Python/lldbsuite/test/expression_command/dollar-in-variable/TestDollarInVariable.py
  lldb/packages/Python/lldbsuite/test/expression_command/dollar-in-variable/main.c
  lldb/packages/Python/lldbsuite/test/expression_command/unicode-in-variable/Makefile
  lldb/packages/Python/lldbsuite/test/expression_command/unicode-in-variable/TestUnicodeInVariable.py
  lldb/packages/Python/lldbsuite/test/expression_command/unicode-in-variable/main.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64194.208569.patch
Type: text/x-patch
Size: 8817 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190709/cf6130fb/attachment-0001.bin>


More information about the lldb-commits mailing list