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()
329
329
330
330
assert (!playground && !repl && " Playground/REPL mode not expected" );
331
331
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
+
332
339
if (pound_file && pound_line) {
333
340
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);
335
342
text = fixed_text.GetString ().data ();
336
343
} else if (generate_debug_info) {
337
344
std::string expr_source_path;
338
345
if (SwiftASTManipulator::SaveExpressionTextToTempFile (orig_text, options,
339
346
expr_source_path)) {
340
347
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);
342
350
text = fixed_text.GetString ().data ();
343
351
}
344
352
}
You can’t perform that action at this time.
0 commit comments