summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-10-20 20:54:39 +0000
committerGreg Clayton <gclayton@apple.com>2010-10-20 20:54:39 +0000
commit274060b6f110c6023fc63e4803d120949750867f (patch)
tree30a22eb4bc4585b04aed031edc1e77b6874a0156 /lldb
parent6b4120915e47fe01a4ad398cdd3f0ba19944a4b4 (diff)
downloadbcm5719-llvm-274060b6f110c6023fc63e4803d120949750867f.tar.gz
bcm5719-llvm-274060b6f110c6023fc63e4803d120949750867f.zip
Fixed an issue where we were resolving paths when we should have been.
So the issue here was that we have lldb_private::FileSpec that by default was always resolving a path when using the: FileSpec::FileSpec (const char *path); and in the: void FileSpec::SetFile(const char *pathname, bool resolve = true); This isn't what we want in many many cases. One example is you have "/tmp" on your file system which is really "/private/tmp". You compile code in that directory and end up with debug info that mentions "/tmp/file.c". Then you type: (lldb) breakpoint set --file file.c --line 5 If your current working directory is "/tmp", then "file.c" would be turned into "/private/tmp/file.c" which won't match anything in the debug info. Also, it should have been just a FileSpec with no directory and a filename of "file.c" which could (and should) potentially match any instances of "file.c" in the debug info. So I removed the constructor that just takes a path: FileSpec::FileSpec (const char *path); // REMOVED You must now use the other constructor that has a "bool resolve" parameter that you must always supply: FileSpec::FileSpec (const char *path, bool resolve); I also removed the default parameter to SetFile(): void FileSpec::SetFile(const char *pathname, bool resolve); And fixed all of the code to use the right settings. llvm-svn: 116944
Diffstat (limited to 'lldb')
-rw-r--r--lldb/include/lldb/API/SBFileSpec.h4
-rw-r--r--lldb/include/lldb/Core/FileSpec.h24
-rw-r--r--lldb/lldb.xcodeproj/project.pbxproj2
-rw-r--r--lldb/source/API/SBDebugger.cpp8
-rw-r--r--lldb/source/API/SBFileSpec.cpp8
-rw-r--r--lldb/source/API/SBTarget.cpp8
-rw-r--r--lldb/source/Commands/CommandCompletions.cpp4
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.cpp19
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectFile.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectImage.cpp12
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp4
-rw-r--r--lldb/source/Commands/CommandObjectSource.cpp4
-rw-r--r--lldb/source/Core/FileSpec.cpp16
-rw-r--r--lldb/source/Core/Module.cpp13
-rw-r--r--lldb/source/Core/ModuleList.cpp11
-rw-r--r--lldb/source/Host/common/Host.cpp6
-rw-r--r--lldb/source/Host/macosx/Host.mm4
-rw-r--r--lldb/source/Host/macosx/Symbols.cpp15
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp2
-rw-r--r--lldb/source/Interpreter/Options.cpp2
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp4
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp2
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp2
-rw-r--r--lldb/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp4
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp6
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp4
-rw-r--r--lldb/source/Symbol/CompileUnit.cpp2
-rw-r--r--lldb/source/Symbol/ObjectFile.cpp2
29 files changed, 97 insertions, 99 deletions
diff --git a/lldb/include/lldb/API/SBFileSpec.h b/lldb/include/lldb/API/SBFileSpec.h
index db76655795a..73538d31f37 100644
--- a/lldb/include/lldb/API/SBFileSpec.h
+++ b/lldb/include/lldb/API/SBFileSpec.h
@@ -21,7 +21,9 @@ public:
SBFileSpec (const lldb::SBFileSpec &rhs);
- SBFileSpec (const char *path);
+ SBFileSpec (const char *path);// Deprected, use SBFileSpec (const char *path, bool resolve)
+
+ SBFileSpec (const char *path, bool resolve);
~SBFileSpec ();
diff --git a/lldb/include/lldb/Core/FileSpec.h b/lldb/include/lldb/Core/FileSpec.h
index 019032f6dd8..ba40cfd8376 100644
--- a/lldb/include/lldb/Core/FileSpec.h
+++ b/lldb/include/lldb/Core/FileSpec.h
@@ -53,23 +53,11 @@ public:
FileSpec();
//------------------------------------------------------------------
- /// Default constructor.
+ /// Constructor with path.
///
- /// Takes an optional full path to a file. If \a path is valid,
- /// this function will call FileSpec::SetFile (\a path).
- ///
- /// @param[in] path
- /// The full or partial path to a file.
- ///
- /// @see FileSpec::SetFile ()
- //------------------------------------------------------------------
- explicit FileSpec (const char *path);
-
- //------------------------------------------------------------------
- /// Default constructor.
- ///
- /// Takes an optional full path to a file. If \a path is valid,
- /// this function will call FileSpec::SetFile (\a path).
+ /// Takes an path to a file which can be just a filename, or a full
+ /// path. If \a path is not NULL or empty, this function will call
+ /// FileSpec::SetFile (const char *path, bool resolve).
///
/// @param[in] path
/// The full or partial path to a file.
@@ -78,7 +66,7 @@ public:
/// If \b true, then we resolve the path with realpath,
/// if \b false we trust the path is in canonical form already.
///
- /// @see FileSpec::SetFile ()
+ /// @see FileSpec::SetFile (const char *path, bool resolve)
//------------------------------------------------------------------
explicit FileSpec (const char *path, bool resolve_path);
@@ -463,7 +451,7 @@ public:
/// the static FileSpec::Resolve.
//------------------------------------------------------------------
void
- SetFile (const char *path, bool resolve = true);
+ SetFile (const char *path, bool resolve);
//------------------------------------------------------------------
/// Read the file into an array of strings, one per line.
diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj
index 4c898f70714..101964e3097 100644
--- a/lldb/lldb.xcodeproj/project.pbxproj
+++ b/lldb/lldb.xcodeproj/project.pbxproj
@@ -2976,7 +2976,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- ONLY_ACTIVE_ARCH = YES;
+ ONLY_ACTIVE_ARCH = NO;
PREBINDING = NO;
VALID_ARCHS = "x86_64 i386";
};
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index 6a68e3bf34e..1c0f79d1ca0 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -381,7 +381,7 @@ SBDebugger::CreateTargetWithFileAndTargetTriple (const char *filename,
if (m_opaque_sp)
{
ArchSpec arch;
- FileSpec file_spec (filename);
+ FileSpec file_spec (filename, true);
arch.SetArchFromTargetTriple(target_triple);
TargetSP target_sp;
Error error (m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp, file_spec, arch, NULL, true, target_sp));
@@ -396,7 +396,7 @@ SBDebugger::CreateTargetWithFileAndArch (const char *filename, const char *archn
SBTarget target;
if (m_opaque_sp)
{
- FileSpec file (filename);
+ FileSpec file (filename, true);
ArchSpec arch = lldb_private::Target::GetDefaultArchitecture ();
TargetSP target_sp;
Error error;
@@ -439,7 +439,7 @@ SBDebugger::CreateTarget (const char *filename)
SBTarget target;
if (m_opaque_sp)
{
- FileSpec file (filename);
+ FileSpec file (filename, true);
ArchSpec arch = lldb_private::Target::GetDefaultArchitecture ();
TargetSP target_sp;
Error error;
@@ -495,7 +495,7 @@ SBDebugger::FindTargetWithFileAndArch (const char *filename, const char *arch_na
ArchSpec arch;
if (arch_name)
arch.SetArch(arch_name);
- TargetSP target_sp (m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture (FileSpec(filename), arch_name ? &arch : NULL));
+ TargetSP target_sp (m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture (FileSpec(filename, false), arch_name ? &arch : NULL));
sb_target.reset(target_sp);
}
return sb_target;
diff --git a/lldb/source/API/SBFileSpec.cpp b/lldb/source/API/SBFileSpec.cpp
index 36fcf1bbf2e..fb504f233f9 100644
--- a/lldb/source/API/SBFileSpec.cpp
+++ b/lldb/source/API/SBFileSpec.cpp
@@ -28,8 +28,14 @@ SBFileSpec::SBFileSpec (const SBFileSpec &rhs) :
m_opaque_ap.reset (new FileSpec (rhs.get()));
}
+// Deprected!!!
SBFileSpec::SBFileSpec (const char *path) :
- m_opaque_ap(new FileSpec (path))
+ m_opaque_ap(new FileSpec (path, true))
+{
+}
+
+SBFileSpec::SBFileSpec (const char *path, bool resolve) :
+ m_opaque_ap(new FileSpec (path, resolve))
{
}
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index fa64cbaf2cd..9b78220567b 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -355,7 +355,7 @@ SBTarget::BreakpointCreateByName (const char *symbol_name, const char *module_na
{
if (module_name && module_name[0])
{
- FileSpec module_file_spec(module_name);
+ FileSpec module_file_spec(module_name, false);
*sb_bp = m_opaque_sp->CreateBreakpoint (&module_file_spec, symbol_name, eFunctionNameTypeFull | eFunctionNameTypeBase, false);
}
else
@@ -376,7 +376,7 @@ SBTarget::BreakpointCreateByRegex (const char *symbol_name_regex, const char *mo
if (module_name && module_name[0])
{
- FileSpec module_file_spec(module_name);
+ FileSpec module_file_spec(module_name, false);
*sb_bp = m_opaque_sp->CreateBreakpoint (&module_file_spec, regexp, false);
}
@@ -523,7 +523,7 @@ SBTarget::Disassemble (lldb::addr_t start_addr, lldb::addr_t end_addr, const cha
ModuleSP module_sp;
if (module_name != NULL)
{
- FileSpec module_file_spec (module_name);
+ FileSpec module_file_spec (module_name, false);
module_sp = m_opaque_sp->GetImages().FindFirstModuleForFileSpec (module_file_spec, NULL);
}
@@ -602,7 +602,7 @@ SBTarget::Disassemble (const char *function_name, const char *module_name)
ModuleSP module_sp;
if (module_name != NULL)
{
- FileSpec module_file_spec (module_name);
+ FileSpec module_file_spec (module_name, false);
module_sp = m_opaque_sp->GetImages().FindFirstModuleForFileSpec (module_file_spec, NULL);
}
diff --git a/lldb/source/Commands/CommandCompletions.cpp b/lldb/source/Commands/CommandCompletions.cpp
index 42275cb982d..91a6cfe6258 100644
--- a/lldb/source/Commands/CommandCompletions.cpp
+++ b/lldb/source/Commands/CommandCompletions.cpp
@@ -469,7 +469,7 @@ CommandCompletions::SourceFileCompleter::SourceFileCompleter
m_include_support_files (include_support_files),
m_matching_files()
{
- FileSpec partial_spec (m_completion_str.c_str());
+ FileSpec partial_spec (m_completion_str.c_str(), false);
m_file_name = partial_spec.GetFilename().GetCString();
m_dir_name = partial_spec.GetDirectory().GetCString();
}
@@ -661,7 +661,7 @@ CommandCompletions::ModuleCompleter::ModuleCompleter
) :
CommandCompletions::Completer (interpreter, completion_str, match_start_point, max_return_elements, matches)
{
- FileSpec partial_spec (m_completion_str.c_str());
+ FileSpec partial_spec (m_completion_str.c_str(), false);
m_file_name = partial_spec.GetFilename().GetCString();
m_dir_name = partial_spec.GetDirectory().GetCString();
}
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index c642ae5551f..55e83fef491 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -307,7 +307,7 @@ CommandObjectBreakpointSet::Execute
ModuleSP module_sp = target->GetExecutableModule();
Breakpoint *bp = NULL;
- FileSpec module;
+ FileSpec module_spec;
bool use_module = false;
int num_modules = m_options.m_modules.size();
@@ -354,15 +354,15 @@ CommandObjectBreakpointSet::Execute
}
else
{
- file.SetFile(m_options.m_filename.c_str());
+ file.SetFile(m_options.m_filename.c_str(), false);
}
if (use_module)
{
for (int i = 0; i < num_modules; ++i)
{
- module.SetFile(m_options.m_modules[i].c_str());
- bp = target->CreateBreakpoint (&module,
+ module_spec.SetFile(m_options.m_modules[i].c_str(), false);
+ bp = target->CreateBreakpoint (&module_spec,
file,
m_options.m_line_num,
m_options.m_ignore_inlines).get();
@@ -405,8 +405,11 @@ CommandObjectBreakpointSet::Execute
{
for (int i = 0; i < num_modules; ++i)
{
- module.SetFile(m_options.m_modules[i].c_str());
- bp = target->CreateBreakpoint (&module, m_options.m_func_name.c_str(), name_type_mask, Breakpoint::Exact).get();
+ module_spec.SetFile(m_options.m_modules[i].c_str(), false);
+ bp = target->CreateBreakpoint (&module_spec,
+ m_options.m_func_name.c_str(),
+ name_type_mask,
+ Breakpoint::Exact).get();
if (bp)
{
StreamString &output_stream = result.GetOutputStream();
@@ -435,8 +438,8 @@ CommandObjectBreakpointSet::Execute
{
for (int i = 0; i < num_modules; ++i)
{
- module.SetFile(m_options.m_modules[i].c_str());
- bp = target->CreateBreakpoint (&module, regexp).get();
+ module_spec.SetFile(m_options.m_modules[i].c_str(), false);
+ bp = target->CreateBreakpoint (&module_spec, regexp).get();
if (bp)
{
StreamString &output_stream = result.GetOutputStream();
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index 349c3fc802c..dd5ab3267a7 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -70,7 +70,7 @@ public:
result.AppendMessageWithFormat ("Executing commands in '%s'.\n", filename);
- FileSpec cmd_file (filename);
+ FileSpec cmd_file (filename, false);
if (cmd_file.Exists())
{
STLStringArray commands;
diff --git a/lldb/source/Commands/CommandObjectFile.cpp b/lldb/source/Commands/CommandObjectFile.cpp
index 737b0cb4ec8..45dc2a968e6 100644
--- a/lldb/source/Commands/CommandObjectFile.cpp
+++ b/lldb/source/Commands/CommandObjectFile.cpp
@@ -127,7 +127,7 @@ CommandObjectFile::Execute
const int argc = command.GetArgumentCount();
if (argc == 1)
{
- FileSpec file_spec (file_path);
+ FileSpec file_spec (file_path, true);
if (! file_spec.Exists() && !file_spec.ResolveExecutableLocation())
{
diff --git a/lldb/source/Commands/CommandObjectImage.cpp b/lldb/source/Commands/CommandObjectImage.cpp
index ebbc0f1c840..53db6dfbeb4 100644
--- a/lldb/source/Commands/CommandObjectImage.cpp
+++ b/lldb/source/Commands/CommandObjectImage.cpp
@@ -656,7 +656,7 @@ public:
const char *arg_cstr;
for (int arg_idx = 0; (arg_cstr = command.GetArgumentAtIndex(arg_idx)) != NULL; ++arg_idx)
{
- FileSpec image_file(arg_cstr);
+ FileSpec image_file(arg_cstr, false);
ModuleList matching_modules;
size_t num_matching_modules = target->GetImages().FindModules(&image_file, NULL, NULL, NULL, matching_modules);
@@ -861,7 +861,7 @@ public:
const char *arg_cstr;
for (int arg_idx = 0; (arg_cstr = command.GetArgumentAtIndex(arg_idx)) != NULL; ++arg_idx)
{
- FileSpec image_file(arg_cstr);
+ FileSpec image_file(arg_cstr, false);
ModuleList matching_modules;
size_t num_matching_modules = target->GetImages().FindModules(&image_file, NULL, NULL, NULL, matching_modules);
@@ -969,7 +969,7 @@ public:
const char *arg_cstr;
for (int arg_idx = 0; (arg_cstr = command.GetArgumentAtIndex(arg_idx)) != NULL; ++arg_idx)
{
- FileSpec image_file(arg_cstr);
+ FileSpec image_file(arg_cstr, false);
ModuleList matching_modules;
size_t num_matching_modules = target->GetImages().FindModules(&image_file, NULL, NULL, NULL, matching_modules);
@@ -1062,7 +1062,7 @@ public:
const char *arg_cstr;
for (int arg_idx = 0; (arg_cstr = command.GetArgumentAtIndex(arg_idx)) != NULL; ++arg_idx)
{
- FileSpec file_spec(arg_cstr);
+ FileSpec file_spec(arg_cstr, false);
const uint32_t num_modules = target->GetImages().GetSize();
if (num_modules > 0)
{
@@ -1381,7 +1381,7 @@ public:
break;
case 'f':
- m_file.SetFile (option_arg);
+ m_file.SetFile (option_arg, false);
m_type = eLookupTypeFileLine;
break;
@@ -1627,7 +1627,7 @@ public:
const char *arg_cstr;
for (i = 0; (arg_cstr = command.GetArgumentAtIndex(i)) != NULL && syntax_error == false; ++i)
{
- FileSpec image_file(arg_cstr);
+ FileSpec image_file(arg_cstr, false);
ModuleList matching_modules;
size_t num_matching_modules = target->GetImages().FindModules(&image_file, NULL, NULL, NULL, matching_modules);
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index 767b472904e..3020c01de81 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -143,7 +143,7 @@ public:
break;
case 'o':
- m_outfile_filespec.SetFile (option_arg);
+ m_outfile_filespec.SetFile (option_arg, true);
break;
case 'b':
@@ -462,7 +462,7 @@ public:
break;
case 'i':
- m_infile.SetFile (option_arg);
+ m_infile.SetFile (option_arg, true);
if (!m_infile.Exists())
{
m_infile.Clear();
diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp
index 63d319eefed..88c18be5551 100644
--- a/lldb/source/Commands/CommandObjectSource.cpp
+++ b/lldb/source/Commands/CommandObjectSource.cpp
@@ -297,7 +297,7 @@ public:
ModuleList matching_modules;
for (unsigned i = 0, e = m_options.m_modules.size(); i != e; i++)
{
- FileSpec module_spec(m_options.m_modules[i].c_str());
+ FileSpec module_spec(m_options.m_modules[i].c_str(), false);
if (module_spec)
{
matching_modules.Clear();
@@ -471,7 +471,7 @@ public:
ModuleList matching_modules;
for (unsigned i = 0, e = m_options.m_modules.size(); i != e; i++)
{
- FileSpec module_spec(m_options.m_modules[i].c_str());
+ FileSpec module_spec(m_options.m_modules[i].c_str(), false);
if (module_spec)
{
matching_modules.Clear();
diff --git a/lldb/source/Core/FileSpec.cpp b/lldb/source/Core/FileSpec.cpp
index 1768a063035..21b00ae73c5 100644
--- a/lldb/source/Core/FileSpec.cpp
+++ b/lldb/source/Core/FileSpec.cpp
@@ -174,18 +174,6 @@ FileSpec::FileSpec() :
// Default constructor that can take an optional full path to a
// file on disk.
//------------------------------------------------------------------
-FileSpec::FileSpec(const char *pathname) :
- m_directory(),
- m_filename()
-{
- if (pathname && pathname[0])
- SetFile(pathname);
-}
-
-//------------------------------------------------------------------
-// Default constructor that can take an optional full path to a
-// file on disk.
-//------------------------------------------------------------------
FileSpec::FileSpec(const char *pathname, bool resolve_path) :
m_directory(),
m_filename()
@@ -447,7 +435,7 @@ FileSpec::Exists () const
bool
FileSpec::ResolveExecutableLocation ()
{
- if (m_directory.GetLength() == 0)
+ if (!m_directory)
{
const std::string file_str (m_filename.AsCString());
llvm::sys::Path path = llvm::sys::Program::FindProgramByName (file_str);
@@ -465,7 +453,7 @@ FileSpec::ResolveExecutableLocation ()
{
// If FindProgramByName found the file, it returns the directory + filename in its return results.
// We need to separate them.
- FileSpec tmp_file (dir_ref.data());
+ FileSpec tmp_file (dir_ref.data(), false);
if (tmp_file.Exists())
{
m_directory = tmp_file.m_directory;
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 251207425d1..ce334606712 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -241,9 +241,16 @@ Module::ResolveSymbolContextForAddress (const Address& so_addr, uint32_t resolve
}
uint32_t
-Module::ResolveSymbolContextForFilePath (const char *file_path, uint32_t line, bool check_inlines, uint32_t resolve_scope, SymbolContextList& sc_list)
-{
- FileSpec file_spec(file_path);
+Module::ResolveSymbolContextForFilePath
+(
+ const char *file_path,
+ uint32_t line,
+ bool check_inlines,
+ uint32_t resolve_scope,
+ SymbolContextList& sc_list
+)
+{
+ FileSpec file_spec(file_path, false);
return ResolveSymbolContextsForFileSpec (file_spec, line, check_inlines, resolve_scope, sc_list);
}
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp
index 1d7e75537b3..d1c640e898e 100644
--- a/lldb/source/Core/ModuleList.cpp
+++ b/lldb/source/Core/ModuleList.cpp
@@ -405,9 +405,16 @@ ModuleList::ResolveSymbolContextForAddress (const Address& so_addr, uint32_t res
}
uint32_t
-ModuleList::ResolveSymbolContextForFilePath (const char *file_path, uint32_t line, bool check_inlines, uint32_t resolve_scope, SymbolContextList& sc_list)
+ModuleList::ResolveSymbolContextForFilePath
+(
+ const char *file_path,
+ uint32_t line,
+ bool check_inlines,
+ uint32_t resolve_scope,
+ SymbolContextList& sc_list
+)
{
- FileSpec file_spec(file_path);
+ FileSpec file_spec(file_path, false);
return ResolveSymbolContextsForFileSpec (file_spec, line, check_inlines, resolve_scope, sc_list);
}
diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp
index ea96e65f6cb..ed6a2746099 100644
--- a/lldb/source/Host/common/Host.cpp
+++ b/lldb/source/Host/common/Host.cpp
@@ -581,14 +581,14 @@ Host::GetProgramFileSpec ()
uint32_t len = sizeof(program_fullpath);
int err = _NSGetExecutablePath (program_fullpath, &len);
if (err == 0)
- g_program_filespec.SetFile (program_fullpath);
+ g_program_filespec.SetFile (program_fullpath, true);
else if (err == -1)
{
char *large_program_fullpath = (char *)::malloc (len + 1);
err = _NSGetExecutablePath (large_program_fullpath, &len);
if (err == 0)
- g_program_filespec.SetFile (large_program_fullpath);
+ g_program_filespec.SetFile (large_program_fullpath, true);
::free (large_program_fullpath);
}
@@ -619,7 +619,7 @@ Host::GetModuleFileSpecForHostAddress (const void *host_addr)
if (::dladdr (host_addr, &info))
{
if (info.dli_fname)
- module_filespec.SetFile(info.dli_fname);
+ module_filespec.SetFile(info.dli_fname, true);
}
return module_filespec;
}
diff --git a/lldb/source/Host/macosx/Host.mm b/lldb/source/Host/macosx/Host.mm
index 6f15c259d92..df4f92199d1 100644
--- a/lldb/source/Host/macosx/Host.mm
+++ b/lldb/source/Host/macosx/Host.mm
@@ -116,7 +116,7 @@ Host::ResolveExecutableInBundle (FileSpec &file)
{
if (::CFURLGetFileSystemRepresentation (url.get(), YES, (UInt8*)path, sizeof(path)))
{
- file.SetFile(path);
+ file.SetFile(path, false);
return true;
}
}
@@ -232,7 +232,7 @@ LaunchInNewTerminalWithCommandFile
OSStatus error = 0;
- FileSpec program (argv[0]);
+ FileSpec program (argv[0], false);
std::string unix_socket_name;
diff --git a/lldb/source/Host/macosx/Symbols.cpp b/lldb/source/Host/macosx/Symbols.cpp
index f59f35e0c13..cc39319d662 100644
--- a/lldb/source/Host/macosx/Symbols.cpp
+++ b/lldb/source/Host/macosx/Symbols.cpp
@@ -239,8 +239,7 @@ LocateDSYMMachFileInDSYMBundle
DIR* dirp = ::opendir(path);
if (dirp != NULL)
{
- const size_t path_len = strlen(path);
- const int bytes_left = sizeof(path) - path_len - 1;
+ dsym_fspec.GetDirectory().SetCString(path);
struct dirent* dp;
while ((dp = readdir(dirp)) != NULL)
{
@@ -256,9 +255,7 @@ LocateDSYMMachFileInDSYMBundle
if (dp->d_type == DT_REG || dp->d_type == DT_UNKNOWN)
{
- ::strncpy (&path[path_len], dp->d_name, bytes_left);
-
- dsym_fspec.SetFile(path);
+ dsym_fspec.GetFilename().SetCString(dp->d_name);
if (FileAtPathContainsArchAndUUID (dsym_fspec, arch, uuid))
return dsym_fspec;
}
@@ -334,7 +331,7 @@ LocateMacOSXFilesUsingDebugSymbols
{
if (::CFURLGetFileSystemRepresentation (dsym_url.get(), true, (UInt8*)path, sizeof(path)-1))
{
- out_dsym_fspec->SetFile(path);
+ out_dsym_fspec->SetFile(path, false);
if (out_dsym_fspec->GetFileType () == FileSpec::eFileTypeDirectory)
{
@@ -358,7 +355,7 @@ LocateMacOSXFilesUsingDebugSymbols
if (exec_cf_path && ::CFStringGetFileSystemRepresentation (exec_cf_path, path, sizeof(path)))
{
++items_found;
- out_dsym_fspec->SetFile(path);
+ out_dsym_fspec->SetFile(path, false);
}
}
}
@@ -384,7 +381,7 @@ LocateDSYMInVincinityOfExecutable (const FileSpec *exec_fspec, const ArchSpec* a
strncat(path, ".dSYM/Contents/Resources/DWARF/", sizeof(path));
strncat(path, exec_fspec->GetFilename().AsCString(), sizeof(path));
- dsym_fspec.SetFile(path);
+ dsym_fspec.SetFile(path, false);
if (FileAtPathContainsArchAndUUID (dsym_fspec, arch, uuid))
{
@@ -403,7 +400,7 @@ LocateDSYMInVincinityOfExecutable (const FileSpec *exec_fspec, const ArchSpec* a
*next_slash = '\0';
strncat(path, ".dSYM/Contents/Resources/DWARF/", sizeof(path));
strncat(path, exec_fspec->GetFilename().AsCString(), sizeof(path));
- dsym_fspec.SetFile(path);
+ dsym_fspec.SetFile(path, false);
if (dsym_fspec.Exists())
return true;
else
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 2258ca2f16e..5bf313ba7c2 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -1074,7 +1074,7 @@ CommandInterpreter::SourceInitFile (bool in_cwd, CommandReturnObject &result)
return;
const char *init_file_path = in_cwd ? "./.lldbinit" : "~/.lldbinit";
- FileSpec init_file (init_file_path);
+ FileSpec init_file (init_file_path, true);
// If the file exists, tell HandleCommand to 'source' it; this will do the actual broadcasting
// of the commands back to any appropriate listener (see CommandObjectSource::Execute for more details).
diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp
index fcf048b4412..cd810c6e0bc 100644
--- a/lldb/source/Interpreter/Options.cpp
+++ b/lldb/source/Interpreter/Options.cpp
@@ -866,7 +866,7 @@ Options::HandleOptionArgumentCompletion
const char *module_name = input.GetArgumentAtIndex(cur_arg_pos);
if (module_name)
{
- FileSpec module_spec(module_name);
+ FileSpec module_spec(module_name, false);
lldb::TargetSP target_sp = interpreter.GetDebugger().GetSelectedTarget();
// Search filters require a target...
if (target_sp != NULL)
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
index 73a333f2bdf..10e7e7a5034 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
@@ -543,7 +543,7 @@ DynamicLoaderMacOSXDYLD::UpdateAllImageInfos()
char raw_path[PATH_MAX];
m_process->ReadMemory (path_addr, raw_path, sizeof(raw_path), error);
- m_dyld_image_infos[i].file_spec.SetFile(raw_path);
+ m_dyld_image_infos[i].file_spec.SetFile(raw_path, true);
}
assert(i == m_dyld_all_image_infos.dylib_info_count);
@@ -787,7 +787,7 @@ DynamicLoaderMacOSXDYLD::ParseLoadCommands (const DataExtractor& data, struct DY
{
uint32_t name_offset = load_cmd_offset + data.GetU32 (&offset);
const char *path = data.PeekCStr (name_offset);
- lc_id_dylinker->SetFile (path);
+ lc_id_dylinker->SetFile (path, true);
}
break;
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index 402dcae292b..85c337f7ae1 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -271,7 +271,7 @@ ObjectFileELF::ParseDependentModules()
uint32_t str_index = static_cast<uint32_t>(symbol.d_val);
const char *lib_name = dynstr_data.PeekCStr(str_index);
- m_filespec_ap->Append(FileSpec(lib_name));
+ m_filespec_ap->Append(FileSpec(lib_name, true));
}
}
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index e5c7db31d62..ddadd2cea01 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -1412,7 +1412,7 @@ ObjectFileMachO::GetDependentModules (FileSpecList& files)
// @rpath/.../file
if (path && path[0] != '@')
{
- FileSpec file_spec(path);
+ FileSpec file_spec(path, true);
if (files.AppendIfUnique(file_spec))
count++;
}
diff --git a/lldb/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp b/lldb/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp
index aae460e5ff1..63c9dc591de 100644
--- a/lldb/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp
@@ -111,13 +111,13 @@ ThreadMacOSX::GetDispatchQueueName()
DataExtractor data(memory_buffer, sizeof(memory_buffer), m_process.GetByteOrder(), m_process.GetAddressByteSize());
static ConstString g_dispatch_queue_offsets_symbol_name ("dispatch_queue_offsets");
const Symbol *dispatch_queue_offsets_symbol = NULL;
- ModuleSP module_sp(m_process.GetTarget().GetImages().FindFirstModuleForFileSpec (FileSpec("libSystem.B.dylib")));
+ ModuleSP module_sp(m_process.GetTarget().GetImages().FindFirstModuleForFileSpec (FileSpec("libSystem.B.dylib", false)));
if (module_sp)
dispatch_queue_offsets_symbol = module_sp->FindFirstSymbolWithNameAndType (g_dispatch_queue_offsets_symbol_name, eSymbolTypeData);
if (dispatch_queue_offsets_symbol == NULL)
{
- module_sp = m_process.GetTarget().GetImages().FindFirstModuleForFileSpec (FileSpec("libdispatch.dylib"));
+ module_sp = m_process.GetTarget().GetImages().FindFirstModuleForFileSpec (FileSpec("libdispatch.dylib", false));
if (module_sp)
dispatch_queue_offsets_symbol = module_sp->FindFirstSymbolWithNameAndType (g_dispatch_queue_offsets_symbol_name, eSymbolTypeData);
}
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 8a4cfa7a599..5e99e9ce331 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -1674,7 +1674,7 @@ ProcessGDBRemote::StartDebugserverProcess
// to the debugserver to use and use it if we do.
const char *env_debugserver_path = getenv("LLDB_DEBUGSERVER_PATH");
if (env_debugserver_path)
- debugserver_file_spec.SetFile (env_debugserver_path);
+ debugserver_file_spec.SetFile (env_debugserver_path, false);
else
debugserver_file_spec = g_debugserver_file_spec;
bool debugserver_exists = debugserver_file_spec.Exists();
@@ -2236,13 +2236,13 @@ ProcessGDBRemote::GetDispatchQueueNameForThread
{
static ConstString g_dispatch_queue_offsets_symbol_name ("dispatch_queue_offsets");
const Symbol *dispatch_queue_offsets_symbol = NULL;
- ModuleSP module_sp(GetTarget().GetImages().FindFirstModuleForFileSpec (FileSpec("libSystem.B.dylib")));
+ ModuleSP module_sp(GetTarget().GetImages().FindFirstModuleForFileSpec (FileSpec("libSystem.B.dylib", false)));
if (module_sp)
dispatch_queue_offsets_symbol = module_sp->FindFirstSymbolWithNameAndType (g_dispatch_queue_offsets_symbol_name, eSymbolTypeData);
if (dispatch_queue_offsets_symbol == NULL)
{
- module_sp = GetTarget().GetImages().FindFirstModuleForFileSpec (FileSpec("libdispatch.dylib"));
+ module_sp = GetTarget().GetImages().FindFirstModuleForFileSpec (FileSpec("libdispatch.dylib", false));
if (module_sp)
dispatch_queue_offsets_symbol = module_sp->FindFirstSymbolWithNameAndType (g_dispatch_queue_offsets_symbol_name, eSymbolTypeData);
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index 88a8a128b2c..4647b912077 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -137,7 +137,7 @@ SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo (CompileUnitInfo *comp_unit_inf
Symbol *oso_symbol = comp_unit_info->oso_symbol;
if (oso_symbol)
{
- FileSpec oso_file_spec(oso_symbol->GetMangled().GetName().AsCString());
+ FileSpec oso_file_spec(oso_symbol->GetMangled().GetName().AsCString(), true);
ModuleList::GetSharedModule (oso_file_spec,
m_obj_file->GetModule()->GetArchitecture(),
@@ -168,7 +168,7 @@ SymbolFileDWARFDebugMap::GetFileSpecForSO (uint32_t oso_idx, FileSpec &file_spec
std::string so_path (m_compile_unit_infos[oso_idx].so_symbol->GetMangled().GetName().AsCString());
if (m_compile_unit_infos[oso_idx].so_symbol[1].GetType() == eSymbolTypeSourceFile)
so_path += m_compile_unit_infos[oso_idx].so_symbol[1].GetMangled().GetName().AsCString();
- m_compile_unit_infos[oso_idx].so_file.SetFile(so_path.c_str());
+ m_compile_unit_infos[oso_idx].so_file.SetFile(so_path.c_str(), true);
}
file_spec = m_compile_unit_infos[oso_idx].so_file;
return true;
diff --git a/lldb/source/Symbol/CompileUnit.cpp b/lldb/source/Symbol/CompileUnit.cpp
index b263e57851d..e0ef4fe983c 100644
--- a/lldb/source/Symbol/CompileUnit.cpp
+++ b/lldb/source/Symbol/CompileUnit.cpp
@@ -18,7 +18,7 @@ using namespace lldb_private;
CompileUnit::CompileUnit (Module *module, void *user_data, const char *pathname, const lldb::user_id_t cu_sym_id, lldb::LanguageType language) :
ModuleChild(module),
- FileSpec (pathname),
+ FileSpec (pathname, false),
UserID(cu_sym_id),
Language (language),
m_user_data (user_data),
diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp
index d4225cf4e46..8c0ffceb65e 100644
--- a/lldb/source/Symbol/ObjectFile.cpp
+++ b/lldb/source/Symbol/ObjectFile.cpp
@@ -51,7 +51,7 @@ ObjectFile::FindPlugin (Module* module, const FileSpec* file, lldb::addr_t file_
if (g_object_regex.GetMatchAtIndex (path_with_object, 1, path) &&
g_object_regex.GetMatchAtIndex (path_with_object, 2, object))
{
- archive_file.SetFile (path.c_str());
+ archive_file.SetFile (path.c_str(), false);
file_size = archive_file.GetByteSize();
if (file_size > 0)
module->SetFileSpecAndObjectName (archive_file, ConstString(object.c_str()));
OpenPOWER on IntegriCloud