- Dec 16, 2010
-
-
Jason Molenda authored
(from Sean's commit a minute ago) llvm-svn: 121954
-
Sean Callanan authored
can avoid running the code in the target if the expression's result is known and the expression has no side effects. Right now this feature is quite conservative in its guess about side effects, and it only computes integer results, but the machinery to make it more sophisticated is there. llvm-svn: 121952
-
- Dec 14, 2010
-
-
Greg Clayton authored
values or persistent expression variables. Now if an expression consists of a value that is a child of a variable, or of a persistent variable only, we will create a value object for it and make a ValueObjectConstResult from it to freeze the value (for program variables only, not persistent variables) and avoid running JITed code. For everything else we still parse up and JIT code and run it in the inferior. There was also a lot of clean up in the expression code. I made the ClangExpressionVariables be stored in collections of shared pointers instead of in collections of objects. This will help stop a lot of copy constructors on these large objects and also cleans up the code considerably. The persistent clang expression variables were moved over to the Target to ensure they persist across process executions. Added the ability for lldb_private::Target objects to evaluate expressions. We want to evaluate expressions at the target level in case we aren't running yet, or we have just completed running. We still want to be able to access the persistent expression variables between runs, and also evaluate constant expressions. Added extra logging to the dynamic loader plug-in for MacOSX. ModuleList objects can now dump their contents with the UUID, arch and full paths being logged with appropriate prefix values. Thread hardened the Communication class a bit by making the connection auto_ptr member into a shared pointer member and then making a local copy of the shared pointer in each method that uses it to make sure another thread can't nuke the connection object while it is being used by another thread. Added a new file to the lldb/test/load_unload test that causes the test a.out file to link to the libd.dylib file all the time. This will allow us to test using the DYLD_LIBRARY_PATH environment variable after moving libd.dylib somewhere else. llvm-svn: 121745
-
Sean Callanan authored
the code to pass the _cmd pointer has been improved, and _cmd is now set to the value of _cmd for the current context, as opposed to being simply NULL. llvm-svn: 121739
-
- Dec 13, 2010
-
-
Sean Callanan authored
access to the members of the Objective-C self object. The approach we take is to generate the method as a @category on top of the self object, and to pass the "self" pointer to it. (_cmd is currently NULL.) Most changes are in ClangExpressionDeclMap, but the change that adds support to the ABIs to pass _cmd touches a fair amount of code. llvm-svn: 121722
-
- Dec 07, 2010
-
-
Sean Callanan authored
between clients of the LLDB API and the expression parser. llvm-svn: 121193
-
Sean Callanan authored
LLDB expression execution. We also now print the argument structure after execution, to allow us to verify that the expression did indeed execute correctly. llvm-svn: 121126
-
- Dec 03, 2010
-
-
Sean Callanan authored
so that it is not referring to potentially stale state during IR execution. This was done by introducing modular state (like ClangExpressionVariable) where groups of state variables have well-defined lifetimes: - m_parser_vars are specific to parsing, and only exist between calls to WillParse() and DidParse(). - m_struct_vars survive for the entire execution of the ClangExpressionDeclMap because they provide the template for a materialized set of expression variables. - m_material_vars are specific to a single instance of materialization, and only exist between calls to Materialize() and Dematerialize(). I also removed unnecessary references to long- lived state that really didn't need to be referred to at all, and also introduced several assert()s that helped me diagnose a few bugs (fixed too). llvm-svn: 120778
-
- Dec 01, 2010
-
-
Sean Callanan authored
in C++ methods. There were two fixes involved: - For an object whose contents are not known, the expression should be treated as a non-member, and "this" should have no meaning. - For a const object, the method should be declared const as well. llvm-svn: 120606
-
Sean Callanan authored
llvm-svn: 120520
-
- Nov 30, 2010
-
-
Jim Ingham authored
Moved the code in ClangUserExpression that set up & ran the thread plan with timeouts, and restarting with all threads into a utility function in Process. This required a bunch of renaming. Added a ThreadPlanCallUserExpression that differs from ThreadPlanCallFunction in that it holds onto a shared pointer to its ClangUserExpression so that can't go away before the thread plan is done using it. Fixed the stop message when you hit a breakpoint while running a user expression so it is more obvious what has happened. llvm-svn: 120386
-
- Nov 19, 2010
-
-
Sean Callanan authored
that the result of an expression should be coerced to a specific type. Also made breakpoint conditions pass in the bool type for this type. The expression parser ignores this indication for now. llvm-svn: 119779
-
- Nov 10, 2010
-
-
Johnny Chen authored
llvm-svn: 118697
-
- Nov 08, 2010
-
-
Sean Callanan authored
when a function starts and ends, and also the disassembly for anything that is a client of ClangExpressionParser after it has been JIT compiled. llvm-svn: 118401
-
- Nov 06, 2010
-
-
Greg Clayton authored
don't crash if we disable logging when some code already has a copy of the logger. Prior to this fix, logs were handed out as pointers and if they were held onto while a log got disabled, then it could cause a crash. Now all logs are handed out as shared pointers so this problem shouldn't happen anymore. We are also using our new shared pointers that put the shared pointer count and the object into the same allocation for a tad better performance. llvm-svn: 118319
-
- Nov 05, 2010
-
-
Jim Ingham authored
Added the equivalent of gdb's "unwind-on-signal" to the expression command, and a parameter to control it in ClangUserExpression, and on down to ClangFunction. llvm-svn: 118290
-
Sean Callanan authored
that check pointer validity fail to parse. Now lldb does not crash in that case. Also added support for checking Objective-C class validity in the Version 1 runtime as well as Version 2 runtimes with varying levels of available debug support. llvm-svn: 118271
-
- Nov 04, 2010
-
-
Greg Clayton authored
adding support into lldb_private::Process: virtual uint32_t lldb_private::Process::LoadImage (const FileSpec &image_spec, Error &error); virtual Error lldb_private::Process::UnloadImage (uint32_t image_token); There is a default implementation that should work for both linux and MacOSX. This ability has also been exported through the SBProcess API: uint32_t lldb::SBProcess::LoadImage (lldb::SBFileSpec &image_spec, lldb::SBError &error); lldb::SBError lldb::SBProcess::UnloadImage (uint32_t image_token); Modified the DynamicLoader plug-in interface to require it to be able to tell us if it is currently possible to load/unload a shared library: virtual lldb_private::Error DynamicLoader::CanLoadImage () = 0; This way the dynamic loader plug-ins are allows to veto whether we can currently load a shared library since the dynamic loader might know if it is currenlty loading/unloading shared libraries. It might also know about the current host system and know where to check to make sure runtime or malloc locks are currently being held. Modified the expression parser to have ClangUserExpression::Evaluate() be the one that causes the dynamic checkers to be loaded instead of other code that shouldn't have to worry about it. llvm-svn: 118227
-
- Oct 29, 2010
-
-
Johnny Chen authored
llvm-svn: 117700
-
Sean Callanan authored
which holds the name of a file whose contents are prefixed to each expression. For example, if the file ~/lldb.prefix.header contains: typedef unsigned short my_type; then you can do this: (lldb) settings set target.expr-prefix '~/lldb.prefix.header' (lldb) expr sizeof(my_type) (unsigned long) $0 = 2 When the variable is changed, the corresponding file is loaded and its contents are fetched into a string that is stored along with the target. This string is then passed to each expression and inserted into it during parsing, like this: typedef unsigned short my_type; void $__lldb_expr(void *$__lldb_arg) { sizeof(my_type); } llvm-svn: 117627
-
- Oct 27, 2010
-
-
Greg Clayton authored
all of the calls inlined in the header file for better performance. Fixed the summary for C string types (array of chars (with any combo if modifiers), and pointers to chars) work in all cases. Fixed an issue where a forward declaration to a clang type could cause itself to resolve itself more than once if, during the resolving of the type itself it caused something to try and resolve itself again. We now remove the clang type from the forward declaration map in the DWARF parser when we start to resolve it and avoid this additional call. This should stop any duplicate members from appearing and throwing all the alignment of structs, unions and classes. llvm-svn: 117437
-
- Oct 24, 2010
-
-
Sean Callanan authored
"unsigned short." As discussed in the comments, this is pending a better solution to the problem of types not in the debug information but readily available through headers. llvm-svn: 117247
-
- Oct 23, 2010
-
-
Sean Callanan authored
method results to int. This will only last until we get accurate type information for Objective-C methods or some way of making their types inferred by the parser. llvm-svn: 117178
-
- Oct 20, 2010
-
-
Sean Callanan authored
to be passed improperly to expressions in certain cases. llvm-svn: 116884
-
- Oct 19, 2010
-
-
Sean Callanan authored
did not return a result. The result is nonexistent (or void), not NULL. llvm-svn: 116855
-
- Oct 16, 2010
-
-
Greg Clayton authored
Changed all of our synthesized "___clang" functions, types and variables that get used in expressions over to have a prefix of "$_lldb". Now when we do name lookups we can easily switch off of the first '$' character to know if we should look through only our internal (when first char is '$') stuff, or when we should look through program variables, functions and types. Converted all of the clang expression code over to using "const ConstString&" values for names instead of "const char *" since there were many places that were converting the "const char *" names into ConstString names and them throwing them away. We now avoid making a lot of ConstString conversions and benefit from the quick comparisons in a few extra spots. Converted a lot of code from LLVM coding conventions into LLDB coding conventions. llvm-svn: 116634
-
- Oct 15, 2010
-
-
Jim Ingham authored
Added support for breakpoint conditions. I also had to separate the "run the expression" part of ClangFunction::Execute from the "Gather the expression result" so that in the case of the Breakpoint condition I can move the condition evaluation into the normal thread plan processing. Also added support for remembering the "last set breakpoint" so that "break modify" will act on the last set breakpoint. llvm-svn: 116542
-
- Oct 07, 2010
-
-
Sean Callanan authored
milliseconds to 10 seconds, which was the original intent. llvm-svn: 115942
-
- Oct 05, 2010
-
-
Greg Clayton authored
bool ValueObject::GetIsConstant() const; void ValueObject::SetIsConstant(); This will stop anything from being re-evaluated within the value object so that constant result value objects can maintain their frozen values without anything being updated or changed within the value object. Made it so the ValueObjectConstResult can be constructed with an lldb_private::Error object to allow for expression results to have errors. Since ValueObject objects contain error objects, I changed the expression evaluation in ClangUserExpression from static Error ClangUserExpression::Evaluate (ExecutionContext &exe_ctx, const char *expr_cstr, lldb::ValueObjectSP &result_valobj_sp); to: static lldb::ValueObjectSP Evaluate (ExecutionContext &exe_ctx, const char *expr_cstr); Even though expression parsing is borked right now (pending fixes coming from Sean Callanan), I filled in the implementation for: SBValue SBFrame::EvaluateExpression (const char *expr); Modified all expression code to deal with the above changes. llvm-svn: 115589
-
Greg Clayton authored
ClangUserExpression::Evaluate () as a public static function so anyone can evaluate an expression. llvm-svn: 115581
-
- Sep 21, 2010
-
-
Sean Callanan authored
for C++ classes. Replaced it with a less hacky approach: - If an expression is defined in the context of a method of class A, then that expression is wrapped as ___clang_class::___clang_expr(void*) { ... } instead of ___clang_expr(void*) { ... }. - ___clang_class is resolved as the type of the target of the "this" pointer in the method the expression is defined in. - When reporting the type of ___clang_class, a method with the signature ___clang_expr(void*) is added to that class, so that Clang doesn't complain about a method being defined without a corresponding declaration. - Whenever the expression gets called, "this" gets looked up, type-checked, and then passed in as the first argument. This required the following changes: - The ABIs were changed to support passing of the "this" pointer as part of trivial calls. - ThreadPlanCallFunction and ClangFunction were changed to support passing of an optional "this" pointer. - ClangUserExpression was extended to perform the wrapping described above. - ClangASTSource was changed to revert the changes required by the hack. - ClangExpressionParser, IRForTarget, and ClangExpressionDeclMap were changed to handle different manglings of ___clang_expr flexibly. This meant no longer searching for a function called ___clang_expr, but rather looking for a function whose name *contains* ___clang_expr. - ClangExpressionParser and ClangExpressionDeclMap now remember whether "this" is required, and know how to look it up as necessary. A few inheritance bugs remain, and I'm trying to resolve these. But it is now possible to use "this" as well as refer implicitly to member variables, when in the proper context. llvm-svn: 114384
-
- Sep 14, 2010
-
-
Sean Callanan authored
expressions. This involved three main changes: - In ClangUserExpression::ClangUserExpression(), we now insert the following lines into the expression: #define this ___clang_this #define self ___clang_self - In ClangExpressionDeclMap::GetDecls(), we special-case ___clang_(this|self) and instead look up "this" or "self" - In ClangASTSource, we introduce the capability to generate Decls with a different, overridden, name from the one that was requested, e.g. this for ___clang_this. llvm-svn: 113866
-
- Sep 13, 2010
-
-
Sean Callanan authored
- If you put a semicolon at the end of an expression, this no longer causes the expression parser to error out. This was a two-part fix: first, ClangExpressionDeclMap::Materialize now handles an empty struct (such as when there is no return value); second, ASTResultSynthesizer walks backward from the end of the ASTs until it reaches something that's not a NullStmt. - ClangExpressionVariable now properly byte-swaps when printing itself. - ClangUtilityFunction now cleans up after itself when it's done compiling itself. - Utility functions can now use external functions just like user expressions. - If you end your expression with a statement that does not return a value, the expression now runs correctly anyway. Also, added the beginnings of an Objective-C object validator function, which is neither installed nor used as yet. llvm-svn: 113789
-
- Aug 28, 2010
-
-
Sean Callanan authored
debugger to insert self-contained functions for use by expressions (mainly for error-checking). In order to support detecting whether a crash occurred in one of these helpers -- currently our preferred way of reporting that an error-check failed -- added a bit of support for getting the extent of a JITted function in addition to just its base. llvm-svn: 112324
-
- Aug 27, 2010
-
-
Sean Callanan authored
The goal is to separate the parser's data from the data belonging to the parser's clients. This allows clients to use the parser to obtain (for example) a JIT compiled function or some DWARF code, and then discard the parser state. Previously, parser state was held in ClangExpression and used liberally by ClangFunction, which inherited from ClangExpression. The main effects of this refactoring are: - reducing ClangExpression to an abstract class that declares methods that any client must expose to the expression parser, - moving the code specific to implementing the "expr" command from ClangExpression and CommandObjectExpression into ClangUserExpression, a new class, - moving the common parser interaction code from ClangExpression into ClangExpressionParser, a new class, and - making ClangFunction rely only on ClangExpressionParser and not depend on the internal implementation of ClangExpression. Side effects include: - the compiler interaction code has been factored out of ClangFunction and is now in an AST pass (ASTStructExtractor), - the header file for ClangFunction is now fully documented, - several bugs that only popped up when Clang was deallocated (which never happened, since the lifetime of the compiler was essentially infinite) are now fixed, and - the developer-only "call" command has been disabled. I have tested the expr command and the Objective-C step-into code, which use ClangUserExpression and ClangFunction, respectively, and verified that they work. Please let me know if you encounter bugs or poor documentation. llvm-svn: 112249
-