GDB/LLDB plugin: correctly handle string escaping and unescaping
Summary: - Fix wrong implementation of quoteExpression/unquoteExpression, add unit tests for it quoteExpression is used in MIVariable when creating new watch variables, original code didn't escape '\\' in the expression, so the user can't input expression containing '\\'. unqouteExpression in used in MIBreakpointcontroller to extract path from breakpoint notification emitted from debugger, because GDB escapes these paths twice, so after regular unescape happens when parsing the MI response, extra escape is needed. However, in practice, neither GDB nor LLDB can handle reliably paths with special characters like '\\' or '\"', so no unit test is added to verify the use of unquoteExpression. - Improve LLDB data formatter output for non-ascii char, which should be displayed in UI correctly. LLDB emits unicode escape sequence for non-ascii code. Correct unescape them in the UI. Test Plan: Added/Changed unit tests: - GdbTest::testVariablesWatchesQuotes - LldbTest::testVariablesWatchesQuotes - LldbTest::testVariablesNonascii Reviewers: apol, #kdevelop Reviewed By: apol, #kdevelop Subscribers: kdevelop-devel Differential Revision: https://phabricator.kde.org/D2375
parent
5dce5b89
Please register or sign in to comment