summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression
Commit message (Collapse)AuthorAgeFilesLines
...
* Got a lot of the kinks worked out in the inline support after debugging moreGreg Clayton2010-08-241-5/+11
| | | | | | | | | | | | | | | | | | | | | | complex inlined examples. StackFrame classes don't have a "GetPC" anymore, they have "GetFrameCodeAddress()". This is because inlined frames will have a PC value that is the same as the concrete frame that owns the inlined frame, yet the code locations for the frame can be different. We also need to be able to get the real PC value for a given frame so that variables evaluate correctly. To get the actual PC value for a frame you can use: addr_t pc = frame->GetRegisterContext()->GetPC(); Some issues with the StackFrame stomping on its own symbol context were resolved which were causing the information to change for a frame when the stack ID was calculated. Also the StackFrame will now correctly store the symbol context resolve flags for any extra bits of information that were looked up (if you ask for a block only and you find one, you will alwasy have the compile unit and function). llvm-svn: 111964
* Added support for inlined stack frames being represented as real stack framesGreg Clayton2010-08-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which is now on by default. Frames are gotten from the unwinder as concrete frames, then if inline frames are to be shown, extra information to track and reconstruct these frames is cached with each Thread and exanded as needed. I added an inline height as part of the lldb_private::StackID class, the class that helps us uniquely identify stack frames. This allows for two frames to shared the same call frame address, yet differ only in inline height. Fixed setting breakpoint by address to not require addresses to resolve. A quick example: % cat main.cpp % ./build/Debug/lldb test/stl/a.out Current executable set to 'test/stl/a.out' (x86_64). (lldb) breakpoint set --address 0x0000000100000d31 Breakpoint created: 1: address = 0x0000000100000d31, locations = 1 (lldb) r Launching 'a.out' (x86_64) (lldb) Process 38031 Stopped * thread #1: tid = 0x2e03, pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::_M_data() const at /usr/include/c++/4.2.1/bits/basic_string.h:280, stop reason = breakpoint 1.1, queue = com.apple.main-thread 277 278 _CharT* 279 _M_data() const 280 -> { return _M_dataplus._M_p; } 281 282 _CharT* 283 _M_data(_CharT* __p) (lldb) bt thread #1: tid = 0x2e03, stop reason = breakpoint 1.1, queue = com.apple.main-thread frame #0: pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::_M_data() const at /usr/include/c++/4.2.1/bits/basic_string.h:280 frame #1: pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::_M_rep() const at /usr/include/c++/4.2.1/bits/basic_string.h:288 frame #2: pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::size() const at /usr/include/c++/4.2.1/bits/basic_string.h:606 frame #3: pc = 0x0000000100000d31, where = a.out`main [inlined] operator<< <char, std::char_traits<char>, std::allocator<char> > at /usr/include/c++/4.2.1/bits/basic_string.h:2414 frame #4: pc = 0x0000000100000d31, where = a.out`main + 33 at /Volumes/work/gclayton/Documents/src/lldb/test/stl/main.cpp:14 frame #5: pc = 0x0000000100000d08, where = a.out`start + 52 Each inline frame contains only the variables that they contain and each inlined stack frame is treated as a single entity. llvm-svn: 111877
* Refactored ClangExpressionDeclMap to useSean Callanan2010-08-233-193/+163
| | | | | | | | ClangExpressionVariables for found external variables as well as for struct members, replacing the Tuple and StructMember data structures. llvm-svn: 111859
* Modified the host process monitor callback function ↵Greg Clayton2010-08-211-14/+7
| | | | | | | | | | | | | | | | | | Host::StartMonitoringChildProcess to spawn a thread for each process that is being monitored. Previously LLDB would spawn a single thread that would wait for any child process which isn't ok to do as a shared library (LLDB.framework on Mac OSX, or lldb.so on linux). The old single thread used to call wait4() with a pid of -1 which could cause it to reap child processes that it shouldn't have. Re-wrote the way Function blocks are handles. Previously I attempted to keep all blocks in a single memory allocation (in a std::vector). This made the code somewhat efficient, but hard to work with. I got rid of the old BlockList class, and went to a straight parent with children relationship. This new approach will allow for partial parsing of the blocks within a function. llvm-svn: 111706
* First step of refactoring variable handling in theSean Callanan2010-08-206-173/+163
| | | | | | | | | | | | | | | expression parser. There shouldn't be four separate classes encapsulating a variable. ClangExpressionVariable is now meant to be the container for all variable information. It has several optional components that hold data for different subsystems. ClangPersistentVariable has been removed; we now use ClangExpressionVariable instead. llvm-svn: 111600
* Patch by Bill Lynch fixing handling of the pidSean Callanan2010-08-183-8/+10
| | | | | | in the IR transformation passes. llvm-svn: 111388
* Check for errors in Resume before waiting for the resume to complete.Jim Ingham2010-08-171-1/+6
| | | | llvm-svn: 111216
* Documented ClangResultSynthesizer and added very minorSean Callanan2010-08-161-3/+4
| | | | | | API fixes. llvm-svn: 111202
* Documented ClangExpressionVariable(List), andSean Callanan2010-08-131-17/+4
| | | | | | cleaned up its API slightly. llvm-svn: 111053
* Added documentation to ClangExpressionDeclMap.Sean Callanan2010-08-132-5/+3
| | | | | | | | Also cleaned up its API a tiny bit (but not the extensive amount that is actually needed. That's still coming.) llvm-svn: 111049
* Documented ClangExpression and made parts of itSean Callanan2010-08-132-92/+5
| | | | | | | more sane (i.e., removed dead arguments, made sensible defaults, etc.) llvm-svn: 110990
* Added documentation to ClangASTSource andSean Callanan2010-08-121-0/+4
| | | | | | NameSearchContext. llvm-svn: 110980
* Removed the ClangStmtVisitor, which is old codeSean Callanan2010-08-122-1046/+1
| | | | | | | that translates Clang ASTs straight to DWARF. We are now using IR instead. llvm-svn: 110957
* Added automatically generated result variables for eachSean Callanan2010-08-123-55/+293
| | | | | | | | | | | | | | | | | | | | expression. It is now possible to do things like this: (lldb) expr int $i = 5; $i + 1 $0 = (int) 6 (lldb) expr $i + 3 $1 = (int) 8 (lldb) expr $1 + $0 $2 = (int) 14 As a bonus, this allowed us to move printing of expression results into the ClangPersistentVariable class. This code needs a bit of refactoring -- in particular, ClangExpressionDeclMap has eaten one too many bacteria and needs to undergo mitosis -- but the infrastructure appears to be holding up nicely. llvm-svn: 110896
* Added support for persistent variables to theSean Callanan2010-08-114-49/+310
| | | | | | | | | | | | | | | | | | | | | | | | | expression parser. It is now possible to type: (lldb) expr int $i = 5; $i + 1 (int) 6 (lldb) expr $i + 2 (int) 7 The skeleton for automatic result variables is also implemented. The changes affect: - the process, which now contains a ClangPersistentVariables object that holds persistent variables associated with it - the expression parser, which now uses the persistent variables during variable lookup - TaggedASTType, where I loaded some commonly used tags into a header so that they are interchangeable between different clients of the class llvm-svn: 110777
* Removed the -i option from the expr command, andSean Callanan2010-08-061-1/+3
| | | | | | | | | | | | made IR-based expression evaluation the default. Also added a new class to hold persistent variables. The class is empty as yet while I write up a design document for what it will do. Also the place where it is currently created (by the Expression command) is certainly wrong. llvm-svn: 110415
* Abtracted the old "lldb_private::Thread::StopInfo" into an abtract class.Greg Clayton2010-08-041-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow debugger plug-ins to make any instance of "lldb_private::StopInfo" that can completely describe any stop reason. It also provides a framework for doing intelligent things with the stop info at important times in the lifetime of the inferior. Examples include the signal stop info in StopInfoUnixSignal. It will check with the process to see that the current action is for the signal. These actions include wether to stop for the signal, wether the notify that the signal was hit, and wether to pass the signal along to the inferior process. The StopInfoUnixSignal class overrides the "ShouldStop()" method of StopInfo and this allows the stop info to determine if it should stop at the signal or continue the process. StopInfo subclasses must override the following functions: virtual lldb::StopReason GetStopReason () const = 0; virtual const char * GetDescription () = 0; StopInfo subclasses can override the following functions: // If the subclass returns "false", the inferior will resume. The default // version of this function returns "true" which means the default stop // info will stop the process. The breakpoint subclass will check if // the breakpoint wants us to stop by calling any installed callback on // the breakpoint, and also checking if the breakpoint is for the current // thread. Signals will check if they should stop based off of the // UnixSignal settings in the process. virtual bool ShouldStop (Event *event_ptr); // Sublasses can state if they want to notify the debugger when "ShouldStop" // returns false. This would be handy for breakpoints where you want to // log information and continue and is also used by the signal stop info // to notify that a signal was received (after it checks with the process // signal settings). virtual bool ShouldNotify (Event *event_ptr) { return false; } // Allow subclasses to do something intelligent right before we resume. // The signal class will figure out if the signal should be propagated // to the inferior process and pass that along to the debugger plug-ins. virtual void WillResume (lldb::StateType resume_state) { // By default, don't do anything } The support the Mach exceptions was moved into the lldb/source/Plugins/Process/Utility folder and now doesn't polute the lldb_private::Thread class with platform specific code. llvm-svn: 110184
* Added support for accessing members of C++ objects,Sean Callanan2010-08-044-1/+44
| | | | | | | | | | | | | including superclass members. This involved ensuring that access control was ignored, and ensuring that the operands of BitCasts were properly scanned for variables that needed importing. Also laid the groundwork for declaring objects of custom types; however, this functionality is disabled for now because of a potential loop in ASTImporter. llvm-svn: 110174
* Added support for objective C built-in types: id, Class, and SEL. This Greg Clayton2010-08-033-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | involved watching for the objective C built-in types in DWARF and making sure when we convert the DWARF types into clang types that we use the appropriate ASTContext types. Added a way to find and dump types in lldb (something equivalent to gdb's "ptype" command): image lookup --type <TYPENAME> This only works for looking up types by name and won't work with variables. It also currently dumps out verbose internal information. I will modify it to dump more appropriate user level info in my next submission. Hookup up the "FindTypes()" functions in the SymbolFile and SymbolVendor so we can lookup types by name in one or more images. Fixed "image lookup --address <ADDRESS>" to be able to correctly show all symbol context information, but it will only show this extra information when the new "--verbose" flag is used. Updated to latest LLVM to get a few needed fixes. llvm-svn: 110089
* Set a CodeGenOption in Clang to inhibit insertionSean Callanan2010-08-032-0/+9
| | | | | | | | | | of profiling code into expressions. Modified IRForTarget to emit array and record member accesses correctly. (Reading and writing both work.) llvm-svn: 110088
* Added support for rewriting objc_msgSend so we canSean Callanan2010-07-312-32/+256
| | | | | | | | | | | call Objective-C methods from expressions. Also added some more logging to the function-calling thread plan so that we can see the registers when a function finishes. Also documented things maybe a bit better. llvm-svn: 109938
* Updated to llvm/clang from July 30, 2010 at 08:00.Greg Clayton2010-07-302-80/+77
| | | | llvm-svn: 109887
* Fixed "warning: unused variable 'log'".Johnny Chen2010-07-291-2/+0
| | | | llvm-svn: 109794
* Fixed the expression code to use the rightSean Callanan2010-07-291-23/+25
| | | | | | code model with the JIT. llvm-svn: 109792
* Added and improved logging. This is helping us as weSean Callanan2010-07-284-36/+74
| | | | | | | diagnose a problem where we're not correctly emitting PIC code. llvm-svn: 109568
* Added support for calling functions from expressions.Sean Callanan2010-07-272-24/+47
| | | | | | | | | Right now we mock up the function as a variadic function when generating the IR for the call; we need to eventually make the function be the right type if the type is available. llvm-svn: 109543
* Added support for locating a function that isSean Callanan2010-07-272-10/+66
| | | | | | | referenced in the IR. We don't yet support updating the call to that function. llvm-svn: 109483
* Fixed a bug in the IR transformer where we wereSean Callanan2010-07-271-1/+10
| | | | | | | | trying to do replaceUsesOfWith on a constant, which doesn't work. Turns out we don't need to do anything for constants. llvm-svn: 109477
* Changed SymbolContext so when you search for functionsSean Callanan2010-07-272-26/+76
| | | | | | | | | | | | | | | | | | it returns a list of functions as a SymbolContextList. Rewrote the clients of SymbolContext to use this SymbolContextList. Rewrote some of the providers of the data to SymbolContext to make them respect preferences as to whether the list should be cleared first; propagated that change out. ClangExpressionDeclMap and ClangASTSource use this new function list to properly generate function definitions - even for functions that don't have a prototype in the debug information. llvm-svn: 109476
* Fixed a bug where we didn't restore thread andSean Callanan2010-07-261-48/+56
| | | | | | | | frame state after running a function. This caused nondeterministic crashes in the expression evaluation code. llvm-svn: 109454
* Updated the IR converter for the target to eliminateSean Callanan2010-07-243-80/+90
| | | | | | | | | | | | spurious guard variables on expression statics. Updated the AST result synthesizer to eliminate the unneeded result pointer. Very rudimentary expressions now evaluate correctly in the target using the new JIT-based mechanism. llvm-svn: 109317
* Added logging:Sean Callanan2010-07-232-5/+71
| | | | | | | | | | - When we JIT an expression, we print the disassembly of the generated code - When we put the structure into the target, we print the individual entries in the structure byte for byte. llvm-svn: 109278
* Added extensive logging of the code that is actually goingSean Callanan2010-07-232-0/+144
| | | | | | | | | | | | to be executed by the inferior. This required explicit support from RecordingMemoryManager for finding the address range belonging to a particular function. Also fixed a bug in DisassemblerLLVM where the disassembler assumed there was an AddressRange available even when it was NULL. llvm-svn: 109209
* Modified TaggedASTType to inherit from ClangASTTypeSean Callanan2010-07-232-61/+142
| | | | | | | | | | | | | and moved it to its own header file for cleanliness. Added more logging to ClangFunction so that we can diagnose crashes in the executing expression. Added code to extract the result of the expression from the struct that is passed to the JIT-compiled code. llvm-svn: 109199
* Change over to using the definitions for mach-o types and defines to theGreg Clayton2010-07-213-33/+25
| | | | | | | | | | | defines that are in "llvm/Support/MachO.h". This should allow ObjectFileMachO and ObjectContainerUniversalMachO to be able to be cross compiled in Linux. Also did some cleanup on the ASTType by renaming it to ClangASTType and renaming the header file. Moved a lot of "AST * + opaque clang type *" functionality from lldb_private::Type over into ClangASTType. llvm-svn: 109046
* Added functionality to dematerialize values that wereSean Callanan2010-07-202-127/+195
| | | | | | | | | | | | | | used by the JIT compiled expression, including the result of the expression. Also added a new class, ASTType, which encapsulates an opaque Clang type and its associated AST context. Refactored ClangExpressionDeclMap to use ASTTypes, significantly reducing the possibility of mixups of types from different AST contexts. llvm-svn: 108965
* Remove use of STL collection class use of the "data()" method since it isn'tGreg Clayton2010-07-201-4/+4
| | | | | | | part of C++'98. Most of these were "std::vector<T>::data()" and "std::string::data()". llvm-svn: 108957
* Added the necessary code to copy variables used bySean Callanan2010-07-171-87/+197
| | | | | | | an expression into the struct prepared for the JIT compiled code to use. llvm-svn: 108596
* Fixed a copyright header.Greg Clayton2010-07-161-8/+9
| | | | llvm-svn: 108544
* Wrote the code that looks at a context to seeSean Callanan2010-07-162-24/+190
| | | | | | | if the variables in that context allow a particular JIT compiled expression to run in that context. llvm-svn: 108485
* Fixes to the IR generator in the expression parserSean Callanan2010-07-141-2/+109
| | | | | | | | to correctly unfold constant-folded global variables. Also added code to JIT the expression. Simple expressions are now JIT compiled successfully. llvm-svn: 108380
* I enabled some extra warnings for hidden local variables and for hiddenGreg Clayton2010-07-142-4/+4
| | | | | | virtual functions and caught some things and did some general code cleanup. llvm-svn: 108299
* Removed unused variable "log".Greg Clayton2010-07-131-2/+0
| | | | | | | Fixed the llvm build for Mac OS X builds to look in llvm/lib/Release+Asserts output directory for all configurations (Debug, Release, BuildAndIntegration). llvm-svn: 108289
* "expr -i" now performs the required transforms toSean Callanan2010-07-133-27/+308
| | | | | | | | prepare the IR for JIT compilation. We still need to do the JIT compilation and move the arguments in/out of target memory. llvm-svn: 108279
* Patch from Jean-Daniel Dupas:Greg Clayton2010-07-121-4/+5
| | | | | | | | | Makefile patch to explicitly use PROJ_SRC_DIR when required. It fixes build when obj dir is not source dir. I also fixed a build warning in ClangResultSynthesizer.cpp. llvm-svn: 108210
* Merged Eli Friedman's linux build changes where he added Makefile files thatGreg Clayton2010-07-095-35/+59
| | | | | | | 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
* Switch over to using llvm's dwarf constants file.Jason Molenda2010-07-061-1/+0
| | | | llvm-svn: 107716
* Added the skeleton of an IR transformer that willSean Callanan2010-07-033-3/+135
| | | | | | | | | | prepare IR for execution in the target. Wired the expression command to use this IR transformer when conversion to DWARF fails, and wired conversion to DWARF to always fail (well, we don't generate any DWARF...) llvm-svn: 107559
* Fixes to improve logging (by printing basicSean Callanan2010-07-022-2/+4
| | | | | | | block labels) and produce cleaner IR (by removing the thread-safe statics guards) llvm-svn: 107528
* Small fixes to the DWARF relocator.Sean Callanan2010-07-021-2/+6
| | | | llvm-svn: 107518
OpenPOWER on IntegriCloud