summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Target.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Convert from the C-based LLVM Disassembler shim to the full MC Disassembler ↵Jim Ingham2013-03-021-1/+31
| | | | | | | | | | | | API's. Calculate "can branch" using the MC API's rather than our hand-rolled regex'es. As extra credit, allow setting the disassembly flavor for x86 based architectures to intel or att. <rdar://problem/11319574> <rdar://problem/9329275> llvm-svn: 176392
* Remove the m_images(NULL) hack in the Target ctor nowJason Molenda2013-02-041-13/+0
| | | | | | that the original issue has been fixed by r174222. llvm-svn: 174334
* <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
* <rdar://problem/12437929>Enrico Granata2013-01-211-0/+76
| | | | | | | | | | | | | | | | | | Providing a special mode of operator for "memory read -f c-str" which actually works in most common cases Where the old behavior would provide: (lldb) mem read --format s `foo` 0x100000f5d: NULL Now we do: (lldb) mem read --format s `foo` 0x100000f5d: "hello world" You can also specify a count and that many strings will be showed starting at the initial address: (lldb) mem read -c 2 -f c-str `foo` 0x100000f1d: "hello world" 0x100000f29: "short" llvm-svn: 173076
* Separated the "expr --unwind-on-error" behavior into two parts, actual ↵Jim Ingham2013-01-151-0/+1
| | | | | | | | | | | | | | | | errors (i.e. crashes) which continue to be controlled by the --unwind-on-error flag, and --ignore-breakpoint which separately controls behavior when a called function hits a breakpoint. For breakpoints, we don't unwind, we either stop, or ignore the breakpoint, which makes more sense. Also make both these behaviors globally settable through "settings set". Also handle the case where a breakpoint command calls code that ends up re-hitting the breakpoint. We were recursing and crashing. Now we just stop without calling the second command. <rdar://problem/12986644> <rdar://problem/9119325> llvm-svn: 172503
* Removed the hack that uses "frame variable" toSean Callanan2013-01-121-100/+22
| | | | | | | | | | evaluate expressions. The expression parser and IR interpreter are now fully capable of evaluating expressions with as much (or better) fidelity. <rdar://problem/12879364> llvm-svn: 172293
* Adding events when watchpoints are set or changed.Jim Ingham2012-12-181-17/+13
| | | | | | <rdar://problem/11597849> llvm-svn: 170400
* Removed the == and != operators from ArchSpec, sinceSean Callanan2012-12-131-1/+1
| | | | | | | | | | | | equality can be strict or loose and we want code to explicitly choose one or the other. Also renamed the Compare function to IsEqualTo, to avoid confusion. <rdar://problem/12856749> llvm-svn: 170152
* <rdar://problem/12831670> Jason Molenda2012-12-131-0/+13
| | | | | | | | | | For iOS native lldb, don't initialize the ModuleList notifier callback. See the added comment for details on how this is a problem in that environment. We'll need to restructure how the ModuleDidLoad notification is called vrs. when the DynamicLoader pluging has had a chance to set the Sectino load addresses. llvm-svn: 170082
* Add a LOG_TARGET log to Target::SetDefaultArchitectureJason Molenda2012-12-121-3/+4
| | | | | | to track any architecture setting there. llvm-svn: 169958
* Adding missing log->Printf instead of printf in Target::SetArchitectureJason Molenda2012-12-051-9/+12
| | | | | | for target logging. llvm-svn: 169444
* Crash every time with new target logging is now fixed.Greg Clayton2012-12-051-1/+2
| | | | llvm-svn: 169394
* Add an LLDB_LOG_TARGET logging channel (log eanble lldb target).Jason Molenda2012-12-051-1/+18
| | | | | | | Update the Target methods which can change the target log to this channel. llvm-svn: 169342
* Fix Linux build warnings due to redefinition of macros:Daniel Malea2012-12-051-0/+2
| | | | | | | | | - 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! llvm-svn: 169341
* <rdar://problem/12649160>Greg Clayton2012-12-051-10/+17
| | | | | | Added the ability to debug through your process exec'ing itself to the same architecture. llvm-svn: 169340
* <rdar://problem/12687087>Greg Clayton2012-11-291-26/+51
| | | | | | | | Emit an error when using "target modules add PATH" where PATH points to a debug info only (dSYM) file. Also added a "--uuid" option for "target modules add --uuid UUID" to locate and load a module by UUID if the host supports it. llvm-svn: 168949
* Resolve printf formatting warnings on Linux:Daniel Malea2012-11-291-10/+10
| | | | | | | | - use macros from inttypes.h for format strings instead of OS-specific types Patch from Matt Kopec! llvm-svn: 168945
* Minor cleanups to the new ModuleList notification APIs: passing in the ↵Enrico Granata2012-11-081-10/+10
| | | | | | ModuleList as part of the callbacks, and not copying the notifier as part of copy constructing and assigning llvm-svn: 167592
* <rdar://problem/12586350>Enrico Granata2012-11-081-19/+44
| | | | | | | | | | | | | | This commit does three things: (a) introduces a new notification model for adding/removing/changing modules to a ModuleList, and applies it to the Target's ModuleList, so that we make sure to always trigger the right set of actions whenever modules come and go in a target. Certain spots in the code still need to "manually" notify the Target for several reasons, so this is a work in progress (b) adds a new capability to the Platforms: locating a scripting resources associated to a module. A scripting resource is a Python file that can load commands, formatters, ... and any other action of interest corresponding to the loading of a module. At the moment, this is only implemented on Mac OS X and only for files inside .dSYM bundles - the next step is going to be letting the frameworks themselves hold their scripting resources. Implementors of platforms for other systems are free to implement "the right thing" for their own worlds (c) hooking up items (a) and (b) so that targets auto-load the scripting resources as the corresponding modules get loaded in a target. This has a few caveats at the moment: - the user needs to manually add the .py file to the dSYM (soon, it will also work in the framework itself) - if two modules with the same name show up during the lifetime of an LLDB session, the second one won't be able to load its scripting resource, but will otherwise work just fine llvm-svn: 167569
* Fixed build warnings.Greg Clayton2012-10-301-0/+1
| | | | llvm-svn: 167065
* Watchpoints remember the type of the expression or variable they were set ↵Jim Ingham2012-10-231-6/+5
| | | | | | | | | | with, and use it to print the old and new values. Temporarily disable the "out of scope" checking since it didn't work correctly, and was not what people generally expected watchpoints to be doing. llvm-svn: 166472
* Added the infrastructure necessary for plug-ins to be able to add their own ↵Greg Clayton2012-10-191-17/+1
| | | | | | | | | | | | | | | | | settings instead of having settings added to existing ones. In particular "target.disable-kext-loading" was added to "target" where it should actually be specific to the the dynamic loader plugin. Now the plug-in manager has the ability to create settings at the root level starting with "plugin". Each plug-in type can add new sub dictionaries, and then each plug-in can register a setting dictionary under its own short name. For example the DynamicLoaderDarwinKernel plug-in now registers a setting dictionary at: plugin dynamic-loader macosx-kernel (bool) disable-kext-loading To settings can be set using: (lldb) settings set plugin.dynamic-loader.macosx-kernel.disable-kext-loading true I currently only hooked up the DynamicLoader plug-ins, but the code is very easy to duplicate when and if we need settings for other plug-ins. llvm-svn: 166294
* Add a new target setting to disable automatic loading of kext imagesJason Molenda2012-10-191-1/+17
| | | | | | | | | | in a kernel debug session: settings set target.disable-kext-loading true <rdar://problem/12490623> llvm-svn: 166262
* <rdar://problem/12462048>Greg Clayton2012-10-171-1/+17
| | | | | | | | | | | | | | | | | | | LLDB changes argv[0] when debugging a symlink. Now we have the notion of argv0 in the target settings: target.arg0 (string) = There is also the program argument that are separate from the first argument that have existed for a while: target.run-args (arguments) = When running "target create <exe>", we will place the untouched "<exe>" into target.arg0 to ensure when we run, we run with what the user typed. This has been added to the ProcessLaunchInfo and all other needed places so we always carry around the: - resolved executable path - argv0 - program args Some systems may not support separating argv0 from the resolved executable path and the ProcessLaunchInfo needs to carry all of this information along so that each platform can make that decision. llvm-svn: 166137
* Add the ability to set timeout & "run all threads" options both from the ↵Jim Ingham2012-10-161-1/+2
| | | | | | | | | | "expr" command and from the SB API's that evaluate expressions. <rdar://problem/12457211> llvm-svn: 166062
* Change the Thread constructor over to take a Process& rather than a ↵Jim Ingham2012-10-101-1/+1
| | | | | | | | | | | | | ProcessSP. We can't create Threads with a NULL ProcessSP, so it makes no sense to use the SP. Then make the Thread a Broadcaster, and get it to broadcast when the selected frame is changed (but only from the Command Line) and when Thread::ReturnFromFrame changes the stack. Made the Driver use this notification to print the new thread status rather than doing it in the command. Fixed a few places where people were setting their broadcaster class by hand rather than using the static broadcaster class call. <rdar://problem/12383087> llvm-svn: 165640
* Stop using the "%z" size_t modifier and cast all size_t values to uint64_t. ↵Greg Clayton2012-09-181-3/+3
| | | | | | Some platforms don't support this modification. llvm-svn: 164148
* <rdar://problem/11988289> Making C++ synthetic children provider for ↵Enrico Granata2012-09-181-0/+2
| | | | | | NSDictionary and related classes llvm-svn: 164144
* Make file + line breakpoints even more efficient by using our SearchFilter ↵Greg Clayton2012-09-071-2/+12
| | | | | | objects correctly now that we sometimes don't check for inlined breakpoints. llvm-svn: 163435
* Implementing an Options class for EvaluateExpression() in order to make the ↵Enrico Granata2012-09-051-15/+8
| | | | | | signature more compact and make it easy to 'just run an expression' llvm-svn: 163239
* OptionValueFileSpec had an accessor to read the contents of the file and ↵Greg Clayton2012-08-301-1/+2
| | | | | | 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-6/+57
| | | | | | | | | | | | 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
* Check that the data buffer is non-null before getting its file contents.Jim Ingham2012-08-221-1/+5
| | | | llvm-svn: 162400
* Remove further outdated "settings" code and also implement a few missing things.Greg Clayton2012-08-221-880/+18
| | | | llvm-svn: 162376
* Reimplemented the code that backed the "settings" in lldb. There were many ↵Greg Clayton2012-08-221-787/+1159
| | | | | | | | | | | | | 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/12027563> Making sure that some class of stop-hook commands ↵Enrico Granata2012-08-031-1/+6
| | | | | | that involve po'ing objects do not cause an endless recursion llvm-svn: 161271
* Add useful documentation to the "target.source-map" setting.Jim Ingham2012-07-181-1/+5
| | | | | | <rdar://problem/11893881> llvm-svn: 160442
* <rdar://problem/11672978> Fixing an issue where an ObjC object might come ↵Enrico Granata2012-07-161-2/+4
| | | | | | out without a description because the expression used to obtain it would timeout before running to completion llvm-svn: 160326
* rdar://problem/11584012Johnny Chen2012-06-041-4/+35
| | | | | | | | | | | Refactorings of watchpoint creation APIs so that SBTarget::WatchAddress(), SBValue::Watch(), and SBValue::WatchPointee() now take an additional 'SBError &error' parameter (at the end) to contain the reason if there is some failure in the operation. Update 'watchpoint set variable/expression' commands to take advantage of that. Update existing test cases to reflect the API change and add test cases to verify that the SBError mechanism works for SBTarget::WatchAddress() by passing an invalid watch_size. llvm-svn: 157964
* Thread-hardening the SB API calls related to watchpoint operations.Johnny Chen2012-05-311-0/+4
| | | | llvm-svn: 157776
* <rdar://problem/11328896> Fixing a bug where regex commands were saved in ↵Enrico Granata2012-05-311-1/+2
| | | | | | the history even if they came from a 'command sourced' file - this fix introduces a command sourcing depth and disables history for all levels of depth > 0, which means no commands go into history when being sourced from a file. we need an integer depth because command files might themselves source other command files, ... llvm-svn: 157727
* <rdar://problem/11534686> Greg Clayton2012-05-251-0/+1
| | | | | | Reading memory from a file when the section is encrypted doesn't show an error. No we do. llvm-svn: 157484
* Also push file & line breakpoints past the prologue. Also added a "-K" ↵Jim Ingham2012-05-221-13/+21
| | | | | | | | | | | argument to the relevant "break set" commands to set this per breakpoint. Also, some CreateBreakpoint API's in the lldb_private namespace had "internal" first and "skip_prologue" second. "internal should always be last. Fixed that. rdar://problem/11484729 llvm-svn: 157225
* Fixes the case where we created a dummy target, deleted it, and then tried ↵Filipe Cabecinhas2012-05-191-0/+2
| | | | | | to evaluate an expression with no target. llvm-svn: 157110
* If we notice that a module with a given file path is replaced by another ↵Jim Ingham2012-05-171-56/+87
| | | | | | | | | | | with the same file path on rerunning, evict the old module from the target module list, inform the breakpoints about this so they can do something intelligent as well. rdar://problem/11273043 llvm-svn: 157008
* <rdar://problem/11451919>Greg Clayton2012-05-151-5/+2
| | | | | | Fixed the test suite not working on i386 due to recent default arch detection changes. llvm-svn: 156796
* <rdar://problem/11240464>Greg Clayton2012-05-151-5/+5
| | | | | | Correctly unique a class' methods when we detect that a class has been uniqued to another. llvm-svn: 156795
* <rdar://problem/11439169> Greg Clayton2012-05-121-3/+5
| | | | | | | | | | | | "lldb -a i386" doesn't set the calculator mode correctly if run on a 64 bit system. The previous logic always used the current host architecture, not the default architecture. The default arch gets set into a static varaible in lldb_private::Target when an arch is set from the command line: lldb -a i386 We now use the default arch correctly. llvm-svn: 156680
* <rdar://problem/11358639>Greg Clayton2012-05-081-17/+7
| | | | | | | | Switch over to the "*-apple-macosx" for desktop and "*-apple-ios" for iOS triples. Also make the selection process for auto selecting platforms based off of an arch much better. llvm-svn: 156354
* Clean up the way modules are looked for when calling ↵Greg Clayton2012-04-271-14/+38
| | | | | | Target::GetSharedModule(...). We were ignoring remapped files, even if they were valid. Also if we have a UUID, we should check our global module list first. llvm-svn: 155683
OpenPOWER on IntegriCloud