summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
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/source/Interpreter
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/source/Interpreter')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp2
-rw-r--r--lldb/source/Interpreter/Options.cpp2
2 files changed, 2 insertions, 2 deletions
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)
OpenPOWER on IntegriCloud