History log of /external/lldb/source/Core/SourceManager.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
535f53c8795b3592ce835804af5cef89be39ceea 19-Mar-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13443931>

Fixed a crasher in the SourceManager where it wasn't checking the m_target member variable for NULL.

In doing this fix, I hardened this class to have weak pointers to the debugger and target in case they do go away. I also changed SBSourceManager to hold onto weak pointers to the debugger and target so they don't keep objects alive by holding a strong reference to them.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@177365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
a01b0fa183a5bd0110722bf17401882b1672635f 14-Mar-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/12537646>

lldb remembers not-found source file, setting target.source-map doesn't make it re-check for it. Now this is fixed. Each time the source path remappings get updated, the modification ID in the PathMappingList gets bumped and then we know the re-check for sources.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@177125 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
b1f44b340f31ec747a7b6dcd299b8a6151470817 13-Mar-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13404189>

Made the "--reverse" option to "source list" also be able to use the "--count". This helps us implement support for regexp source list command:

(lldb) l -10

Which gets turned into:

(lldb) source list --reverse --count 10

Also simplified the code that is used to track showing more source from the last file and line.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
381549e26c5704e211f1b7acea55b5dad126e18c 07-Feb-2013 Greg Clayton <gclayton@apple.com> Fixed an bug found by running LLDB with the address sanitizer! We were accessing one past the end of the buffer.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174578 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
36da2aa6dc5ad9994b638ed09eb81c44cc05540b 25-Jan-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13069948>

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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@173463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
12b5aa0a637c6070fa0290a90fdc9d5b0b9df950 09-Jan-2013 Jim Ingham <jingham@apple.com> Add a "--reverse" or "-r" option to the "list" with no options command. This will list backwards from the
last source point listed.
Also fix the setting of the default file & line to the file containing main, when you do a plain "list".

<rdar://problem/12685226>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@171945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
d891f9b872103235cfd2ed452c6f14a4394d9b3a 05-Dec-2012 Daniel Malea <daniel.malea@intel.com> Fix Linux build warnings due to redefinition of macros:
- add new header lldb-python.h to be included before other system headers
- short term fix (eventually python dependencies must be cleaned up)

Patch by Matt Kopec!




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169341 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
49ce8969d3154e1560106cfe530444c09410f217 29-Aug-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11757916>

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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
964deba8853eb794e59263322b59b09b43669618 15-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/8196933>

Use the metadata in the dSYM bundle Info.plist to remap source paths when they keys are available.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
302d78c71902398ce1f422bd09216dd53a6abb88 10-Feb-2012 Sean Callanan <scallanan@apple.com> Extended function lookup to allow the user to
indicate whether inline functions are desired.
This allows the expression parser, for instance,
to filter out inlined functions when looking for
functions it can call.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
931449ee91b1a3acf0cd8ab2e1dd1285d7c42ad4 12-Dec-2011 Johnny Chen <johnny.chen@apple.com> rdar://problem/10227672

There were two problems associated with this radar:
1. "settings show target.source-map" failed to show the source-map after, for example,
"settings set target.source-map /Volumes/data/lldb/svn/trunk/test/source-manager /Volumes/data/lldb/svn/trunk/test/source-manager/hidden"
has been executed to set the source-map.
2. "list -n main" failed to display the source of the main() function after we properly set the source-map.

The first was fixed by adding the missing functionality to TargetInstanceSettings::GetInstanceSettingsValue (Target.cpp)
and updating the support files PathMappingList.h/.cpp; the second by modifying SourceManager.cpp to fix several places
with incorrect logic.

Also added a test case test_move_and_then_display_source() to TestSourceManager.py, which moves main.c to hidden/main.c,
sets target.source-map to perform the directory mapping, and then verifies that "list -n main" can still show the main()
function.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146422 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
c5d14e6146ccacd8e00f1c247e21cd86ebfac21d 10-Dec-2011 Greg Clayton <gclayton@apple.com> <rdar://problem/9958446>
<rdar://problem/10561406>

Stopped the SymbolFileDWARF::FindFunctions (...) from always calculating
the line table entry for all functions that were found. This can slow down
the expression parser if it ends up finding a bunch of matches. Fixed the
places that were relying on the line table entry being filled in.

Discovered a recursive stack blowout that happened when "main" didn't have
line info for it and there was no line information for "main"



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
3e80cd9c9e6ae50ff54537551e2fe3ed5319b9b4 12-Oct-2011 Sean Callanan <scallanan@apple.com> Added ClangNamespaceDecl * parameters to several
core Module functions that the expression parser
will soon be using.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
ca804bfc09bdc53065e11081c8cb42a5e67fc613 08-Oct-2011 Jim Ingham <jingham@apple.com> Don't look up main to find the default source file till somebody actually asks for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141422 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
03c8ee5aeafcd6c43f10002a4f8096af01780f86 21-Sep-2011 Jim Ingham <jingham@apple.com> Add a new breakpoint type "break by source regular expression".
Fix the RegularExpression class so it has a real copy constructor.
Fix the breakpoint setting with multiple shared libraries so it makes
one breakpoint not one per shared library.
Add SBFileSpecList, to be used to expose the above to the SB interface (not done yet.)


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140225 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
cc637461f6c59851302836c64e0cb002de4f4571 13-Sep-2011 Jim Ingham <jingham@apple.com> SBSourceManager now gets the real source manager either from the Debugger or Target. Also, move the SourceManager file cache into the debugger
so it can be shared amongst the targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139564 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
fdf24efe672bf3fa041cdbebd2d7f406b11882bd 09-Sep-2011 Jim Ingham <jingham@apple.com> Move the SourceManager from the Debugger to the Target. That way it can store the per-Target default Source File & Line.
Set the default Source File & line to main (if it can be found.) at startup. Selecting the current thread & or frame resets
the current source file & line, and "source list" as well as the breakpoint command "break set -l <NUM>" will use the
current source file.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
801417e453f8531ac176cd952200587bf15d9ccf 07-Jul-2011 Greg Clayton <gclayton@apple.com> Added "target variable" command that allows introspection of global
variables prior to running your binary. Zero filled sections now get
section data correctly filled with zeroes when Target::ReadMemory
reads from the object file section data.

Added new option groups and option values for file lists. I still need
to hook up all of the options to "target variable" to allow more complete
introspection by file and shlib.

Added the ability for ValueObjectVariable objects to be created with
only the target as the execution context. This allows them to be read
from the object files through Target::ReadMemory(...).

Added a "virtual Module * GetModule()" function to the ValueObject
class. By default it will look to the parent variable object and
return its module. The module is needed when we have global variables
that have file addresses (virtual addresses that are specific to
module object files) and in turn allows global variables to be displayed
prior to running.

Removed all of the unused proxy object support that bit rotted in
lldb_private::Value.

Replaced a lot of places that used "FileSpec::Compare (lhs, rhs) == 0" code
with the more efficient "FileSpec::Equal (lhs, rhs)".

Improved logging in GDB remote plug-in.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134579 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
ff44ab42e9f5d8e4d550e11d1b69413e0bc75b71 23-Apr-2011 Greg Clayton <gclayton@apple.com> Fixed the SymbolContext::DumpStopContext() to correctly indent and dump
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.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@130044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
52c8b6e3205e11e90adc83521c01915fc13626de 19-Apr-2011 Greg Clayton <gclayton@apple.com> Added a new option to the "source list" command that allows us to see where
line tables specify breakpoints can be set in the source. When dumping the
source, the number of breakpoints that can be set on a source line are shown
as a prefix:

(lldb) source list -f test.c -l1 -c222 -b
1 #include <stdio.h>
2 #include <sys/fcntl.h>
3 #include <unistd.h>
4 int
5 sleep_loop (const int num_secs)
[2] 6 {
7 int i;
[1] 8 for (i=0; i<num_secs; ++i)
9 {
[1] 10 printf("%d of %i - sleep(1);\n", i, num_secs);
[1] 11 sleep(1);
12 }
13 return 0;
[1] 14 }
15
16 int
17 main (int argc, char const* argv[])
[1] 18 {
[1] 19 printf("Process: %i\n\n", getpid());
[1] 20 puts("Press any key to continue..."); getchar();
[1] 21 sleep_loop (20);
22 return 12;
[1] 23 }

Above we can see there are two breakpoints for line 6 and one breakpoint for
lines 8, 10, 11, 14, 18, 19, 20, 21 and 23. All other lines have no line table
entries for them. This helps visualize the data provided in the debug
information without having to manually dump all line tables. It also includes
all inline breakpoint that may result for a given file which can also be very
handy to see.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@129747 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
24bc5d9bfad2a1c562c27e7cf37e1c56d85c45e7 30-Mar-2011 Greg Clayton <gclayton@apple.com> Many improvements to the Platform base class and subclasses. The base Platform
class now implements the Host functionality for a lot of things that make
sense by default so that subclasses can check:

int
PlatformSubclass::Foo ()
{
if (IsHost())
return Platform::Foo (); // Let the platform base class do the host specific stuff

// Platform subclass specific code...
int result = ...
return result;
}

Added new functions to the platform:

virtual const char *Platform::GetUserName (uint32_t uid);
virtual const char *Platform::GetGroupName (uint32_t gid);

The user and group names are cached locally so that remote platforms can avoid
sending packets multiple times to resolve this information.

Added the parent process ID to the ProcessInfo class.

Added a new ProcessInfoMatch class which helps us to match processes up
and changed the Host layer over to using this new class. The new class allows
us to search for processs:
1 - by name (equal to, starts with, ends with, contains, and regex)
2 - by pid
3 - And further check for parent pid == value, uid == value, gid == value,
euid == value, egid == value, arch == value, parent == value.

This is all hookup up to the "platform process list" command which required
adding dumping routines to dump process information. If the Host class
implements the process lookup routines, you can now lists processes on
your local machine:

machine1.foo.com % lldb
(lldb) platform process list
PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE NAME
====== ====== ========== ========== ========== ========== ======================== ============================
99538 1 username usergroup username usergroup x86_64-apple-darwin FileMerge
94943 1 username usergroup username usergroup x86_64-apple-darwin mdworker
94852 244 username usergroup username usergroup x86_64-apple-darwin Safari
94727 244 username usergroup username usergroup x86_64-apple-darwin Xcode
92742 92710 username usergroup username usergroup i386-apple-darwin debugserver


This of course also works remotely with the lldb-platform:

machine1.foo.com % lldb-platform --listen 1234

machine2.foo.com % lldb
(lldb) platform create remote-macosx
Platform: remote-macosx
Connected: no
(lldb) platform connect connect://localhost:1444
Platform: remote-macosx
Triple: x86_64-apple-darwin
OS Version: 10.6.7 (10J869)
Kernel: Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
Hostname: machine1.foo.com
Connected: yes
(lldb) platform process list
PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE NAME
====== ====== ========== ========== ========== ========== ======================== ============================
99556 244 username usergroup username usergroup x86_64-apple-darwin trustevaluation
99548 65539 username usergroup username usergroup x86_64-apple-darwin lldb
99538 1 username usergroup username usergroup x86_64-apple-darwin FileMerge
94943 1 username usergroup username usergroup x86_64-apple-darwin mdworker
94852 244 username usergroup username usergroup x86_64-apple-darwin Safari

The lldb-platform implements everything with the Host:: layer, so this should
"just work" for linux. I will probably be adding more stuff to the Host layer
for launching processes and attaching to processes so that this support should
eventually just work as well.

Modified the target to be able to be created with an architecture that differs
from the main executable. This is needed for iOS debugging since we can have
an "armv6" binary which can run on an "armv7" machine, so we want to be able
to do:

% lldb
(lldb) platform create remote-ios
(lldb) file --arch armv7 a.out

Where "a.out" is an armv6 executable. The platform then can correctly decide
to open all "armv7" images for all dependent shared libraries.

Modified the disassembly to show the current PC value. Example output:

(lldb) disassemble --frame
a.out`main:
0x1eb7: pushl %ebp
0x1eb8: movl %esp, %ebp
0x1eba: pushl %ebx
0x1ebb: subl $20, %esp
0x1ebe: calll 0x1ec3 ; main + 12 at test.c:18
0x1ec3: popl %ebx
-> 0x1ec4: calll 0x1f12 ; getpid
0x1ec9: movl %eax, 4(%esp)
0x1ecd: leal 199(%ebx), %eax
0x1ed3: movl %eax, (%esp)
0x1ed6: calll 0x1f18 ; printf
0x1edb: leal 213(%ebx), %eax
0x1ee1: movl %eax, (%esp)
0x1ee4: calll 0x1f1e ; puts
0x1ee9: calll 0x1f0c ; getchar
0x1eee: movl $20, (%esp)
0x1ef5: calll 0x1e6a ; sleep_loop at test.c:6
0x1efa: movl $12, %eax
0x1eff: addl $20, %esp
0x1f02: popl %ebx
0x1f03: leave
0x1f04: ret

This can be handy when dealing with the new --line options that was recently
added:

(lldb) disassemble --line
a.out`main + 13 at test.c:19
18 {
-> 19 printf("Process: %i\n\n", getpid());
20 puts("Press any key to continue..."); getchar();
-> 0x1ec4: calll 0x1f12 ; getpid
0x1ec9: movl %eax, 4(%esp)
0x1ecd: leal 199(%ebx), %eax
0x1ed3: movl %eax, (%esp)
0x1ed6: calll 0x1f18 ; printf

Modified the ModuleList to have a lookup based solely on a UUID. Since the
UUID is typically the MD5 checksum of a binary image, there is no need
to give the path and architecture when searching for a pre-existing
image in an image list.

Now that we support remote debugging a bit better, our lldb_private::Module
needs to be able to track what the original path for file was as the platform
knows it, as well as where the file is locally. The module has the two
following functions to retrieve both paths:

const FileSpec &Module::GetFileSpec () const;
const FileSpec &Module::GetPlatformFileSpec () const;





git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
61e2c303e343598ed4aafecf6463a3b9631cb2b9 08-Dec-2010 Greg Clayton <gclayton@apple.com> Fixed an issue in our source manager where we were permanently caching source
file data, so if a source file was modified, we would always show the first
cached copy of the source data. We now check file modification times when
displaying source info so we can show the update source info.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp
24943d2ee8bfaa7cf5893e4709143924157a5c1e 08-Jun-2010 Chris Lattner <sabre@nondot.org> Initial checkin of lldb code from internal Apple repo.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/SourceManager.cpp