summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/FileSpec.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Since we use C++11, we should switch over to using std::unique_ptr when ↵Greg Clayton2013-04-181-3/+2
| | | | | | | | C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++. Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro. llvm-svn: 179779
* Change EnumerateDirectory from using readdir() to using readdir_r()Jason Molenda2013-04-041-2/+13
| | | | | | so it can be re-entered while iterating over a directory safely. llvm-svn: 178738
* <rdar://problem/13069948>Greg Clayton2013-01-251-1/+1
| | | | | | | | | | | | Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary. So I defined a new "lldb::offset_t" which should be used for all file offsets. After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed. Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections. llvm-svn: 173463
* More Linux warnings fixes (remove default labels as needed):Daniel Malea2012-12-071-1/+0
| | | | | | | | - as per http://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations Patch by Matt Kopec! llvm-svn: 169633
* Fix a little think-o. In FileSpec::operator== we were trying to figure out ↵Jim Ingham2012-11-031-1/+1
| | | | | | | | | | | whether the rhs file was resolved or not by comparing the resolved version of the rhs FileSpec's directory name with the lhs FileSpec's directory name. We really meant to compare it with the rhs FileSpec's directory name... <rdar://problem/12438838> llvm-svn: 167349
* Caught two cases where we were passing a Stream* without checking for NULLEnrico Granata2012-11-031-4/+7
| | | | llvm-svn: 167342
* <rdar://problem/12462048>Greg Clayton2012-10-181-0/+24
| | | | | | | | | | <rdar://problem/12068650> More fixes to how we handle paths that are used to create a target. This modification centralizes the location where and how what the user specifies gets resolved. Prior to this fix, the TargetList::CreateTarget variants took a FileSpec object which meant everyone had the opportunity to resolve the path their own way. Now both CreateTarget variants take a "const char *use_exe_path" which allows the TargetList::CreateTarget to centralize where the resolving happens and "do the right thing". llvm-svn: 166186
* OptionValueFileSpec had an accessor to read the contents of the file and ↵Greg Clayton2012-08-301-1/+31
| | | | | | return the data. This can end up being used to get the string contents of a text file and could end up not being NULL terminated. I added accessors to get the file contents raw, or with a null terminator. Added the needed calls to make this happen in the FileSpec and File classes. llvm-svn: 162921
* <rdar://problem/11757916>Greg Clayton2012-08-291-9/+32
| | | | | | | | | | | | Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes: - Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file". - modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly - Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was. - modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile() Cleaned up header includes a bit as well. llvm-svn: 162860
* Reimplemented the code that backed the "settings" in lldb. There were many ↵Greg Clayton2012-08-221-7/+1
| | | | | | | | | | | | | issues with the previous implementation: - no setting auto completion - very manual and error prone way of getting/setting variables - tons of code duplication - useless instance names for processes, threads Now settings can easily be defined like option values. The new settings makes use of the "OptionValue" classes so we can re-use the option value code that we use to set settings in command options. No more instances, just "does the right thing". llvm-svn: 162366
* <rdar://problem/10652336>Greg Clayton2012-01-061-4/+16
| | | | | | | | | | | Fixed a crasher when trying to load an expression prefix file: % touch /tmp/carp.txt % xcrun lldb (lldb) settings set target.expr-prefix /tmp/carp.txt Segmentation fault llvm-svn: 147646
* <rdar://problem/10507811>Greg Clayton2012-01-041-64/+13
| | | | | | | | | | Be better at detecting when DWARF changes and handle this more gracefully than asserting and exiting. Also fixed up a bunch of system calls that weren't properly checking for EINTR. llvm-svn: 147559
* Fix build under gcc.Johnny Chen2011-10-181-2/+2
| | | | | | Patch from Dawn. llvm-svn: 142402
* this patch introduces a new command script import command which takes as ↵Enrico Granata2011-10-171-1/+30
| | | | | | input a filename for a Python script and imports the module contained in that file. the containing directory is added to the Python path such that dependencies are honored. also, the module may contain an __lldb_init_module(debugger,dict) function, which gets called after importing, and which can somehow initialize the module's interaction with lldb llvm-svn: 142283
* Added the ability to restrict breakpoints by function name, function regexp, ↵Jim Ingham2011-09-231-3/+3
| | | | | | | | | | selector etc to specific source files. Added SB API's to specify these source files & also more than one module. Added an "exact" option to CompileUnit's FindLineEntry API. llvm-svn: 140362
* Changed to using an "operator bool" instead of an "operator void*"Greg Clayton2011-09-121-3/+2
| | | | | | | | | and avoid returning a pointer to the current object. In the new "operator bool" implementation, check the filename object first since many times we have FileSpec objects with a filename, yet no directory. llvm-svn: 139488
* Patch by Matt Johnson to silence G++ warnings!Johnny Chen2011-07-191-1/+1
| | | | | | | | Used hand merge to apply the diffs. I did not apply the diffs for FormatManager.h and the diffs for memberwise initialization for ValueObject.cpp because they changed since. I will ask my colleague to apply them later. llvm-svn: 135508
* Fixed the SymbolContext::DumpStopContext() to correctly indent and dumpGreg Clayton2011-04-231-1/+1
| | | | | | | | | | | | | | | | | inline contexts when the deepest most block is not inlined. Added source path remappings to the lldb_private::Target class that allow it to remap paths found in debug info so we can find source files that are elsewhere on the current system. Fixed disassembly by function name to disassemble inline functions that are inside other functions much better and to show enough context before the disassembly output so you can tell where things came from. Added the ability to get more than one address range from a SymbolContext class for the case where a block or function has discontiguous address ranges. llvm-svn: 130044
* Some OpenBSD patches from Amit Kulkarni.Greg Clayton2011-04-011-0/+2
| | | | llvm-svn: 128721
* Add FileSpec::ResolvePartialUsername, and use it in CommandCompletions to ↵Jim Ingham2011-02-081-0/+35
| | | | | | isolate pwd.h in the Host layer. llvm-svn: 125135
* A bit more cleanup with respect to using LLDB_CONFIG_XXX defines outside ofGreg Clayton2011-02-081-3/+11
| | | | | | | | | | | the lldb/source/Host/*.cpp and lldb/source/Host/*/*.cpp directories. The only offenders are the command completion and the StreamFile.cpp. I will soon modify StreamFile.cpp to use a lldb/source/Host/File.cpp so that all file open, close, read, write, seek, are abstracted into the host layer as well, then this will be gone. llvm-svn: 125082
* Moved FileSpec into the Host layer since it will vary from host to host.Greg Clayton2011-02-081-0/+918
We have a common unix implementation in lldb/source/Host/common/FileSpec.cpp. llvm-svn: 125078
OpenPOWER on IntegriCloud