From 3a0dfac5979667221f20cb839bd30bc8d1ce166a Mon Sep 17 00:00:00 2001 From: Alexey Prokhin Date: Sat, 30 Apr 2011 17:35:40 +0400 Subject: [PATCH] Fix file paths in debug info --- gen/todebug.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gen/todebug.cpp b/gen/todebug.cpp index 9447a3eb..f0a2dee8 100644 --- a/gen/todebug.cpp +++ b/gen/todebug.cpp @@ -428,18 +428,21 @@ void DtoDwarfCompileUnit(Module* m) LOG_SCOPE; // prepare srcpath - std::string srcpath(FileName::path(m->srcfile->name->toChars())); + const char *srcname = m->srcfile->name->toChars(); + std::string srcpath(FileName::path(srcname)); if (!FileName::absolute(srcpath.c_str())) { llvm::sys::Path tmp = llvm::sys::Path::GetCurrentDirectory(); tmp.appendComponent(srcpath); srcpath = tmp.str(); if (!srcpath.empty() && *srcpath.rbegin() != '/' && *srcpath.rbegin() != '\\') srcpath = srcpath + '/'; + } else { + srcname = FileName::name(srcname); } gIR->dibuilder.createCompileUnit( global.params.symdebug == 2 ? DW_LANG_C : DW_LANG_D, - m->srcfile->name->toChars(), + srcname, srcpath, "LDC (http://www.dsource.org/projects/ldc)", false, // isOptimized TODO