File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
lldb/source/Plugins/ExpressionParser/Swift Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -329,16 +329,24 @@ __builtin_logger_initialize()
329329
330330 assert (!playground && !repl && " Playground/REPL mode not expected" );
331331
332+ auto path_literal = [](const char *path) -> std::string {
333+ std::string escaped;
334+ llvm::raw_string_ostream os (escaped);
335+ llvm::printEscapedString (path, os);
336+ return escaped;
337+ };
338+
332339 if (pound_file && pound_line) {
333340 fixed_text.Printf (" #sourceLocation(file: \" %s\" , line: %u)\n %s\n " ,
334- pound_file, pound_line, orig_text);
341+ path_literal ( pound_file). c_str () , pound_line, orig_text);
335342 text = fixed_text.GetString ().data ();
336343 } else if (generate_debug_info) {
337344 std::string expr_source_path;
338345 if (SwiftASTManipulator::SaveExpressionTextToTempFile (orig_text, options,
339346 expr_source_path)) {
340347 fixed_text.Printf (" #sourceLocation(file: \" %s\" , line: 1)\n %s\n " ,
341- expr_source_path.c_str (), orig_text);
348+ path_literal (expr_source_path.c_str ()).c_str (),
349+ orig_text);
342350 text = fixed_text.GetString ().data ();
343351 }
344352 }
You can’t perform that action at this time.
0 commit comments