[llvm-commits] [llvm-gcc-4.2] r128582 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Devang Patel
dpatel at apple.com
Wed Mar 30 15:32:46 PDT 2011
Author: dpatel
Date: Wed Mar 30 17:32:46 2011
New Revision: 128582
URL: http://llvm.org/viewvc/llvm-project?rev=128582&view=rev
Log:
Use full path as AT_name in TAG_compile_unit.
The debugger may not be able to construct full path using AT_comp_dir due to one or other reason.
Radar 8884898.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=128582&r1=128581&r2=128582&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Wed Mar 30 17:32:46 2011
@@ -1389,18 +1389,20 @@
/// create a new one if necessary.
DICompileUnit DebugInfo::getOrCreateCompileUnit(const char *FullPath,
bool isMain) {
+ // Get source file information.
+ std::string Directory = get_src_pwd();
+ std::string FileName;
if (!FullPath) {
if (!strcmp (main_input_filename, ""))
- FullPath = "<stdin>";
+ FileName = "<stdin>";
else
- FullPath = main_input_filename;
- }
-
- // Get source file information.
- std::string Directory;
- std::string FileName;
- DirectoryAndFile(FullPath, Directory, FileName);
+ FileName = main_input_filename;
+ } else
+ FileName = FullPath;
+ if (FileName[0] != '/' && FullPath)
+ FileName = std::string(get_src_pwd()) + "/" + FileName;
+
// Set up Language number.
unsigned LangTag;
const std::string LanguageName(lang_hooks.name);
More information about the llvm-commits
mailing list