summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/FileSpec.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Updated to latest LLVM/Clang for external AST source changes that allowGreg Clayton2010-12-021-2/+2
| | | | | | | TagDecl subclasses and Objective C interfaces to complete themselves through the ExternalASTSource class. llvm-svn: 120749
* Fixed FileSpec's operator == to deal with equivalent paths such as "/tmp/a.c"Greg Clayton2010-11-081-10/+73
| | | | | | | | | | | | | | and "/private/tmp/a.c". This was done by adding a "mutable bool m_is_resolved;" member to FileSpec and then modifying the equal operator to check if the filenames are equal, and if they are, then check the directories. If they are not equal, then both paths are checked to see if they have been resolved. If they have been resolved, we resolve the paths in temporary FileSpec objects and set each of the m_is_resolved bools to try (for lhs and rhs) if the paths match what is contained in the path. This allows us to do more intelligent compares without having to resolve all paths found in the debug info (which can quickly get costly if the files are on remote NFS mounts). llvm-svn: 118387
* Cleaned up the API logging a lot more to reduce redundant information and Greg Clayton2010-10-311-23/+9
| | | | | | | | | keep the file size a bit smaller. Exposed SBValue::GetExpressionPath() so SBValue users can get an expression path for their values. llvm-svn: 117851
* Fixed a crasher that could happen if a FileSpec had a filename only, or viceGreg Clayton2010-10-201-16/+12
| | | | | | versa. llvm-svn: 116963
* Fixed an issue where we were resolving paths when we should have been.Greg Clayton2010-10-201-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Added a new Host call to find LLDB related paths:Greg Clayton2010-10-171-30/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | static bool Host::GetLLDBPath (lldb::PathType path_type, FileSpec &file_spec); This will fill in "file_spec" with an appropriate path that is appropriate for the current Host OS. MacOSX will return paths within the LLDB.framework, and other unixes will return the paths they want. The current PathType enums are: typedef enum PathType { ePathTypeLLDBShlibDir, // The directory where the lldb.so (unix) or LLDB mach-o file in LLDB.framework (MacOSX) exists ePathTypeSupportExecutableDir, // Find LLDB support executable directory (debugserver, etc) ePathTypeHeaderDir, // Find LLDB header file directory ePathTypePythonDir // Find Python modules (PYTHONPATH) directory } PathType; All places that were finding executables are and python paths are now updated to use this Host call. Added another new host call to launch the inferior in a terminal. This ability will be very host specific and doesn't need to be supported on all systems. MacOSX currently will create a new .command file and tell Terminal.app to open the .command file. It also uses the new "darwin-debug" app which is a small app that uses posix to exec (no fork) and stop at the entry point of the program. The GDB remote plug-in is almost able launch a process and attach to it, it currently will spawn the process, but it won't attach to it just yet. This will let LLDB not have to share the terminal with another process and a new terminal window will pop up when you launch. This won't get hooked up until we work out all of the kinks. The new Host function is: static lldb::pid_t Host::LaunchInNewTerminal ( const char **argv, // argv[0] is executable const char **envp, const ArchSpec *arch_spec, bool stop_at_entry, bool disable_aslr); Cleaned up FileSpec::GetPath to not use strncpy() as it was always zero filling the entire path buffer. Fixed an issue with the dynamic checker function where I missed a '$' prefix that should have been added. llvm-svn: 116690
* Add the ability to not resolve the name passed to FileSpec. Then don't ↵Jim Ingham2010-09-161-3/+39
| | | | | | resolve the names of compilation units found in DWARF. llvm-svn: 114054
* Remove Host::ResolveExecutableLocation (very recent addition); replace use ofCaroline Tice2010-09-121-1/+33
| | | | | | it with llvm::sys::Program::FindProgramByName. llvm-svn: 113709
* If the file the user specifies can't be found in the current directory,Caroline Tice2010-09-101-0/+7
| | | | | | | and the user didn't specify a particular directory, search for the file using the $PATH environment variable. llvm-svn: 113575
* Merged Eli Friedman's linux build changes where he added Makefile files thatGreg Clayton2010-07-091-9/+9
| | | | | | | enabled LLVM make style building and made this compile LLDB on Mac OS X. We can now iterate on this to make the build work on both linux and macosx. llvm-svn: 108009
* Add const qualification; fixes error on gcc 4.4.Eli Friedman2010-07-021-1/+1
| | | | llvm-svn: 107499
* Added a missing static function prototype to FileSpec.h for ResolveUsername.Greg Clayton2010-07-011-10/+10
| | | | | | Did a bit of code formatting and cleanup. llvm-svn: 107403
* Moved the User Name expansion over to FileSpec, and converted it to use ↵Jim Ingham2010-07-011-9/+87
| | | | | | | | getpwname directly. Changed the file completion to deal with this, and FileSpec::Resolve now resolves all user names (not just ~/). llvm-svn: 107370
* Centralized all disassembly into static functions in ↵Greg Clayton2010-06-301-6/+42
| | | | | | | | | | | | | | | | | | | | | | | | source/Core/Disassembler.cpp. Added the ability to read memory from the target's object files when we aren't running, so disassembling works before you run! Cleaned up the API to lldb_private::Target::ReadMemory(). Cleaned up the API to the Disassembler to use actual "lldb_private::Address" objects instead of just an "addr_t". This is nice because the Address objects when resolved carry along their section and module which can get us the object file. This allows Target::ReadMemory to be used when we are not running. Added a new lldb_private::Address dump style: DumpStyleDetailedSymbolContext This will show a full breakdown of what an address points to. To see some sample output, execute a "image lookup --address <addr>". Fixed SymbolContext::DumpStopContext(...) to not require a live process in order to be able to print function and symbol offsets. llvm-svn: 107350
* Return false from FileSpec::GetPath early instead of making the return valueBenjamin Kramer2010-06-211-0/+4
| | | | | | dependent on the last byte of the buffer, which could be unitialized. llvm-svn: 106417
* Use st_mtime instead of st_mtimespec for portability.Eli Friedman2010-06-111-1/+1
| | | | llvm-svn: 105813
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-081-0/+580
llvm-svn: 105619
OpenPOWER on IntegriCloud