From johnny.chen at apple.com Mon Oct 31 14:04:07 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Mon, 31 Oct 2011 19:04:07 -0000 Subject: [Lldb-commits] [lldb] r143355 - /lldb/trunk/test/dosep.ty Message-ID: <20111031190407.BDDB63524001@llvm.org> Author: johnny Date: Mon Oct 31 14:04:07 2011 New Revision: 143355 URL: http://llvm.org/viewvc/llvm-project?rev=143355&view=rev Log: Add a Python script to invoke each test file under the test root using a separate process. Example: [11:33:09] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dosep.ty -o "-v -n" dotest.py options: -v -n Running /Volumes/data/lldb/svn/trunk/test/dotest.py -v -n -p TestPublicAPIHeaders.py /Volumes/data/lldb/svn/trunk/test/api/check_public_api_headers 1: test_sb_api_directory (TestPublicAPIHeaders.SBDirCheckerCase) Test the SB API directory and make sure there's no unwanted stuff. ... ok ---------------------------------------------------------------------- Ran 1 test in 4.404s OK Running /Volumes/data/lldb/svn/trunk/test/dotest.py -v -n -p TestEmulations.py /Volumes/data/lldb/svn/trunk/test/arm_emulation 1: test_arm_emulations (TestEmulations.ARMEmulationTestCase) ... ok 2: test_thumb_emulations (TestEmulations.ARMEmulationTestCase) ... ok ---------------------------------------------------------------------- Ran 2 tests in 1.399s OK ... Added: lldb/trunk/test/dosep.ty (with props) Added: lldb/trunk/test/dosep.ty URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dosep.ty?rev=143355&view=auto ============================================================================== --- lldb/trunk/test/dosep.ty (added) +++ lldb/trunk/test/dosep.ty Mon Oct 31 14:04:07 2011 @@ -0,0 +1,52 @@ +#!/usr/bin/env python + +""" +Run the test suite using a separate process for each test file. +""" + +import os, sys +from optparse import OptionParser + +# Command template of the invocation of the test driver. +template = '%s/dotest.py %s -p %s %s' + +def walk_and_invoke(test_root, dotest_options): + """Look for matched file and invoke test driver on it.""" + for root, dirs, files in os.walk(test_root, topdown=False): + for name in files: + path = os.path.join(root, name) + + # We're only interested in the test file with the "Test*.py" naming pattern. + if not name.startswith("Test") or not name.endswith(".py"): + continue + + # Neither a symbolically linked file. + if os.path.islink(path): + continue + + command = template % (test_root, dotest_options if dotest_options else "", name, root) + print "Running %s" % (command) + os.system(command) + +def main(): + """Read the root dir and the path spec, invoke lldb-disasm.py on the file.""" + test_root = sys.path[0] + + parser = OptionParser(usage="""\ +Run lldb test suite using a separate process for each test file. +""") + parser.add_option('-o', '--options', + type='string', action='store', + dest='dotest_options', + help="""The options passed to 'dotest.py' if specified.""") + + opts, args = parser.parse_args() + dotest_options = opts.dotest_options + + print "dotest.py options:", dotest_options + + walk_and_invoke(test_root, dotest_options) + + +if __name__ == '__main__': + main() Propchange: lldb/trunk/test/dosep.ty ------------------------------------------------------------------------------ svn:executable = * From johnny.chen at apple.com Mon Oct 31 15:12:15 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Mon, 31 Oct 2011 20:12:15 -0000 Subject: [Lldb-commits] [lldb] r143359 - /lldb/trunk/source/Interpreter/CommandInterpreter.cpp Message-ID: <20111031201215.1CCB83524001@llvm.org> Author: johnny Date: Mon Oct 31 15:12:14 2011 New Revision: 143359 URL: http://llvm.org/viewvc/llvm-project?rev=143359&view=rev Log: Fix the r143266 check-in which broke TestCommandRegex.py. Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=143359&r1=143358&r2=143359&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original) +++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Mon Oct 31 15:12:14 2011 @@ -1376,13 +1376,6 @@ } } break; - - default: - result.AppendErrorWithFormat ("unknown command shorthand suffix: '%s'\n", - suffix.c_str()); - result.SetStatus (eReturnStatusFailed); - return false; - } } } From johnny.chen at apple.com Mon Oct 31 15:29:36 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Mon, 31 Oct 2011 20:29:36 -0000 Subject: [Lldb-commits] [lldb] r143361 - /lldb/trunk/test/bench-history Message-ID: <20111031202937.195053524001@llvm.org> Author: johnny Date: Mon Oct 31 15:29:36 2011 New Revision: 143361 URL: http://llvm.org/viewvc/llvm-project?rev=143361&view=rev Log: Add bench entries. Modified: lldb/trunk/test/bench-history Modified: lldb/trunk/test/bench-history URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/bench-history?rev=143361&r1=143360&r2=143361&view=diff ============================================================================== --- lldb/trunk/test/bench-history (original) +++ lldb/trunk/test/bench-history Mon Oct 31 15:29:36 2011 @@ -107,3 +107,22 @@ lldb expr cmd benchmark: Avg: 0.208264 (Laps: 25, Total Elapsed Time: 5.206604, min=0.204082, max=0.258287) lldb disassembly benchmark: Avg: 0.091677 (Laps: 10, Total Elapsed Time: 0.916773, min=0.090101, max=0.099648) +r143359 +# No performance regression. +[13:20:01] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:' +lldb startup delay (create fresh target) benchmark: Avg: 0.106920 (Laps: 30, Total Elapsed Time: 3.207593, min=0.101197, max=0.197640) +lldb startup delay (set first breakpoint) benchmark: Avg: 0.147324 (Laps: 30, Total Elapsed Time: 4.419733, min=0.101534, max=0.900991) +lldb startup delay (run to breakpoint) benchmark: Avg: 0.463680 (Laps: 30, Total Elapsed Time: 13.910386, min=0.429071, max=0.872424) +lldb frame variable benchmark: Avg: 1.655778 (Laps: 20, Total Elapsed Time: 33.115570, min=1.597218, max=1.779512) +lldb stepping benchmark: Avg: 0.145967 (Laps: 50, Total Elapsed Time: 7.298373, min=0.101121, max=2.288423) +lldb expr cmd benchmark: Avg: 0.207389 (Laps: 25, Total Elapsed Time: 5.184725, min=0.203226, max=0.240773) +lldb disassembly benchmark: Avg: 0.091902 (Laps: 10, Total Elapsed Time: 0.919019, min=0.088413, max=0.115076) +[13:24:24] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:' +lldb startup delay (create fresh target) benchmark: Avg: 0.150258 (Laps: 30, Total Elapsed Time: 4.507753, min=0.101110, max=1.296165) +lldb startup delay (set first breakpoint) benchmark: Avg: 0.192823 (Laps: 30, Total Elapsed Time: 5.784686, min=0.101897, max=0.697168) +lldb startup delay (run to breakpoint) benchmark: Avg: 0.451879 (Laps: 30, Total Elapsed Time: 13.556380, min=0.428884, max=0.536964) +lldb frame variable benchmark: Avg: 1.725232 (Laps: 20, Total Elapsed Time: 34.504649, min=1.596926, max=2.303283) +lldb stepping benchmark: Avg: 0.111959 (Laps: 50, Total Elapsed Time: 5.597941, min=0.101375, max=0.586357) +lldb expr cmd benchmark: Avg: 0.207557 (Laps: 25, Total Elapsed Time: 5.188913, min=0.203918, max=0.241022) +lldb disassembly benchmark: Avg: 0.092959 (Laps: 10, Total Elapsed Time: 0.929594, min=0.089094, max=0.109135) + From gclayton at apple.com Mon Oct 31 15:50:40 2011 From: gclayton at apple.com (Greg Clayton) Date: Mon, 31 Oct 2011 20:50:40 -0000 Subject: [Lldb-commits] [lldb] r143362 - /lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Message-ID: <20111031205040.7A1E33524001@llvm.org> Author: gclayton Date: Mon Oct 31 15:50:40 2011 New Revision: 143362 URL: http://llvm.org/viewvc/llvm-project?rev=143362&view=rev Log: Fixed an issue where if a mach-o symbol table was corrupt and had a string table offset that is invalid, we could crash. We now properly check the string table offset and ignore any symbols with invalid strings. Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=143362&r1=143361&r2=143362&view=diff ============================================================================== --- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original) +++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Mon Oct 31 15:50:40 2011 @@ -772,8 +772,7 @@ DataBufferSP strtab_data_sp(m_file.ReadFileContents(m_offset + symtab_load_command.stroff, symtab_load_command.strsize)); const char *strtab_data = (const char *)strtab_data_sp->GetBytes(); -// DataExtractor symtab_data(symtab_data_sp, endian, addr_size); -// DataExtractor strtab_data(strtab_data_sp, endian, addr_size); + const size_t strtab_data_len = strtab_data_sp->GetByteSize(); static ConstString g_segment_name_TEXT ("__TEXT"); static ConstString g_segment_name_DATA ("__DATA"); @@ -840,7 +839,21 @@ } SymbolType type = eSymbolTypeInvalid; + if (nlist.n_strx >= strtab_data_len) + { + // No symbol should be NULL, even the symbols with no + // string values should have an offset zero which points + // to an empty C-string + fprintf (stderr, + "error: symbol[%u] has invalid string table offset 0x%x in %s/%s, ignoring symbol\n", + nlist_idx, + nlist.n_strx, + m_module->GetFileSpec().GetDirectory().GetCString(), + m_module->GetFileSpec().GetFilename().GetCString()); + continue; + } const char* symbol_name = &strtab_data[nlist.n_strx]; + if (symbol_name[0] == '\0') symbol_name = NULL; Section* symbol_section = NULL; From gclayton at apple.com Mon Oct 31 17:05:30 2011 From: gclayton at apple.com (Greg Clayton) Date: Mon, 31 Oct 2011 15:05:30 -0700 Subject: [Lldb-commits] [lldb] r143359 - /lldb/trunk/source/Interpreter/CommandInterpreter.cpp In-Reply-To: <20111031201215.1CCB83524001@llvm.org> References: <20111031201215.1CCB83524001@llvm.org> Message-ID: <45876106-047C-4554-96A9-8B54A7A06A0A@apple.com> Please put this back in. We need to fix the test case that is failing or come up with a better solution. On Oct 31, 2011, at 1:12 PM, Johnny Chen wrote: > Author: johnny > Date: Mon Oct 31 15:12:14 2011 > New Revision: 143359 > > URL: http://llvm.org/viewvc/llvm-project?rev=143359&view=rev > Log: > Fix the r143266 check-in which broke TestCommandRegex.py. > > Modified: > lldb/trunk/source/Interpreter/CommandInterpreter.cpp > > Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp > URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=143359&r1=143358&r2=143359&view=diff > ============================================================================== > --- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original) > +++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Mon Oct 31 15:12:14 2011 > @@ -1376,13 +1376,6 @@ > } > } > break; > - > - default: > - result.AppendErrorWithFormat ("unknown command shorthand suffix: '%s'\n", > - suffix.c_str()); > - result.SetStatus (eReturnStatusFailed); > - return false; > - > } > } > } > > > _______________________________________________ > lldb-commits mailing list > lldb-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits From scallanan at apple.com Mon Oct 31 17:11:40 2011 From: scallanan at apple.com (Sean Callanan) Date: Mon, 31 Oct 2011 22:11:40 -0000 Subject: [Lldb-commits] [lldb] r143371 - in /lldb/trunk: include/lldb/Expression/IRForTarget.h source/Expression/IRDynamicChecks.cpp source/Expression/IRForTarget.cpp Message-ID: <20111031221140.DBFBB3524001@llvm.org> Author: spyffe Date: Mon Oct 31 17:11:40 2011 New Revision: 143371 URL: http://llvm.org/viewvc/llvm-project?rev=143371&view=rev Log: The IRDynamicChecks subsystem was not properly detecting Objective-C method calls because the "lldb.call.realName" metadata was no longer being correctly installed. I fixed this problem. Modified: lldb/trunk/include/lldb/Expression/IRForTarget.h lldb/trunk/source/Expression/IRDynamicChecks.cpp lldb/trunk/source/Expression/IRForTarget.cpp Modified: lldb/trunk/include/lldb/Expression/IRForTarget.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/IRForTarget.h?rev=143371&r1=143370&r2=143371&view=diff ============================================================================== --- lldb/trunk/include/lldb/Expression/IRForTarget.h (original) +++ lldb/trunk/include/lldb/Expression/IRForTarget.h Mon Oct 31 17:11:40 2011 @@ -233,6 +233,11 @@ BuildFunctionPointer (llvm::Type *type, uint64_t ptr); + void + RegisterFunctionMetadata (llvm::LLVMContext &context, + llvm::Value *function_ptr, + const char *name); + //------------------------------------------------------------------ /// The top-level pass implementation /// Modified: lldb/trunk/source/Expression/IRDynamicChecks.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRDynamicChecks.cpp?rev=143371&r1=143370&r2=143371&view=diff ============================================================================== --- lldb/trunk/source/Expression/IRDynamicChecks.cpp (original) +++ lldb/trunk/source/Expression/IRDynamicChecks.cpp Mon Oct 31 17:11:40 2011 @@ -435,7 +435,7 @@ arg_array[0] = bit_cast; arg_array[1] = selector; - ArrayRef args(arg_array, 1); + ArrayRef args(arg_array, 2); CallInst::Create(m_objc_object_check_func, args, Modified: lldb/trunk/source/Expression/IRForTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRForTarget.cpp?rev=143371&r1=143370&r2=143371&view=diff ============================================================================== --- lldb/trunk/source/Expression/IRForTarget.cpp (original) +++ lldb/trunk/source/Expression/IRForTarget.cpp Mon Oct 31 17:11:40 2011 @@ -291,6 +291,36 @@ return ConstantExpr::getIntToPtr(fun_addr_int, fun_ptr_ty); } +void +IRForTarget::RegisterFunctionMetadata(LLVMContext &context, + llvm::Value *function_ptr, + const char *name) +{ + lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); + + for (Value::use_iterator i = function_ptr->use_begin(), e = function_ptr->use_end(); + i != e; + ++i) + { + Value *user = *i; + + if (Instruction *user_inst = dyn_cast(user)) + { + Constant *name_array = ConstantArray::get(context, StringRef(name)); + + ArrayRef md_values(name_array); + + MDNode *metadata = MDNode::get(context, md_values); + + user_inst->setMetadata("lldb.call.realName", metadata); + } + else + { + RegisterFunctionMetadata (context, user, name); + } + } +} + bool IRForTarget::ResolveFunctionPointers(llvm::Module &llvm_module, llvm::Function &llvm_function) @@ -326,6 +356,8 @@ Constant *value = BuildFunctionPointer(fun->getFunctionType(), addr); + RegisterFunctionMetadata (llvm_module.getContext(), fun, name.AsCString()); + if (value_ptr) *value_ptr = value; From johnny.chen at apple.com Mon Oct 31 17:22:06 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Mon, 31 Oct 2011 22:22:06 -0000 Subject: [Lldb-commits] [lldb] r143372 - in /lldb/trunk: source/Interpreter/CommandInterpreter.cpp test/functionalities/command_regex/TestCommandRegex.py Message-ID: <20111031222207.3D28A2A6C12C@llvm.org> Author: johnny Date: Mon Oct 31 17:22:06 2011 New Revision: 143372 URL: http://llvm.org/viewvc/llvm-project?rev=143372&view=rev Log: Revert 143359 and modify the test case to not include non-valid c identifier character. Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp lldb/trunk/test/functionalities/command_regex/TestCommandRegex.py Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=143372&r1=143371&r2=143372&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original) +++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Mon Oct 31 17:22:06 2011 @@ -1376,6 +1376,13 @@ } } break; + + default: + result.AppendErrorWithFormat ("unknown command shorthand suffix: '%s'\n", + suffix.c_str()); + result.SetStatus (eReturnStatusFailed); + return false; + } } } Modified: lldb/trunk/test/functionalities/command_regex/TestCommandRegex.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/command_regex/TestCommandRegex.py?rev=143372&r1=143371&r2=143372&view=diff ============================================================================== --- lldb/trunk/test/functionalities/command_regex/TestCommandRegex.py (original) +++ lldb/trunk/test/functionalities/command_regex/TestCommandRegex.py Mon Oct 31 17:22:06 2011 @@ -27,13 +27,13 @@ # Substitute 'Help!' for 'help' using the 'commands regex' mechanism. child.expect_exact(prompt) - child.sendline("command regex 'Help!'") + child.sendline("command regex 'Help__'") child.expect_exact(regex_prompt) child.sendline('s/^$/help/') child.expect_exact(regex_prompt1) child.sendline('') # Help! - child.sendline('Help!') + child.sendline('Help__') # If we see the familiar 'help' output, the test is done. child.expect('The following is a list of built-in, permanent debugger commands:') From jingham at apple.com Mon Oct 31 18:06:46 2011 From: jingham at apple.com (Jim Ingham) Date: Mon, 31 Oct 2011 23:06:46 -0000 Subject: [Lldb-commits] [lldb] r143393 - /lldb/trunk/source/Core/ValueObjectVariable.cpp Message-ID: <20111031230646.28A1D2A6C12C@llvm.org> Author: jingham Date: Mon Oct 31 18:06:45 2011 New Revision: 143393 URL: http://llvm.org/viewvc/llvm-project?rev=143393&view=rev Log: ValueObjectVariable::GetClangAST should check that it has a valid Type before accessing it. Modified: lldb/trunk/source/Core/ValueObjectVariable.cpp Modified: lldb/trunk/source/Core/ValueObjectVariable.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectVariable.cpp?rev=143393&r1=143392&r2=143393&view=diff ============================================================================== --- lldb/trunk/source/Core/ValueObjectVariable.cpp (original) +++ lldb/trunk/source/Core/ValueObjectVariable.cpp Mon Oct 31 18:06:45 2011 @@ -83,7 +83,10 @@ clang::ASTContext * ValueObjectVariable::GetClangAST () { - return m_variable_sp->GetType()->GetClangAST(); + Type *var_type = m_variable_sp->GetType(); + if (var_type) + return var_type->GetClangAST(); + return 0; } size_t From johnny.chen at apple.com Mon Oct 31 18:28:53 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Mon, 31 Oct 2011 23:28:53 -0000 Subject: [Lldb-commits] [lldb] r143395 - in /lldb/trunk/test/lang/cpp/stl: TestSTL.py main.cpp Message-ID: <20111031232853.11F982A6C12C@llvm.org> Author: johnny Date: Mon Oct 31 18:28:52 2011 New Revision: 143395 URL: http://llvm.org/viewvc/llvm-project?rev=143395&view=rev Log: Add some expr evaluations for simple STL data types. Radar to be filed soon. Modified: lldb/trunk/test/lang/cpp/stl/TestSTL.py lldb/trunk/test/lang/cpp/stl/main.cpp Modified: lldb/trunk/test/lang/cpp/stl/TestSTL.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/stl/TestSTL.py?rev=143395&r1=143394&r2=143395&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/stl/TestSTL.py (original) +++ lldb/trunk/test/lang/cpp/stl/TestSTL.py Mon Oct 31 18:28:52 2011 @@ -41,8 +41,6 @@ # rdar://problem/8543077 # test/stl: clang built binaries results in the breakpoint locations = 3, # is this a problem with clang generated debug info? - # - # Break on line 13 of main.cpp. self.expect("breakpoint set -f main.cpp -l %d" % self.line, BREAKPOINT_CREATED, startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" % @@ -59,14 +57,18 @@ self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE, substrs = [' resolved, hit count = 1']) - # Now do 'thread step-in', if we have successfully stopped, we should - # stop due to the reason of "step in". - self.runCmd("thread step-in") - - self.runCmd("process status") - if "stopped" in self.res.GetOutput(): - self.expect("thread backtrace", "We have successfully stepped in", - substrs = ['stop reason = step in']) + # Now try some expressions.... + + self.runCmd('expr for (int i = 0; i < hello_world.length(); ++i) { (void)printf("%c\\n", hello_world[i]); }') + + self.expect('expr associative_array.size()', + substrs = [' = 3']) + self.expect('expr associative_array.count(hello_world)', + substrs = [' = 1']) + self.expect('expr associative_array[hello_world]', + substrs = [' = 1']) + self.expect('expr associative_array["hello"]', + substrs = [' = 2']) if __name__ == '__main__': Modified: lldb/trunk/test/lang/cpp/stl/main.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/stl/main.cpp?rev=143395&r1=143394&r2=143395&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/stl/main.cpp (original) +++ lldb/trunk/test/lang/cpp/stl/main.cpp Mon Oct 31 18:28:52 2011 @@ -8,8 +8,22 @@ //===----------------------------------------------------------------------===// #include #include +#include int main (int argc, char const *argv[]) { - std::string hello_world ("Hello World!"); // Set break point at this line. + std::string hello_world ("Hello World!"); std::cout << hello_world << std::endl; + std::cout << hello_world.length() << std::endl; + std::cout << hello_world[11] << std::endl; + + std::map associative_array; + std::cout << "size of upon construction associative_array: " << associative_array.size() << std::endl; + associative_array[hello_world] = 1; + associative_array["hello"] = 2; + associative_array["world"] = 3; + + std::cout << "size of associative_array: " << associative_array.size() << std::endl; + printf("associative_array[\"hello\"]=%d\n", associative_array["hello"]); + + printf("before returning....\n"); // Set break point at this line. } From johnny.chen at apple.com Mon Oct 31 18:35:33 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Mon, 31 Oct 2011 23:35:33 -0000 Subject: [Lldb-commits] [lldb] r143396 - /lldb/trunk/test/lang/cpp/stl/TestSTL.py Message-ID: <20111031233533.6FE6C3524002@llvm.org> Author: johnny Date: Mon Oct 31 18:35:33 2011 New Revision: 143396 URL: http://llvm.org/viewvc/llvm-project?rev=143396&view=rev Log: Add expectedFailure decorators. rdar://problem/10373783 Modified: lldb/trunk/test/lang/cpp/stl/TestSTL.py Modified: lldb/trunk/test/lang/cpp/stl/TestSTL.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/stl/TestSTL.py?rev=143396&r1=143395&r2=143396&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/stl/TestSTL.py (original) +++ lldb/trunk/test/lang/cpp/stl/TestSTL.py Mon Oct 31 18:35:33 2011 @@ -1,5 +1,5 @@ """ -Test that we can successfully step into an STL function. +Test some expressions involving STL data types. """ import os, time @@ -11,16 +11,18 @@ mydir = os.path.join("lang", "cpp", "stl") + @unittest2.expectedFailure @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym(self): - """Test that we can successfully step into an STL function.""" + """Test some expressions involving STL data types.""" self.buildDsym() - self.step_into_stl() + self.step_stl_exprs() + @unittest2.expectedFailure def test_with_dwarf(self): - """Test that we can successfully step into an STL function.""" + """Test some expressions involving STL data types.""" self.buildDwarf() - self.step_into_stl() + self.step_stl_exprs() def setUp(self): # Call super's setUp(). @@ -28,8 +30,8 @@ # Find the line number to break inside main(). self.line = line_number('main.cpp', '// Set break point at this line.') - def step_into_stl(self): - """Test that we can successfully step into an STL function.""" + def step_stl_exprs(self): + """Test some expressions involving STL data types.""" exe = os.path.join(os.getcwd(), "a.out") # The following two lines, if uncommented, will enable loggings. @@ -61,6 +63,7 @@ self.runCmd('expr for (int i = 0; i < hello_world.length(); ++i) { (void)printf("%c\\n", hello_world[i]); }') + # rdar://problem/10373783 self.expect('expr associative_array.size()', substrs = [' = 3']) self.expect('expr associative_array.count(hello_world)', From daniel at zuster.org Mon Oct 31 17:50:24 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 22:50:24 -0000 Subject: [Lldb-commits] [lldb] r143375 - /lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp Message-ID: <20111031225024.5E1AB3524001@llvm.org> Author: ddunbar Date: Mon Oct 31 17:50:24 2011 New Revision: 143375 URL: http://llvm.org/viewvc/llvm-project?rev=143375&view=rev Log: AppleObjCTrampolineHandler: Use array_lengthof instead of unnecessary sentinel. Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp?rev=143375&r1=143374&r2=143375&view=diff ============================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp (original) +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp Mon Oct 31 17:50:24 2011 @@ -35,6 +35,8 @@ #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/ThreadPlanRunToAddress.h" +#include "llvm/ADT/STLExtras.h" + using namespace lldb; using namespace lldb_private; @@ -244,7 +246,7 @@ lldb::addr_t start_offset = offset_ptr; uint32_t offset = desc_extractor.GetU32 (&offset_ptr); uint32_t flags = desc_extractor.GetU32 (&offset_ptr); - lldb:addr_t code_addr = desc_ptr + start_offset + offset; + lldb::addr_t code_addr = desc_ptr + start_offset + offset; m_descriptors.push_back (VTableDescriptor(flags, code_addr)); if (m_code_start_addr == 0 || code_addr < m_code_start_addr) @@ -516,7 +518,6 @@ {"objc_msgSendSuper2_stret", true, true, true, DispatchFunction::eFixUpNone }, {"objc_msgSendSuper2_stret_fixup", true, true, true, DispatchFunction::eFixUpToFix }, {"objc_msgSendSuper2_stret_fixedup", true, true, true, DispatchFunction::eFixUpFixed }, - {NULL} }; AppleObjCTrampolineHandler::AppleObjCTrampolineHandler (const ProcessSP &process_sp, @@ -558,7 +559,7 @@ // turn the g_dispatch_functions char * array into a template table, and populate the DispatchFunction map // from there. - for (int i = 0; g_dispatch_functions[i].name != NULL; i++) + for (int i = 0; i != llvm::array_lengthof(g_dispatch_functions); i++) { ConstString name_const_str(g_dispatch_functions[i].name); const Symbol *msgSend_symbol = m_objc_module_sp->FindFirstSymbolWithNameAndType (name_const_str, eSymbolTypeCode); From daniel at zuster.org Mon Oct 31 17:50:28 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 22:50:28 -0000 Subject: [Lldb-commits] [lldb] r143376 - in /lldb/trunk: lib/Makefile source/Plugins/Makefile source/Plugins/Process/MacOSX-Kernel/Makefile Message-ID: <20111031225028.3B5392A6C12C@llvm.org> Author: ddunbar Date: Mon Oct 31 17:50:27 2011 New Revision: 143376 URL: http://llvm.org/viewvc/llvm-project?rev=143376&view=rev Log: build: Fixup Darwin process plugin build for Makefiles. Added: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/Makefile Modified: lldb/trunk/lib/Makefile lldb/trunk/source/Plugins/Makefile Modified: lldb/trunk/lib/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lib/Makefile?rev=143376&r1=143375&r2=143376&view=diff ============================================================================== --- lldb/trunk/lib/Makefile (original) +++ lldb/trunk/lib/Makefile Mon Oct 31 17:50:27 2011 @@ -76,7 +76,7 @@ lldbPluginObjectFileMachO.a \ lldbPluginSymbolVendorMacOSX.a \ lldbPluginPlatformMacOSX.a \ - lldbPluginProcessDarwin + lldbPluginProcessDarwin.a endif ifeq ($(HOST_OS),Linux) Modified: lldb/trunk/source/Plugins/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Makefile?rev=143376&r1=143375&r2=143376&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Makefile (original) +++ lldb/trunk/source/Plugins/Makefile Mon Oct 31 17:50:27 2011 @@ -21,7 +21,7 @@ LanguageRuntime/ObjC/AppleObjCRuntime ifeq ($(HOST_OS),Darwin) -DIRS += Process/Darwin DynamicLoader/MacOSX-DYLD ObjectContainer/Universal-Mach-O \ +DIRS += Process/MacOSX-Kernel DynamicLoader/MacOSX-DYLD ObjectContainer/Universal-Mach-O \ ObjectFile/Mach-O SymbolVendor/MacOSX #DIRS += Process/MacOSX-User endif Added: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/Makefile?rev=143376&view=auto ============================================================================== --- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/Makefile (added) +++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/Makefile Mon Oct 31 17:50:27 2011 @@ -0,0 +1,14 @@ +##===- source/Plugins/Process/MacOSX-Darwin/Makefile -------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +LLDB_LEVEL := ../../../.. +LIBRARYNAME := lldbPluginProcessDarwin +BUILD_ARCHIVE = 1 + +include $(LLDB_LEVEL)/Makefile From daniel at zuster.org Mon Oct 31 17:50:30 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 22:50:30 -0000 Subject: [Lldb-commits] [lldb] r143377 - /lldb/trunk/lib/Makefile Message-ID: <20111031225030.A257F3524001@llvm.org> Author: ddunbar Date: Mon Oct 31 17:50:30 2011 New Revision: 143377 URL: http://llvm.org/viewvc/llvm-project?rev=143377&view=rev Log: build: Fix Darwin linker flags which weren't properly passed (and aren't valid). Modified: lldb/trunk/lib/Makefile Modified: lldb/trunk/lib/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lib/Makefile?rev=143377&r1=143376&r2=143377&view=diff ============================================================================== --- lldb/trunk/lib/Makefile (original) +++ lldb/trunk/lib/Makefile Mon Oct 31 17:50:30 2011 @@ -102,7 +102,6 @@ -Wl,-compatibility_version -Wl,1 endif # extra options to override libtool defaults - LLVMLibsOptions += -avoid-version LLVMLibsOptions += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks LLVMLibsOptions += -framework Foundation -framework CoreFoundation LLVMLibsOptions += -framework CoreServices -framework Carbon @@ -111,7 +110,7 @@ # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/') ifneq ($(DARWIN_VERS),8) - LLVMLibsOptions += -no-undefined -Wl,-install_name \ + LLVMLibsOptions += -Wl,-install_name \ -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)" endif endif From daniel at zuster.org Mon Oct 31 17:50:33 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 22:50:33 -0000 Subject: [Lldb-commits] [lldb] r143378 - /lldb/trunk/include/lldb/lldb-forward.h Message-ID: <20111031225033.491B93524001@llvm.org> Author: ddunbar Date: Mon Oct 31 17:50:33 2011 New Revision: 143378 URL: http://llvm.org/viewvc/llvm-project?rev=143378&view=rev Log: warnings: Fixup a number of mismatched tags problems. Modified: lldb/trunk/include/lldb/lldb-forward.h Modified: lldb/trunk/include/lldb/lldb-forward.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=143378&r1=143377&r2=143378&view=diff ============================================================================== --- lldb/trunk/include/lldb/lldb-forward.h (original) +++ lldb/trunk/include/lldb/lldb-forward.h Mon Oct 31 17:50:33 2011 @@ -99,7 +99,7 @@ class Module; class ModuleList; class Mutex; -class NameSearchContext; +struct NameSearchContext; class ObjCLanguageRuntime; class ObjectContainer; class OptionGroup; @@ -124,7 +124,7 @@ class RegisterValue; class RegularExpression; class Scalar; -class ScriptSummaryFormat; +struct ScriptSummaryFormat; class ScriptInterpreter; class ScriptInterpreterPython; class SearchFilter; @@ -145,8 +145,8 @@ class StreamFile; class StreamString; class StringList; -class StringSummaryFormat; -class SummaryFormat; +struct StringSummaryFormat; +struct SummaryFormat; class Symbol; class SymbolContext; class SymbolContextList; @@ -187,7 +187,7 @@ class UserSettingsController; class VMRange; class Value; -class ValueFormat; +struct ValueFormat; class ValueList; class ValueObject; class ValueObjectChild; From daniel at zuster.org Mon Oct 31 17:50:37 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 22:50:37 -0000 Subject: [Lldb-commits] [lldb] r143379 - in /lldb/trunk: include/lldb/Core/FormatClasses.h include/lldb/Target/Target.h source/Core/FormatClasses.cpp source/Target/Target.cpp Message-ID: <20111031225037.704F93524001@llvm.org> Author: ddunbar Date: Mon Oct 31 17:50:37 2011 New Revision: 143379 URL: http://llvm.org/viewvc/llvm-project?rev=143379&view=rev Log: warnings: Fix up several const qualified return types. Modified: lldb/trunk/include/lldb/Core/FormatClasses.h lldb/trunk/include/lldb/Target/Target.h lldb/trunk/source/Core/FormatClasses.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/Core/FormatClasses.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatClasses.h?rev=143379&r1=143378&r2=143379&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/FormatClasses.h (original) +++ lldb/trunk/include/lldb/Core/FormatClasses.h Mon Oct 31 17:50:37 2011 @@ -483,7 +483,7 @@ return m_head.GetCount(); } - const int + int GetRealIndexForIndex(int i); bool Modified: lldb/trunk/include/lldb/Target/Target.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=143379&r1=143378&r2=143379&view=diff ============================================================================== --- lldb/trunk/include/lldb/Target/Target.h (original) +++ lldb/trunk/include/lldb/Target/Target.h Mon Oct 31 17:50:37 2011 @@ -507,7 +507,7 @@ /// /// @return \b true if the module should be excluded, \b false otherwise. //------------------------------------------------------------------ - const bool + bool ModuleIsExcludedForNonModuleSpecificSearches (const FileSpec &module_spec); //------------------------------------------------------------------ @@ -529,7 +529,7 @@ /// /// @return \b true if the module should be excluded, \b false otherwise. //------------------------------------------------------------------ - const bool + bool ModuleIsExcludedForNonModuleSpecificSearches (const lldb::ModuleSP &module_sp); ArchSpec & Modified: lldb/trunk/source/Core/FormatClasses.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatClasses.cpp?rev=143379&r1=143378&r2=143379&view=diff ============================================================================== --- lldb/trunk/source/Core/FormatClasses.cpp (original) +++ lldb/trunk/source/Core/FormatClasses.cpp Mon Oct 31 17:50:37 2011 @@ -278,7 +278,7 @@ return sstr.GetString(); } -const int +int SyntheticArrayView::GetRealIndexForIndex(int i) { if (i >= GetCount()) Modified: lldb/trunk/source/Target/Target.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=143379&r1=143378&r2=143379&view=diff ============================================================================== --- lldb/trunk/source/Target/Target.cpp (original) +++ lldb/trunk/source/Target/Target.cpp Mon Oct 31 17:50:37 2011 @@ -935,7 +935,7 @@ } -const bool +bool Target::ModuleIsExcludedForNonModuleSpecificSearches (const FileSpec &module_spec) { @@ -965,7 +965,7 @@ } } -const bool +bool Target::ModuleIsExcludedForNonModuleSpecificSearches (const lldb::ModuleSP &module_sp) { if (!m_breakpoints_use_platform_avoid) From daniel at zuster.org Mon Oct 31 17:50:41 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 22:50:41 -0000 Subject: [Lldb-commits] [lldb] r143380 - in /lldb/trunk: include/lldb/Core/MappedHash.h source/Plugins/Process/Utility/RegisterContextDarwin_arm.h source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h Message-ID: <20111031225042.0F2DA3524001@llvm.org> Author: ddunbar Date: Mon Oct 31 17:50:41 2011 New Revision: 143380 URL: http://llvm.org/viewvc/llvm-project?rev=143380&view=rev Log: warnings: Fix several uses of trailing comma on enumeration extensions. Modified: lldb/trunk/include/lldb/Core/MappedHash.h lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h Modified: lldb/trunk/include/lldb/Core/MappedHash.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/MappedHash.h?rev=143380&r1=143379&r2=143380&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/MappedHash.h (original) +++ lldb/trunk/include/lldb/Core/MappedHash.h Mon Oct 31 17:50:41 2011 @@ -20,7 +20,7 @@ enum HashFunctionType { - eHashFunctionDJB = 0u, // Daniel J Bernstein hash function that is also used by the ELF GNU_HASH sections + eHashFunctionDJB = 0u // Daniel J Bernstein hash function that is also used by the ELF GNU_HASH sections }; Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h?rev=143380&r1=143379&r2=143380&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h (original) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h Mon Oct 31 17:50:41 2011 @@ -163,7 +163,7 @@ GPRRegSet = 1, FPURegSet = 2, EXCRegSet = 3, - DBGRegSet = 4, + DBGRegSet = 4 }; enum Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h?rev=143380&r1=143379&r2=143380&view=diff ============================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h Mon Oct 31 17:50:41 2011 @@ -29,7 +29,7 @@ eAtomTypeCUOffset = 2u, // DIE offset of the compiler unit header that contains the item in question eAtomTypeTag = 3u, // DW_TAG_xxx value, should be encoded as DW_FORM_data1 (if no tags exceed 255) or DW_FORM_data2 eAtomTypeNameFlags = 4u, // Flags from enum NameFlags - eAtomTypeTypeFlags = 5u, // Flags from enum TypeFlags + eAtomTypeTypeFlags = 5u // Flags from enum TypeFlags }; struct Atom From daniel at zuster.org Mon Oct 31 17:50:49 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 22:50:49 -0000 Subject: [Lldb-commits] [lldb] r143381 - in /lldb/trunk: include/lldb/Expression/ClangASTSource.h include/lldb/Expression/ClangExpressionDeclMap.h source/Commands/CommandObjectTarget.cpp source/Core/RegularExpression.cpp source/Core/ValueObject.cpp source/Expression/ASTResultSynthesizer.cpp source/Expression/ClangUserExpression.cpp source/Expression/IRInterpreter.cpp source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp tools/driver/Driver.cpp Message-ID: <20111031225050.29F8E3524001@llvm.org> Author: ddunbar Date: Mon Oct 31 17:50:49 2011 New Revision: 143381 URL: http://llvm.org/viewvc/llvm-project?rev=143381&view=rev Log: warnings: Fix a bunch of -Wreorder problems. Modified: lldb/trunk/include/lldb/Expression/ClangASTSource.h lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h lldb/trunk/source/Commands/CommandObjectTarget.cpp lldb/trunk/source/Core/RegularExpression.cpp lldb/trunk/source/Core/ValueObject.cpp lldb/trunk/source/Expression/ASTResultSynthesizer.cpp lldb/trunk/source/Expression/ClangUserExpression.cpp lldb/trunk/source/Expression/IRInterpreter.cpp lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp lldb/trunk/tools/driver/Driver.cpp Modified: lldb/trunk/include/lldb/Expression/ClangASTSource.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangASTSource.h?rev=143381&r1=143380&r2=143381&view=diff ============================================================================== --- lldb/trunk/include/lldb/Expression/ClangASTSource.h (original) +++ lldb/trunk/include/lldb/Expression/ClangASTSource.h Mon Oct 31 17:50:49 2011 @@ -44,11 +44,11 @@ /// A reference to the LLDB object that handles entity lookup. //------------------------------------------------------------------ ClangASTSource (const lldb::TargetSP &target) : - m_ast_context (NULL), - m_active_lookups (), m_import_in_progress (false), m_lookups_enabled (false), - m_target (target) + m_target (target), + m_ast_context (NULL), + m_active_lookups () { } Modified: lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h?rev=143381&r1=143380&r2=143381&view=diff ============================================================================== --- lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h (original) +++ lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h Mon Oct 31 17:50:49 2011 @@ -665,11 +665,11 @@ { public: ParserVars(ClangExpressionDeclMap &decl_map) : - m_decl_map(decl_map), m_exe_ctx(NULL), m_sym_ctx(), m_persistent_vars(NULL), - m_enable_lookups(false) + m_enable_lookups(false), + m_decl_map(decl_map) { } Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=143381&r1=143380&r2=143381&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Mon Oct 31 17:50:49 2011 @@ -2618,8 +2618,8 @@ CommandOptions (CommandInterpreter &interpreter) : Options(interpreter), - m_use_global_module_list (false), m_format_array(), + m_use_global_module_list (false), m_module_addr (LLDB_INVALID_ADDRESS) { } Modified: lldb/trunk/source/Core/RegularExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/RegularExpression.cpp?rev=143381&r1=143380&r2=143381&view=diff ============================================================================== --- lldb/trunk/source/Core/RegularExpression.cpp (original) +++ lldb/trunk/source/Core/RegularExpression.cpp Mon Oct 31 17:50:49 2011 @@ -32,8 +32,8 @@ RegularExpression::RegularExpression(const char* re, int flags) : m_re(), m_comp_err (1), - m_compile_flags(flags), - m_preg() + m_preg(), + m_compile_flags(flags) { memset(&m_preg,0,sizeof(m_preg)); Compile(re); @@ -46,8 +46,8 @@ RegularExpression::RegularExpression(const char* re) : m_re(), m_comp_err (1), - m_compile_flags(REG_EXTENDED), - m_preg() + m_preg(), + m_compile_flags(REG_EXTENDED) { memset(&m_preg,0,sizeof(m_preg)); Compile(re); Modified: lldb/trunk/source/Core/ValueObject.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=143381&r1=143380&r2=143381&view=diff ============================================================================== --- lldb/trunk/source/Core/ValueObject.cpp (original) +++ lldb/trunk/source/Core/ValueObject.cpp Mon Oct 31 17:50:49 2011 @@ -85,6 +85,7 @@ m_last_value_format(), m_last_synthetic_filter(), m_user_id_of_forced_summary(), + m_address_type_of_ptr_or_ref_children(eAddressTypeInvalid), m_value_is_valid (false), m_value_did_change (false), m_children_count_valid (false), @@ -94,7 +95,6 @@ m_is_bitfield_for_scalar(false), m_is_expression_path_child(false), m_is_child_at_offset(false), - m_address_type_of_ptr_or_ref_children(eAddressTypeInvalid), m_trying_summary_already(false) { m_manager->ManageObject(this); @@ -131,6 +131,7 @@ m_last_value_format(), m_last_synthetic_filter(), m_user_id_of_forced_summary(), + m_address_type_of_ptr_or_ref_children(child_ptr_or_ref_addr_type), m_value_is_valid (false), m_value_did_change (false), m_children_count_valid (false), @@ -140,7 +141,6 @@ m_is_bitfield_for_scalar(false), m_is_expression_path_child(false), m_is_child_at_offset(false), - m_address_type_of_ptr_or_ref_children(child_ptr_or_ref_addr_type), m_trying_summary_already(false) { m_manager = new ValueObjectManager(); Modified: lldb/trunk/source/Expression/ASTResultSynthesizer.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ASTResultSynthesizer.cpp?rev=143381&r1=143380&r2=143381&view=diff ============================================================================== --- lldb/trunk/source/Expression/ASTResultSynthesizer.cpp (original) +++ lldb/trunk/source/Expression/ASTResultSynthesizer.cpp Mon Oct 31 17:50:49 2011 @@ -34,10 +34,10 @@ m_ast_context (NULL), m_passthrough (passthrough), m_passthrough_sema (NULL), - m_sema (NULL), - m_desired_type (desired_type), m_scratch_ast_context (scratch_ast_context), - m_persistent_vars (persistent_vars) + m_persistent_vars (persistent_vars), + m_sema (NULL), + m_desired_type (desired_type) { if (!m_passthrough) return; Modified: lldb/trunk/source/Expression/ClangUserExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangUserExpression.cpp?rev=143381&r1=143380&r2=143381&view=diff ============================================================================== --- lldb/trunk/source/Expression/ClangUserExpression.cpp (original) +++ lldb/trunk/source/Expression/ClangUserExpression.cpp Mon Oct 31 17:50:49 2011 @@ -54,9 +54,9 @@ m_objectivec (false), m_needs_object_ptr (false), m_const_object (false), + m_target (NULL), m_evaluated_statically (false), - m_const_result (), - m_target (NULL) + m_const_result () { } Modified: lldb/trunk/source/Expression/IRInterpreter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRInterpreter.cpp?rev=143381&r1=143380&r2=143381&view=diff ============================================================================== --- lldb/trunk/source/Expression/IRInterpreter.cpp (original) +++ lldb/trunk/source/Expression/IRInterpreter.cpp Mon Oct 31 17:50:49 2011 @@ -419,8 +419,8 @@ InterpreterStackFrame (TargetData &target_data, Memory &memory, lldb_private::ClangExpressionDeclMap &decl_map) : - m_target_data (target_data), m_memory (memory), + m_target_data (target_data), m_decl_map (decl_map) { m_byte_order = (target_data.isLittleEndian() ? lldb::eByteOrderLittle : lldb::eByteOrderBig); Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp?rev=143381&r1=143380&r2=143381&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp (original) +++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp Mon Oct 31 17:50:49 2011 @@ -80,8 +80,8 @@ llvm::Triple::ArchType arch_type) : Instruction (addr, addr_class), m_disassembler (disassembler), - m_arch_type (arch_type), - m_inst (NULL) + m_inst (NULL), + m_arch_type (arch_type) { } Modified: lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=143381&r1=143380&r2=143381&view=diff ============================================================================== --- lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp (original) +++ lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp Mon Oct 31 17:50:49 2011 @@ -94,9 +94,9 @@ m_kext_summary_header_ptr_addr (), m_kext_summary_header_addr (), m_kext_summary_header (), - m_break_id (LLDB_INVALID_BREAK_ID), m_kext_summaries(), - m_mutex(Mutex::eMutexTypeRecursive) + m_mutex(Mutex::eMutexTypeRecursive), + m_break_id (LLDB_INVALID_BREAK_ID) { } Modified: lldb/trunk/tools/driver/Driver.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Driver.cpp?rev=143381&r1=143380&r2=143381&view=diff ============================================================================== --- lldb/trunk/tools/driver/Driver.cpp (original) +++ lldb/trunk/tools/driver/Driver.cpp Mon Oct 31 17:50:49 2011 @@ -378,10 +378,10 @@ m_debug_mode (false), m_print_version (false), m_print_help (false), - m_use_external_editor(false), m_wait_for(false), m_process_name(), m_process_pid(LLDB_INVALID_PROCESS_ID), + m_use_external_editor(false), m_seen_options() { } From daniel at zuster.org Mon Oct 31 17:50:53 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 22:50:53 -0000 Subject: [Lldb-commits] [lldb] r143382 - /lldb/trunk/source/Host/macosx/Symbols.cpp Message-ID: <20111031225053.3B71D3524001@llvm.org> Author: ddunbar Date: Mon Oct 31 17:50:53 2011 New Revision: 143382 URL: http://llvm.org/viewvc/llvm-project?rev=143382&view=rev Log: build: Fix an improperly formed include path (works under Xcode's promiscuous include additions, but not Makefiles). Modified: lldb/trunk/source/Host/macosx/Symbols.cpp Modified: lldb/trunk/source/Host/macosx/Symbols.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Symbols.cpp?rev=143382&r1=143381&r2=143382&view=diff ============================================================================== --- lldb/trunk/source/Host/macosx/Symbols.cpp (original) +++ lldb/trunk/source/Host/macosx/Symbols.cpp Mon Oct 31 17:50:53 2011 @@ -25,12 +25,11 @@ #include "lldb/Core/UUID.h" #include "lldb/Host/Endian.h" #include "lldb/Utility/CleanUp.h" +#include "Host/macosx/cfcpp/CFCBundle.h" #include "Host/macosx/cfcpp/CFCReleaser.h" #include "Host/macosx/cfcpp/CFCString.h" #include "mach/machine.h" -#include "CFCBundle.h" - using namespace lldb; using namespace lldb_private; From daniel at zuster.org Mon Oct 31 17:50:55 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 22:50:55 -0000 Subject: [Lldb-commits] [lldb] r143383 - /lldb/trunk/Makefile Message-ID: <20111031225055.79D413524001@llvm.org> Author: ddunbar Date: Mon Oct 31 17:50:55 2011 New Revision: 143383 URL: http://llvm.org/viewvc/llvm-project?rev=143383&view=rev Log: build: Add some -Wno's for things LLDB isn't clean on yet. Modified: lldb/trunk/Makefile Modified: lldb/trunk/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/Makefile?rev=143383&r1=143382&r2=143383&view=diff ============================================================================== --- lldb/trunk/Makefile (original) +++ lldb/trunk/Makefile Mon Oct 31 17:50:55 2011 @@ -60,6 +60,13 @@ # "#pragma mark" construct which GCC warns about on platforms other than Darwin. EXTRA_OPTIONS += -Wno-unknown-pragmas +# Drop -Wsign-compare, which we are not currently clean with. +EXTRA_OPTIONS += -Wno-sign-compare + +# Drop -Wunused-function and -Wunneeded-internal-declaration, which we are not +# currently clean with. +EXTRA_OPTIONS += -Wno-sign-compare -Wno-unused-function -Wno-unneeded-internal-declaration + ### # LLDB Top Level specific stuff. From daniel at zuster.org Mon Oct 31 17:50:58 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 22:50:58 -0000 Subject: [Lldb-commits] [lldb] r143384 - /lldb/trunk/source/Symbol/ClangASTContext.cpp Message-ID: <20111031225058.2AE652A6C12C@llvm.org> Author: ddunbar Date: Mon Oct 31 17:50:57 2011 New Revision: 143384 URL: http://llvm.org/viewvc/llvm-project?rev=143384&view=rev Log: warnings: Get rid of spurious semicolon. Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=143384&r1=143383&r2=143384&view=diff ============================================================================== --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Mon Oct 31 17:50:57 2011 @@ -1550,7 +1550,7 @@ else return false; } -; + bool ClangASTContext::CheckOverloadedOperatorKindParameterCount (uint32_t op_kind, uint32_t num_params) { From daniel at zuster.org Mon Oct 31 17:51:00 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 22:51:00 -0000 Subject: [Lldb-commits] [lldb] r143385 - /lldb/trunk/source/Core/DataExtractor.cpp Message-ID: <20111031225100.862873524001@llvm.org> Author: ddunbar Date: Mon Oct 31 17:51:00 2011 New Revision: 143385 URL: http://llvm.org/viewvc/llvm-project?rev=143385&view=rev Log: warnings: Fix use of a non-standard escape. Modified: lldb/trunk/source/Core/DataExtractor.cpp Modified: lldb/trunk/source/Core/DataExtractor.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataExtractor.cpp?rev=143385&r1=143384&r2=143385&view=diff ============================================================================== --- lldb/trunk/source/Core/DataExtractor.cpp (original) +++ lldb/trunk/source/Core/DataExtractor.cpp Mon Oct 31 17:51:00 2011 @@ -1453,7 +1453,7 @@ { switch (ch) { - case '\e': s->Printf ("\\e"); break; + case '\033': s->Printf ("\\e"); break; case '\a': s->Printf ("\\a"); break; case '\b': s->Printf ("\\b"); break; case '\f': s->Printf ("\\f"); break; From daniel at zuster.org Mon Oct 31 17:51:02 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 22:51:02 -0000 Subject: [Lldb-commits] [lldb] r143386 - /lldb/trunk/source/Core/DataExtractor.cpp Message-ID: <20111031225102.F07A73524001@llvm.org> Author: ddunbar Date: Mon Oct 31 17:51:02 2011 New Revision: 143386 URL: http://llvm.org/viewvc/llvm-project?rev=143386&view=rev Log: warnings: Fix a non-standard escape sequence. Modified: lldb/trunk/source/Core/DataExtractor.cpp Modified: lldb/trunk/source/Core/DataExtractor.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataExtractor.cpp?rev=143386&r1=143385&r2=143386&view=diff ============================================================================== --- lldb/trunk/source/Core/DataExtractor.cpp (original) +++ lldb/trunk/source/Core/DataExtractor.cpp Mon Oct 31 17:51:02 2011 @@ -1527,7 +1527,7 @@ { switch (ch) { - case '\e': s->Printf ("\\e"); break; + case '\033': s->Printf ("\\e"); break; case '\a': s->Printf ("\\a"); break; case '\b': s->Printf ("\\b"); break; case '\f': s->Printf ("\\f"); break; From daniel at zuster.org Mon Oct 31 17:51:06 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 22:51:06 -0000 Subject: [Lldb-commits] [lldb] r143387 - in /lldb/trunk/source/Plugins/Process/Utility: RegisterContextDarwin_arm.cpp RegisterContextDarwin_x86_64.cpp Message-ID: <20111031225106.392792A6C12C@llvm.org> Author: ddunbar Date: Mon Oct 31 17:51:05 2011 New Revision: 143387 URL: http://llvm.org/viewvc/llvm-project?rev=143387&view=rev Log: warnings: Use LLVM_EXTENSION to suppress a bunch of pedantic warnings. Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp?rev=143387&r1=143386&r2=143387&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp (original) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp Mon Oct 31 17:51:05 2011 @@ -23,6 +23,13 @@ #include "lldb/Core/RegisterValue.h" #include "lldb/Core/Scalar.h" #include "lldb/Host/Endian.h" +#include "llvm/Support/Compiler.h" + +// Support building against older versions of LLVM, this macro was added +// recently. +#ifndef LLVM_EXTENSION +#define LLVM_EXTENSION +#endif // Project includes #include "ARM_GCC_Registers.h" @@ -184,7 +191,7 @@ #define GPR_OFFSET(idx) ((idx) * 4) #define FPU_OFFSET(idx) ((idx) * 4 + sizeof (RegisterContextDarwin_arm::GPR)) #define EXC_OFFSET(idx) ((idx) * 4 + sizeof (RegisterContextDarwin_arm::GPR) + sizeof (RegisterContextDarwin_arm::FPU)) -#define DBG_OFFSET(reg) (offsetof (RegisterContextDarwin_arm::DBG, reg) + sizeof (RegisterContextDarwin_arm::GPR) + sizeof (RegisterContextDarwin_arm::FPU) + sizeof (RegisterContextDarwin_arm::EXC)) +#define DBG_OFFSET(reg) ((LLVM_EXTENSION offsetof (RegisterContextDarwin_arm::DBG, reg) + sizeof (RegisterContextDarwin_arm::GPR) + sizeof (RegisterContextDarwin_arm::FPU) + sizeof (RegisterContextDarwin_arm::EXC))) #define DEFINE_DBG(reg, i) #reg, NULL, sizeof(((RegisterContextDarwin_arm::DBG *)NULL)->reg[i]), DBG_OFFSET(reg[i]), eEncodingUint, eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, dbg_##reg##i } #define REG_CONTEXT_SIZE (sizeof (RegisterContextDarwin_arm::GPR) + sizeof (RegisterContextDarwin_arm::FPU) + sizeof (RegisterContextDarwin_arm::EXC)) Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp?rev=143387&r1=143386&r2=143387&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp (original) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp Mon Oct 31 17:51:05 2011 @@ -19,6 +19,13 @@ #include "lldb/Core/RegisterValue.h" #include "lldb/Core/Scalar.h" #include "lldb/Host/Endian.h" +#include "llvm/Support/Compiler.h" + +// Support building against older versions of LLVM, this macro was added +// recently. +#ifndef LLVM_EXTENSION +#define LLVM_EXTENSION +#endif // Project includes #include "RegisterContextDarwin_x86_64.h" @@ -227,9 +234,9 @@ { } -#define GPR_OFFSET(reg) (offsetof (RegisterContextDarwin_x86_64::GPR, reg)) -#define FPU_OFFSET(reg) (offsetof (RegisterContextDarwin_x86_64::FPU, reg) + sizeof (RegisterContextDarwin_x86_64::GPR)) -#define EXC_OFFSET(reg) (offsetof (RegisterContextDarwin_x86_64::EXC, reg) + sizeof (RegisterContextDarwin_x86_64::GPR) + sizeof (RegisterContextDarwin_x86_64::FPU)) +#define GPR_OFFSET(reg) (LLVM_EXTENSION offsetof (RegisterContextDarwin_x86_64::GPR, reg)) +#define FPU_OFFSET(reg) (LLVM_EXTENSION offsetof (RegisterContextDarwin_x86_64::FPU, reg) + sizeof (RegisterContextDarwin_x86_64::GPR)) +#define EXC_OFFSET(reg) (LLVM_EXTENSION offsetof (RegisterContextDarwin_x86_64::EXC, reg) + sizeof (RegisterContextDarwin_x86_64::GPR) + sizeof (RegisterContextDarwin_x86_64::FPU)) // These macros will auto define the register name, alt name, register size, // register offset, encoding, format and native register. This ensures that From daniel at zuster.org Mon Oct 31 17:51:09 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 22:51:09 -0000 Subject: [Lldb-commits] [lldb] r143388 - in /lldb/trunk: lib/Makefile source/Plugins/Makefile Message-ID: <20111031225109.298393524001@llvm.org> Author: ddunbar Date: Mon Oct 31 17:51:08 2011 New Revision: 143388 URL: http://llvm.org/viewvc/llvm-project?rev=143388&view=rev Log: build: Fix Makefiles on Darwin to link proper dynamic loader plugin. Modified: lldb/trunk/lib/Makefile lldb/trunk/source/Plugins/Makefile Modified: lldb/trunk/lib/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lib/Makefile?rev=143388&r1=143387&r2=143388&view=diff ============================================================================== --- lldb/trunk/lib/Makefile (original) +++ lldb/trunk/lib/Makefile Mon Oct 31 17:51:08 2011 @@ -72,6 +72,7 @@ ifeq ($(HOST_OS),Darwin) USEDLIBS += lldbHostMacOSX.a \ lldbPluginDynamicLoaderMacOSX.a \ + lldbPluginDynamicLoaderDarwinKernel.a \ lldbPluginObjectContainerUniversalMachO.a \ lldbPluginObjectFileMachO.a \ lldbPluginSymbolVendorMacOSX.a \ Modified: lldb/trunk/source/Plugins/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Makefile?rev=143388&r1=143387&r2=143388&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Makefile (original) +++ lldb/trunk/source/Plugins/Makefile Mon Oct 31 17:51:08 2011 @@ -21,8 +21,9 @@ LanguageRuntime/ObjC/AppleObjCRuntime ifeq ($(HOST_OS),Darwin) -DIRS += Process/MacOSX-Kernel DynamicLoader/MacOSX-DYLD ObjectContainer/Universal-Mach-O \ - ObjectFile/Mach-O SymbolVendor/MacOSX +DIRS += Process/MacOSX-Kernel DynamicLoader/MacOSX-DYLD \ + DynamicLoader/Darwin-Kernel \ + ObjectContainer/Universal-Mach-O ObjectFile/Mach-O SymbolVendor/MacOSX #DIRS += Process/MacOSX-User endif From daniel at zuster.org Mon Oct 31 17:51:11 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 22:51:11 -0000 Subject: [Lldb-commits] [lldb] r143389 - in /lldb/trunk: lib/Makefile source/Plugins/Makefile Message-ID: <20111031225111.E94CF3524001@llvm.org> Author: ddunbar Date: Mon Oct 31 17:51:11 2011 New Revision: 143389 URL: http://llvm.org/viewvc/llvm-project?rev=143389&view=rev Log: build: Build in the Darwin-Kernel OperatingSystem plugin. Modified: lldb/trunk/lib/Makefile lldb/trunk/source/Plugins/Makefile Modified: lldb/trunk/lib/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lib/Makefile?rev=143389&r1=143388&r2=143389&view=diff ============================================================================== --- lldb/trunk/lib/Makefile (original) +++ lldb/trunk/lib/Makefile Mon Oct 31 17:51:11 2011 @@ -75,9 +75,10 @@ lldbPluginDynamicLoaderDarwinKernel.a \ lldbPluginObjectContainerUniversalMachO.a \ lldbPluginObjectFileMachO.a \ + lldbPluginOperatingSystemDarwinKernel.a \ lldbPluginSymbolVendorMacOSX.a \ lldbPluginPlatformMacOSX.a \ - lldbPluginProcessDarwin.a + lldbPluginProcessDarwin.a endif ifeq ($(HOST_OS),Linux) Modified: lldb/trunk/source/Plugins/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Makefile?rev=143389&r1=143388&r2=143389&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Makefile (original) +++ lldb/trunk/source/Plugins/Makefile Mon Oct 31 17:51:11 2011 @@ -21,9 +21,11 @@ LanguageRuntime/ObjC/AppleObjCRuntime ifeq ($(HOST_OS),Darwin) -DIRS += Process/MacOSX-Kernel DynamicLoader/MacOSX-DYLD \ - DynamicLoader/Darwin-Kernel \ - ObjectContainer/Universal-Mach-O ObjectFile/Mach-O SymbolVendor/MacOSX +DIRS += Process/MacOSX-Kernel +DIRS += DynamicLoader/MacOSX-DYLD DynamicLoader/Darwin-Kernel +DIRS += ObjectContainer/Universal-Mach-O ObjectFile/Mach-O +DIRS += SymbolVendor/MacOSX +DIRS += OperatingSystem/Darwin-Kernel #DIRS += Process/MacOSX-User endif From daniel at zuster.org Mon Oct 31 17:51:14 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 22:51:14 -0000 Subject: [Lldb-commits] [lldb] r143390 - /lldb/trunk/source/Interpreter/Makefile Message-ID: <20111031225114.4CCAB3524001@llvm.org> Author: ddunbar Date: Mon Oct 31 17:51:14 2011 New Revision: 143390 URL: http://llvm.org/viewvc/llvm-project?rev=143390&view=rev Log: build: Fix SWIG include paths on Darwin. Modified: lldb/trunk/source/Interpreter/Makefile Modified: lldb/trunk/source/Interpreter/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Makefile?rev=143390&r1=143389&r2=143390&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/Makefile (original) +++ lldb/trunk/source/Interpreter/Makefile Mon Oct 31 17:51:14 2011 @@ -32,9 +32,16 @@ LLDB_SWIG_INCLUDE_DIRS += -I"/usr/local/include" LLDB_SWIG_INCLUDE_DIRS += -I"/usr/include" +# On Darwin, stdint.h might only be in the compiler subdirectory. Unfortunately, +# swig doesn't currently seem able to understand Clang's stdint.h, so we have to +# point at the GCC one. +ifeq ($(HOST_OS),Darwin) +LLDB_SWIG_INCLUDE_DIRS += -I"/usr/include/gcc/darwin/4.2" +endif + SWIG_DEPEND_OPTIONS = -MMD -MF "$(PROJ_OBJ_DIR)/$*.cpp.d.tmp" CPP_DEPEND_MOVEFILE = then $(MV) -f "$(PROJ_OBJ_DIR)/$*.cpp.d.tmp" "$(PROJ_OBJ_DIR)/$*.cpp.d"; \ - else $(RM) "$(PROJ_OBJ_DIR)/$*.cpp.d.tmp"; exit 1; fi + else $(RM) -f "$(PROJ_OBJ_DIR)/$*.cpp.d.tmp"; exit 1; fi LLDBWrapPython.cpp: $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/modify-python-lldb.py \ $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py From daniel at zuster.org Mon Oct 31 18:27:06 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 23:27:06 -0000 Subject: [Lldb-commits] [lldb] r143394 - in /lldb/trunk/test: Makefile dotest.py Message-ID: <20111031232706.EEE8E3524002@llvm.org> Author: ddunbar Date: Mon Oct 31 18:27:06 2011 New Revision: 143394 URL: http://llvm.org/viewvc/llvm-project?rev=143394&view=rev Log: tests: Improve Makefile/dotest to properly set LLDB_HERE variable used in some tests. Modified: lldb/trunk/test/Makefile lldb/trunk/test/dotest.py Modified: lldb/trunk/test/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/Makefile?rev=143394&r1=143393&r2=143394&view=diff ============================================================================== --- lldb/trunk/test/Makefile (original) +++ lldb/trunk/test/Makefile Mon Oct 31 18:27:06 2011 @@ -32,5 +32,6 @@ rm -rf ../test-rdir env PATH="$(ToolDir):$(PATH)" \ PYTHONPATH=$(ToolDir) \ + LLDB_EXEC=$(ToolDir)/lldb \ $(SHLIBPATH_VAR)=$(LibDir):$($(SHLIBPATH_VAR)) \ python $(PROJ_SRC_DIR)/dotest.py -i -v -r ../test-rdir Modified: lldb/trunk/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=143394&r1=143393&r2=143394&view=diff ============================================================================== --- lldb/trunk/test/dotest.py (original) +++ lldb/trunk/test/dotest.py Mon Oct 31 18:27:06 2011 @@ -663,6 +663,8 @@ lldbHere = baiExec elif is_exe(baiExec2): lldbHere = baiExec2 + elif lldbExec: + lldbHere = lldbExec if lldbHere: os.environ["LLDB_HERE"] = lldbHere From daniel at zuster.org Mon Oct 31 18:38:31 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 23:38:31 -0000 Subject: [Lldb-commits] [lldb] r143397 - /lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp Message-ID: <20111031233831.2DCA03524002@llvm.org> Author: ddunbar Date: Mon Oct 31 18:38:30 2011 New Revision: 143397 URL: http://llvm.org/viewvc/llvm-project?rev=143397&view=rev Log: warnings: Fix another place with extension warnings I somehow missed. Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp?rev=143397&r1=143396&r2=143397&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp (original) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp Mon Oct 31 18:38:30 2011 @@ -17,6 +17,13 @@ #include "lldb/Core/RegisterValue.h" #include "lldb/Core/Scalar.h" #include "lldb/Host/Endian.h" +#include "llvm/Support/Compiler.h" + +// Support building against older versions of LLVM, this macro was added +// recently. +#ifndef LLVM_EXTENSION +#define LLVM_EXTENSION +#endif // Project includes #include "RegisterContextDarwin_i386.h" @@ -204,9 +211,9 @@ -#define GPR_OFFSET(reg) (offsetof (RegisterContextDarwin_i386::GPR, reg)) -#define FPU_OFFSET(reg) (offsetof (RegisterContextDarwin_i386::FPU, reg) + sizeof (RegisterContextDarwin_i386::GPR)) -#define EXC_OFFSET(reg) (offsetof (RegisterContextDarwin_i386::EXC, reg) + sizeof (RegisterContextDarwin_i386::GPR) + sizeof (RegisterContextDarwin_i386::FPU)) +#define GPR_OFFSET(reg) (LLVM_EXTENSION offsetof (RegisterContextDarwin_i386::GPR, reg)) +#define FPU_OFFSET(reg) (LLVM_EXTENSION offsetof (RegisterContextDarwin_i386::FPU, reg) + sizeof (RegisterContextDarwin_i386::GPR)) +#define EXC_OFFSET(reg) (LLVM_EXTENSION offsetof (RegisterContextDarwin_i386::EXC, reg) + sizeof (RegisterContextDarwin_i386::GPR) + sizeof (RegisterContextDarwin_i386::FPU)) // These macros will auto define the register name, alt name, register size, // register offset, encoding, format and native register. This ensures that From daniel at zuster.org Mon Oct 31 18:38:34 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 31 Oct 2011 23:38:34 -0000 Subject: [Lldb-commits] [lldb] r143398 - /lldb/trunk/source/Plugins/OperatingSystem/Darwin-Kernel/Makefile Message-ID: <20111031233834.F03FB3524002@llvm.org> Author: ddunbar Date: Mon Oct 31 18:38:34 2011 New Revision: 143398 URL: http://llvm.org/viewvc/llvm-project?rev=143398&view=rev Log: build: Add the Darwin-Kernel Makefile. Added: lldb/trunk/source/Plugins/OperatingSystem/Darwin-Kernel/Makefile Added: lldb/trunk/source/Plugins/OperatingSystem/Darwin-Kernel/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/OperatingSystem/Darwin-Kernel/Makefile?rev=143398&view=auto ============================================================================== --- lldb/trunk/source/Plugins/OperatingSystem/Darwin-Kernel/Makefile (added) +++ lldb/trunk/source/Plugins/OperatingSystem/Darwin-Kernel/Makefile Mon Oct 31 18:38:34 2011 @@ -0,0 +1,14 @@ +##==- source/Plugins/OperatingSystem/Darwin-Kernel/Makefile -*- Makefile -*-==## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +LLDB_LEVEL := ../../../.. +LIBRARYNAME := lldbPluginOperatingSystemDarwinKernel +BUILD_ARCHIVE = 1 + +include $(LLDB_LEVEL)/Makefile From jingham at apple.com Mon Oct 31 18:47:10 2011 From: jingham at apple.com (Jim Ingham) Date: Mon, 31 Oct 2011 23:47:10 -0000 Subject: [Lldb-commits] [lldb] r143402 - /lldb/trunk/source/Core/Module.cpp Message-ID: <20111031234710.6A9D03524002@llvm.org> Author: jingham Date: Mon Oct 31 18:47:10 2011 New Revision: 143402 URL: http://llvm.org/viewvc/llvm-project?rev=143402&view=rev Log: We can't have the global vector of modules be a static object, or it might get destroyed before all the modules, which will then crash when the next modules tries to take itself off it. Modified: lldb/trunk/source/Core/Module.cpp Modified: lldb/trunk/source/Core/Module.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=143402&r1=143401&r2=143402&view=diff ============================================================================== --- lldb/trunk/source/Core/Module.cpp (original) +++ lldb/trunk/source/Core/Module.cpp Mon Oct 31 18:47:10 2011 @@ -28,8 +28,17 @@ static ModuleCollection & GetModuleCollection() { - static ModuleCollection g_module_collection; - return g_module_collection; + // This module collection needs to live past any module, so we could either make it a + // shared pointer in each module or just leak is. Since it is only an empty vector by + // the time all the modules have gone away, we just leak it for now. If we decide this + // is a big problem we can introduce a Finalize method that will tear everything down in + // a predictable order. + + static ModuleCollection *g_module_collection = NULL; + if (g_module_collection == NULL) + g_module_collection = new ModuleCollection(); + + return *g_module_collection; } Mutex & From gclayton at apple.com Mon Oct 31 18:51:19 2011 From: gclayton at apple.com (Greg Clayton) Date: Mon, 31 Oct 2011 23:51:19 -0000 Subject: [Lldb-commits] [lldb] r143403 - in /lldb/trunk: lldb.xcodeproj/project.pbxproj source/Interpreter/Options.cpp source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp source/Symbol/ClangASTContext.cpp tools/darwin-debug/darwin-debug.cpp tools/lldb-platform/lldb-platform.cpp Message-ID: <20111031235120.1A2FA2A6C12C@llvm.org> Author: gclayton Date: Mon Oct 31 18:51:19 2011 New Revision: 143403 URL: http://llvm.org/viewvc/llvm-project?rev=143403&view=rev Log: Fixed some warnings after enabling some stricter warnings in the Xcode project settings. Also fixed an issue where we weren't creating anonymous namepaces correctly: Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/source/Interpreter/Options.cpp lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/trunk/source/Symbol/ClangASTContext.cpp lldb/trunk/tools/darwin-debug/darwin-debug.cpp lldb/trunk/tools/lldb-platform/lldb-platform.cpp Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=143403&r1=143402&r2=143403&view=diff ============================================================================== --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Oct 31 18:51:19 2011 @@ -3592,7 +3592,7 @@ LLDB_CONFIGURATION_DEBUG, ); GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; @@ -3600,6 +3600,8 @@ GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; @@ -3628,7 +3630,7 @@ LLDB_CONFIGURATION_RELEASE, ); GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; @@ -3636,6 +3638,8 @@ GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; @@ -3913,7 +3917,7 @@ LLDB_CONFIGURATION_BUILD_AND_INTEGRATION, ); GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; @@ -3921,6 +3925,8 @@ GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; LLVM_BUILD_DIR = "$(OBJROOT)/llvm"; Modified: lldb/trunk/source/Interpreter/Options.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Options.cpp?rev=143403&r1=143402&r2=143403&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/Options.cpp (original) +++ lldb/trunk/source/Interpreter/Options.cpp Mon Oct 31 18:51:19 2011 @@ -375,11 +375,9 @@ const OptionDefinition *opt_defs = GetDefinitions (); if (opt_defs) { - const char *long_option_name; + const char *long_option_name = long_option; if (long_option[0] == '-' && long_option[1] == '-') long_option_name += 2; - else - long_option_name = long_option; for (uint32_t i = 0; opt_defs[i].long_option; ++i) { Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=143403&r1=143402&r2=143403&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original) +++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Mon Oct 31 18:51:19 2011 @@ -13185,11 +13185,11 @@ { default: return false; - eModeARM: + case eModeARM: // Clear the T bit. m_new_inst_cpsr &= ~MASK_CPSR_T; break; - eModeThumb: + case eModeThumb: // Set the T bit. m_new_inst_cpsr |= MASK_CPSR_T; break; Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=143403&r1=143402&r2=143403&view=diff ============================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Mon Oct 31 18:51:19 2011 @@ -1012,7 +1012,17 @@ std::auto_ptr line_table_ap(new LineTable(sc.comp_unit)); if (line_table_ap.get()) { - ParseDWARFLineTableCallbackInfo info = { line_table_ap.get(), m_obj_file->GetSectionList(), 0, 0, m_debug_map_symfile != NULL, false}; + ParseDWARFLineTableCallbackInfo info = { + line_table_ap.get(), + m_obj_file->GetSectionList(), + 0, + 0, + m_debug_map_symfile != NULL, + false, + DWARFDebugLine::Row(), + SectionSP(), + SectionSP() + }; uint32_t offset = cu_line_offset; DWARFDebugLine::ParseStatementTable(get_debug_line_data(), &offset, ParseDWARFLineTableCallback, &info); sc.comp_unit->SetLineTable(line_table_ap.release()); @@ -3516,14 +3526,14 @@ else { const char *namespace_name = die->GetAttributeValueAsString(this, curr_cu, DW_AT_name, NULL); - if (namespace_name) + clang::DeclContext *containing_decl_ctx = GetClangDeclContextContainingDIE (curr_cu, die, NULL); + namespace_decl = GetClangASTContext().GetUniqueNamespaceDeclaration (namespace_name, containing_decl_ctx); + LogSP log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO)); + if (log) { - clang::DeclContext *containing_decl_ctx = GetClangDeclContextContainingDIE (curr_cu, die, NULL); - namespace_decl = GetClangASTContext().GetUniqueNamespaceDeclaration (namespace_name, containing_decl_ctx); - LogSP log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO)); - if (log) + const char *object_name = m_obj_file->GetModule()->GetObjectName().GetCString(); + if (namespace_name) { - const char *object_name = m_obj_file->GetModule()->GetObjectName().GetCString(); log->Printf ("ASTContext => %p: 0x%8.8llx: DW_TAG_namespace with DW_AT_name(\"%s\") => clang::NamespaceDecl * %p in %s/%s%s%s%s (original = %p)", GetClangASTContext().getASTContext(), MakeUserID(die->GetOffset()), @@ -3536,11 +3546,24 @@ object_name ? "(" : "", namespace_decl->getOriginalNamespace()); } - - if (namespace_decl) - LinkDeclContextToDIE((clang::DeclContext*)namespace_decl, die); - return namespace_decl; + else + { + log->Printf ("ASTContext => %p: 0x%8.8llx: DW_TAG_namespace (anonymous) => clang::NamespaceDecl * %p in %s/%s%s%s%s (original = %p)", + GetClangASTContext().getASTContext(), + MakeUserID(die->GetOffset()), + namespace_decl, + m_obj_file->GetFileSpec().GetDirectory().GetCString(), + m_obj_file->GetFileSpec().GetFilename().GetCString(), + object_name ? "(" : "", + object_name ? object_name : "", + object_name ? "(" : "", + namespace_decl->getOriginalNamespace()); + } } + + if (namespace_decl) + LinkDeclContextToDIE((clang::DeclContext*)namespace_decl, die); + return namespace_decl; } } return NULL; Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=143403&r1=143402&r2=143403&view=diff ============================================================================== --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Mon Oct 31 18:51:19 2011 @@ -4299,12 +4299,13 @@ ClangASTContext::GetUniqueNamespaceDeclaration (const char *name, DeclContext *decl_ctx) { NamespaceDecl *namespace_decl = NULL; + ASTContext *ast = getASTContext(); + TranslationUnitDecl *translation_unit_decl = ast->getTranslationUnitDecl (); + if (decl_ctx == NULL) + decl_ctx = translation_unit_decl; + if (name) { - ASTContext *ast = getASTContext(); - if (decl_ctx == NULL) - decl_ctx = ast->getTranslationUnitDecl(); - IdentifierInfo &identifier_info = ast->Idents.get(name); DeclarationName decl_name (&identifier_info); clang::DeclContext::lookup_result result = decl_ctx->lookup(decl_name); @@ -4317,12 +4318,61 @@ namespace_decl = NamespaceDecl::Create(*ast, decl_ctx, SourceLocation(), SourceLocation(), &identifier_info); - decl_ctx->addDecl (namespace_decl); + decl_ctx->addDecl (namespace_decl); + } + else + { + if (decl_ctx == translation_unit_decl) + { + namespace_decl = translation_unit_decl->getAnonymousNamespace(); + if (namespace_decl) + return namespace_decl; + + namespace_decl = NamespaceDecl::Create(*ast, decl_ctx, SourceLocation(), SourceLocation(), NULL); + translation_unit_decl->setAnonymousNamespace (namespace_decl); + translation_unit_decl->addDecl (namespace_decl); + assert (namespace_decl == translation_unit_decl->getAnonymousNamespace()); + } + else + { + NamespaceDecl *parent_namespace_decl = cast(decl_ctx); + if (parent_namespace_decl) + { + namespace_decl = parent_namespace_decl->getAnonymousNamespace(); + if (namespace_decl) + return namespace_decl; + namespace_decl = NamespaceDecl::Create(*ast, decl_ctx, SourceLocation(), SourceLocation(), NULL); + parent_namespace_decl->setAnonymousNamespace (namespace_decl); + parent_namespace_decl->addDecl (namespace_decl); + assert (namespace_decl == parent_namespace_decl->getAnonymousNamespace()); + } + else + { + // BAD!!! + } + } + + if (namespace_decl) + { + // If we make it here, we are creating the anonymous namespace decl + // for the first time, so we need to do the using directive magic + // like SEMA does + UsingDirectiveDecl* using_directive_decl = UsingDirectiveDecl::Create (*ast, + decl_ctx, + SourceLocation(), + SourceLocation(), + NestedNameSpecifierLoc(), + SourceLocation(), + namespace_decl, + decl_ctx); + using_directive_decl->setImplicit(); + decl_ctx->addDecl(using_directive_decl); + } + } #ifdef LLDB_CONFIGURATION_DEBUG - VerifyDecl(namespace_decl); + VerifyDecl(namespace_decl); #endif - } return namespace_decl; } Modified: lldb/trunk/tools/darwin-debug/darwin-debug.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/darwin-debug/darwin-debug.cpp?rev=143403&r1=143402&r2=143403&view=diff ============================================================================== --- lldb/trunk/tools/darwin-debug/darwin-debug.cpp (original) +++ lldb/trunk/tools/darwin-debug/darwin-debug.cpp Mon Oct 31 18:51:19 2011 @@ -178,7 +178,7 @@ cpu_type_t cpu_type = 0; bool show_usage = false; - char ch; + int ch; int disable_aslr = 0; // By default we disable ASLR int pass_env = 1; std::string unix_socket_name; Modified: lldb/trunk/tools/lldb-platform/lldb-platform.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-platform/lldb-platform.cpp?rev=143403&r1=143402&r2=143403&view=diff ============================================================================== --- lldb/trunk/tools/lldb-platform/lldb-platform.cpp (original) +++ lldb/trunk/tools/lldb-platform/lldb-platform.cpp Mon Oct 31 18:51:19 2011 @@ -73,7 +73,7 @@ Args log_args; Error error; std::string listen_host_port; - char ch; + int ch; Debugger::Initialize(); // ConnectionMachPort a; From johnny.chen at apple.com Mon Oct 31 19:18:04 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Mon, 31 Oct 2011 17:18:04 -0700 Subject: [Lldb-commits] [lldb] r143403 - in /lldb/trunk: lldb.xcodeproj/project.pbxproj source/Interpreter/Options.cpp source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp source/Symbol/ClangASTContext.cpp tools/darwin-debug/darwin-debug.cpp tools/lldb-platform/lldb-platform.cpp In-Reply-To: <20111031235120.1A2FA2A6C12C@llvm.org> References: <20111031235120.1A2FA2A6C12C@llvm.org> Message-ID: Hi Greg, TestNamespace.py failed as a result of the check-in? runCmd: frame variable output: (int) a = 12 (::my_uint_t) anon_uint = 0 (A::uint_t) a_uint = 1 (A::B::uint_t) b_uint = 2 (Y::uint_t) y_uint = 3 Expecting sub string: (int) a = 12 Matched Expecting sub string: (my_uint_t) anon_uint = 0 Not matched FAIL On Oct 31, 2011, at 4:51 PM, Greg Clayton wrote: > Author: gclayton > Date: Mon Oct 31 18:51:19 2011 > New Revision: 143403 > > URL: http://llvm.org/viewvc/llvm-project?rev=143403&view=rev > Log: > Fixed some warnings after enabling some stricter warnings in the Xcode project > settings. > > Also fixed an issue where we weren't creating anonymous namepaces correctly: > > > > > Modified: > lldb/trunk/lldb.xcodeproj/project.pbxproj > lldb/trunk/source/Interpreter/Options.cpp > lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp > lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp > lldb/trunk/source/Symbol/ClangASTContext.cpp > lldb/trunk/tools/darwin-debug/darwin-debug.cpp > lldb/trunk/tools/lldb-platform/lldb-platform.cpp > > Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj > URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=143403&r1=143402&r2=143403&view=diff > ============================================================================== > --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) > +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Oct 31 18:51:19 2011 > @@ -3592,7 +3592,7 @@ > LLDB_CONFIGURATION_DEBUG, > ); > GCC_VERSION = com.apple.compilers.llvm.clang.1_0; > - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; > + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; > GCC_WARN_ABOUT_MISSING_NEWLINE = YES; > GCC_WARN_ABOUT_RETURN_TYPE = YES; > GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; > @@ -3600,6 +3600,8 @@ > GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; > GCC_WARN_MISSING_PARENTHESES = YES; > GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; > + GCC_WARN_UNINITIALIZED_AUTOS = YES; > + GCC_WARN_UNUSED_LABEL = YES; > GCC_WARN_UNUSED_VALUE = YES; > GCC_WARN_UNUSED_VARIABLE = YES; > LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; > @@ -3628,7 +3630,7 @@ > LLDB_CONFIGURATION_RELEASE, > ); > GCC_VERSION = com.apple.compilers.llvm.clang.1_0; > - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; > + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; > GCC_WARN_ABOUT_MISSING_NEWLINE = YES; > GCC_WARN_ABOUT_RETURN_TYPE = YES; > GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; > @@ -3636,6 +3638,8 @@ > GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; > GCC_WARN_MISSING_PARENTHESES = YES; > GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; > + GCC_WARN_UNINITIALIZED_AUTOS = YES; > + GCC_WARN_UNUSED_LABEL = YES; > GCC_WARN_UNUSED_VALUE = YES; > GCC_WARN_UNUSED_VARIABLE = YES; > LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; > @@ -3913,7 +3917,7 @@ > LLDB_CONFIGURATION_BUILD_AND_INTEGRATION, > ); > GCC_VERSION = com.apple.compilers.llvm.clang.1_0; > - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; > + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; > GCC_WARN_ABOUT_MISSING_NEWLINE = YES; > GCC_WARN_ABOUT_RETURN_TYPE = YES; > GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; > @@ -3921,6 +3925,8 @@ > GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; > GCC_WARN_MISSING_PARENTHESES = YES; > GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; > + GCC_WARN_UNINITIALIZED_AUTOS = YES; > + GCC_WARN_UNUSED_LABEL = YES; > GCC_WARN_UNUSED_VALUE = YES; > GCC_WARN_UNUSED_VARIABLE = YES; > LLVM_BUILD_DIR = "$(OBJROOT)/llvm"; > > Modified: lldb/trunk/source/Interpreter/Options.cpp > URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Options.cpp?rev=143403&r1=143402&r2=143403&view=diff > ============================================================================== > --- lldb/trunk/source/Interpreter/Options.cpp (original) > +++ lldb/trunk/source/Interpreter/Options.cpp Mon Oct 31 18:51:19 2011 > @@ -375,11 +375,9 @@ > const OptionDefinition *opt_defs = GetDefinitions (); > if (opt_defs) > { > - const char *long_option_name; > + const char *long_option_name = long_option; > if (long_option[0] == '-' && long_option[1] == '-') > long_option_name += 2; > - else > - long_option_name = long_option; > > for (uint32_t i = 0; opt_defs[i].long_option; ++i) > { > > Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp > URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=143403&r1=143402&r2=143403&view=diff > ============================================================================== > --- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original) > +++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Mon Oct 31 18:51:19 2011 > @@ -13185,11 +13185,11 @@ > { > default: > return false; > - eModeARM: > + case eModeARM: > // Clear the T bit. > m_new_inst_cpsr &= ~MASK_CPSR_T; > break; > - eModeThumb: > + case eModeThumb: > // Set the T bit. > m_new_inst_cpsr |= MASK_CPSR_T; > break; > > Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp > URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=143403&r1=143402&r2=143403&view=diff > ============================================================================== > --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original) > +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Mon Oct 31 18:51:19 2011 > @@ -1012,7 +1012,17 @@ > std::auto_ptr line_table_ap(new LineTable(sc.comp_unit)); > if (line_table_ap.get()) > { > - ParseDWARFLineTableCallbackInfo info = { line_table_ap.get(), m_obj_file->GetSectionList(), 0, 0, m_debug_map_symfile != NULL, false}; > + ParseDWARFLineTableCallbackInfo info = { > + line_table_ap.get(), > + m_obj_file->GetSectionList(), > + 0, > + 0, > + m_debug_map_symfile != NULL, > + false, > + DWARFDebugLine::Row(), > + SectionSP(), > + SectionSP() > + }; > uint32_t offset = cu_line_offset; > DWARFDebugLine::ParseStatementTable(get_debug_line_data(), &offset, ParseDWARFLineTableCallback, &info); > sc.comp_unit->SetLineTable(line_table_ap.release()); > @@ -3516,14 +3526,14 @@ > else > { > const char *namespace_name = die->GetAttributeValueAsString(this, curr_cu, DW_AT_name, NULL); > - if (namespace_name) > + clang::DeclContext *containing_decl_ctx = GetClangDeclContextContainingDIE (curr_cu, die, NULL); > + namespace_decl = GetClangASTContext().GetUniqueNamespaceDeclaration (namespace_name, containing_decl_ctx); > + LogSP log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO)); > + if (log) > { > - clang::DeclContext *containing_decl_ctx = GetClangDeclContextContainingDIE (curr_cu, die, NULL); > - namespace_decl = GetClangASTContext().GetUniqueNamespaceDeclaration (namespace_name, containing_decl_ctx); > - LogSP log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO)); > - if (log) > + const char *object_name = m_obj_file->GetModule()->GetObjectName().GetCString(); > + if (namespace_name) > { > - const char *object_name = m_obj_file->GetModule()->GetObjectName().GetCString(); > log->Printf ("ASTContext => %p: 0x%8.8llx: DW_TAG_namespace with DW_AT_name(\"%s\") => clang::NamespaceDecl * %p in %s/%s%s%s%s (original = %p)", > GetClangASTContext().getASTContext(), > MakeUserID(die->GetOffset()), > @@ -3536,11 +3546,24 @@ > object_name ? "(" : "", > namespace_decl->getOriginalNamespace()); > } > - > - if (namespace_decl) > - LinkDeclContextToDIE((clang::DeclContext*)namespace_decl, die); > - return namespace_decl; > + else > + { > + log->Printf ("ASTContext => %p: 0x%8.8llx: DW_TAG_namespace (anonymous) => clang::NamespaceDecl * %p in %s/%s%s%s%s (original = %p)", > + GetClangASTContext().getASTContext(), > + MakeUserID(die->GetOffset()), > + namespace_decl, > + m_obj_file->GetFileSpec().GetDirectory().GetCString(), > + m_obj_file->GetFileSpec().GetFilename().GetCString(), > + object_name ? "(" : "", > + object_name ? object_name : "", > + object_name ? "(" : "", > + namespace_decl->getOriginalNamespace()); > + } > } > + > + if (namespace_decl) > + LinkDeclContextToDIE((clang::DeclContext*)namespace_decl, die); > + return namespace_decl; > } > } > return NULL; > > Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp > URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=143403&r1=143402&r2=143403&view=diff > ============================================================================== > --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) > +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Mon Oct 31 18:51:19 2011 > @@ -4299,12 +4299,13 @@ > ClangASTContext::GetUniqueNamespaceDeclaration (const char *name, DeclContext *decl_ctx) > { > NamespaceDecl *namespace_decl = NULL; > + ASTContext *ast = getASTContext(); > + TranslationUnitDecl *translation_unit_decl = ast->getTranslationUnitDecl (); > + if (decl_ctx == NULL) > + decl_ctx = translation_unit_decl; > + > if (name) > { > - ASTContext *ast = getASTContext(); > - if (decl_ctx == NULL) > - decl_ctx = ast->getTranslationUnitDecl(); > - > IdentifierInfo &identifier_info = ast->Idents.get(name); > DeclarationName decl_name (&identifier_info); > clang::DeclContext::lookup_result result = decl_ctx->lookup(decl_name); > @@ -4317,12 +4318,61 @@ > > namespace_decl = NamespaceDecl::Create(*ast, decl_ctx, SourceLocation(), SourceLocation(), &identifier_info); > > - decl_ctx->addDecl (namespace_decl); > + decl_ctx->addDecl (namespace_decl); > + } > + else > + { > + if (decl_ctx == translation_unit_decl) > + { > + namespace_decl = translation_unit_decl->getAnonymousNamespace(); > + if (namespace_decl) > + return namespace_decl; > + > + namespace_decl = NamespaceDecl::Create(*ast, decl_ctx, SourceLocation(), SourceLocation(), NULL); > + translation_unit_decl->setAnonymousNamespace (namespace_decl); > + translation_unit_decl->addDecl (namespace_decl); > + assert (namespace_decl == translation_unit_decl->getAnonymousNamespace()); > + } > + else > + { > + NamespaceDecl *parent_namespace_decl = cast(decl_ctx); > + if (parent_namespace_decl) > + { > + namespace_decl = parent_namespace_decl->getAnonymousNamespace(); > + if (namespace_decl) > + return namespace_decl; > + namespace_decl = NamespaceDecl::Create(*ast, decl_ctx, SourceLocation(), SourceLocation(), NULL); > + parent_namespace_decl->setAnonymousNamespace (namespace_decl); > + parent_namespace_decl->addDecl (namespace_decl); > + assert (namespace_decl == parent_namespace_decl->getAnonymousNamespace()); > + } > + else > + { > + // BAD!!! > + } > + } > > + > + if (namespace_decl) > + { > + // If we make it here, we are creating the anonymous namespace decl > + // for the first time, so we need to do the using directive magic > + // like SEMA does > + UsingDirectiveDecl* using_directive_decl = UsingDirectiveDecl::Create (*ast, > + decl_ctx, > + SourceLocation(), > + SourceLocation(), > + NestedNameSpecifierLoc(), > + SourceLocation(), > + namespace_decl, > + decl_ctx); > + using_directive_decl->setImplicit(); > + decl_ctx->addDecl(using_directive_decl); > + } > + } > #ifdef LLDB_CONFIGURATION_DEBUG > - VerifyDecl(namespace_decl); > + VerifyDecl(namespace_decl); > #endif > - } > return namespace_decl; > } > > > Modified: lldb/trunk/tools/darwin-debug/darwin-debug.cpp > URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/darwin-debug/darwin-debug.cpp?rev=143403&r1=143402&r2=143403&view=diff > ============================================================================== > --- lldb/trunk/tools/darwin-debug/darwin-debug.cpp (original) > +++ lldb/trunk/tools/darwin-debug/darwin-debug.cpp Mon Oct 31 18:51:19 2011 > @@ -178,7 +178,7 @@ > > cpu_type_t cpu_type = 0; > bool show_usage = false; > - char ch; > + int ch; > int disable_aslr = 0; // By default we disable ASLR > int pass_env = 1; > std::string unix_socket_name; > > Modified: lldb/trunk/tools/lldb-platform/lldb-platform.cpp > URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-platform/lldb-platform.cpp?rev=143403&r1=143402&r2=143403&view=diff > ============================================================================== > --- lldb/trunk/tools/lldb-platform/lldb-platform.cpp (original) > +++ lldb/trunk/tools/lldb-platform/lldb-platform.cpp Mon Oct 31 18:51:19 2011 > @@ -73,7 +73,7 @@ > Args log_args; > Error error; > std::string listen_host_port; > - char ch; > + int ch; > Debugger::Initialize(); > > // ConnectionMachPort a; > > > _______________________________________________ > lldb-commits mailing list > lldb-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits From gclayton at apple.com Mon Oct 31 20:10:56 2011 From: gclayton at apple.com (Greg Clayton) Date: Tue, 01 Nov 2011 01:10:56 -0000 Subject: [Lldb-commits] [lldb] r143408 - in /lldb/trunk: lldb.xcodeproj/project.pbxproj resources/LLDB-Info.plist tools/debugserver/debugserver.xcodeproj/project.pbxproj Message-ID: <20111101011057.0933E2A6C12C@llvm.org> Author: gclayton Date: Mon Oct 31 20:10:56 2011 New Revision: 143408 URL: http://llvm.org/viewvc/llvm-project?rev=143408&view=rev Log: Bumped Xcode project version to lldb-84 and debugserver-149. Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/resources/LLDB-Info.plist lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=143408&r1=143407&r2=143408&view=diff ============================================================================== --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Oct 31 20:10:56 2011 @@ -3695,9 +3695,9 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 83; + CURRENT_PROJECT_VERSION = 84; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 83; + DYLIB_CURRENT_VERSION = 84; EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3745,10 +3745,10 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 83; + CURRENT_PROJECT_VERSION = 84; DEAD_CODE_STRIPPING = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 83; + DYLIB_CURRENT_VERSION = 84; EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3794,8 +3794,8 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 83; - DYLIB_CURRENT_VERSION = 83; + CURRENT_PROJECT_VERSION = 84; + DYLIB_CURRENT_VERSION = 84; EXECUTABLE_EXTENSION = a; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3832,8 +3832,8 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 83; - DYLIB_CURRENT_VERSION = 83; + CURRENT_PROJECT_VERSION = 84; + DYLIB_CURRENT_VERSION = 84; EXECUTABLE_EXTENSION = a; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3870,8 +3870,8 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 83; - DYLIB_CURRENT_VERSION = 83; + CURRENT_PROJECT_VERSION = 84; + DYLIB_CURRENT_VERSION = 84; EXECUTABLE_EXTENSION = a; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3945,7 +3945,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 83; + CURRENT_PROJECT_VERSION = 84; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"", @@ -3974,10 +3974,10 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 83; + CURRENT_PROJECT_VERSION = 84; DEAD_CODE_STRIPPING = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 83; + DYLIB_CURRENT_VERSION = 84; EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -4100,7 +4100,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 83; + CURRENT_PROJECT_VERSION = 84; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"", @@ -4130,7 +4130,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 83; + CURRENT_PROJECT_VERSION = 84; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"", Modified: lldb/trunk/resources/LLDB-Info.plist URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/resources/LLDB-Info.plist?rev=143408&r1=143407&r2=143408&view=diff ============================================================================== --- lldb/trunk/resources/LLDB-Info.plist (original) +++ lldb/trunk/resources/LLDB-Info.plist Mon Oct 31 20:10:56 2011 @@ -17,7 +17,7 @@ CFBundleSignature ???? CFBundleVersion - 83 + 84 CFBundleName ${EXECUTABLE_NAME} Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=143408&r1=143407&r2=143408&view=diff ============================================================================== --- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original) +++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Mon Oct 31 20:10:56 2011 @@ -475,7 +475,7 @@ i386, ); COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 148; + CURRENT_PROJECT_VERSION = 149; "GCC_VERSION[sdk=iphoneos*][arch=*]" = 4.2; "GCC_VERSION[sdk=macosx*][arch=*]" = ""; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -496,7 +496,7 @@ x86_64, i386, ); - CURRENT_PROJECT_VERSION = 148; + CURRENT_PROJECT_VERSION = 149; DEAD_CODE_STRIPPING = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; @@ -517,7 +517,7 @@ x86_64, i386, ); - CURRENT_PROJECT_VERSION = 148; + CURRENT_PROJECT_VERSION = 149; DEAD_CODE_STRIPPING = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; @@ -535,7 +535,7 @@ buildSettings = { "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 148; + CURRENT_PROJECT_VERSION = 149; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks; "FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = ( @@ -575,7 +575,7 @@ "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 148; + CURRENT_PROJECT_VERSION = 149; FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks; "FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = ( "$(SDKROOT)/System/Library/PrivateFrameworks", @@ -615,7 +615,7 @@ "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 148; + CURRENT_PROJECT_VERSION = 149; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks; "FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = ( From gclayton at apple.com Mon Oct 31 20:11:17 2011 From: gclayton at apple.com (Greg Clayton) Date: Tue, 01 Nov 2011 01:11:17 -0000 Subject: [Lldb-commits] [lldb] r143409 - /lldb/tags/lldb-84/ Message-ID: <20111101011117.4225A3524002@llvm.org> Author: gclayton Date: Mon Oct 31 20:11:17 2011 New Revision: 143409 URL: http://llvm.org/viewvc/llvm-project?rev=143409&view=rev Log: lldb-84 Added: lldb/tags/lldb-84/ - copied from r143408, lldb/trunk/ From jingham at apple.com Mon Oct 31 21:46:54 2011 From: jingham at apple.com (Jim Ingham) Date: Tue, 01 Nov 2011 02:46:54 -0000 Subject: [Lldb-commits] [lldb] r143419 - in /lldb/trunk: include/lldb/Expression/ include/lldb/Target/ source/Expression/ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/ source/Plugins/Process/Utility/ source/Target/ test/lang/objc/objc-checker/ Message-ID: <20111101024655.102C32A6C12C@llvm.org> Author: jingham Date: Mon Oct 31 21:46:54 2011 New Revision: 143419 URL: http://llvm.org/viewvc/llvm-project?rev=143419&view=rev Log: Enhanced the ObjC DynamicCheckerFunction to test for "object responds to selector" as well as "object borked"... Also made the error when the checker fails reflect this fact rather than report a crash at 0x0. Also a little cleanup: - StopInfoMachException had a redundant copy of the description string. - ThreadPlanCallFunction had a redundant copy of the thread, and had a copy of the process that it didn't really need. Added: lldb/trunk/test/lang/objc/objc-checker/ lldb/trunk/test/lang/objc/objc-checker/Makefile lldb/trunk/test/lang/objc/objc-checker/TestObjCCheckers.py lldb/trunk/test/lang/objc/objc-checker/main.m Modified: lldb/trunk/include/lldb/Expression/IRDynamicChecks.h lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h lldb/trunk/include/lldb/Target/ThreadPlanCallUserExpression.h lldb/trunk/source/Expression/IRDynamicChecks.cpp lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.h lldb/trunk/source/Target/ThreadPlanCallFunction.cpp lldb/trunk/source/Target/ThreadPlanCallUserExpression.cpp Modified: lldb/trunk/include/lldb/Expression/IRDynamicChecks.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/IRDynamicChecks.h?rev=143419&r1=143418&r2=143419&view=diff ============================================================================== --- lldb/trunk/include/lldb/Expression/IRDynamicChecks.h (original) +++ lldb/trunk/include/lldb/Expression/IRDynamicChecks.h Mon Oct 31 21:46:54 2011 @@ -10,6 +10,7 @@ #ifndef liblldb_IRDynamicChecks_h_ #define liblldb_IRDynamicChecks_h_ +#include "lldb-types.h" #include "llvm/Pass.h" namespace llvm { @@ -74,6 +75,8 @@ bool Install (Stream &error_stream, ExecutionContext &exe_ctx); + bool DoCheckersExplainStop (lldb::addr_t addr, Stream &message); + std::auto_ptr m_valid_pointer_check; std::auto_ptr m_objc_object_check; }; Modified: lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h?rev=143419&r1=143418&r2=143419&view=diff ============================================================================== --- lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h (original) +++ lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h Mon Oct 31 21:46:54 2011 @@ -127,6 +127,12 @@ { return m_real_stop_info_sp; } + + lldb::addr_t + GetStopAddress () + { + return m_stop_address; + } protected: void ReportRegisterState (const char *message); @@ -148,8 +154,8 @@ Address m_function_addr; Address m_start_addr; lldb::addr_t m_function_sp; - Process &m_process; - Thread &m_thread; +// Process &m_process; +// Thread &m_thread; Thread::RegisterCheckpoint m_register_backup; lldb::ThreadPlanSP m_subplan_sp; LanguageRuntime *m_cxx_language_runtime; @@ -161,6 +167,7 @@ // This gets set in DoTakedown. lldb::ValueSP m_return_value_sp; // If this contains a valid pointer, use the ABI to extract values when complete bool m_takedown_done; // We want to ensure we only do the takedown once. This ensures that. + lldb::addr_t m_stop_address; // This is the address we stopped at. Also set in DoTakedown; DISALLOW_COPY_AND_ASSIGN (ThreadPlanCallFunction); }; Modified: lldb/trunk/include/lldb/Target/ThreadPlanCallUserExpression.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanCallUserExpression.h?rev=143419&r1=143418&r2=143419&view=diff ============================================================================== --- lldb/trunk/include/lldb/Target/ThreadPlanCallUserExpression.h (original) +++ lldb/trunk/include/lldb/Target/ThreadPlanCallUserExpression.h Mon Oct 31 21:46:54 2011 @@ -48,6 +48,9 @@ m_user_expression_sp.reset(); } + virtual lldb::StopInfoSP + GetRealStopInfo(); + protected: private: ClangUserExpression::ClangUserExpressionSP m_user_expression_sp; // This is currently just used to ensure the Modified: lldb/trunk/source/Expression/IRDynamicChecks.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRDynamicChecks.cpp?rev=143419&r1=143418&r2=143419&view=diff ============================================================================== --- lldb/trunk/source/Expression/IRDynamicChecks.cpp (original) +++ lldb/trunk/source/Expression/IRDynamicChecks.cpp Mon Oct 31 21:46:54 2011 @@ -74,6 +74,25 @@ return true; } +bool +DynamicCheckerFunctions::DoCheckersExplainStop (lldb::addr_t addr, Stream &message) +{ + // FIXME: We have to get the checkers to know why they scotched the call in more detail, + // so we can print a better message here. + if (m_valid_pointer_check.get() != NULL && m_valid_pointer_check->ContainsAddress(addr)) + { + message.Printf ("Attempted to dereference an invalid pointer."); + return true; + } + else if (m_objc_object_check.get() != NULL && m_objc_object_check->ContainsAddress(addr)) + { + message.Printf ("Attempted to dereference an invalid ObjC Object or send it an unrecognized selector"); + return true; + } + return false; +} + + static std::string PrintValue(llvm::Value *V, bool truncate = false) { Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=143419&r1=143418&r2=143419&view=diff ============================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original) +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Mon Oct 31 21:46:54 2011 @@ -99,7 +99,7 @@ m_isa_to_name_cache(), m_isa_to_parent_cache() { - m_has_object_getClass = (objc_module_sp->FindFirstSymbolWithNameAndType(ConstString("gdb_object_getClass")) != NULL); + m_has_object_getClass = (objc_module_sp->FindFirstSymbolWithNameAndType(ConstString("gdb_object_getClass"), eSymbolTypeCode) != NULL); } bool @@ -492,38 +492,56 @@ ClangUtilityFunction * AppleObjCRuntimeV2::CreateObjectChecker(const char *name) { - char check_function_code[1024]; + char check_function_code[2048]; int len = 0; if (m_has_object_getClass) { len = ::snprintf (check_function_code, sizeof(check_function_code), - "extern \"C\" void *gdb_object_getClass(void *); \n" - "extern \"C\" void \n" - "%s(void *$__lldb_arg_obj, void *$__lldb_arg_selector) \n" - "{ \n" - " if ($__lldb_arg_obj == (void *)0) \n" - " return; // nil is ok \n" - " if (!gdb_object_getClass($__lldb_arg_obj)) \n" - " *((volatile int *)0) = 'ocgc'; \n" - "} \n", + "extern \"C\" void *gdb_object_getClass(void *); \n" + "extern \"C\" int printf(const char *format, ...); \n" + "extern \"C\" void \n" + "%s(void *$__lldb_arg_obj, void *$__lldb_arg_selector) \n" + "{ \n" + " if ($__lldb_arg_obj == (void *)0) \n" + " return; // nil is ok \n" + " if (!gdb_object_getClass($__lldb_arg_obj)) \n" + " *((volatile int *)0) = 'ocgc'; \n" + " else if ($__lldb_arg_selector != (void *)0) \n" + " { \n" + " signed char responds = (signed char) [(id) $__lldb_arg_obj \n" + " respondsToSelector: \n" + " (struct objc_selector *) $__lldb_arg_selector]; \n" + " if (responds == (signed char) 0) \n" + " *((volatile int *)0) = 'ocgc'; \n" + " } \n" + "} \n", name); } else { len = ::snprintf (check_function_code, sizeof(check_function_code), - "extern \"C\" void *gdb_class_getClass(void *); \n" - "extern \"C\" void \n" - "%s(void *$__lldb_arg_obj, void *$__lldb_arg_selector) \n" - "{ \n" - " if ($__lldb_arg_obj == (void *)0) \n" - " return; // nil is ok \n" - " void **$isa_ptr = (void **)$__lldb_arg_obj; \n" - " if (*$isa_ptr == (void *)0 || !gdb_class_getClass(*$isa_ptr)) \n" - " *((volatile int *)0) = 'ocgc'; \n" - "} \n", + "extern \"C\" void *gdb_class_getClass(void *); \n" + "extern \"C\" int printf(const char *format, ...); \n" + "extern \"C\" void \n" + "%s(void *$__lldb_arg_obj, void *$__lldb_arg_selector) \n" + "{ \n" + " if ($__lldb_arg_obj == (void *)0) \n" + " return; // nil is ok \n" + " void **$isa_ptr = (void **)$__lldb_arg_obj; \n" + " if (*$isa_ptr == (void *)0 || !gdb_class_getClass(*$isa_ptr)) \n" + " *((volatile int *)0) = 'ocgc'; \n" + " else if ($__lldb_arg_selector != (void *)0) \n" + " { \n" + " signed char responds = (signed char) [(id) $__lldb_arg_obj \n" + " respondsToSelector: \n" + " (struct objc_selector *) $__lldb_arg_selector]; \n" + " if (responds == (signed char) 0) \n" + " *((volatile int *)0) = 'ocgc'; \n" + " } \n" + "} \n", name); } Modified: lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.h?rev=143419&r1=143418&r2=143419&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.h (original) +++ lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.h Mon Oct 31 21:46:54 2011 @@ -67,7 +67,6 @@ uint32_t m_exc_data_count; uint64_t m_exc_code; uint64_t m_exc_subcode; - std::string m_description; }; Modified: lldb/trunk/source/Target/ThreadPlanCallFunction.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanCallFunction.cpp?rev=143419&r1=143418&r2=143419&view=diff ============================================================================== --- lldb/trunk/source/Target/ThreadPlanCallFunction.cpp (original) +++ lldb/trunk/source/Target/ThreadPlanCallFunction.cpp Mon Oct 31 21:46:54 2011 @@ -47,9 +47,8 @@ m_stop_other_threads (stop_other_threads), m_function_addr (function), m_function_sp (NULL), - m_process (thread.GetProcess()), - m_thread (thread), - m_takedown_done (false) + m_takedown_done (false), + m_stop_address (LLDB_INVALID_ADDRESS) { SetOkayToDiscard (discard_on_error); @@ -163,8 +162,6 @@ m_stop_other_threads (stop_other_threads), m_function_addr (function), m_function_sp(NULL), - m_process (thread.GetProcess()), - m_thread (thread), m_takedown_done (false) { SetOkayToDiscard (discard_on_error); @@ -294,6 +291,7 @@ if (log) log->Printf ("DoTakedown called for thread 0x%4.4llx, m_valid: %d complete: %d.\n", m_thread.GetID(), m_valid, IsPlanComplete()); m_takedown_done = true; + m_stop_address = m_thread.GetStackFrameAtIndex(0)->GetRegisterContext()->GetPC(); m_real_stop_info_sp = GetPrivateStopReason(); m_thread.RestoreThreadStateFromCheckpoint(m_stored_thread_state); SetPlanComplete(); @@ -324,7 +322,7 @@ } else { - s->Printf("Thread plan to call 0x%llx", m_function_addr.GetLoadAddress(&m_process.GetTarget())); + s->Printf("Thread plan to call 0x%llx", m_function_addr.GetLoadAddress(&m_thread.GetProcess().GetTarget())); } } @@ -474,8 +472,8 @@ void ThreadPlanCallFunction::SetBreakpoints () { - m_cxx_language_runtime = m_process.GetLanguageRuntime(eLanguageTypeC_plus_plus); - m_objc_language_runtime = m_process.GetLanguageRuntime(eLanguageTypeObjC); + m_cxx_language_runtime = m_thread.GetProcess().GetLanguageRuntime(eLanguageTypeC_plus_plus); + m_objc_language_runtime = m_thread.GetProcess().GetLanguageRuntime(eLanguageTypeObjC); if (m_cxx_language_runtime) m_cxx_language_runtime->SetExceptionBreakpoints(); Modified: lldb/trunk/source/Target/ThreadPlanCallUserExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanCallUserExpression.cpp?rev=143419&r1=143418&r2=143419&view=diff ============================================================================== --- lldb/trunk/source/Target/ThreadPlanCallUserExpression.cpp (original) +++ lldb/trunk/source/Target/ThreadPlanCallUserExpression.cpp Mon Oct 31 21:46:54 2011 @@ -55,6 +55,20 @@ void ThreadPlanCallUserExpression::GetDescription (Stream *s, lldb::DescriptionLevel level) -{ +{ ThreadPlanCallFunction::GetDescription (s, level); } + +StopInfoSP +ThreadPlanCallUserExpression::GetRealStopInfo() +{ + StopInfoSP stop_info_sp = ThreadPlanCallFunction::GetRealStopInfo(); + lldb::addr_t addr = GetStopAddress(); + DynamicCheckerFunctions *checkers = m_thread.GetProcess().GetDynamicCheckers(); + StreamString s; + + if (checkers && checkers->DoCheckersExplainStop(addr, s)) + stop_info_sp->SetDescription(s.GetData()); + + return stop_info_sp; +} Added: lldb/trunk/test/lang/objc/objc-checker/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-checker/Makefile?rev=143419&view=auto ============================================================================== --- lldb/trunk/test/lang/objc/objc-checker/Makefile (added) +++ lldb/trunk/test/lang/objc/objc-checker/Makefile Mon Oct 31 21:46:54 2011 @@ -0,0 +1,6 @@ +LEVEL = ../../../make + +OBJC_SOURCES := main.m +LDFLAGS = $(CFLAGS) -lobjc -framework Foundation + +include $(LEVEL)/Makefile.rules Added: lldb/trunk/test/lang/objc/objc-checker/TestObjCCheckers.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-checker/TestObjCCheckers.py?rev=143419&view=auto ============================================================================== --- lldb/trunk/test/lang/objc/objc-checker/TestObjCCheckers.py (added) +++ lldb/trunk/test/lang/objc/objc-checker/TestObjCCheckers.py Mon Oct 31 21:46:54 2011 @@ -0,0 +1,85 @@ +""" +Use lldb Python API to make sure the dynamic checkers are doing their jobs. +""" + +import os, time +import re +import unittest2 +import lldb, lldbutil +from lldbtest import * + +class ObjCDynamicValueTestCase(TestBase): + + mydir = os.path.join("lang", "objc", "objc-checker") + + @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") + @python_api_test + def test_get_dynamic_objc_vals_with_dsym(self): + """Test that checkers catch unrecognized selectors""" + self.buildDsym() + self.do_test_checkers() + + @python_api_test + def test_get_objc_dynamic_vals_with_dwarf(self): + """Test that checkers catch unrecognized selectors""" + self.buildDwarf() + self.do_test_checkers() + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + + # Find the line number to break for main.c. + + self.source_name = 'main.m' + + def do_test_checkers (self): + """Make sure the dynamic checkers catch messages to unrecognized selectors""" + exe = os.path.join(os.getcwd(), "a.out") + + # Create a target from the debugger. + + target = self.dbg.CreateTarget (exe) + self.assertTrue(target, VALID_TARGET) + + # Set up our breakpoints: + + + main_bkpt = target.BreakpointCreateBySourceRegex ("Set a breakpoint here.", lldb.SBFileSpec (self.source_name)) + self.assertTrue(main_bkpt and + main_bkpt.GetNumLocations() == 1, + VALID_BREAKPOINT) + + # Now launch the process, and do not stop at the entry point. + process = target.LaunchSimple (None, None, os.getcwd()) + + self.assertTrue(process.GetState() == lldb.eStateStopped, + PROCESS_STOPPED) + + threads = lldbutil.get_threads_stopped_at_breakpoint (process, main_bkpt) + self.assertTrue (len(threads) == 1) + thread = threads[0] + + # + # The class Simple doesn't have a count method. Make sure that we don't + # actually try to send count but catch it as an unrecognized selector. + + frame = thread.GetFrameAtIndex(0) + expr_value = frame.EvaluateExpression("(int) [my_simple count]", False) + expr_error = expr_value.GetError() + + self.assertTrue (expr_error.Fail()) + + # Make sure the call produced no NSLog stdout. + stdout = process.GetSTDOUT(100) + self.assertTrue (len(stdout) == 0) + + # Make sure the error is helpful: + err_string = expr_error.GetCString() + self.assertTrue ("selector" in err_string) + +if __name__ == '__main__': + import atexit + lldb.SBDebugger.Initialize() + atexit.register(lambda: lldb.SBDebugger.Terminate()) + unittest2.main() Added: lldb/trunk/test/lang/objc/objc-checker/main.m URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-checker/main.m?rev=143419&view=auto ============================================================================== --- lldb/trunk/test/lang/objc/objc-checker/main.m (added) +++ lldb/trunk/test/lang/objc/objc-checker/main.m Mon Oct 31 21:46:54 2011 @@ -0,0 +1,30 @@ +#import + + at interface Simple : NSObject +{ + int _value; +} +- (int) value; +- (void) setValue: (int) newValue; + at end + + at implementation Simple +- (int) value +{ + return _value; +} + +- (void) setValue: (int) newValue +{ + _value = newValue; +} + at end + +int main () +{ + Simple *my_simple = [[Simple alloc] init]; + my_simple.value = 20; + // Set a breakpoint here. + NSLog (@"Object has value: %d.", my_simple.value); + return 0; +} From clattner at apple.com Mon Oct 31 22:17:57 2011 From: clattner at apple.com (Chris Lattner) Date: Mon, 31 Oct 2011 20:17:57 -0700 Subject: [Lldb-commits] [lldb] r143380 - in /lldb/trunk: include/lldb/Core/MappedHash.h source/Plugins/Process/Utility/RegisterContextDarwin_arm.h source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h In-Reply-To: <20111031225042.0F2DA3524001@llvm.org> References: <20111031225042.0F2DA3524001@llvm.org> Message-ID: <26FC1560-6351-4F58-8619-22688E1656B7@apple.com> On Oct 31, 2011, at 3:50 PM, Daniel Dunbar wrote: > Author: ddunbar > Date: Mon Oct 31 17:50:41 2011 > New Revision: 143380 > > URL: http://llvm.org/viewvc/llvm-project?rev=143380&view=rev > Log: > warnings: Fix several uses of trailing comma on enumeration extensions. FWIW, it would be completely reasonable for lldb to switch to C++'11. -Chris From jmolenda at apple.com Mon Oct 31 22:21:25 2011 From: jmolenda at apple.com (Jason Molenda) Date: Tue, 01 Nov 2011 03:21:25 -0000 Subject: [Lldb-commits] [lldb] r143423 - in /lldb/trunk/source/Plugins/Process/Utility: RegisterContextLLDB.cpp RegisterContextLLDB.h UnwindLLDB.cpp UnwindLLDB.h Message-ID: <20111101032125.A4B9A3524002@llvm.org> Author: jmolenda Date: Mon Oct 31 22:21:25 2011 New Revision: 143423 URL: http://llvm.org/viewvc/llvm-project?rev=143423&view=rev Log: Restructure the relationship between UnwindLLDB and the RegisterContextLLDBs it contains. Previously RegisterContextLLDB objects had a pointer to their "next" frame down the stack. e.g. stack starts at frame 0; frame 3 has a pointer to frame 2. This is used to retreive callee saved register values. When debugging an inferior that has blown out its own stack, however, this could result in lldb blowing out its own stack while recursing down to retrieve register values. RegisterContextLLDB no longer has a pointer to its next frame; it has a reference to the UnwindLLDB which contains it. When it needs to retrieve a reg value, it asks the UnwindLLDB for that reg value and UnwindLLDB iterates through the frames until it finds a location. Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.h lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp?rev=143423&r1=143422&r2=143423&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp (original) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp Mon Oct 31 22:21:25 2011 @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -#include "RegisterContextLLDB.h" #include "lldb/lldb-private.h" #include "lldb/Core/Address.h" @@ -28,20 +27,21 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "RegisterContextLLDB.h" + using namespace lldb; using namespace lldb_private; - RegisterContextLLDB::RegisterContextLLDB ( Thread& thread, const SharedPtr &next_frame, SymbolContext& sym_ctx, - uint32_t frame_number + uint32_t frame_number, + UnwindLLDB& unwind_lldb ) : RegisterContext (thread, frame_number), m_thread(thread), - m_next_frame(next_frame), m_fast_unwind_plan_sp (), m_full_unwind_plan_sp (), m_all_registers_available(false), @@ -54,7 +54,8 @@ m_sym_ctx(sym_ctx), m_sym_ctx_valid (false), m_frame_number (frame_number), - m_registers() + m_registers(), + m_parent_unwind (unwind_lldb) { m_sym_ctx.Clear(); m_sym_ctx_valid = false; @@ -70,8 +71,8 @@ // This same code exists over in the GetFullUnwindPlanForFrame() but it may not have been executed yet if (IsFrameZero() - || m_next_frame->m_frame_type == eSigtrampFrame - || m_next_frame->m_frame_type == eDebuggerFrame) + || next_frame->m_frame_type == eSigtrampFrame + || next_frame->m_frame_type == eDebuggerFrame) { m_all_registers_available = true; } @@ -207,7 +208,7 @@ return; } - if (!m_next_frame->IsValid()) + if (!GetNextFrame().get() || !GetNextFrame()->IsValid()) { m_frame_type = eNotAValidFrame; return; @@ -331,8 +332,8 @@ // Or if we're in the middle of the stack (and not "above" an asynchronous event like sigtramp), // and our "current" pc is the start of a function... if (m_sym_ctx_valid - && m_next_frame->m_frame_type != eSigtrampFrame - && m_next_frame->m_frame_type != eDebuggerFrame + && GetNextFrame()->m_frame_type != eSigtrampFrame + && GetNextFrame()->m_frame_type != eDebuggerFrame && addr_range.GetBaseAddress().IsValid() && addr_range.GetBaseAddress().GetSection() == m_current_pc.GetSection() && addr_range.GetBaseAddress().GetOffset() == m_current_pc.GetOffset()) @@ -453,7 +454,7 @@ // break out to avoid a possible infinite loop in lldb trying to unwind the stack. addr_t next_frame_cfa; addr_t next_next_frame_cfa = LLDB_INVALID_ADDRESS; - if (m_next_frame.get() && m_next_frame->GetCFA(next_frame_cfa)) + if (GetNextFrame().get() && GetNextFrame()->GetCFA(next_frame_cfa)) { bool repeating_frames = false; if (next_frame_cfa == m_cfa) @@ -462,7 +463,7 @@ } else { - if (m_next_frame->GetNextFrame() && m_next_frame->GetNextFrame()->GetCFA(next_next_frame_cfa) + if (GetNextFrame()->GetNextFrame() && GetNextFrame()->GetNextFrame()->GetCFA(next_next_frame_cfa) && next_next_frame_cfa == m_cfa) { repeating_frames = true; @@ -492,10 +493,7 @@ bool RegisterContextLLDB::IsFrameZero () const { - if (m_next_frame.get () == NULL) - return true; - else - return false; + return m_frame_number == 0; } @@ -575,8 +573,8 @@ bool behaves_like_zeroth_frame = false; if (IsFrameZero () - || m_next_frame->m_frame_type == eSigtrampFrame - || m_next_frame->m_frame_type == eDebuggerFrame) + || GetNextFrame()->m_frame_type == eSigtrampFrame + || GetNextFrame()->m_frame_type == eDebuggerFrame) { behaves_like_zeroth_frame = true; // If this frame behaves like a 0th frame (currently executing or @@ -720,7 +718,7 @@ } bool -RegisterContextLLDB::ReadRegisterValueFromRegisterLocation (RegisterLocation regloc, +RegisterContextLLDB::ReadRegisterValueFromRegisterLocation (lldb_private::UnwindLLDB::RegisterLocation regloc, const RegisterInfo *reg_info, RegisterValue &value) { @@ -730,7 +728,7 @@ switch (regloc.type) { - case eRegisterInRegister: + case UnwindLLDB::RegisterLocation::eRegisterInRegister: { const RegisterInfo *other_reg_info = GetRegisterInfoAtIndex(regloc.location.register_number); if (IsFrameZero ()) @@ -739,20 +737,20 @@ } else { - success = m_next_frame->ReadRegister (other_reg_info, value); + success = GetNextFrame()->ReadRegister (other_reg_info, value); } } break; - case eRegisterValueInferred: + case UnwindLLDB::RegisterLocation::eRegisterValueInferred: success = value.SetUInt (regloc.location.inferred_value, reg_info->byte_size); break; - case eRegisterNotSaved: + case UnwindLLDB::RegisterLocation::eRegisterNotSaved: break; - case eRegisterSavedAtHostMemoryLocation: + case UnwindLLDB::RegisterLocation::eRegisterSavedAtHostMemoryLocation: assert ("FIXME debugger inferior function call unwind"); break; - case eRegisterSavedAtMemoryLocation: + case UnwindLLDB::RegisterLocation::eRegisterSavedAtMemoryLocation: { Error error (ReadRegisterValueFromMemory(reg_info, regloc.location.target_memory_location, @@ -769,7 +767,7 @@ } bool -RegisterContextLLDB::WriteRegisterValueToRegisterLocation (RegisterLocation regloc, +RegisterContextLLDB::WriteRegisterValueToRegisterLocation (lldb_private::UnwindLLDB::RegisterLocation regloc, const RegisterInfo *reg_info, const RegisterValue &value) { @@ -780,7 +778,7 @@ switch (regloc.type) { - case eRegisterInRegister: + case UnwindLLDB::RegisterLocation::eRegisterInRegister: { const RegisterInfo *other_reg_info = GetRegisterInfoAtIndex(regloc.location.register_number); if (IsFrameZero ()) @@ -789,17 +787,17 @@ } else { - success = m_next_frame->WriteRegister (other_reg_info, value); + success = GetNextFrame()->WriteRegister (other_reg_info, value); } } break; - case eRegisterValueInferred: - case eRegisterNotSaved: + case UnwindLLDB::RegisterLocation::eRegisterValueInferred: + case UnwindLLDB::RegisterLocation::eRegisterNotSaved: break; - case eRegisterSavedAtHostMemoryLocation: + case UnwindLLDB::RegisterLocation::eRegisterSavedAtHostMemoryLocation: assert ("FIXME debugger inferior function call unwind"); break; - case eRegisterSavedAtMemoryLocation: + case UnwindLLDB::RegisterLocation::eRegisterSavedAtMemoryLocation: { Error error (WriteRegisterValueToMemory (reg_info, regloc.location.target_memory_location, @@ -825,14 +823,14 @@ // Answer the question: Where did THIS frame save the CALLER frame ("previous" frame)'s register value? bool -RegisterContextLLDB::SavedLocationForRegister (uint32_t lldb_regnum, RegisterLocation ®loc) +RegisterContextLLDB::SavedLocationForRegister (uint32_t lldb_regnum, lldb_private::UnwindLLDB::RegisterLocation ®loc, bool check_next_frame) { LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND)); // Have we already found this register location? if (!m_registers.empty()) { - std::map::const_iterator iterator; + std::map::const_iterator iterator; iterator = m_registers.find (lldb_regnum); if (iterator != m_registers.end()) { @@ -849,7 +847,7 @@ { // make sure we won't lose precision copying an addr_t (m_cfa) into a uint64_t (.inferred_value) assert (sizeof (addr_t) <= sizeof (uint64_t)); - regloc.type = eRegisterValueInferred; + regloc.type = UnwindLLDB::RegisterLocation::eRegisterValueInferred; regloc.location.inferred_value = m_cfa; m_registers[lldb_regnum] = regloc; return true; @@ -930,7 +928,7 @@ if (have_unwindplan_regloc == false) { - // If a volatile register is being requested, we don't want to forward m_next_frame's register contents + // If a volatile register is being requested, we don't want to forward the next frame's register contents // up the stack -- the register is not retrievable at this frame. ABI *abi = m_thread.GetProcess().GetABI().get(); if (abi) @@ -951,8 +949,8 @@ if (IsFrameZero ()) { // This is frame 0 - we should return the actual live register context value - RegisterLocation new_regloc; - new_regloc.type = eRegisterInRegister; + lldb_private::UnwindLLDB::RegisterLocation new_regloc; + new_regloc.type = UnwindLLDB::RegisterLocation::eRegisterInRegister; new_regloc.location.register_number = lldb_regnum; m_registers[lldb_regnum] = new_regloc; regloc = new_regloc; @@ -960,7 +958,8 @@ } else { - return m_next_frame->SavedLocationForRegister (lldb_regnum, regloc); + if (check_next_frame) + return m_parent_unwind.SearchForSavedLocationForRegister (lldb_regnum, regloc, m_frame_number - 1); } if (log) { @@ -974,8 +973,8 @@ // unwindplan_regloc has valid contents about where to retrieve the register if (unwindplan_regloc.IsUnspecified()) { - RegisterLocation new_regloc; - new_regloc.type = eRegisterNotSaved; + lldb_private::UnwindLLDB::RegisterLocation new_regloc; + new_regloc.type = UnwindLLDB::RegisterLocation::eRegisterNotSaved; m_registers[lldb_regnum] = new_regloc; if (log) { @@ -1000,14 +999,17 @@ } else { - return m_next_frame->SavedLocationForRegister (lldb_regnum, regloc); + if (check_next_frame) + return m_parent_unwind.SearchForSavedLocationForRegister (lldb_regnum, regloc, m_frame_number - 1); + else + return false; } } if (unwindplan_regloc.IsCFAPlusOffset()) { int offset = unwindplan_regloc.GetOffset(); - regloc.type = eRegisterValueInferred; + regloc.type = UnwindLLDB::RegisterLocation::eRegisterValueInferred; regloc.location.inferred_value = m_cfa + offset; m_registers[lldb_regnum] = regloc; return true; @@ -1016,7 +1018,7 @@ if (unwindplan_regloc.IsAtCFAPlusOffset()) { int offset = unwindplan_regloc.GetOffset(); - regloc.type = eRegisterSavedAtMemoryLocation; + regloc.type = UnwindLLDB::RegisterLocation::eRegisterSavedAtMemoryLocation; regloc.location.target_memory_location = m_cfa + offset; m_registers[lldb_regnum] = regloc; return true; @@ -1036,7 +1038,7 @@ } return false; } - regloc.type = eRegisterInRegister; + regloc.type = UnwindLLDB::RegisterLocation::eRegisterInRegister; regloc.location.register_number = row_regnum_in_lldb; m_registers[lldb_regnum] = regloc; return true; @@ -1058,14 +1060,14 @@ val = result.GetScalar().ULongLong(); if (unwindplan_regloc.IsDWARFExpression()) { - regloc.type = eRegisterValueInferred; + regloc.type = UnwindLLDB::RegisterLocation::eRegisterValueInferred; regloc.location.inferred_value = val; m_registers[lldb_regnum] = regloc; return true; } else { - regloc.type = eRegisterSavedAtMemoryLocation; + regloc.type = UnwindLLDB::RegisterLocation::eRegisterSavedAtMemoryLocation; regloc.location.target_memory_location = val; m_registers[lldb_regnum] = regloc; return true; @@ -1135,8 +1137,8 @@ return false; } - RegisterLocation regloc; - if (!m_next_frame->SavedLocationForRegister (lldb_regnum, regloc)) + lldb_private::UnwindLLDB::RegisterLocation regloc; + if (!m_parent_unwind.SearchForSavedLocationForRegister (lldb_regnum, regloc, m_frame_number - 1)) { return false; } @@ -1177,9 +1179,9 @@ return m_thread.GetRegisterContext()->ReadRegister (reg_info, value); } - RegisterLocation regloc; + lldb_private::UnwindLLDB::RegisterLocation regloc; // Find out where the NEXT frame saved THIS frame's register contents - if (!m_next_frame->SavedLocationForRegister (lldb_regnum, regloc)) + if (!m_parent_unwind.SearchForSavedLocationForRegister (lldb_regnum, regloc, m_frame_number - 1)) return false; return ReadRegisterValueFromRegisterLocation (regloc, reg_info, value); @@ -1212,9 +1214,9 @@ return m_thread.GetRegisterContext()->WriteRegister (reg_info, value); } - RegisterLocation regloc; + lldb_private::UnwindLLDB::RegisterLocation regloc; // Find out where the NEXT frame saved THIS frame's register contents - if (!m_next_frame->SavedLocationForRegister (lldb_regnum, regloc)) + if (!m_parent_unwind.SearchForSavedLocationForRegister (lldb_regnum, regloc, m_frame_number - 1)) return false; return WriteRegisterValueToRegisterLocation (regloc, reg_info, value); @@ -1253,9 +1255,12 @@ RegisterContextLLDB::SharedPtr -RegisterContextLLDB::GetNextFrame () +RegisterContextLLDB::GetNextFrame () const { - return m_next_frame; + RegisterContextLLDB::SharedPtr regctx; + if (m_frame_number == 0) + return regctx; + return m_parent_unwind.GetRegisterContextForFrameNum (m_frame_number - 1); } // Retrieve the address of the start of the function of THIS frame @@ -1302,3 +1307,4 @@ return false; } } + Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.h?rev=143423&r1=143422&r2=143423&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.h (original) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.h Mon Oct 31 22:21:25 2011 @@ -16,6 +16,11 @@ #include "lldb/Target/RegisterContext.h" #include "lldb/Symbol/UnwindPlan.h" #include "lldb/Symbol/SymbolContext.h" +#include "UnwindLLDB.h" + +namespace lldb_private { + +class UnwindLLDB; class RegisterContextLLDB : public lldb_private::RegisterContext { @@ -25,7 +30,7 @@ RegisterContextLLDB (lldb_private::Thread &thread, const SharedPtr& next_frame, lldb_private::SymbolContext& sym_ctx, - uint32_t frame_number); + uint32_t frame_number, lldb_private::UnwindLLDB& unwind_lldb); /// // pure virtual functions from the base class that we must implement @@ -86,33 +91,11 @@ eNotAValidFrame // this frame is invalid for some reason - most likely it is past the top (end) of the stack }; - enum RegisterLocationTypes - { - eRegisterNotSaved = 0, // register was not preserved by callee. If volatile reg, is unavailable - eRegisterSavedAtMemoryLocation, // register is saved at a specific word of target mem (target_memory_location) - eRegisterInRegister, // register is available in a (possible other) register (register_number) - eRegisterSavedAtHostMemoryLocation, // register is saved at a word in lldb's address space - eRegisterValueInferred // register val was computed (and is in inferred_value) - }; - - struct RegisterLocation - { - int type; - union - { - lldb::addr_t target_memory_location; - uint32_t register_number; // in eRegisterKindLLDB register numbering system - void* host_memory_location; - uint64_t inferred_value; // eRegisterValueInferred - e.g. stack pointer == cfa + offset - } location; - }; - + // UnwindLLDB needs to pass around references to RegisterLocations + friend class UnwindLLDB; // Indicates whether this frame is frame zero -- the currently - // executing frame -- or not. If it is not frame zero, m_next_frame's - // shared pointer holds a pointer to the RegisterContextLLDB - // object "below" this frame, i.e. this frame called m_next_frame's - // function. + // executing frame -- or not. bool IsFrameZero () const; @@ -123,7 +106,7 @@ InitializeNonZerothFrame(); SharedPtr - GetNextFrame (); + GetNextFrame () const; // Provide a location for where THIS function saved the CALLER's register value // Or a frame "below" this one saved it, i.e. a function called by this one, preserved a register that this @@ -137,22 +120,25 @@ // stack have saved the register anywhere, it is safe to assume that frame 0's register values are still the same // as the requesting frame's. // + // NB this function takes a "check_next_frame" boolean which indicates whether it should call back to the + // containing UnwindLLDB object to iterate the search down the stack (true) or if this call should look for + // a register save for that reg in the current frame only (false). Allows UnwindLLDB to iterate through the + // RegisterContextLLDB's instead of using recursion to find saved register values. bool - SavedLocationForRegister (uint32_t lldb_regnum, RegisterLocation ®loc); + SavedLocationForRegister (uint32_t lldb_regnum, lldb_private::UnwindLLDB::RegisterLocation ®loc, bool check_next_frame); bool - ReadRegisterValueFromRegisterLocation (RegisterLocation regloc, + ReadRegisterValueFromRegisterLocation (lldb_private::UnwindLLDB::RegisterLocation regloc, const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value); bool - WriteRegisterValueToRegisterLocation (RegisterLocation regloc, + WriteRegisterValueToRegisterLocation (lldb_private::UnwindLLDB::RegisterLocation regloc, const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value); // Get the contents of a general purpose (address-size) register for this frame - // (usually retrieved from the m_next_frame) - // m_base_reg_ectx and m_next_frame should both be initialized appropriately before calling. + // (usually retrieved from the next frame) bool ReadGPRValue (int register_kind, uint32_t regnum, lldb::addr_t &value); @@ -164,8 +150,6 @@ lldb_private::Thread& m_thread; - SharedPtr m_next_frame; - /// // The following tell us how to retrieve the CALLER's register values (ie the "previous" frame, aka the frame above) // i.e. where THIS frame saved them @@ -194,9 +178,11 @@ lldb_private::SymbolContext& m_sym_ctx; bool m_sym_ctx_valid; // if ResolveSymbolContextForAddress fails, don't try to use m_sym_ctx - uint32_t m_frame_number; // What stack frame level this frame is - used for debug logging + uint32_t m_frame_number; // What stack frame this RegisterContext is - std::map m_registers; // where to find reg values for this frame + std::map m_registers; // where to find reg values for this frame + + lldb_private::UnwindLLDB& m_parent_unwind; // The UnwindLLDB that is creating this RegisterContextLLDB //------------------------------------------------------------------ // For RegisterContextLLDB only @@ -205,4 +191,6 @@ DISALLOW_COPY_AND_ASSIGN (RegisterContextLLDB); }; +} // namespace lldb_private + #endif // lldb_RegisterContextLLDB_h_ Modified: lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp?rev=143423&r1=143422&r2=143423&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp (original) +++ lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp Mon Oct 31 22:21:25 2011 @@ -69,10 +69,10 @@ { // First, set up the 0th (initial) frame CursorSP first_cursor_sp(new Cursor ()); - RegisterContextLLDB::SharedPtr reg_ctx_sp (new RegisterContextLLDB (m_thread, - RegisterContextLLDB::SharedPtr(), + RegisterContextLLDBSharedPtr reg_ctx_sp (new RegisterContextLLDB (m_thread, + RegisterContextLLDBSharedPtr(), first_cursor_sp->sctx, - 0)); + 0, *this)); if (reg_ctx_sp.get() == NULL) return false; @@ -104,10 +104,10 @@ return false; uint32_t cur_idx = m_frames.size (); - RegisterContextLLDB::SharedPtr reg_ctx_sp(new RegisterContextLLDB (m_thread, + RegisterContextLLDBSharedPtr reg_ctx_sp(new RegisterContextLLDB (m_thread, m_frames[cur_idx - 1]->reg_ctx, cursor_sp->sctx, - cur_idx)); + cur_idx, *this)); if (reg_ctx_sp.get() == NULL) return false; @@ -225,3 +225,28 @@ reg_ctx_sp = m_frames[idx]->reg_ctx; return reg_ctx_sp; } + +UnwindLLDB::RegisterContextLLDBSharedPtr +UnwindLLDB::GetRegisterContextForFrameNum (uint32_t frame_num) +{ + RegisterContextLLDBSharedPtr reg_ctx_sp; + if (frame_num >= m_frames.size()) + return reg_ctx_sp; + reg_ctx_sp = m_frames[frame_num]->reg_ctx; + return reg_ctx_sp; +} + +bool +UnwindLLDB::SearchForSavedLocationForRegister (uint32_t lldb_regnum, lldb_private::UnwindLLDB::RegisterLocation ®loc, uint32_t starting_frame_num) +{ + int64_t frame_num = starting_frame_num; + if (frame_num >= m_frames.size()) + return false; + while (frame_num >= 0) + { + if (m_frames[frame_num]->reg_ctx->SavedLocationForRegister (lldb_regnum, regloc, false)) + return true; + frame_num--; + } + return false; +} Modified: lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h?rev=143423&r1=143422&r2=143423&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h (original) +++ lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h Mon Oct 31 22:21:25 2011 @@ -18,10 +18,10 @@ #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Unwind.h" -#include "RegisterContextLLDB.h" - namespace lldb_private { +class RegisterContextLLDB; + class UnwindLLDB : public lldb_private::Unwind { public: @@ -29,8 +29,29 @@ virtual ~UnwindLLDB() { } - + protected: + friend class lldb_private::RegisterContextLLDB; + + struct RegisterLocation { + enum RegisterLocationTypes + { + eRegisterNotSaved = 0, // register was not preserved by callee. If volatile reg, is unavailable + eRegisterSavedAtMemoryLocation, // register is saved at a specific word of target mem (target_memory_location) + eRegisterInRegister, // register is available in a (possible other) register (register_number) + eRegisterSavedAtHostMemoryLocation, // register is saved at a word in lldb's address space + eRegisterValueInferred // register val was computed (and is in inferred_value) + }; + int type; + union + { + lldb::addr_t target_memory_location; + uint32_t register_number; // in eRegisterKindLLDB register numbering system + void* host_memory_location; + uint64_t inferred_value; // eRegisterValueInferred - e.g. stack pointer == cfa + offset + } location; + }; + void DoClear() { @@ -48,13 +69,27 @@ lldb::RegisterContextSP DoCreateRegisterContextForFrame (lldb_private::StackFrame *frame); + typedef lldb::SharedPtr::Type RegisterContextLLDBSharedPtr; + + // Needed to retrieve the "next" frame (e.g. frame 2 needs to retrieve frame 1's RegisterContextLLDB) + // The RegisterContext for frame_num must already exist or this returns an empty shared pointer. + RegisterContextLLDBSharedPtr + GetRegisterContextForFrameNum (uint32_t frame_num); + + // Iterate over the RegisterContextLLDB's in our m_frames vector, look for the first one that + // has a saved location for this reg. + bool + SearchForSavedLocationForRegister (uint32_t lldb_regnum, lldb_private::UnwindLLDB::RegisterLocation ®loc, uint32_t starting_frame_num); + + private: + struct Cursor { lldb::addr_t start_pc; // The start address of the function/symbol for this frame - current pc if unknown lldb::addr_t cfa; // The canonical frame address for this stack frame lldb_private::SymbolContext sctx; // A symbol context we'll contribute to & provide to the StackFrame creation - RegisterContextLLDB::SharedPtr reg_ctx; // These are all RegisterContextLLDB's + RegisterContextLLDBSharedPtr reg_ctx; // These are all RegisterContextLLDB's Cursor () : start_pc (LLDB_INVALID_ADDRESS), cfa (LLDB_INVALID_ADDRESS), sctx(), reg_ctx() { } private: From daniel at zuster.org Tue Nov 1 12:32:01 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 01 Nov 2011 17:32:01 -0000 Subject: [Lldb-commits] [lldb] r143466 - /lldb/trunk/lib/Makefile Message-ID: <20111101173201.4E38D2A6C12C@llvm.org> Author: ddunbar Date: Tue Nov 1 12:32:01 2011 New Revision: 143466 URL: http://llvm.org/viewvc/llvm-project?rev=143466&view=rev Log: build: liblldb now depends on the linker library Modified: lldb/trunk/lib/Makefile Modified: lldb/trunk/lib/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lib/Makefile?rev=143466&r1=143465&r2=143466&view=diff ============================================================================== --- lldb/trunk/lib/Makefile (original) +++ lldb/trunk/lib/Makefile Tue Nov 1 12:32:01 2011 @@ -67,7 +67,7 @@ include $(LLDB_LEVEL)/../../Makefile.config LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \ - instrumentation ipo selectiondag jit mc mcjit + instrumentation ipo selectiondag jit mc mcjit linker ifeq ($(HOST_OS),Darwin) USEDLIBS += lldbHostMacOSX.a \ From scallanan at apple.com Tue Nov 1 12:33:54 2011 From: scallanan at apple.com (Sean Callanan) Date: Tue, 01 Nov 2011 17:33:54 -0000 Subject: [Lldb-commits] [lldb] r143467 - in /lldb/trunk/source/Expression: ClangExpressionParser.cpp IRForTarget.cpp Message-ID: <20111101173354.8B3BE2A6C12C@llvm.org> Author: spyffe Date: Tue Nov 1 12:33:54 2011 New Revision: 143467 URL: http://llvm.org/viewvc/llvm-project?rev=143467&view=rev Log: Minor logging changes: added logging right before the expression makes it to the JIT, and made some logging only appear in verbose mode. Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp lldb/trunk/source/Expression/IRForTarget.cpp Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionParser.cpp?rev=143467&r1=143466&r2=143467&view=diff ============================================================================== --- lldb/trunk/source/Expression/ClangExpressionParser.cpp (original) +++ lldb/trunk/source/Expression/ClangExpressionParser.cpp Tue Nov 1 12:33:54 2011 @@ -539,7 +539,19 @@ RecordingMemoryManager *jit_memory_manager = new RecordingMemoryManager(); std::string error_string; - + + if (log) + { + std::string s; + raw_string_ostream oss(s); + + module->print(oss, NULL); + + oss.flush(); + + log->Printf ("Module being sent to JIT: \n%s", s.c_str()); + } + #if defined (USE_STANDARD_JIT) m_execution_engine.reset(llvm::ExecutionEngine::createJIT (module, &error_string, @@ -578,10 +590,17 @@ // Errors usually cause failures in the JIT, but if we're lucky we get here. + if (!function) + { + err.SetErrorToGenericError(); + err.SetErrorStringWithFormat("Couldn't find '%s' in the JITted module", function_name.c_str()); + return err; + } + if (!fun_ptr) { err.SetErrorToGenericError(); - err.SetErrorString("Couldn't JIT the function"); + err.SetErrorStringWithFormat("'%s' was in the JITted module but wasn't lowered", function_name.c_str()); return err; } Modified: lldb/trunk/source/Expression/IRForTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRForTarget.cpp?rev=143467&r1=143466&r2=143467&view=diff ============================================================================== --- lldb/trunk/source/Expression/IRForTarget.cpp (original) +++ lldb/trunk/source/Expression/IRForTarget.cpp Tue Nov 1 12:33:54 2011 @@ -2556,7 +2556,7 @@ } } - if (log) + if (log && log->GetVerbose()) { std::string s; raw_string_ostream oss(s); @@ -2669,7 +2669,7 @@ return false; } - if (log) + if (log && log->GetVerbose()) { std::string s; raw_string_ostream oss(s); From scallanan at apple.com Tue Nov 1 13:07:13 2011 From: scallanan at apple.com (Sean Callanan) Date: Tue, 01 Nov 2011 18:07:13 -0000 Subject: [Lldb-commits] [lldb] r143469 - in /lldb/trunk: include/lldb/Symbol/ClangASTContext.h source/Expression/ClangExpressionDeclMap.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp source/Symbol/ClangASTContext.cpp Message-ID: <20111101180713.733F02A6C12C@llvm.org> Author: spyffe Date: Tue Nov 1 13:07:13 2011 New Revision: 143469 URL: http://llvm.org/viewvc/llvm-project?rev=143469&view=rev Log: Added the capability (turned off for now) to mark a method as __attribute__ ((used)) when adding it to a class. This functionality is useful when stopped in anonymous namespaces: expressions attached to classes in anonymous namespaces are typically elided by Clang's CodeGen because they have no namespaces are intended not to be externally visible. __attribute__ ((used)) forces CodeGen to emit the function. Right now, __attribute__ ((used)) causes the JIT not to emit the function, so we're not enabling it until we fix that. Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=143469&r1=143468&r2=143469&view=diff ============================================================================== --- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Tue Nov 1 13:07:13 2011 @@ -279,7 +279,8 @@ bool is_virtual, bool is_static, bool is_inline, - bool is_explicit); + bool is_explicit, + bool is_attr_used); clang::CXXMethodDecl * AddMethodToCXXRecordType (lldb::clang_type_t record_opaque_type, @@ -289,7 +290,8 @@ bool is_virtual, bool is_static, bool is_inline, - bool is_explicit) + bool is_explicit, + bool is_attr_used) { return ClangASTContext::AddMethodToCXXRecordType (getASTContext(), @@ -300,7 +302,8 @@ is_virtual, is_static, is_inline, - is_explicit); + is_explicit, + is_attr_used); } class TemplateParameterInfos Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=143469&r1=143468&r2=143469&view=diff ============================================================================== --- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original) +++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Tue Nov 1 13:07:13 2011 @@ -3005,17 +3005,18 @@ args[0] = ClangASTContext::GetVoidPtrType(parser_ast_context, false); - void *method_type = ClangASTContext::CreateFunctionType (parser_ast_context, - ClangASTContext::GetBuiltInType_void(parser_ast_context), - args, - 1, - false, - ClangASTContext::GetTypeQualifiers(copied_type)); - + clang_type_t method_type = ClangASTContext::CreateFunctionType (parser_ast_context, + ClangASTContext::GetBuiltInType_void(parser_ast_context), + args, + 1, + false, + ClangASTContext::GetTypeQualifiers(copied_type)); + const bool is_virtual = false; const bool is_static = false; const bool is_inline = false; const bool is_explicit = false; + const bool is_attr_used = false; ClangASTContext::AddMethodToCXXRecordType (parser_ast_context, copied_type, @@ -3025,7 +3026,8 @@ is_virtual, is_static, is_inline, - is_explicit); + is_explicit, + is_attr_used); } context.AddTypeDecl(copied_type); Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=143469&r1=143468&r2=143469&view=diff ============================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue Nov 1 13:07:13 2011 @@ -4570,6 +4570,8 @@ m_obj_file->GetFileSpec().GetDirectory().GetCString(), m_obj_file->GetFileSpec().GetFilename().GetCString()); + const bool is_attr_used = false; + cxx_method_decl = ast.AddMethodToCXXRecordType (class_opaque_type, type_name_cstr, clang_type, @@ -4577,7 +4579,8 @@ is_virtual, is_static, is_inline, - is_explicit); + is_explicit, + is_attr_used); LinkDeclContextToDIE(ClangASTContext::GetAsDeclContext(cxx_method_decl), die); type_handled = cxx_method_decl != NULL; Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=143469&r1=143468&r2=143469&view=diff ============================================================================== --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue Nov 1 13:07:13 2011 @@ -1574,7 +1574,8 @@ bool is_virtual, bool is_static, bool is_inline, - bool is_explicit + bool is_explicit, + bool is_attr_used ) { if (!record_opaque_type || !method_opaque_type || !name) @@ -1701,6 +1702,9 @@ cxx_method_decl->setAccess (access_specifier); cxx_method_decl->setVirtualAsWritten (is_virtual); + if (is_attr_used) + cxx_method_decl->addAttr(::new (*ast) UsedAttr(SourceRange(), *ast)); + // Populate the method decl with parameter decls llvm::SmallVector params; From johnny.chen at apple.com Tue Nov 1 13:46:52 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Tue, 01 Nov 2011 18:46:52 -0000 Subject: [Lldb-commits] [lldb] r143474 - /lldb/trunk/test/lang/cpp/namespace/TestNamespace.py Message-ID: <20111101184652.D3E902A6C12C@llvm.org> Author: johnny Date: Tue Nov 1 13:46:52 2011 New Revision: 143474 URL: http://llvm.org/viewvc/llvm-project?rev=143474&view=rev Log: Change the expected substrings for 'frame variable' output to: '::my_uint_t', 'anon_uint = 0' from: '(my_uint_t) anon_uint = 0' to make the test suite clean with ToT. Modified: lldb/trunk/test/lang/cpp/namespace/TestNamespace.py Modified: lldb/trunk/test/lang/cpp/namespace/TestNamespace.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/namespace/TestNamespace.py?rev=143474&r1=143473&r2=143474&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/namespace/TestNamespace.py (original) +++ lldb/trunk/test/lang/cpp/namespace/TestNamespace.py Tue Nov 1 13:46:52 2011 @@ -56,7 +56,7 @@ slist = ['(int) a = 12', 'anon_uint', 'a_uint', 'b_uint', 'y_uint'] if sys.platform.startswith("darwin") and self.getCompiler() in ['clang', 'llvm-gcc']: slist = ['(int) a = 12', - '(my_uint_t) anon_uint = 0', + '::my_uint_t', 'anon_uint = 0', '(A::uint_t) a_uint = 1', '(A::B::uint_t) b_uint = 2', '(Y::uint_t) y_uint = 3'] From johnny.chen at apple.com Tue Nov 1 14:22:09 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Tue, 01 Nov 2011 19:22:09 -0000 Subject: [Lldb-commits] [lldb] r143476 - /lldb/trunk/test/bench-history Message-ID: <20111101192209.3ECB92A6C12C@llvm.org> Author: johnny Date: Tue Nov 1 14:22:09 2011 New Revision: 143476 URL: http://llvm.org/viewvc/llvm-project?rev=143476&view=rev Log: Add bench entries. Modified: lldb/trunk/test/bench-history Modified: lldb/trunk/test/bench-history URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/bench-history?rev=143476&r1=143475&r2=143476&view=diff ============================================================================== --- lldb/trunk/test/bench-history (original) +++ lldb/trunk/test/bench-history Tue Nov 1 14:22:09 2011 @@ -126,3 +126,21 @@ lldb expr cmd benchmark: Avg: 0.207557 (Laps: 25, Total Elapsed Time: 5.188913, min=0.203918, max=0.241022) lldb disassembly benchmark: Avg: 0.092959 (Laps: 10, Total Elapsed Time: 0.929594, min=0.089094, max=0.109135) +r143469 +# No performance regression. +[11:45:27] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:' +lldb startup delay (create fresh target) benchmark: Avg: 0.112890 (Laps: 30, Total Elapsed Time: 3.386693, min=0.101696, max=0.414717) +lldb startup delay (set first breakpoint) benchmark: Avg: 0.133955 (Laps: 30, Total Elapsed Time: 4.018643, min=0.101611, max=1.050222) +lldb startup delay (run to breakpoint) benchmark: Avg: 0.470838 (Laps: 30, Total Elapsed Time: 14.125148, min=0.425866, max=1.437070) +lldb frame variable benchmark: Avg: 1.608339 (Laps: 20, Total Elapsed Time: 32.166771, min=1.579538, max=1.721902) +lldb stepping benchmark: Avg: 0.136881 (Laps: 50, Total Elapsed Time: 6.844043, min=0.101149, max=1.835094) +lldb expr cmd benchmark: Avg: 0.207529 (Laps: 25, Total Elapsed Time: 5.188236, min=0.203476, max=0.241281) +lldb disassembly benchmark: Avg: 0.036412 (Laps: 10, Total Elapsed Time: 0.364124, min=0.031895, max=0.069457) +[12:14:54] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:' +lldb startup delay (create fresh target) benchmark: Avg: 0.103313 (Laps: 30, Total Elapsed Time: 3.099402, min=0.101813, max=0.126989) +lldb startup delay (set first breakpoint) benchmark: Avg: 0.102558 (Laps: 30, Total Elapsed Time: 3.076735, min=0.101576, max=0.107419) +lldb startup delay (run to breakpoint) benchmark: Avg: 0.438302 (Laps: 30, Total Elapsed Time: 13.149063, min=0.431972, max=0.449742) +lldb frame variable benchmark: Avg: 1.610409 (Laps: 20, Total Elapsed Time: 32.208184, min=1.575063, max=1.724046) +lldb stepping benchmark: Avg: 0.103874 (Laps: 50, Total Elapsed Time: 5.193698, min=0.101364, max=0.186751) +lldb expr cmd benchmark: Avg: 0.207476 (Laps: 25, Total Elapsed Time: 5.186895, min=0.203365, max=0.240869) +lldb disassembly benchmark: Avg: 0.090917 (Laps: 10, Total Elapsed Time: 0.909167, min=0.089431, max=0.099787) \ No newline at end of file From scallanan at apple.com Tue Nov 1 18:38:03 2011 From: scallanan at apple.com (Sean Callanan) Date: Tue, 01 Nov 2011 23:38:03 -0000 Subject: [Lldb-commits] [lldb] r143520 - in /lldb/trunk: include/lldb/Expression/IRForTarget.h source/Expression/IRForTarget.cpp test/lang/objc/objc-class-method/ test/lang/objc/objc-class-method/Makefile test/lang/objc/objc-class-method/TestObjCClassMethod.py test/lang/objc/objc-class-method/class.m Message-ID: <20111101233803.EBD3F2A6C12C@llvm.org> Author: spyffe Date: Tue Nov 1 18:38:03 2011 New Revision: 143520 URL: http://llvm.org/viewvc/llvm-project?rev=143520&view=rev Log: Added functionality to call Objective-C class methods correctly, and added a testcase to check that it works. The main problem here is that Objective-C class method selectors are external references stored in a special data structure in the LLVM IR module for an expression. I just had to extract them and ensure that the real class object locations were properly resolved. Added: lldb/trunk/test/lang/objc/objc-class-method/ lldb/trunk/test/lang/objc/objc-class-method/Makefile lldb/trunk/test/lang/objc/objc-class-method/TestObjCClassMethod.py lldb/trunk/test/lang/objc/objc-class-method/class.m Modified: lldb/trunk/include/lldb/Expression/IRForTarget.h lldb/trunk/source/Expression/IRForTarget.cpp Modified: lldb/trunk/include/lldb/Expression/IRForTarget.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/IRForTarget.h?rev=143520&r1=143519&r2=143520&view=diff ============================================================================== --- lldb/trunk/include/lldb/Expression/IRForTarget.h (original) +++ lldb/trunk/include/lldb/Expression/IRForTarget.h Tue Nov 1 18:38:03 2011 @@ -488,6 +488,19 @@ //------------------------------------------------------------------ bool HandleSymbol (llvm::Value *symbol); + + //------------------------------------------------------------------ + /// Handle a single externally-defined Objective-C class + /// + /// @param[in] classlist_reference + /// The reference, usually "01L_OBJC_CLASSLIST_REFERENCES_$_n" + /// where n (if present) is an index. + /// + /// @return + /// True on success; false otherwise + //------------------------------------------------------------------ + bool + HandleObjCClass(llvm::Value *classlist_reference); //------------------------------------------------------------------ /// Handle all the arguments to a function call Modified: lldb/trunk/source/Expression/IRForTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRForTarget.cpp?rev=143520&r1=143519&r2=143520&view=diff ============================================================================== --- lldb/trunk/source/Expression/IRForTarget.cpp (original) +++ lldb/trunk/source/Expression/IRForTarget.cpp Tue Nov 1 18:38:03 2011 @@ -1704,6 +1704,63 @@ } bool +IRForTarget::HandleObjCClass(Value *classlist_reference) +{ + lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); + + GlobalVariable *global_variable = dyn_cast(classlist_reference); + + if (!global_variable) + return false; + + Constant *initializer = global_variable->getInitializer(); + + if (!initializer) + return false; + + if (!initializer->hasName()) + return false; + + StringRef name(initializer->getName()); + lldb_private::ConstString name_cstr(name.str().c_str()); + lldb::addr_t class_ptr = m_decl_map->GetSymbolAddress(name_cstr); + + if (log) + log->Printf("Found reference to Objective-C class %s (0x%llx)", name_cstr.AsCString(), (unsigned long long)class_ptr); + + if (class_ptr == LLDB_INVALID_ADDRESS) + return false; + + if (global_variable->use_begin() == global_variable->use_end()) + return false; + + LoadInst *load_instruction = NULL; + + for (Value::use_iterator i = global_variable->use_begin(), e = global_variable->use_end(); + i != e; + ++i) + { + if ((load_instruction = dyn_cast(*i))) + break; + } + + if (!load_instruction) + return false; + + IntegerType *intptr_ty = Type::getIntNTy(m_module->getContext(), + (m_module->getPointerSize() == Module::Pointer64) ? 64 : 32); + + Constant *class_addr = ConstantInt::get(intptr_ty, (uint64_t)class_ptr); + Constant *class_bitcast = ConstantExpr::getIntToPtr(class_addr, load_instruction->getType()); + + load_instruction->replaceAllUsesWith(class_bitcast); + + load_instruction->eraseFromParent(); + + return true; +} + +bool IRForTarget::ResolveCalls(BasicBlock &basic_block) { ///////////////////////////////////////////////////////////////////////// @@ -1742,7 +1799,9 @@ (*global).getName().str().c_str(), DeclForGlobal(global)); - if ((*global).getName().str().find("OBJC_IVAR") == 0) + std::string global_name = (*global).getName().str(); + + if (global_name.find("OBJC_IVAR") == 0) { if (!HandleSymbol(global)) { @@ -1752,6 +1811,16 @@ return false; } } + else if (global_name.find("OBJC_CLASSLIST_REFERENCES_$") != global_name.npos) + { + if (!HandleObjCClass(global)) + { + if (m_error_stream) + m_error_stream->Printf("Error [IRForTarget]: Couldn't resolve the class for an Objective-C static method call\n"); + + return false; + } + } else if (DeclForGlobal(global)) { if (!MaybeHandleVariable (global)) Added: lldb/trunk/test/lang/objc/objc-class-method/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-class-method/Makefile?rev=143520&view=auto ============================================================================== --- lldb/trunk/test/lang/objc/objc-class-method/Makefile (added) +++ lldb/trunk/test/lang/objc/objc-class-method/Makefile Tue Nov 1 18:38:03 2011 @@ -0,0 +1,6 @@ +LEVEL = ../../../make + +OBJC_SOURCES := class.m +LDFLAGS = $(CFLAGS) -lobjc -framework Foundation + +include $(LEVEL)/Makefile.rules Added: lldb/trunk/test/lang/objc/objc-class-method/TestObjCClassMethod.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-class-method/TestObjCClassMethod.py?rev=143520&view=auto ============================================================================== --- lldb/trunk/test/lang/objc/objc-class-method/TestObjCClassMethod.py (added) +++ lldb/trunk/test/lang/objc/objc-class-method/TestObjCClassMethod.py Tue Nov 1 18:38:03 2011 @@ -0,0 +1,69 @@ +"""Test calling functions in class methods.""" + +import os, time +import unittest2 +import lldb +import lldbutil +from lldbtest import * + +class TestObjCStaticMethod(TestBase): + + mydir = os.path.join("lang", "objc", "objc-class-method") + + @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") + @python_api_test + + def test_with_dsym_and_python_api(self): + """Test calling functions in class methods.""" + self.buildDsym() + self.objc_class_method() + + @python_api_test + def test_with_dwarf_and_python_api(self): + """Test calling functions in class methods.""" + self.buildDwarf() + self.objc_class_method() + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + # Find the line numbers to break inside main(). + self.main_source = "class.m" + self.break_line = line_number(self.main_source, '// Set breakpoint here.') + + #rdar://problem/9745789 "expression" can't call functions in class methods + def objc_class_method(self): + """Test calling class methods.""" + exe = os.path.join(os.getcwd(), "a.out") + + target = self.dbg.CreateTarget(exe) + self.assertTrue(target, VALID_TARGET) + + bpt = target.BreakpointCreateByLocation(self.main_source, self.break_line) + self.assertTrue(bpt, VALID_BREAKPOINT) + + # Now launch the process, and do not stop at entry point. + process = target.LaunchSimple (None, None, os.getcwd()) + + self.assertTrue(process, PROCESS_IS_VALID) + + # The stop reason of the thread should be breakpoint. + thread_list = lldbutil.get_threads_stopped_at_breakpoint (process, bpt) + + # Make sure we stopped at the first breakpoint. + self.assertTrue (len(thread_list) != 0, "No thread stopped at our breakpoint.") + self.assertTrue (len(thread_list) == 1, "More than one thread stopped at our breakpoint.") + + # Now make sure we can call a function in the class method we've stopped in. + frame = thread_list[0].GetFrameAtIndex(0) + self.assertTrue (frame, "Got a valid frame 0 frame.") + + cmd_value = frame.EvaluateExpression ("(int)[Foo doSomethingWithString:@\"Hello\"]") + self.assertTrue (cmd_value.IsValid()) + self.assertTrue (cmd_value.GetValueAsUnsigned() == 5) + +if __name__ == '__main__': + import atexit + lldb.SBDebugger.Initialize() + atexit.register(lambda: lldb.SBDebugger.Terminate()) + unittest2.main() Added: lldb/trunk/test/lang/objc/objc-class-method/class.m URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-class-method/class.m?rev=143520&view=auto ============================================================================== --- lldb/trunk/test/lang/objc/objc-class-method/class.m (added) +++ lldb/trunk/test/lang/objc/objc-class-method/class.m Tue Nov 1 18:38:03 2011 @@ -0,0 +1,24 @@ +#import + + at interface Foo : NSObject ++(int) doSomethingWithString: (NSString *) string; +-(int) doSomethingInstance: (NSString *) string; + at end + + at implementation Foo ++(int) doSomethingWithString: (NSString *) string +{ + NSLog (@"String is: %@.", string); + return [string length]; +} + +-(int) doSomethingInstance: (NSString *)string +{ + return [Foo doSomethingWithString:string]; +} + at end + +int main() +{ + return 0; // Set breakpoint here. +} From scallanan at apple.com Tue Nov 1 20:38:59 2011 From: scallanan at apple.com (Sean Callanan) Date: Wed, 02 Nov 2011 01:38:59 -0000 Subject: [Lldb-commits] [lldb] r143526 - in /lldb/trunk: include/lldb/Symbol/ClangASTContext.h source/Expression/ClangExpressionDeclMap.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp source/Symbol/ClangASTContext.cpp Message-ID: <20111102013859.D85142A6C12C@llvm.org> Author: spyffe Date: Tue Nov 1 20:38:59 2011 New Revision: 143526 URL: http://llvm.org/viewvc/llvm-project?rev=143526&view=rev Log: Sometimes the debug information includes artifically- generated special member functions (constructors, destructors, etc.) for classes that don't really have them. We needed to mark these as artificial to reflect the debug information; this bug does that for constructors and destructors. The "etc." case (certain assignment operators, mostly) remains to be fixed. Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=143526&r1=143525&r2=143526&view=diff ============================================================================== --- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Tue Nov 1 20:38:59 2011 @@ -280,7 +280,8 @@ bool is_static, bool is_inline, bool is_explicit, - bool is_attr_used); + bool is_attr_used, + bool is_artificial); clang::CXXMethodDecl * AddMethodToCXXRecordType (lldb::clang_type_t record_opaque_type, @@ -291,7 +292,8 @@ bool is_static, bool is_inline, bool is_explicit, - bool is_attr_used) + bool is_attr_used, + bool is_artificial) { return ClangASTContext::AddMethodToCXXRecordType (getASTContext(), @@ -303,7 +305,8 @@ is_static, is_inline, is_explicit, - is_attr_used); + is_attr_used, + is_artificial); } class TemplateParameterInfos Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=143526&r1=143525&r2=143526&view=diff ============================================================================== --- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original) +++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Tue Nov 1 20:38:59 2011 @@ -3017,6 +3017,7 @@ const bool is_inline = false; const bool is_explicit = false; const bool is_attr_used = false; + const bool is_artificial = false; ClangASTContext::AddMethodToCXXRecordType (parser_ast_context, copied_type, @@ -3027,7 +3028,8 @@ is_static, is_inline, is_explicit, - is_attr_used); + is_attr_used, + is_artificial); } context.AddTypeDecl(copied_type); Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=143526&r1=143525&r2=143526&view=diff ============================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue Nov 1 20:38:59 2011 @@ -4298,6 +4298,7 @@ bool is_static = false; bool is_virtual = false; bool is_explicit = false; + bool is_artificial = false; dw_offset_t specification_die_offset = DW_INVALID_OFFSET; dw_offset_t abstract_origin_die_offset = DW_INVALID_OFFSET; @@ -4332,6 +4333,8 @@ case DW_AT_inline: is_inline = form_value.Unsigned() != 0; break; case DW_AT_virtuality: is_virtual = form_value.Unsigned() != 0; break; case DW_AT_explicit: is_explicit = form_value.Unsigned() != 0; break; + case DW_AT_artificial: is_artificial = form_value.Unsigned() != 0; break; + case DW_AT_external: if (form_value.Unsigned()) @@ -4351,11 +4354,9 @@ abstract_origin_die_offset = form_value.Reference(dwarf_cu); break; - case DW_AT_allocated: case DW_AT_associated: case DW_AT_address_class: - case DW_AT_artificial: case DW_AT_calling_convention: case DW_AT_data_location: case DW_AT_elemental: @@ -4580,7 +4581,8 @@ is_static, is_inline, is_explicit, - is_attr_used); + is_attr_used, + is_artificial); LinkDeclContextToDIE(ClangASTContext::GetAsDeclContext(cxx_method_decl), die); type_handled = cxx_method_decl != NULL; Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=143526&r1=143525&r2=143526&view=diff ============================================================================== --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue Nov 1 20:38:59 2011 @@ -1575,7 +1575,8 @@ bool is_static, bool is_inline, bool is_explicit, - bool is_attr_used + bool is_attr_used, + bool is_artificial ) { if (!record_opaque_type || !method_opaque_type || !name) @@ -1600,8 +1601,6 @@ DeclarationName decl_name (&identifier_table->get(name)); - const bool is_implicitly_declared = false; - const clang::FunctionType *function_Type = dyn_cast(method_qual_type.getTypePtr()); if (function_Type == NULL) @@ -1614,29 +1613,34 @@ unsigned int num_params = method_function_prototype->getNumArgs(); + CXXDestructorDecl *cxx_dtor_decl(NULL); + CXXConstructorDecl *cxx_ctor_decl(NULL); + if (name[0] == '~') { - cxx_method_decl = CXXDestructorDecl::Create (*ast, - cxx_record_decl, - SourceLocation(), - DeclarationNameInfo (ast->DeclarationNames.getCXXDestructorName (ast->getCanonicalType (record_qual_type)), SourceLocation()), - method_qual_type, - NULL, - is_inline, - is_implicitly_declared); + cxx_dtor_decl = CXXDestructorDecl::Create (*ast, + cxx_record_decl, + SourceLocation(), + DeclarationNameInfo (ast->DeclarationNames.getCXXDestructorName (ast->getCanonicalType (record_qual_type)), SourceLocation()), + method_qual_type, + NULL, + is_inline, + is_artificial); + cxx_method_decl = cxx_dtor_decl; } else if (decl_name == cxx_record_decl->getDeclName()) { - cxx_method_decl = CXXConstructorDecl::Create (*ast, - cxx_record_decl, - SourceLocation(), - DeclarationNameInfo (ast->DeclarationNames.getCXXConstructorName (ast->getCanonicalType (record_qual_type)), SourceLocation()), - method_qual_type, - NULL, // TypeSourceInfo * - is_explicit, - is_inline, - is_implicitly_declared, - false /*is_constexpr*/); + cxx_ctor_decl = CXXConstructorDecl::Create (*ast, + cxx_record_decl, + SourceLocation(), + DeclarationNameInfo (ast->DeclarationNames.getCXXConstructorName (ast->getCanonicalType (record_qual_type)), SourceLocation()), + method_qual_type, + NULL, // TypeSourceInfo * + is_explicit, + is_inline, + is_artificial, + false /*is_constexpr*/); + cxx_method_decl = cxx_ctor_decl; } else { @@ -1729,6 +1733,20 @@ cxx_record_decl->addDecl (cxx_method_decl); + if (is_artificial) + { + if (cxx_ctor_decl && cxx_ctor_decl->isCopyConstructor() && cxx_record_decl->hasTrivialCopyConstructor()) + { + cxx_ctor_decl->setDefaulted(); + cxx_ctor_decl->setTrivial(true); + } + else if (cxx_dtor_decl && cxx_record_decl->hasTrivialDestructor()) + { + cxx_dtor_decl->setDefaulted(); + cxx_dtor_decl->setTrivial(true); + } + } + #ifdef LLDB_CONFIGURATION_DEBUG VerifyDecl(cxx_method_decl); #endif From gclayton at apple.com Tue Nov 1 21:06:21 2011 From: gclayton at apple.com (Greg Clayton) Date: Wed, 02 Nov 2011 02:06:21 -0000 Subject: [Lldb-commits] [lldb] r143528 - /lldb/trunk/source/Symbol/ClangASTContext.cpp Message-ID: <20111102020621.259512A6C12C@llvm.org> Author: gclayton Date: Tue Nov 1 21:06:20 2011 New Revision: 143528 URL: http://llvm.org/viewvc/llvm-project?rev=143528&view=rev Log: Fixed an issue where the DWARF might mention that a class has a constructor (default, copy or move), destructor, or an assignment operator (copy or move) and it might not have an actual implementation in your code. Then you try and use this struct or class in an expression and the JIT would ask for the address of these methods that were in the declaration, yet there are none. We now "do the right thing" for trivial ctors, dtors and assignment operators by telling the methods that they are are defaulted and trivial, and clang will then just do all of the work with builtins! Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=143528&r1=143527&r2=143528&view=diff ============================================================================== --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue Nov 1 21:06:20 2011 @@ -1733,17 +1733,36 @@ cxx_record_decl->addDecl (cxx_method_decl); + // Sometimes the debug info will mention a constructor (default/copy/move), + // destructor, or assignment operator (copy/move) but there won't be any + // version of this in the code. So we check if the function was artificially + // generated and if it is trivial and this lets the compiler/backend know + // that it can inline the IR for these when it needs to and we can avoid a + // "missing function" error when running expressions. + if (is_artificial) { - if (cxx_ctor_decl && cxx_ctor_decl->isCopyConstructor() && cxx_record_decl->hasTrivialCopyConstructor()) + if (cxx_ctor_decl && + ((cxx_ctor_decl->isDefaultConstructor() && cxx_record_decl->hasTrivialDefaultConstructor ()) || + (cxx_ctor_decl->isCopyConstructor() && cxx_record_decl->hasTrivialCopyConstructor ()) || + (cxx_ctor_decl->isMoveConstructor() && cxx_record_decl->hasTrivialMoveConstructor ()) )) { cxx_ctor_decl->setDefaulted(); cxx_ctor_decl->setTrivial(true); } - else if (cxx_dtor_decl && cxx_record_decl->hasTrivialDestructor()) + else if (cxx_dtor_decl) + { + if (cxx_record_decl->hasTrivialDestructor()) + { + cxx_dtor_decl->setDefaulted(); + cxx_dtor_decl->setTrivial(true); + } + } + else if ((cxx_method_decl->isCopyAssignmentOperator() && cxx_record_decl->hasTrivialCopyAssignment()) || + (cxx_method_decl->isMoveAssignmentOperator() && cxx_record_decl->hasTrivialMoveAssignment())) { - cxx_dtor_decl->setDefaulted(); - cxx_dtor_decl->setTrivial(true); + cxx_method_decl->setDefaulted(); + cxx_method_decl->setTrivial(true); } } From scallanan at apple.com Wed Nov 2 13:09:01 2011 From: scallanan at apple.com (Sean Callanan) Date: Wed, 02 Nov 2011 18:09:01 -0000 Subject: [Lldb-commits] [lldb] r143560 - in /lldb/trunk/source: Expression/ClangExpressionDeclMap.cpp Symbol/ClangASTContext.cpp Symbol/ClangASTType.cpp Message-ID: <20111102180902.0EC2A2A6C12C@llvm.org> Author: spyffe Date: Wed Nov 2 13:09:01 2011 New Revision: 143560 URL: http://llvm.org/viewvc/llvm-project?rev=143560&view=rev Log: Updated LLVM/Clang to pull in an MCJIT fix that allows us to set __attribute__ ((used)) on expressions that masquerade as methods. When we are stopped in classes in anonymous namespaces, this fix (and enabling __attribute__ ((used)) on the method) will allow expressions to run. Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp lldb/trunk/source/Symbol/ClangASTContext.cpp lldb/trunk/source/Symbol/ClangASTType.cpp Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=143560&r1=143559&r2=143560&view=diff ============================================================================== --- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original) +++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Wed Nov 2 13:09:01 2011 @@ -3016,7 +3016,7 @@ const bool is_static = false; const bool is_inline = false; const bool is_explicit = false; - const bool is_attr_used = false; + const bool is_attr_used = true; const bool is_artificial = false; ClangASTContext::AddMethodToCXXRecordType (parser_ast_context, Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=143560&r1=143559&r2=143560&view=diff ============================================================================== --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Wed Nov 2 13:09:01 2011 @@ -3059,6 +3059,7 @@ case clang::BuiltinType::BoundMember: case clang::BuiltinType::Half: case clang::BuiltinType::ARCUnbridgedCast: + case clang::BuiltinType::PseudoObject: return 1; } break; @@ -4898,6 +4899,7 @@ case clang::BuiltinType::BoundMember: case clang::BuiltinType::Half: case clang::BuiltinType::ARCUnbridgedCast: + case clang::BuiltinType::PseudoObject: break; } break; @@ -5033,6 +5035,7 @@ case clang::BuiltinType::BoundMember: case clang::BuiltinType::Half: case clang::BuiltinType::ARCUnbridgedCast: + case clang::BuiltinType::PseudoObject: break; } break; Modified: lldb/trunk/source/Symbol/ClangASTType.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=143560&r1=143559&r2=143560&view=diff ============================================================================== --- lldb/trunk/source/Symbol/ClangASTType.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTType.cpp Wed Nov 2 13:09:01 2011 @@ -572,6 +572,7 @@ case clang::BuiltinType::ObjCSel: case clang::BuiltinType::Half: case clang::BuiltinType::ARCUnbridgedCast: + case clang::BuiltinType::PseudoObject: return lldb::eFormatHex; } break; From johnny.chen at apple.com Wed Nov 2 13:33:20 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Wed, 02 Nov 2011 11:33:20 -0700 Subject: [Lldb-commits] [lldb] r143560 - in /lldb/trunk/source: Expression/ClangExpressionDeclMap.cpp Symbol/ClangASTContext.cpp Symbol/ClangASTType.cpp In-Reply-To: <20111102180902.0EC2A2A6C12C@llvm.org> References: <20111102180902.0EC2A2A6C12C@llvm.org> Message-ID: <9808B847-462F-4D30-86C5-40411FA65059@apple.com> Are you missing a zip file? On Nov 2, 2011, at 11:09 AM, Sean Callanan wrote: > Updated LLVM/Clang to pull in an MCJIT fix -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/lldb-commits/attachments/20111102/f6833d62/attachment.html From benny.kra at googlemail.com Wed Nov 2 14:52:08 2011 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Wed, 02 Nov 2011 19:52:08 -0000 Subject: [Lldb-commits] [lldb] r143566 - /lldb/trunk/include/lldb/Expression/IRDynamicChecks.h Message-ID: <20111102195208.1E0E22A6C12C@llvm.org> Author: d0k Date: Wed Nov 2 14:52:07 2011 New Revision: 143566 URL: http://llvm.org/viewvc/llvm-project?rev=143566&view=rev Log: Try to unbreak Makefile builds. Modified: lldb/trunk/include/lldb/Expression/IRDynamicChecks.h Modified: lldb/trunk/include/lldb/Expression/IRDynamicChecks.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/IRDynamicChecks.h?rev=143566&r1=143565&r2=143566&view=diff ============================================================================== --- lldb/trunk/include/lldb/Expression/IRDynamicChecks.h (original) +++ lldb/trunk/include/lldb/Expression/IRDynamicChecks.h Wed Nov 2 14:52:07 2011 @@ -10,7 +10,7 @@ #ifndef liblldb_IRDynamicChecks_h_ #define liblldb_IRDynamicChecks_h_ -#include "lldb-types.h" +#include "lldb/lldb-types.h" #include "llvm/Pass.h" namespace llvm { From scallanan at apple.com Wed Nov 2 18:09:24 2011 From: scallanan at apple.com (Sean Callanan) Date: Wed, 02 Nov 2011 23:09:24 -0000 Subject: [Lldb-commits] [lldb] r143586 - /lldb/trunk/scripts/build-llvm.pl Message-ID: <20111102230924.1A9B12A6C12C@llvm.org> Author: spyffe Date: Wed Nov 2 18:09:23 2011 New Revision: 143586 URL: http://llvm.org/viewvc/llvm-project?rev=143586&view=rev Log: ...And forgot to check in build-llvm.pl. Sigh. Modified: lldb/trunk/scripts/build-llvm.pl Modified: lldb/trunk/scripts/build-llvm.pl URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/build-llvm.pl?rev=143586&r1=143585&r2=143586&view=diff ============================================================================== --- lldb/trunk/scripts/build-llvm.pl (original) +++ lldb/trunk/scripts/build-llvm.pl Wed Nov 2 18:09:23 2011 @@ -22,8 +22,8 @@ our $llvm_configuration = $ENV{LLVM_CONFIGURATION}; -our $llvm_revision = "142634"; -our $clang_revision = "142634"; +our $llvm_revision = "143472"; +our $clang_revision = "143472"; our $llvm_source_dir = "$ENV{SRCROOT}"; our @archs = split (/\s+/, $ENV{ARCHS}); From gclayton at apple.com Wed Nov 2 18:11:18 2011 From: gclayton at apple.com (Greg Clayton) Date: Wed, 02 Nov 2011 23:11:18 -0000 Subject: [Lldb-commits] [lldb] r143587 - in /lldb/trunk: lldb.xcodeproj/project.pbxproj resources/LLDB-Info.plist tools/debugserver/debugserver.xcodeproj/project.pbxproj Message-ID: <20111102231118.1E20D2A6C12C@llvm.org> Author: gclayton Date: Wed Nov 2 18:11:17 2011 New Revision: 143587 URL: http://llvm.org/viewvc/llvm-project?rev=143587&view=rev Log: Bumping Xcode project versions for lldb-85 and debugserver-150. Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/resources/LLDB-Info.plist lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=143587&r1=143586&r2=143587&view=diff ============================================================================== --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Nov 2 18:11:17 2011 @@ -3695,9 +3695,9 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 84; + CURRENT_PROJECT_VERSION = 85; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 84; + DYLIB_CURRENT_VERSION = 85; EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3745,10 +3745,10 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 84; + CURRENT_PROJECT_VERSION = 85; DEAD_CODE_STRIPPING = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 84; + DYLIB_CURRENT_VERSION = 85; EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3794,8 +3794,8 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 84; - DYLIB_CURRENT_VERSION = 84; + CURRENT_PROJECT_VERSION = 85; + DYLIB_CURRENT_VERSION = 85; EXECUTABLE_EXTENSION = a; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3832,8 +3832,8 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 84; - DYLIB_CURRENT_VERSION = 84; + CURRENT_PROJECT_VERSION = 85; + DYLIB_CURRENT_VERSION = 85; EXECUTABLE_EXTENSION = a; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3870,8 +3870,8 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 84; - DYLIB_CURRENT_VERSION = 84; + CURRENT_PROJECT_VERSION = 85; + DYLIB_CURRENT_VERSION = 85; EXECUTABLE_EXTENSION = a; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3945,7 +3945,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 84; + CURRENT_PROJECT_VERSION = 85; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"", @@ -3974,10 +3974,10 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 84; + CURRENT_PROJECT_VERSION = 85; DEAD_CODE_STRIPPING = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 84; + DYLIB_CURRENT_VERSION = 85; EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -4100,7 +4100,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 84; + CURRENT_PROJECT_VERSION = 85; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"", @@ -4130,7 +4130,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 84; + CURRENT_PROJECT_VERSION = 85; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"", Modified: lldb/trunk/resources/LLDB-Info.plist URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/resources/LLDB-Info.plist?rev=143587&r1=143586&r2=143587&view=diff ============================================================================== --- lldb/trunk/resources/LLDB-Info.plist (original) +++ lldb/trunk/resources/LLDB-Info.plist Wed Nov 2 18:11:17 2011 @@ -17,7 +17,7 @@ CFBundleSignature ???? CFBundleVersion - 84 + 85 CFBundleName ${EXECUTABLE_NAME} Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=143587&r1=143586&r2=143587&view=diff ============================================================================== --- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original) +++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Wed Nov 2 18:11:17 2011 @@ -475,7 +475,7 @@ i386, ); COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 149; + CURRENT_PROJECT_VERSION = 150; "GCC_VERSION[sdk=iphoneos*][arch=*]" = 4.2; "GCC_VERSION[sdk=macosx*][arch=*]" = ""; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -496,7 +496,7 @@ x86_64, i386, ); - CURRENT_PROJECT_VERSION = 149; + CURRENT_PROJECT_VERSION = 150; DEAD_CODE_STRIPPING = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; @@ -517,7 +517,7 @@ x86_64, i386, ); - CURRENT_PROJECT_VERSION = 149; + CURRENT_PROJECT_VERSION = 150; DEAD_CODE_STRIPPING = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; @@ -535,7 +535,7 @@ buildSettings = { "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 149; + CURRENT_PROJECT_VERSION = 150; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks; "FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = ( @@ -575,7 +575,7 @@ "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 149; + CURRENT_PROJECT_VERSION = 150; FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks; "FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = ( "$(SDKROOT)/System/Library/PrivateFrameworks", @@ -615,7 +615,7 @@ "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 149; + CURRENT_PROJECT_VERSION = 150; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks; "FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = ( From gclayton at apple.com Wed Nov 2 18:11:39 2011 From: gclayton at apple.com (Greg Clayton) Date: Wed, 02 Nov 2011 23:11:39 -0000 Subject: [Lldb-commits] [lldb] r143588 - /lldb/tags/lldb-85/ Message-ID: <20111102231139.C230F2A6C12C@llvm.org> Author: gclayton Date: Wed Nov 2 18:11:39 2011 New Revision: 143588 URL: http://llvm.org/viewvc/llvm-project?rev=143588&view=rev Log: lldb-85 Added: lldb/tags/lldb-85/ - copied from r143587, lldb/trunk/ From scallanan at apple.com Wed Nov 2 18:24:30 2011 From: scallanan at apple.com (Sean Callanan) Date: Wed, 02 Nov 2011 23:24:30 -0000 Subject: [Lldb-commits] [lldb] r143592 - /lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Message-ID: <20111102232430.ACAFF2A6C12C@llvm.org> Author: spyffe Date: Wed Nov 2 18:24:30 2011 New Revision: 143592 URL: http://llvm.org/viewvc/llvm-project?rev=143592&view=rev Log: Fixed the function that gets values for the IRInterpreter to get the value, not the location, of references. The location of a reference has type T&&, which is meaningless to Clang. Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=143592&r1=143591&r2=143592&view=diff ============================================================================== --- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original) +++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Wed Nov 2 18:24:30 2011 @@ -954,14 +954,33 @@ ClangExpressionVariableSP expr_var_sp (m_found_entities.GetVariable(decl)); ClangExpressionVariableSP persistent_var_sp (m_parser_vars->m_persistent_vars->GetVariable(decl)); - + if (expr_var_sp) { if (!expr_var_sp->m_parser_vars.get() || !expr_var_sp->m_parser_vars->m_lldb_var) return Value(); + bool is_reference = expr_var_sp->m_flags & ClangExpressionVariable::EVTypeIsReference; + std::auto_ptr value(GetVariableValue(exe_ctx, expr_var_sp->m_parser_vars->m_lldb_var, NULL)); + if (is_reference && value.get() && value->GetValueType() == Value::eValueTypeLoadAddress) + { + Process *process = m_parser_vars->m_exe_ctx->GetProcessPtr(); + + if (!process) + return Value(); + + lldb::addr_t value_addr = value->GetScalar().ULongLong(); + Error read_error; + addr_t ref_value = process->ReadPointerFromMemory (value_addr, read_error); + + if (!read_error.Success()) + return Value(); + + value->GetScalar() = (unsigned long long)ref_value; + } + if (value.get()) return *value; else From gclayton at apple.com Wed Nov 2 18:27:11 2011 From: gclayton at apple.com (Greg Clayton) Date: Wed, 02 Nov 2011 23:27:11 -0000 Subject: [Lldb-commits] [lldb] r143593 - /lldb/tags/lldb-84/ Message-ID: <20111102232711.769692A6C12C@llvm.org> Author: gclayton Date: Wed Nov 2 18:27:11 2011 New Revision: 143593 URL: http://llvm.org/viewvc/llvm-project?rev=143593&view=rev Log: Removing lldb-84 since it never got submitted. Removed: lldb/tags/lldb-84/ From benny.kra at googlemail.com Thu Nov 3 07:13:52 2011 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Thu, 03 Nov 2011 12:13:52 -0000 Subject: [Lldb-commits] [lldb] r143613 - /lldb/trunk/source/Host/common/Host.cpp Message-ID: <20111103121352.F06F32A6C12C@llvm.org> Author: d0k Date: Thu Nov 3 07:13:52 2011 New Revision: 143613 URL: http://llvm.org/viewvc/llvm-project?rev=143613&view=rev Log: The alpha and system z backends were removed. Modified: lldb/trunk/source/Host/common/Host.cpp Modified: lldb/trunk/source/Host/common/Host.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=143613&r1=143612&r2=143613&view=diff ============================================================================== --- lldb/trunk/source/Host/common/Host.cpp (original) +++ lldb/trunk/source/Host/common/Host.cpp Thu Nov 3 07:13:52 2011 @@ -322,11 +322,9 @@ g_supports_32 = true; break; - case llvm::Triple::alpha: case llvm::Triple::x86_64: case llvm::Triple::sparcv9: case llvm::Triple::ppc64: - case llvm::Triple::systemz: case llvm::Triple::cellspu: g_host_arch_64.SetTriple(triple); g_supports_64 = true; From gclayton at apple.com Thu Nov 3 16:22:33 2011 From: gclayton at apple.com (Greg Clayton) Date: Thu, 03 Nov 2011 21:22:33 -0000 Subject: [Lldb-commits] [lldb] r143656 - in /lldb/trunk: include/lldb/ include/lldb/Interpreter/ include/lldb/Target/ source/API/ source/Commands/ source/Interpreter/ source/Plugins/Process/MacOSX-Kernel/ source/Plugins/Process/gdb-remote/ source/Target/ Message-ID: <20111103212234.16B352A6C12C@llvm.org> Author: gclayton Date: Thu Nov 3 16:22:33 2011 New Revision: 143656 URL: http://llvm.org/viewvc/llvm-project?rev=143656&view=rev Log: Modified all Process::Launch() calls to use a ProcessLaunchInfo structure on internal only (public API hasn't changed) to simplify the paramter list to the launch calls down into just one argument. Also all of the argument, envronment and stdio things are now handled in a much more centralized fashion. Modified: lldb/trunk/include/lldb/Interpreter/Args.h lldb/trunk/include/lldb/Target/Process.h lldb/trunk/include/lldb/lldb-enumerations.h lldb/trunk/source/API/SBProcess.cpp lldb/trunk/source/API/SBTarget.cpp lldb/trunk/source/Commands/CommandObjectPlatform.cpp lldb/trunk/source/Commands/CommandObjectProcess.cpp lldb/trunk/source/Interpreter/Args.cpp lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h lldb/trunk/source/Target/Process.cpp Modified: lldb/trunk/include/lldb/Interpreter/Args.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/Args.h?rev=143656&r1=143655&r2=143656&view=diff ============================================================================== --- lldb/trunk/include/lldb/Interpreter/Args.h (original) +++ lldb/trunk/include/lldb/Interpreter/Args.h Thu Nov 3 16:22:33 2011 @@ -205,6 +205,10 @@ void AppendArguments (const Args &rhs); + + void + AppendArguments (const char **argv); + //------------------------------------------------------------------ /// Insert the argument value at index \a idx to \a arg_cstr. /// @@ -266,6 +270,9 @@ void SetArguments (int argc, const char **argv); + void + SetArguments (const char **argv); + //------------------------------------------------------------------ /// Shifts the first argument C string value of the array off the /// argument array. Modified: lldb/trunk/include/lldb/Target/Process.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=143656&r1=143655&r2=143656&view=diff ============================================================================== --- lldb/trunk/include/lldb/Target/Process.h (original) +++ lldb/trunk/include/lldb/Target/Process.h Thu Nov 3 16:22:33 2011 @@ -300,7 +300,29 @@ { return m_executable; } - + + void + SetExecutableFile (const FileSpec &exe_file, bool add_exe_file_as_first_arg) + { + if (exe_file) + { + m_executable = exe_file; + if (add_exe_file_as_first_arg) + { + m_arguments.Clear(); + char filename[PATH_MAX]; + if (exe_file.GetPath(filename, sizeof(filename))) + m_arguments.AppendArgument (filename); + } + } + else + { + m_executable.Clear(); + if (add_exe_file_as_first_arg) + m_arguments.Clear(); + } + } + const FileSpec & GetExecutableFile () const { @@ -389,10 +411,15 @@ } void - SetArgumentsFromArgs (const Args& args, - bool first_arg_is_executable, - bool first_arg_is_executable_and_argument); + SetArguments (const Args& args, + bool first_arg_is_executable, + bool first_arg_is_executable_and_argument); + void + SetArguments (char const **argv, + bool first_arg_is_executable, + bool first_arg_is_executable_and_argument); + Args & GetEnvironmentEntries () { @@ -534,6 +561,14 @@ class FileAction { public: + enum Action + { + eFileActionNone, + eFileActionClose, + eFileActionDuplicate, + eFileActionOpen + }; + FileAction () : m_action (eFileActionNone), @@ -567,15 +602,33 @@ Log *log, Error& error); - protected: - enum Action + int + GetFD () const { - eFileActionNone, - eFileActionClose, - eFileActionDuplicate, - eFileActionOpen - }; + return m_fd; + } + + Action + GetAction () const + { + return m_action; + } + + int + GetActionArgument () const + { + return m_arg; + } + + const char * + GetPath () const + { + if (m_path.empty()) + return NULL; + return m_path.c_str(); + } + protected: Action m_action; // The action for this file int m_fd; // An existing file descriptor int m_arg; // oflag for eFileActionOpen*, dup_fd for eFileActionDuplicate @@ -584,13 +637,45 @@ ProcessLaunchInfo () : ProcessInfo(), - m_flags (), - m_stdin_info (), - m_stdout_info (), - m_stderr_info () + m_flags () { } + ProcessLaunchInfo (const char *stdin_path, + const char *stdout_path, + const char *stderr_path, + const char *working_directory, + uint32_t launch_flags) : + ProcessInfo(), + m_flags (launch_flags) + { + if (stderr_path) + { + ProcessLaunchInfo::FileAction file_action; + const bool read = true; + const bool write = true; + if (file_action.Open(STDERR_FILENO, stderr_path, read, write)) + AppendFileAction (file_action); + } + if (stdout_path) + { + ProcessLaunchInfo::FileAction file_action; + const bool read = false; + const bool write = true; + if (file_action.Open(STDOUT_FILENO, stdout_path, read, write)) + AppendFileAction (file_action); + } + if (stdin_path) + { + ProcessLaunchInfo::FileAction file_action; + const bool read = true; + const bool write = false; + if (file_action.Open(STDIN_FILENO, stdin_path, read, write)) + AppendFileAction (file_action); + } + if (working_directory) + SetWorkingDirectory(working_directory); + } void AppendFileAction (const FileAction &info) { @@ -643,6 +728,17 @@ return NULL; } + const FileAction * + GetFileActionForFD (int fd) const + { + for (uint32_t idx=0, count=m_file_actions.size(); idx < count; ++idx) + { + if (m_file_actions[idx].GetFD () == fd) + return &m_file_actions[idx]; + } + return NULL; + } + Flags & GetFlags () { @@ -703,9 +799,6 @@ m_working_dir.clear(); m_plugin_name.clear(); m_flags.Clear(); - m_stdin_info.Clear(); - m_stdout_info.Clear(); - m_stderr_info.Clear(); m_file_actions.clear(); } @@ -713,9 +806,6 @@ std::string m_working_dir; std::string m_plugin_name; Flags m_flags; // Bitwise OR of bits from lldb::LaunchFlags - FileAction m_stdin_info; // File action for stdin - FileAction m_stdout_info; // File action for stdout - FileAction m_stderr_info; // File action for stderr std::vector m_file_actions; // File actions for any other files }; @@ -1316,13 +1406,7 @@ /// the error object is success. //------------------------------------------------------------------ virtual Error - Launch (char const *argv[], - char const *envp[], - uint32_t launch_flags, - const char *stdin_path, - const char *stdout_path, - const char *stderr_path, - const char *working_directory); + Launch (const ProcessLaunchInfo &launch_info); //------------------------------------------------------------------ /// Attach to an existing process using a process ID. @@ -1688,14 +1772,8 @@ /// launching fails. //------------------------------------------------------------------ virtual Error - DoLaunch (Module* module, - char const *argv[], - char const *envp[], - uint32_t launch_flags, - const char *stdin_path, - const char *stdout_path, - const char *stderr_path, - const char *working_directory) = 0; + DoLaunch (Module *exe_module, + const ProcessLaunchInfo &launch_info) = 0; //------------------------------------------------------------------ /// Called after launching a process. Modified: lldb/trunk/include/lldb/lldb-enumerations.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-enumerations.h?rev=143656&r1=143655&r2=143656&view=diff ============================================================================== --- lldb/trunk/include/lldb/lldb-enumerations.h (original) +++ lldb/trunk/include/lldb/lldb-enumerations.h Thu Nov 3 16:22:33 2011 @@ -44,7 +44,8 @@ eLaunchFlagStopAtEntry = (1u << 2), ///< Stop at the program entry point instead of auto-continuing when launching or attaching at entry point eLaunchFlagDisableASLR = (1u << 3), ///< Disable Address Space Layout Randomization eLaunchFlagDisableSTDIO = (1u << 4), ///< Disable stdio for inferior process (e.g. for a GUI app) - eLaunchFlagLaunchInTTY = (1u << 5) ///< Launch the process in a new TTY if supported by the host + eLaunchFlagLaunchInTTY = (1u << 5), ///< Launch the process in a new TTY if supported by the host + eLaunchFlagLaunchInShell= (1u << 6) ///< Launch the process inside a shell to get shell expansion } LaunchFlags; //---------------------------------------------------------------------- Modified: lldb/trunk/source/API/SBProcess.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBProcess.cpp?rev=143656&r1=143655&r2=143656&view=diff ============================================================================== --- lldb/trunk/source/API/SBProcess.cpp (original) +++ lldb/trunk/source/API/SBProcess.cpp Thu Nov 3 16:22:33 2011 @@ -126,7 +126,21 @@ Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex()); if (m_opaque_sp->GetState() == eStateConnected) { - error.SetError (m_opaque_sp->Launch (argv, envp, launch_flags, stdin_path, stdout_path, stderr_path, working_directory)); + if (stop_at_entry) + launch_flags |= eLaunchFlagStopAtEntry; + ProcessLaunchInfo launch_info (stdin_path, + stdout_path, + stderr_path, + working_directory, + launch_flags); + Module *exe_module = m_opaque_sp->GetTarget().GetExecutableModulePointer(); + if (exe_module) + launch_info.SetExecutableFile(exe_module->GetFileSpec(), true); + if (argv) + launch_info.GetArguments().AppendArguments (argv); + if (envp) + launch_info.GetEnvironmentEntries ().SetArguments (envp); + error.SetError (m_opaque_sp->Launch (launch_info)); } else { Modified: lldb/trunk/source/API/SBTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=143656&r1=143655&r2=143656&view=diff ============================================================================== --- lldb/trunk/source/API/SBTarget.cpp (original) +++ lldb/trunk/source/API/SBTarget.cpp Thu Nov 3 16:22:33 2011 @@ -231,7 +231,17 @@ if (getenv("LLDB_LAUNCH_FLAG_DISABLE_STDIO")) launch_flags |= eLaunchFlagDisableSTDIO; - error.SetError (sb_process->Launch (argv, envp, launch_flags, stdin_path, stdout_path, stderr_path, working_directory)); + ProcessLaunchInfo launch_info (stdin_path, stdout_path, stderr_path, working_directory, launch_flags); + + Module *exe_module = m_opaque_sp->GetExecutableModulePointer(); + if (exe_module) + launch_info.SetExecutableFile(exe_module->GetFileSpec(), true); + if (argv) + launch_info.GetArguments().AppendArguments (argv); + if (envp) + launch_info.GetEnvironmentEntries ().SetArguments (envp); + + error.SetError (sb_process->Launch (launch_info)); if (error.Success()) { // We we are stopping at the entry point, we can return now! Modified: lldb/trunk/source/Commands/CommandObjectPlatform.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectPlatform.cpp?rev=143656&r1=143655&r2=143656&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectPlatform.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectPlatform.cpp Thu Nov 3 16:22:33 2011 @@ -400,9 +400,9 @@ // We don't have any file yet, so the first argument is our // executable, and the rest are program arguments const bool first_arg_is_executable = true; - m_options.launch_info.SetArgumentsFromArgs (args, - first_arg_is_executable, - first_arg_is_executable); + m_options.launch_info.SetArguments (args, + first_arg_is_executable, + first_arg_is_executable); } } Modified: lldb/trunk/source/Commands/CommandObjectProcess.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectProcess.cpp?rev=143656&r1=143655&r2=143656&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectProcess.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectProcess.cpp Thu Nov 3 16:22:33 2011 @@ -35,86 +35,86 @@ { public: - class CommandOptions : public Options - { - public: - - CommandOptions (CommandInterpreter &interpreter) : - Options(interpreter) - { - // Keep default values of all options in one place: OptionParsingStarting () - OptionParsingStarting (); - } - - ~CommandOptions () - { - } - - Error - SetOptionValue (uint32_t option_idx, const char *option_arg) - { - Error error; - char short_option = (char) m_getopt_table[option_idx].val; - - switch (short_option) - { - case 's': stop_at_entry = true; break; - case 'e': stderr_path.assign (option_arg); break; - case 'i': stdin_path.assign (option_arg); break; - case 'o': stdout_path.assign (option_arg); break; - case 'p': plugin_name.assign (option_arg); break; - case 'n': no_stdio = true; break; - case 'w': working_dir.assign (option_arg); break; - case 't': - if (option_arg && option_arg[0]) - tty_name.assign (option_arg); - in_new_tty = true; - break; - default: - error.SetErrorStringWithFormat("invalid short option character '%c'", short_option); - break; - - } - return error; - } - - void - OptionParsingStarting () - { - stop_at_entry = false; - in_new_tty = false; - tty_name.clear(); - stdin_path.clear(); - stdout_path.clear(); - stderr_path.clear(); - plugin_name.clear(); - working_dir.clear(); - no_stdio = false; - } - - const OptionDefinition* - GetDefinitions () - { - return g_option_table; - } - - // Options table: Required for subclasses of Options. - - static OptionDefinition g_option_table[]; - - // Instance variables to hold the values for command options. - - bool stop_at_entry; - bool in_new_tty; - bool no_stdio; - std::string tty_name; - std::string stderr_path; - std::string stdin_path; - std::string stdout_path; - std::string plugin_name; - std::string working_dir; - - }; +// class CommandOptions : public Options +// { +// public: +// +// CommandOptions (CommandInterpreter &interpreter) : +// Options(interpreter) +// { +// // Keep default values of all options in one place: OptionParsingStarting () +// OptionParsingStarting (); +// } +// +// ~CommandOptions () +// { +// } +// +// Error +// SetOptionValue (uint32_t option_idx, const char *option_arg) +// { +// Error error; +// char short_option = (char) m_getopt_table[option_idx].val; +// +// switch (short_option) +// { +// case 's': stop_at_entry = true; break; +// case 'e': stderr_path.assign (option_arg); break; +// case 'i': stdin_path.assign (option_arg); break; +// case 'o': stdout_path.assign (option_arg); break; +// case 'p': plugin_name.assign (option_arg); break; +// case 'n': no_stdio = true; break; +// case 'w': working_dir.assign (option_arg); break; +// case 't': +// if (option_arg && option_arg[0]) +// tty_name.assign (option_arg); +// in_new_tty = true; +// break; +// default: +// error.SetErrorStringWithFormat("invalid short option character '%c'", short_option); +// break; +// +// } +// return error; +// } +// +// void +// OptionParsingStarting () +// { +// stop_at_entry = false; +// in_new_tty = false; +// tty_name.clear(); +// stdin_path.clear(); +// stdout_path.clear(); +// stderr_path.clear(); +// plugin_name.clear(); +// working_dir.clear(); +// no_stdio = false; +// } +// +// const OptionDefinition* +// GetDefinitions () +// { +// return g_option_table; +// } +// +// // Options table: Required for subclasses of Options. +// +// static OptionDefinition g_option_table[]; +// +// // Instance variables to hold the values for command options. +// +// bool stop_at_entry; +// bool in_new_tty; +// bool no_stdio; +// std::string tty_name; +// std::string stderr_path; +// std::string stdin_path; +// std::string stdout_path; +// std::string plugin_name; +// std::string working_dir; +// +// }; CommandObjectProcessLaunch (CommandInterpreter &interpreter) : CommandObject (interpreter, @@ -171,8 +171,11 @@ return false; } - exe_module->GetFileSpec().GetPath(filename, sizeof(filename)); + exe_module->GetFileSpec().GetPath (filename, sizeof(filename)); + const bool add_exe_file_as_first_arg = true; + m_options.launch_info.SetExecutableFile(exe_module->GetFileSpec(), add_exe_file_as_first_arg); + StateType state = eStateInvalid; Process *process = m_interpreter.GetExecutionContext().GetProcessPtr(); if (process) @@ -210,11 +213,7 @@ if (state != eStateConnected) { - const char *plugin_name; - if (!m_options.plugin_name.empty()) - plugin_name = m_options.plugin_name.c_str(); - else - plugin_name = NULL; + const char *plugin_name = m_options.launch_info.GetProcessPluginName(); process = target->CreateProcess (m_interpreter.GetDebugger().GetListener(), plugin_name).get(); if (process == NULL) @@ -225,99 +224,74 @@ } } - - // If no launch args were given on the command line, then use any that - // might have been set using the "run-args" set variable. - if (launch_args.GetArgumentCount() == 0) + if (launch_args.GetArgumentCount() > 0) + { + m_options.launch_info.GetArguments().AppendArguments (launch_args); + } + else { - if (process->GetRunArguments().GetArgumentCount() > 0) - launch_args = process->GetRunArguments(); + const Args &process_args = process->GetRunArguments(); + if (process_args.GetArgumentCount() > 0) + m_options.launch_info.GetArguments().AppendArguments (process_args); } - if (m_options.in_new_tty) + + if (m_options.launch_info.GetFlags().Test (eLaunchFlagLaunchInTTY)) { if (state == eStateConnected) { result.AppendWarning("launch in tty option is ignored when launching through a remote connection"); - m_options.in_new_tty = false; - } - else - { - char exec_file_path[PATH_MAX]; - if (exe_module->GetFileSpec().GetPath(exec_file_path, sizeof(exec_file_path))) - { - launch_args.InsertArgumentAtIndex(0, exec_file_path); - } - else - { - result.AppendError("invalid executable"); - result.SetStatus (eReturnStatusFailed); - return false; - } + m_options.launch_info.GetFlags().Clear (eLaunchFlagLaunchInTTY); } } Args environment; - process->GetEnvironmentAsArgs (environment); - - uint32_t launch_flags = eLaunchFlagNone; + m_options.launch_info.GetEnvironmentEntries ().AppendArguments (environment); if (process->GetDisableASLR()) - launch_flags |= eLaunchFlagDisableASLR; + m_options.launch_info.GetFlags().Set (eLaunchFlagDisableASLR); - if (m_options.in_new_tty) - launch_flags |= eLaunchFlagLaunchInTTY; - - if (m_options.no_stdio) - launch_flags |= eLaunchFlagDisableSTDIO; - else if (!m_options.in_new_tty - && m_options.stdin_path.empty() - && m_options.stdout_path.empty() - && m_options.stderr_path.empty()) + if (m_options.launch_info.GetFlags().Test (eLaunchFlagLaunchInTTY) == false && + m_options.launch_info.GetNumFileActions() == 0) { // Only use the settings value if the user hasn't specified any options that would override it. if (process->GetDisableSTDIO()) - launch_flags |= eLaunchFlagDisableSTDIO; + m_options.launch_info.GetFlags().Set (eLaunchFlagDisableSTDIO); + + const char *path; + path = process->GetStandardErrorPath(); + if (path) + { + ProcessLaunchInfo::FileAction file_action; + const bool read = true; + const bool write = true; + if (file_action.Open(STDERR_FILENO, path, read, write)) + m_options.launch_info.AppendFileAction (file_action); + } + path = process->GetStandardInputPath(); + if (path) + { + ProcessLaunchInfo::FileAction file_action; + const bool read = true; + const bool write = false; + if (file_action.Open(STDIN_FILENO, path, read, write)) + m_options.launch_info.AppendFileAction (file_action); + } + + path = process->GetStandardOutputPath(); + if (path) + { + ProcessLaunchInfo::FileAction file_action; + const bool read = false; + const bool write = true; + if (file_action.Open(STDOUT_FILENO, path, read, write)) + m_options.launch_info.AppendFileAction (file_action); + } } - - const char **inferior_argv = launch_args.GetArgumentCount() ? launch_args.GetConstArgumentVector() : NULL; - const char **inferior_envp = environment.GetArgumentCount() ? environment.GetConstArgumentVector() : NULL; - Error error; - const char *working_dir = NULL; - if (!m_options.working_dir.empty()) - working_dir = m_options.working_dir.c_str(); - - const char * stdin_path = NULL; - const char * stdout_path = NULL; - const char * stderr_path = NULL; - - // Were any standard input/output/error paths given on the command line? - if (m_options.stdin_path.empty() && - m_options.stdout_path.empty() && - m_options.stderr_path.empty()) - { - // No standard file handles were given on the command line, check - // with the process object in case they were give using "set settings" - stdin_path = process->GetStandardInputPath(); - stdout_path = process->GetStandardOutputPath(); - stderr_path = process->GetStandardErrorPath(); - } - else - { - stdin_path = m_options.stdin_path.empty() ? NULL : m_options.stdin_path.c_str(); - stdout_path = m_options.stdout_path.empty() ? NULL : m_options.stdout_path.c_str(); - stderr_path = m_options.stderr_path.empty() ? NULL : m_options.stderr_path.c_str(); - } - error = process->Launch (inferior_argv, - inferior_envp, - launch_flags, - stdin_path, - stdout_path, - stderr_path, - working_dir); + error = process->Launch (m_options.launch_info); if (error.Success()) { @@ -325,7 +299,7 @@ result.AppendMessageWithFormat ("Process %llu launched: '%s' (%s)\n", process->GetID(), filename, archname); result.SetDidChangeProcessState (true); - if (m_options.stop_at_entry == false) + if (m_options.launch_info.GetFlags().Test(eLaunchFlagStopAtEntry) == false) { result.SetStatus (eReturnStatusSuccessContinuingNoResult); StateType state = process->WaitForProcessToStop (NULL); @@ -380,32 +354,31 @@ } protected: - - CommandOptions m_options; + ProcessLaunchCommandOptions m_options; }; -#define SET1 LLDB_OPT_SET_1 -#define SET2 LLDB_OPT_SET_2 -#define SET3 LLDB_OPT_SET_3 - -OptionDefinition -CommandObjectProcessLaunch::CommandOptions::g_option_table[] = -{ -{ SET1 | SET2 | SET3, false, "stop-at-entry", 's', no_argument, NULL, 0, eArgTypeNone, "Stop at the entry point of the program when launching a process."}, -{ SET1 , false, "stdin", 'i', required_argument, NULL, 0, eArgTypePath, "Redirect stdin for the process to ."}, -{ SET1 , false, "stdout", 'o', required_argument, NULL, 0, eArgTypePath, "Redirect stdout for the process to ."}, -{ SET1 , false, "stderr", 'e', required_argument, NULL, 0, eArgTypePath, "Redirect stderr for the process to ."}, -{ SET1 | SET2 | SET3, false, "plugin", 'p', required_argument, NULL, 0, eArgTypePlugin, "Name of the process plugin you want to use."}, -{ SET2 , false, "tty", 't', optional_argument, NULL, 0, eArgTypePath, "Start the process in a terminal. If is specified, look for a terminal whose name contains , else start the process in a new terminal."}, -{ SET3, false, "no-stdio", 'n', no_argument, NULL, 0, eArgTypeNone, "Do not set up for terminal I/O to go to running process."}, -{ SET1 | SET2 | SET3, false, "working-dir", 'w', required_argument, NULL, 0, eArgTypePath, "Set the current working directory to when running the inferior."}, -{ 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL } -}; - -#undef SET1 -#undef SET2 -#undef SET3 +//#define SET1 LLDB_OPT_SET_1 +//#define SET2 LLDB_OPT_SET_2 +//#define SET3 LLDB_OPT_SET_3 +// +//OptionDefinition +//CommandObjectProcessLaunch::CommandOptions::g_option_table[] = +//{ +//{ SET1 | SET2 | SET3, false, "stop-at-entry", 's', no_argument, NULL, 0, eArgTypeNone, "Stop at the entry point of the program when launching a process."}, +//{ SET1 , false, "stdin", 'i', required_argument, NULL, 0, eArgTypePath, "Redirect stdin for the process to ."}, +//{ SET1 , false, "stdout", 'o', required_argument, NULL, 0, eArgTypePath, "Redirect stdout for the process to ."}, +//{ SET1 , false, "stderr", 'e', required_argument, NULL, 0, eArgTypePath, "Redirect stderr for the process to ."}, +//{ SET1 | SET2 | SET3, false, "plugin", 'p', required_argument, NULL, 0, eArgTypePlugin, "Name of the process plugin you want to use."}, +//{ SET2 , false, "tty", 't', optional_argument, NULL, 0, eArgTypePath, "Start the process in a terminal. If is specified, look for a terminal whose name contains , else start the process in a new terminal."}, +//{ SET3, false, "no-stdio", 'n', no_argument, NULL, 0, eArgTypeNone, "Do not set up for terminal I/O to go to running process."}, +//{ SET1 | SET2 | SET3, false, "working-dir", 'w', required_argument, NULL, 0, eArgTypePath, "Set the current working directory to when running the inferior."}, +//{ 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL } +//}; +// +//#undef SET1 +//#undef SET2 +//#undef SET3 //------------------------------------------------------------------------- // CommandObjectProcessAttach Modified: lldb/trunk/source/Interpreter/Args.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=143656&r1=143655&r2=143656&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/Args.cpp (original) +++ lldb/trunk/source/Interpreter/Args.cpp Thu Nov 3 16:22:33 2011 @@ -476,6 +476,16 @@ AppendArgument(rhs.GetArgumentAtIndex(i)); } +void +Args::AppendArguments (const char **argv) +{ + if (argv) + { + for (uint32_t i=0; argv[i]; ++i) + AppendArgument(argv[i]); + } +} + const char * Args::AppendArgument (const char *arg_cstr, char quote_char) { @@ -560,10 +570,8 @@ m_args.clear(); m_args_quote_char.clear(); - // Make a copy of the arguments in our internal buffer - size_t i; // First copy each string - for (i=0; iGetAction () == ProcessLaunchInfo::FileAction::eFileActionOpen) + stdin_path = file_action->GetPath(); + } + file_action = launch_info.GetFileActionForFD (STDOUT_FILENO); + if (file_action) + { + if (file_action->GetAction () == ProcessLaunchInfo::FileAction::eFileActionOpen) + stdout_path = file_action->GetPath(); + } + file_action = launch_info.GetFileActionForFD (STDERR_FILENO); + if (file_action) + { + if (file_action->GetAction () == ProcessLaunchInfo::FileAction::eFileActionOpen) + stderr_path = file_action->GetPath(); + } + // ::LogSetBitMask (GDBR_LOG_DEFAULT); // ::LogSetOptions (LLDB_LOG_OPTION_THREADSAFE | LLDB_LOG_OPTION_PREPEND_TIMESTAMP | LLDB_LOG_OPTION_PREPEND_PROC_AND_THREAD); // ::LogSetLogFile ("/dev/stdout"); LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS)); - ObjectFile * object_file = module->GetObjectFile(); + ObjectFile * object_file = exe_module->GetObjectFile(); if (object_file) { char host_port[128]; @@ -537,18 +554,20 @@ } // Send the environment and the program + arguments after we connect - if (envp) + const Args &environment = launch_info.GetEnvironmentEntries(); + if (environment.GetArgumentCount()) { - const char *env_entry; - for (int i=0; (env_entry = envp[i]); ++i) + size_t num_environment_entries = environment.GetArgumentCount(); + for (size_t i=0; iGetFileSpec().GetFilename().AsCString(), - module->GetArchitecture().GetArchitectureName()); + error.SetErrorStringWithFormat ("failed to get object file from '%s' for arch %s", + exe_module->GetFileSpec().GetFilename().AsCString(), + exe_module->GetArchitecture().GetArchitectureName()); } return error; Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h?rev=143656&r1=143655&r2=143656&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h Thu Nov 3 16:22:33 2011 @@ -79,14 +79,8 @@ WillLaunch (lldb_private::Module* module); virtual lldb_private::Error - DoLaunch (lldb_private::Module* module, - char const *argv[], // Can be NULL - char const *envp[], // Can be NULL - uint32_t flags, - const char *stdin_path, // Can be NULL - const char *stdout_path, // Can be NULL - const char *stderr_path, // Can be NULL - const char *working_dir); // Can be NULL + DoLaunch (lldb_private::Module *exe_module, + const lldb_private::ProcessLaunchInfo &launch_info); virtual void DidLaunch (); Modified: lldb/trunk/source/Target/Process.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=143656&r1=143655&r2=143656&view=diff ============================================================================== --- lldb/trunk/source/Target/Process.cpp (original) +++ lldb/trunk/source/Target/Process.cpp Thu Nov 3 16:22:33 2011 @@ -197,9 +197,35 @@ void -ProcessInfo::SetArgumentsFromArgs (const Args& args, - bool first_arg_is_executable, - bool first_arg_is_executable_and_argument) +ProcessInfo::SetArguments (char const **argv, + bool first_arg_is_executable, + bool first_arg_is_executable_and_argument) +{ + m_arguments.SetArguments (argv); + + // Is the first argument the executable? + if (first_arg_is_executable) + { + const char *first_arg = m_arguments.GetArgumentAtIndex (0); + if (first_arg) + { + // Yes the first argument is an executable, set it as the executable + // in the launch options. Don't resolve the file path as the path + // could be a remote platform path + const bool resolve = false; + m_executable.SetFile(first_arg, resolve); + + // If argument zero is an executable and shouldn't be included + // in the arguments, remove it from the front of the arguments + if (first_arg_is_executable_and_argument == false) + m_arguments.DeleteArgumentAtIndex (0); + } + } +} +void +ProcessInfo::SetArguments (const Args& args, + bool first_arg_is_executable, + bool first_arg_is_executable_and_argument) { // Copy all arguments m_arguments = args; @@ -207,7 +233,7 @@ // Is the first argument the executable? if (first_arg_is_executable) { - const char *first_arg = args.GetArgumentAtIndex (0); + const char *first_arg = m_arguments.GetArgumentAtIndex (0); if (first_arg) { // Yes the first argument is an executable, set it as the executable @@ -415,6 +441,10 @@ launch_info.GetFlags().Set (eLaunchFlagDisableASLR); break; + case 'c': + launch_info.GetFlags().Set (eLaunchFlagLaunchInShell); + break; + case 'v': launch_info.GetEnvironmentEntries().AppendArgument(option_arg); break; @@ -445,6 +475,7 @@ { LLDB_OPT_SET_3 , false, "no-stdio", 'n', no_argument, NULL, 0, eArgTypeNone, "Do not set up for terminal I/O to go to running process."}, +{ LLDB_OPT_SET_4 , false, "shell", 'c', no_argument, NULL, 0, eArgTypeNone, "Run the process in a shell (not supported on all platforms)."}, { 0 , false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL } }; @@ -2037,16 +2068,7 @@ } Error -Process::Launch -( - char const *argv[], - char const *envp[], - uint32_t launch_flags, - const char *stdin_path, - const char *stdout_path, - const char *stderr_path, - const char *working_directory -) +Process::Launch (const ProcessLaunchInfo &launch_info) { Error error; m_abi_sp.reset(); @@ -2070,40 +2092,9 @@ if (error.Success()) { SetPublicState (eStateLaunching); - // The args coming in should not contain the application name, the - // lldb_private::Process class will add this in case the executable - // gets resolved to a different file than was given on the command - // line (like when an applicaiton bundle is specified and will - // resolve to the contained exectuable file, or the file given was - // a symlink or other file system link that resolves to a different - // file). - - // Get the resolved exectuable path - - // Make a new argument vector - std::vector exec_path_plus_argv; - // Append the resolved executable path - exec_path_plus_argv.push_back (platform_exec_file_path); - - // Push all args if there are any - if (argv) - { - for (int i = 0; argv[i]; ++i) - exec_path_plus_argv.push_back(argv[i]); - } - - // Push a NULL to terminate the args. - exec_path_plus_argv.push_back(NULL); // Now launch using these arguments. - error = DoLaunch (exe_module, - exec_path_plus_argv.empty() ? NULL : &exec_path_plus_argv.front(), - envp, - launch_flags, - stdin_path, - stdout_path, - stderr_path, - working_directory); + error = DoLaunch (exe_module, launch_info); if (error.Fail()) { From jingham at apple.com Thu Nov 3 16:43:55 2011 From: jingham at apple.com (Jim Ingham) Date: Thu, 03 Nov 2011 21:43:55 -0000 Subject: [Lldb-commits] [lldb] r143659 - /lldb/trunk/tools/darwin-threads/examine-threads.c Message-ID: <20111103214355.6D5732A6C12C@llvm.org> Author: jingham Date: Thu Nov 3 16:43:55 2011 New Revision: 143659 URL: http://llvm.org/viewvc/llvm-project?rev=143659&view=rev Log: Print out the task suspend count as well. Modified: lldb/trunk/tools/darwin-threads/examine-threads.c Modified: lldb/trunk/tools/darwin-threads/examine-threads.c URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/darwin-threads/examine-threads.c?rev=143659&r1=143658&r2=143659&view=diff ============================================================================== --- lldb/trunk/tools/darwin-threads/examine-threads.c (original) +++ lldb/trunk/tools/darwin-threads/examine-threads.c Thu Nov 3 16:43:55 2011 @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -309,6 +310,17 @@ exit (1); } + struct task_basic_info info; + unsigned int info_count = TASK_BASIC_INFO_COUNT; + + kr = task_info (task, TASK_BASIC_INFO, (task_info_t) &info, &info_count); + if (kr != KERN_SUCCESS) + { + printf ("Error - unable to call task_info.\n"); + exit (1); + } + printf ("Task suspend count: %d.\n", info.suspend_count); + struct timespec *rqtp = (struct timespec *) malloc (sizeof (struct timespec)); rqtp->tv_sec = 0; rqtp->tv_nsec = 150000000; From scallanan at apple.com Thu Nov 3 17:48:37 2011 From: scallanan at apple.com (Sean Callanan) Date: Thu, 03 Nov 2011 22:48:37 -0000 Subject: [Lldb-commits] [lldb] r143663 - /lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Message-ID: <20111103224837.721A72A6C12C@llvm.org> Author: spyffe Date: Thu Nov 3 17:48:37 2011 New Revision: 143663 URL: http://llvm.org/viewvc/llvm-project?rev=143663&view=rev Log: Fixed a problem where the "this" pointer didn't have the correct value in the IRInterpreter. Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=143663&r1=143662&r2=143663&view=diff ============================================================================== --- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original) +++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Thu Nov 3 17:48:37 2011 @@ -1038,6 +1038,23 @@ std::auto_ptr value(GetVariableValue(*m_parser_vars->m_exe_ctx, var, NULL)); + if (value.get() && value->GetValueType() == Value::eValueTypeLoadAddress) + { + Process *process = m_parser_vars->m_exe_ctx->GetProcessPtr(); + + if (!process) + return Value(); + + lldb::addr_t value_addr = value->GetScalar().ULongLong(); + Error read_error; + addr_t ptr_value = process->ReadPointerFromMemory (value_addr, read_error); + + if (!read_error.Success()) + return Value(); + + value->GetScalar() = (unsigned long long)ptr_value; + } + if (value.get()) return *value; else From johnny.chen at apple.com Thu Nov 3 20:05:29 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Fri, 04 Nov 2011 01:05:29 -0000 Subject: [Lldb-commits] [lldb] r143671 - in /lldb/trunk/utils/misc: ./ grep-svn-log.py Message-ID: <20111104010529.613292A6C12C@llvm.org> Author: johnny Date: Thu Nov 3 20:05:29 2011 New Revision: 143671 URL: http://llvm.org/viewvc/llvm-project?rev=143671&view=rev Log: Add a utility script: Greps and returns the first svn log entry containing a line matching the regular expression pattern passed as the only arg. Example: svn log -v | grep-svn-log.py '^ D.+why_are_you_missing.h$' Added: lldb/trunk/utils/misc/ lldb/trunk/utils/misc/grep-svn-log.py (with props) Added: lldb/trunk/utils/misc/grep-svn-log.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/utils/misc/grep-svn-log.py?rev=143671&view=auto ============================================================================== --- lldb/trunk/utils/misc/grep-svn-log.py (added) +++ lldb/trunk/utils/misc/grep-svn-log.py Thu Nov 3 20:05:29 2011 @@ -0,0 +1,83 @@ +#!/usr/bin/env python + +""" +Greps and returns the first svn log entry containing a line matching the regular +expression pattern passed as the only arg. + +Example: + +svn log -v | grep-svn-log.py '^ D.+why_are_you_missing.h$' +""" + +import fileinput, re, sys, StringIO + +# Separator string for "svn log -v" output. +separator = '-' * 72 + +usage = """Usage: grep-svn-log.py line-pattern +Example: + svn log -v | grep-svn-log.py '^ D.+why_are_you_missing.h'""" + +class Log(StringIO.StringIO): + """Simple facade to keep track of the log content.""" + def __init__(self): + self.reset() + def add_line(self, a_line): + """Add a line to the content, if there is a previous line, commit it.""" + global separator + if self.prev_line != None: + print >> self, self.prev_line + self.prev_line = a_line + self.separator_added = (a_line == separator) + def del_line(self): + """Forget about the previous line, do not commit it.""" + self.prev_line = None + def reset(self): + """Forget about the previous lines entered.""" + StringIO.StringIO.__init__(self) + self.prev_line = None + def finish(self): + """Call this when you're finished with populating content.""" + if self.prev_line != None: + print >> self, self.prev_line + self.prev_line = None + +def grep(regexp): + # The log content to be written out once a match is found. + log = Log() + + LOOKING_FOR_MATCH = 0 + FOUND_LINE_MATCH = 1 + state = LOOKING_FOR_MATCH + + while 1: + line = sys.stdin.readline() + if not line: + return + line = line.splitlines()[0] + if state == FOUND_LINE_MATCH: + # At this state, we keep on accumulating lines until the separator + # is encountered. At which point, we can return the log content. + if line == separator: + print log.getvalue() + return + log.add_line(line) + + elif state == LOOKING_FOR_MATCH: + if line == separator: + log.reset() + log.add_line(line) + # Update next state if necessary. + if regexp.search(line): + state = FOUND_LINE_MATCH + +def main(): + if len(sys.argv) != 2: + print usage + sys.exit(0) + + regexp = re.compile(sys.argv[1]) + grep(regexp) + +if __name__ == '__main__': + main() Propchange: lldb/trunk/utils/misc/grep-svn-log.py ------------------------------------------------------------------------------ svn:executable = * From scallanan at apple.com Thu Nov 3 21:09:33 2011 From: scallanan at apple.com (Sean Callanan) Date: Fri, 04 Nov 2011 02:09:33 -0000 Subject: [Lldb-commits] [lldb] r143676 - /lldb/trunk/source/Expression/ClangUserExpression.cpp Message-ID: <20111104020933.B27DA2A6C12C@llvm.org> Author: spyffe Date: Thu Nov 3 21:09:33 2011 New Revision: 143676 URL: http://llvm.org/viewvc/llvm-project?rev=143676&view=rev Log: Occasionally LLDB runs into contexts where the target is stopped in a C++ or Objective-C method but the "self" pointer's valid range actually doesn't cover the current location. Before, that was confusing Clang to the point where it crashed; now, we sanity-check and fall back to pretending we're in a C function if "self" or "this" isn't available. Modified: lldb/trunk/source/Expression/ClangUserExpression.cpp Modified: lldb/trunk/source/Expression/ClangUserExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangUserExpression.cpp?rev=143676&r1=143675&r2=143676&view=diff ============================================================================== --- lldb/trunk/source/Expression/ClangUserExpression.cpp (original) +++ lldb/trunk/source/Expression/ClangUserExpression.cpp Thu Nov 3 21:09:33 2011 @@ -82,7 +82,7 @@ } void -ClangUserExpression::ScanContext(ExecutionContext &exe_ctx) +ClangUserExpression::ScanContext(ExecutionContext &exe_ctx, Error &err) { m_target = exe_ctx.GetTargetPtr(); @@ -109,6 +109,28 @@ { if (method_decl->isInstance()) { + VariableList *vars = frame->GetVariableList(false); + + const char *thisErrorString = "Stopped in a C++ method, but 'this' isn't available; pretending we are in a generic context"; + + if (!vars) + { + err.SetErrorToGenericError(); + err.SetErrorString(thisErrorString); + return; + } + + lldb::VariableSP this_var = vars->FindVariable(ConstString("this")); + + if (!this_var || + !this_var->IsInScope(frame) || + !this_var->LocationIsValidForFrame (frame)) + { + err.SetErrorToGenericError(); + err.SetErrorString(thisErrorString); + return; + } + m_cplusplus = true; m_needs_object_ptr = true; @@ -125,9 +147,31 @@ } } else if (clang::ObjCMethodDecl *method_decl = llvm::dyn_cast(decl_context)) - { + { if (method_decl->isInstanceMethod()) { + VariableList *vars = frame->GetVariableList(false); + + const char *selfErrorString = "Stopped in an Objective-C method, but 'self' isn't available; pretending we are in a generic context"; + + if (!vars) + { + err.SetErrorToGenericError(); + err.SetErrorString(selfErrorString); + return; + } + + lldb::VariableSP self_var = vars->FindVariable(ConstString("self")); + + if (!self_var || + !self_var->IsInScope(frame) || + !self_var->LocationIsValidForFrame (frame)) + { + err.SetErrorToGenericError(); + err.SetErrorString(selfErrorString); + return; + } + m_objectivec = true; m_needs_object_ptr = true; } @@ -182,7 +226,14 @@ { lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); - ScanContext(exe_ctx); + Error err; + + ScanContext(exe_ctx, err); + + if (!err.Success()) + { + error_stream.Printf("warning: %s\n", err.AsCString()); + } StreamString m_transformed_stream; From gclayton at apple.com Thu Nov 3 22:34:57 2011 From: gclayton at apple.com (Greg Clayton) Date: Fri, 04 Nov 2011 03:34:57 -0000 Subject: [Lldb-commits] [lldb] r143678 - in /lldb/trunk: include/lldb/ include/lldb/API/ include/lldb/Core/ include/lldb/Expression/ include/lldb/Interpreter/ lldb.xcodeproj/ scripts/ scripts/Python/ source/API/ source/Commands/ source/Core/ source/Host/common/ source/Host/macosx/ source/Interpreter/ source/Plugins/DynamicLoader/MacOSX-DYLD/ source/Plugins/Process/MacOSX-Kernel/ source/Plugins/Process/Utility/ source/Symbol/ source/Target/ tools/debugserver/debugserver.xcodeproj/ tools/debugserver/debugserver.xcodeproj/xcshared... Message-ID: <20111104033458.2A9732A6C12C@llvm.org> Author: gclayton Date: Thu Nov 3 22:34:56 2011 New Revision: 143678 URL: http://llvm.org/viewvc/llvm-project?rev=143678&view=rev Log: Fixed the Xcode project building of LLVM to be a bit more user friendly: - If you download and build the sources in the Xcode project, x86_64 builds by default using the "llvm.zip" checkpointed LLVM. - If you delete the "lldb/llvm.zip" and the "lldb/llvm" folder, and build the Xcode project will download the right LLVM sources and build them from scratch - If you have a "lldb/llvm" folder already that contains a "lldb/llvm/lib" directory, we will use the sources you have placed in the LLDB directory. Python can now be disabled for platforms that don't support it. Changed the way the libllvmclang.a files get used. They now all get built into arch specific directories and never get merged into universal binaries as this was causing issues where you would have to go and delete the file if you wanted to build an extra architecture slice. Modified: lldb/trunk/include/lldb/API/SBBreakpointLocation.h lldb/trunk/include/lldb/API/SBFrame.h lldb/trunk/include/lldb/Core/FormatClasses.h lldb/trunk/include/lldb/Core/FormatManager.h lldb/trunk/include/lldb/Expression/ClangUserExpression.h lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h lldb/trunk/include/lldb/lldb-forward-rtti.h lldb/trunk/include/lldb/lldb-forward.h lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/scripts/Python/build-swig-Python.sh lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh lldb/trunk/scripts/build-llvm.pl lldb/trunk/source/API/SBCommandInterpreter.cpp lldb/trunk/source/Commands/CommandObjectType.cpp lldb/trunk/source/Commands/CommandObjectType.h lldb/trunk/source/Core/FormatClasses.cpp lldb/trunk/source/Core/FormatManager.cpp lldb/trunk/source/Host/common/Host.cpp lldb/trunk/source/Host/macosx/Host.mm lldb/trunk/source/Host/macosx/Symbols.cpp lldb/trunk/source/Interpreter/CommandInterpreter.cpp lldb/trunk/source/Interpreter/ScriptInterpreter.cpp lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp lldb/trunk/source/Symbol/ClangASTContext.cpp lldb/trunk/source/Symbol/ClangASTType.cpp lldb/trunk/source/Target/StackFrameList.cpp lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj lldb/trunk/tools/debugserver/debugserver.xcodeproj/xcshareddata/xcschemes/debugserver.xcscheme lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.cpp lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp Modified: lldb/trunk/include/lldb/API/SBBreakpointLocation.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBBreakpointLocation.h?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/include/lldb/API/SBBreakpointLocation.h (original) +++ lldb/trunk/include/lldb/API/SBBreakpointLocation.h Thu Nov 3 22:34:56 2011 @@ -96,8 +96,9 @@ private: friend class SBBreakpoint; +#ifndef LLDB_DISABLE_PYTHON friend class lldb_private::ScriptInterpreterPython; - +#endif void SetLocation (const lldb::BreakpointLocationSP &break_loc_sp); Modified: lldb/trunk/include/lldb/API/SBFrame.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBFrame.h?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/include/lldb/API/SBFrame.h (original) +++ lldb/trunk/include/lldb/API/SBFrame.h Thu Nov 3 22:34:56 2011 @@ -205,7 +205,9 @@ private: friend class SBThread; friend class SBInstruction; +#ifndef LLDB_DISABLE_PYTHON friend class lldb_private::ScriptInterpreterPython; +#endif #ifndef SWIG Modified: lldb/trunk/include/lldb/Core/FormatClasses.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatClasses.h?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/FormatClasses.h (original) +++ lldb/trunk/include/lldb/Core/FormatClasses.h Thu Nov 3 22:34:56 2011 @@ -11,6 +11,22 @@ #define lldb_FormatClasses_h_ // C Includes + +#ifdef LLDB_DISABLE_PYTHON + +struct PyObject; + +#else // #ifdef LLDB_DISABLE_PYTHON + +#if defined (__APPLE__) +#include +#else +#include +#endif + +#endif // #ifdef LLDB_DISABLE_PYTHON + + #include #include @@ -262,6 +278,8 @@ }; +#ifndef LLDB_DISABLE_PYTHON + class SyntheticScriptProvider : public SyntheticChildren { std::string m_python_class; @@ -290,7 +308,7 @@ { return true; } - + class FrontEnd : public SyntheticChildrenFrontEnd { private: @@ -341,10 +359,10 @@ GetFrontEnd(lldb::ValueObjectSP backend) { return SyntheticChildrenFrontEnd::SharedPointer(new FrontEnd(m_python_class, backend)); - } - + } }; - + +#endif // #ifndef LLDB_DISABLE_PYTHON class SyntheticArrayView : public SyntheticChildren { public: @@ -648,6 +666,8 @@ }; +#ifndef LLDB_DISABLE_PYTHON + // Python-based summaries, running script code to show data struct ScriptSummaryFormat : public SummaryFormat { @@ -690,6 +710,8 @@ }; +#endif // #ifndef LLDB_DISABLE_PYTHON + } // namespace lldb_private #endif // lldb_FormatClasses_h_ Modified: lldb/trunk/include/lldb/Core/FormatManager.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatManager.h?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/FormatManager.h (original) +++ lldb/trunk/include/lldb/Core/FormatManager.h Thu Nov 3 22:34:56 2011 @@ -44,15 +44,19 @@ typedef FormatNavigator FilterNavigator; typedef FormatNavigator RegexFilterNavigator; +#ifndef LLDB_DISABLE_PYTHON typedef FormatNavigator SynthNavigator; typedef FormatNavigator RegexSynthNavigator; +#endif // #ifndef LLDB_DISABLE_PYTHON typedef SummaryNavigator::MapType SummaryMap; typedef RegexSummaryNavigator::MapType RegexSummaryMap; typedef FilterNavigator::MapType FilterMap; typedef RegexFilterNavigator::MapType RegexFilterMap; +#ifndef LLDB_DISABLE_PYTHON typedef SynthNavigator::MapType SynthMap; typedef RegexSynthNavigator::MapType RegexSynthMap; +#endif // #ifndef LLDB_DISABLE_PYTHON public: @@ -63,8 +67,10 @@ typedef RegexSummaryNavigator::SharedPointer RegexSummaryNavigatorSP; typedef FilterNavigator::SharedPointer FilterNavigatorSP; typedef RegexFilterNavigator::SharedPointer RegexFilterNavigatorSP; +#ifndef LLDB_DISABLE_PYTHON typedef SynthNavigator::SharedPointer SynthNavigatorSP; typedef RegexSynthNavigator::SharedPointer RegexSynthNavigatorSP; +#endif // #ifndef LLDB_DISABLE_PYTHON FormatCategory (IFormatChangeListener* clist, std::string name); @@ -92,7 +98,8 @@ { return RegexFilterNavigatorSP(m_regex_filter_nav); } - + +#ifndef LLDB_DISABLE_PYTHON SynthNavigatorSP GetSyntheticNavigator () { @@ -104,7 +111,8 @@ { return RegexSynthNavigatorSP(m_regex_synth_nav); } - +#endif // #ifndef LLDB_DISABLE_PYTHON + bool IsEnabled () const { @@ -153,8 +161,10 @@ RegexSummaryNavigator::SharedPointer m_regex_summary_nav; FilterNavigator::SharedPointer m_filter_nav; RegexFilterNavigator::SharedPointer m_regex_filter_nav; +#ifndef LLDB_DISABLE_PYTHON SynthNavigator::SharedPointer m_synth_nav; RegexSynthNavigator::SharedPointer m_regex_synth_nav; +#endif // #ifndef LLDB_DISABLE_PYTHON bool m_enabled; @@ -187,8 +197,10 @@ friend class FormatNavigator; friend class FormatNavigator; +#ifndef LLDB_DISABLE_PYTHON friend class FormatNavigator; friend class FormatNavigator; +#endif // #ifndef LLDB_DISABLE_PYTHON }; Modified: lldb/trunk/include/lldb/Expression/ClangUserExpression.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangUserExpression.h?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/include/lldb/Expression/ClangUserExpression.h (original) +++ lldb/trunk/include/lldb/Expression/ClangUserExpression.h Thu Nov 3 22:34:56 2011 @@ -287,12 +287,12 @@ static ExecutionResults EvaluateWithError (ExecutionContext &exe_ctx, - lldb_private::ExecutionPolicy execution_policy, - bool discard_on_error, - const char *expr_cstr, - const char *expr_prefix, - lldb::ValueObjectSP &result_valobj_sp, - Error &error); + lldb_private::ExecutionPolicy execution_policy, + bool discard_on_error, + const char *expr_cstr, + const char *expr_prefix, + lldb::ValueObjectSP &result_valobj_sp, + Error &error); static const Error::ValueType kNoResult = 0x1001; ///< ValueObject::GetError() returns this if there is no result from the expression. private: @@ -301,7 +301,8 @@ //------------------------------------------------------------------ void - ScanContext(ExecutionContext &exe_ctx); + ScanContext (ExecutionContext &exe_ctx, + lldb_private::Error &err); bool PrepareToExecuteJITExpression (Stream &error_stream, Modified: lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h (original) +++ lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h Thu Nov 3 22:34:56 2011 @@ -11,6 +11,18 @@ #ifndef liblldb_ScriptInterpreterPython_h_ #define liblldb_ScriptInterpreterPython_h_ +#ifdef LLDB_DISABLE_PYTHON + +// Python is disabled in this build + +#else + +#if defined (__APPLE__) +#include +#else +#include +#endif + #include "lldb/lldb-private.h" #include "lldb/Interpreter/ScriptInterpreter.h" #include "lldb/Core/InputReader.h" @@ -232,5 +244,6 @@ }; } // namespace lldb_private +#endif // #ifdef LLDB_DISABLE_PYTHON #endif // #ifndef liblldb_ScriptInterpreterPython_h_ Modified: lldb/trunk/include/lldb/lldb-forward-rtti.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward-rtti.h?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/include/lldb/lldb-forward-rtti.h (original) +++ lldb/trunk/include/lldb/lldb-forward-rtti.h Thu Nov 3 22:34:56 2011 @@ -59,7 +59,9 @@ typedef SharedPtr::Type RegularExpressionSP; typedef SharedPtr::Type SectionSP; typedef SharedPtr::Type SearchFilterSP; +#ifndef LLDB_DISABLE_PYTHON typedef SharedPtr::Type ScriptFormatSP; +#endif // #ifndef LLDB_DISABLE_PYTHON typedef IntrusiveSharedPtr::Type StackFrameSP; typedef SharedPtr::Type StackFrameListSP; typedef SharedPtr::Type StopInfoSP; Modified: lldb/trunk/include/lldb/lldb-forward.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/include/lldb/lldb-forward.h (original) +++ lldb/trunk/include/lldb/lldb-forward.h Thu Nov 3 22:34:56 2011 @@ -126,7 +126,10 @@ class Scalar; struct ScriptSummaryFormat; class ScriptInterpreter; +#ifndef LLDB_DISABLE_PYTHON class ScriptInterpreterPython; +class ScriptSummaryFormat; +#endif // #ifndef LLDB_DISABLE_PYTHON class SearchFilter; class Section; class SectionImpl; @@ -157,7 +160,9 @@ class Symtab; class SyntheticChildren; class SyntheticChildrenFrontEnd; +#ifndef LLDB_DISABLE_PYTHON class SyntheticScriptProvider; +#endif // #ifndef LLDB_DISABLE_PYTHON class Target; class TargetList; class Thread; Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Nov 3 22:34:56 2011 @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 260C876A10F538E700BB2B04 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 260C876910F538E700BB2B04 /* Foundation.framework */; }; 260E07C6136FA69E00CF21D3 /* OptionGroupUUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260E07C5136FA69E00CF21D3 /* OptionGroupUUID.cpp */; }; 260E07C8136FAB9200CF21D3 /* OptionGroupFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260E07C7136FAB9200CF21D3 /* OptionGroupFile.cpp */; }; 261744781168585B005ADD65 /* SBType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 261744771168585B005ADD65 /* SBType.cpp */; }; @@ -29,7 +28,7 @@ 265205A813D3E3F700132FE2 /* RegisterContextKDP_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 265205A213D3E3F700132FE2 /* RegisterContextKDP_arm.cpp */; }; 265205AA13D3E3F700132FE2 /* RegisterContextKDP_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 265205A413D3E3F700132FE2 /* RegisterContextKDP_i386.cpp */; }; 265205AC13D3E3F700132FE2 /* RegisterContextKDP_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 265205A613D3E3F700132FE2 /* RegisterContextKDP_x86_64.cpp */; }; - 265ABF6310F42EE900531910 /* DebugSymbols.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 265ABF6210F42EE900531910 /* DebugSymbols.framework */; }; + 2660AAB914622483003A9694 /* LLDBWrapPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A4EEB511682AAC007A372A /* LLDBWrapPython.cpp */; }; 26651A18133BF9E0005B64B7 /* Opcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26651A17133BF9DF005B64B7 /* Opcode.cpp */; }; 266603CA1345B5A8004DA8B6 /* ConnectionSharedMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266603C91345B5A8004DA8B6 /* ConnectionSharedMemory.cpp */; }; 2668020E115FD12C008E1FE4 /* lldb-defines.h in Headers */ = {isa = PBXBuildFile; fileRef = 26BC7C2510F1B3BC00F91463 /* lldb-defines.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -53,9 +52,6 @@ 2668022C115FD13D008E1FE4 /* SBTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9831081125FC5800A56CB0 /* SBTarget.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2668022E115FD13D008E1FE4 /* SBThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A98310A1125FC5800A56CB0 /* SBThread.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2668022F115FD19D008E1FE4 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C39010F3FA26009D5894 /* CoreFoundation.framework */; }; - 26680230115FD19E008E1FE4 /* DebugSymbols.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 265ABF6210F42EE900531910 /* DebugSymbols.framework */; }; - 26680231115FD1A0008E1FE4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 260C876910F538E700BB2B04 /* Foundation.framework */; }; - 26680232115FD1A4008E1FE4 /* libpython.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C32410F3DF23009D5894 /* libpython.dylib */; }; 26680233115FD1A7008E1FE4 /* libobjc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C37410F3F61B009D5894 /* libobjc.dylib */; }; 26680324116005D9008E1FE4 /* SBThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9831091125FC5800A56CB0 /* SBThread.cpp */; }; 26680326116005DB008E1FE4 /* SBTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9831071125FC5800A56CB0 /* SBTarget.cpp */; }; @@ -342,13 +338,8 @@ 2697A54D133A6305004E4240 /* PlatformDarwin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2697A54B133A6305004E4240 /* PlatformDarwin.cpp */; }; 26A69C5F137A17A500262477 /* RegisterValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C6886E137880C400407EDF /* RegisterValue.cpp */; }; 26A7A035135E6E4200FB369E /* NamedOptionValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A7A034135E6E4200FB369E /* NamedOptionValue.cpp */; }; - 26B1FA1413380E61002886E2 /* LLDBWrapPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A4EEB511682AAC007A372A /* LLDBWrapPython.cpp */; }; 26B1FCB813381071002886E2 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C39010F3FA26009D5894 /* CoreFoundation.framework */; }; - 26B1FCB913381071002886E2 /* DebugSymbols.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 265ABF6210F42EE900531910 /* DebugSymbols.framework */; }; - 26B1FCBA13381071002886E2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 260C876910F538E700BB2B04 /* Foundation.framework */; }; - 26B1FCBB13381071002886E2 /* libpython.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C32410F3DF23009D5894 /* libpython.dylib */; }; 26B1FCBC13381071002886E2 /* libobjc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C37410F3F61B009D5894 /* libobjc.dylib */; }; - 26B1FCBD13381071002886E2 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C74CB6212288704006A8171 /* Carbon.framework */; }; 26B1FCC21338115F002886E2 /* Host.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7EE810F1B88F00F91463 /* Host.mm */; }; 26B42C4D1187ABA50079C8C8 /* LLDB.h in Headers */ = {isa = PBXBuildFile; fileRef = 26B42C4C1187ABA50079C8C8 /* LLDB.h */; settings = {ATTRIBUTES = (Public, ); }; }; 26B8283D142D01E9002DBC64 /* SBSection.h in Headers */ = {isa = PBXBuildFile; fileRef = 26B8283C142D01E9002DBC64 /* SBSection.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -392,11 +383,8 @@ 26F4A21C13FBA31A0064B613 /* ThreadMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F4A21A13FBA31A0064B613 /* ThreadMemory.cpp */; }; 26F5C27710F3D9E4009D5894 /* Driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F5C27310F3D9E4009D5894 /* Driver.cpp */; }; 26F5C27810F3D9E4009D5894 /* IOChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F5C27510F3D9E4009D5894 /* IOChannel.cpp */; }; - 26F5C32510F3DF23009D5894 /* libpython.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C32410F3DF23009D5894 /* libpython.dylib */; }; 26F5C32C10F3DFDD009D5894 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C32A10F3DFDD009D5894 /* libedit.dylib */; }; 26F5C32D10F3DFDD009D5894 /* libtermcap.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C32B10F3DFDD009D5894 /* libtermcap.dylib */; }; - 26F5C37510F3F61B009D5894 /* libobjc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C37410F3F61B009D5894 /* libobjc.dylib */; }; - 26F5C39110F3FA26009D5894 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C39010F3FA26009D5894 /* CoreFoundation.framework */; }; 26F73062139D8FDB00FD51C7 /* History.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F73061139D8FDB00FD51C7 /* History.cpp */; }; 494260DA14579144003C1C78 /* VerifyDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 494260D914579144003C1C78 /* VerifyDecl.cpp */; }; 496B015B1406DEB100F830D5 /* IRInterpreter.h in Headers */ = {isa = PBXBuildFile; fileRef = 496B015A1406DEB100F830D5 /* IRInterpreter.h */; }; @@ -405,7 +393,6 @@ 49A71FE8141FFACF00D59478 /* DataEncoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268ED0A4140FF54200DE830F /* DataEncoder.cpp */; }; 49C8507C1384A786007DB519 /* ProcessDataAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49C850781384A0CA007DB519 /* ProcessDataAllocator.cpp */; }; 49D8FB3913B5598F00411094 /* ClangASTImporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49D8FB3513B558DE00411094 /* ClangASTImporter.cpp */; }; - 4C74CB6312288704006A8171 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C74CB6212288704006A8171 /* Carbon.framework */; }; 4CAA56131422D96A001FFA01 /* BreakpointResolverFileRegex.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CAA56121422D96A001FFA01 /* BreakpointResolverFileRegex.h */; }; 4CAA56151422D986001FFA01 /* BreakpointResolverFileRegex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CAA56141422D986001FFA01 /* BreakpointResolverFileRegex.cpp */; }; 4CABA9E0134A8BCD00539BDD /* ValueObjectMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CABA9DF134A8BCD00539BDD /* ValueObjectMemory.cpp */; }; @@ -1391,11 +1378,7 @@ files = ( 268901161335BBC300698AC0 /* liblldb-core.a in Frameworks */, 2668022F115FD19D008E1FE4 /* CoreFoundation.framework in Frameworks */, - 26680230115FD19E008E1FE4 /* DebugSymbols.framework in Frameworks */, - 26680231115FD1A0008E1FE4 /* Foundation.framework in Frameworks */, - 26680232115FD1A4008E1FE4 /* libpython.dylib in Frameworks */, 26680233115FD1A7008E1FE4 /* libobjc.dylib in Frameworks */, - 4C74CB6312288704006A8171 /* Carbon.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1412,11 +1395,7 @@ files = ( 26DC6A171337FE8000FF7998 /* liblldb-core.a in Frameworks */, 26B1FCB813381071002886E2 /* CoreFoundation.framework in Frameworks */, - 26B1FCB913381071002886E2 /* DebugSymbols.framework in Frameworks */, - 26B1FCBA13381071002886E2 /* Foundation.framework in Frameworks */, - 26B1FCBB13381071002886E2 /* libpython.dylib in Frameworks */, 26B1FCBC13381071002886E2 /* libobjc.dylib in Frameworks */, - 26B1FCBD13381071002886E2 /* Carbon.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1424,13 +1403,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 26F5C32510F3DF23009D5894 /* libpython.dylib in Frameworks */, 26F5C32C10F3DFDD009D5894 /* libedit.dylib in Frameworks */, 26F5C32D10F3DFDD009D5894 /* libtermcap.dylib in Frameworks */, - 26F5C37510F3F61B009D5894 /* libobjc.dylib in Frameworks */, - 26F5C39110F3FA26009D5894 /* CoreFoundation.framework in Frameworks */, - 265ABF6310F42EE900531910 /* DebugSymbols.framework in Frameworks */, - 260C876A10F538E700BB2B04 /* Foundation.framework in Frameworks */, 2668035C11601108008E1FE4 /* LLDB.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -3172,12 +3146,12 @@ 9AA69DB1118A024600D753A0 /* SBInputReader.cpp in Sources */, 268F9D55123AA16600B91E9B /* SBSymbolContextList.cpp in Sources */, 26C72C961243229A0068DC16 /* SBStream.cpp in Sources */, - 26B1FA1413380E61002886E2 /* LLDBWrapPython.cpp in Sources */, 9443B122140C18C40013457C /* SBData.cpp in Sources */, 4CAA56151422D986001FFA01 /* BreakpointResolverFileRegex.cpp in Sources */, 4CF52AF8142829390051E832 /* SBFileSpecList.cpp in Sources */, 26B82840142D020F002DBC64 /* SBSection.cpp in Sources */, B2A58724143119D50092BFBA /* SBWatchpoint.cpp in Sources */, + 2660AAB914622483003A9694 /* LLDBWrapPython.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3582,7 +3556,12 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(NATIVE_ARCH)"; + "ARCHS[sdk=iphoneos*]" = armv7; + "ARCHS[sdk=macosx*]" = ( + x86_64, + i386, + ); DEBUG_INFORMATION_FORMAT = dwarf; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; @@ -3591,6 +3570,12 @@ __STDC_LIMIT_MACROS, LLDB_CONFIGURATION_DEBUG, ); + "GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*][arch=*]" = ( + __STDC_CONSTANT_MACROS, + __STDC_LIMIT_MACROS, + LLDB_CONFIGURATION_DEBUG, + LLDB_DISABLE_PYTHON, + ); GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES; @@ -3604,16 +3589,16 @@ GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; - LLVM_BUILD_DIR_ARCH = ""; - LLVM_CONFIGURATION = Release; + LLVM_BUILD_DIR = "$(OBJROOT)/llvm"; + LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/"; + LLVM_CONFIGURATION = "Release+Debug"; LLVM_SOURCE_DIR = "$(SRCROOT)/llvm"; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "-flimit-debug-info", "-Wparentheses", ); - VALID_ARCHS = "x86_64 i386"; + VALID_ARCHS = "armv4t armv5 armv6 armv7 i386 ppc ppc64 ppc7400 ppc970 x86_64"; }; name = Debug; }; @@ -3621,7 +3606,12 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(NATIVE_ARCH)"; + "ARCHS[sdk=iphoneos*]" = armv7; + "ARCHS[sdk=macosx*]" = ( + x86_64, + i386, + ); DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -3629,6 +3619,12 @@ __STDC_LIMIT_MACROS, LLDB_CONFIGURATION_RELEASE, ); + "GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*][arch=*]" = ( + __STDC_CONSTANT_MACROS, + __STDC_LIMIT_MACROS, + LLDB_CONFIGURATION_RELEASE, + LLDB_DISABLE_PYTHON, + ); GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES; @@ -3642,15 +3638,15 @@ GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; - LLVM_BUILD_DIR_ARCH = ""; - LLVM_CONFIGURATION = Release; + LLVM_BUILD_DIR = "$(OBJROOT)/llvm"; + LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/"; + LLVM_CONFIGURATION = "Release+Debug"; LLVM_SOURCE_DIR = "$(SRCROOT)/llvm"; OTHER_CFLAGS = ( "-flimit-debug-info", "-Wparentheses", ); - VALID_ARCHS = "x86_64 i386"; + VALID_ARCHS = "armv4t armv5 armv6 armv7 i386 ppc ppc64 ppc7400 ppc970 x86_64"; }; name = Release; }; @@ -3707,18 +3703,13 @@ GCC_ENABLE_OBJC_GC = supported; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - __STDC_CONSTANT_MACROS, - __STDC_LIMIT_MACROS, - LLDB_CONFIGURATION_DEBUG, - ); HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "resources/LLDB-Info.plist"; INSTALL_PATH = "$(DEVELOPER_DIR)/Library/PrivateFrameworks"; - LD_DYLIB_INSTALL_NAME = "@rpath/LLDB.framework/Versions/A/LLDB"; + LD_DYLIB_INSTALL_NAME = /Developer/Library/PrivateFrameworks/LLDB.framework/LLDB; LIBRARY_SEARCH_PATHS = ( + "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)", "$(inherited)", - "$(LLVM_BUILD_DIR)", ); OTHER_CPLUSPLUSFLAGS = ( "-fno-rtti", @@ -3727,6 +3718,12 @@ ); OTHER_LDFLAGS = ( "-framework", + Carbon, + "-framework", + DebugSymbols, + "-lpython", + "-lllvmclang", + "-framework", Foundation, "-framework", AppKit, @@ -3734,6 +3731,16 @@ "-t", "-Wl,-v", ); + "OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = ( + "-lllvmclang", + "-v", + "-t", + "-Wl,-v", + "-framework", + UIKit, + "-framework", + Foundation, + ); PRODUCT_NAME = LLDB; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; @@ -3757,18 +3764,13 @@ FRAMEWORK_VERSION = A; GCC_ENABLE_OBJC_GC = supported; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_PREPROCESSOR_DEFINITIONS = ( - __STDC_CONSTANT_MACROS, - __STDC_LIMIT_MACROS, - LLDB_CONFIGURATION_RELEASE, - ); HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "resources/LLDB-Info.plist"; INSTALL_PATH = "$(DEVELOPER_DIR)/Library/PrivateFrameworks"; - LD_DYLIB_INSTALL_NAME = "@rpath/LLDB.framework/Versions/A/LLDB"; + LD_DYLIB_INSTALL_NAME = /Developer/Library/PrivateFrameworks/LLDB.framework/LLDB; LIBRARY_SEARCH_PATHS = ( + "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)", "$(inherited)", - "$(LLVM_BUILD_DIR)", ); OTHER_CPLUSPLUSFLAGS = ( "-fno-rtti", @@ -3777,6 +3779,12 @@ ); OTHER_LDFLAGS = ( "-framework", + Carbon, + "-framework", + DebugSymbols, + "-lpython", + "-lllvmclang", + "-framework", Foundation, "-framework", AppKit, @@ -3784,6 +3792,16 @@ "-t", "-Wl,-v", ); + "OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = ( + "-lllvmclang", + "-v", + "-t", + "-Wl,-v", + "-framework", + UIKit, + "-framework", + Foundation, + ); PRODUCT_NAME = LLDB; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; @@ -3803,16 +3821,7 @@ ); GCC_ENABLE_OBJC_GC = supported; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_PREPROCESSOR_DEFINITIONS = ( - __STDC_CONSTANT_MACROS, - __STDC_LIMIT_MACROS, - LLDB_CONFIGURATION_DEBUG, - ); LD_DYLIB_INSTALL_NAME = "$(DEVELOPER_DIR)/Library/PrivateFrameworks/LLDB.framework/Resources/lldb-core.a"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(LLVM_BUILD_DIR)", - ); MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.6; OTHER_CPLUSPLUSFLAGS = ( @@ -3820,7 +3829,7 @@ "-Wglobal-constructors", "$(OTHER_CFLAGS)", ); - OTHER_LDFLAGS = "-lllvmclang"; + OTHER_LDFLAGS = ""; PRODUCT_NAME = "lib$(TARGET_NAME)"; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; @@ -3841,16 +3850,7 @@ ); GCC_ENABLE_OBJC_GC = supported; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_PREPROCESSOR_DEFINITIONS = ( - __STDC_CONSTANT_MACROS, - __STDC_LIMIT_MACROS, - LLDB_CONFIGURATION_RELEASE, - ); LD_DYLIB_INSTALL_NAME = "$(DEVELOPER_DIR)/Library/PrivateFrameworks/LLDB.framework/Resources/lldb-core.a"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(LLVM_BUILD_DIR)", - ); MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.6; OTHER_CPLUSPLUSFLAGS = ( @@ -3858,7 +3858,7 @@ "-Wglobal-constructors", "$(OTHER_CFLAGS)", ); - OTHER_LDFLAGS = "-lllvmclang"; + OTHER_LDFLAGS = ""; PRODUCT_NAME = "lib$(TARGET_NAME)"; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; @@ -3879,16 +3879,7 @@ ); GCC_ENABLE_OBJC_GC = supported; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_PREPROCESSOR_DEFINITIONS = ( - __STDC_CONSTANT_MACROS, - __STDC_LIMIT_MACROS, - LLDB_CONFIGURATION_BUILD_AND_INTEGRATION, - ); LD_DYLIB_INSTALL_NAME = "$(DEVELOPER_DIR)/Library/PrivateFrameworks/LLDB.framework/Resources/lldb-core.a"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(LLVM_BUILD_DIR)", - ); MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.6; OTHER_CPLUSPLUSFLAGS = ( @@ -3896,7 +3887,7 @@ "-Wglobal-constructors", "$(OTHER_CFLAGS)", ); - OTHER_LDFLAGS = "-lllvmclang"; + OTHER_LDFLAGS = ""; PRODUCT_NAME = "lib$(TARGET_NAME)"; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; @@ -3908,7 +3899,12 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(NATIVE_ARCH)"; + "ARCHS[sdk=iphoneos*]" = armv7; + "ARCHS[sdk=macosx*]" = ( + x86_64, + i386, + ); DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -3916,6 +3912,12 @@ __STDC_LIMIT_MACROS, LLDB_CONFIGURATION_BUILD_AND_INTEGRATION, ); + "GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*][arch=*]" = ( + __STDC_CONSTANT_MACROS, + __STDC_LIMIT_MACROS, + LLDB_CONFIGURATION_BUILD_AND_INTEGRATION, + LLDB_DISABLE_PYTHON, + ); GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_MISSING_NEWLINE = YES; @@ -3931,13 +3933,13 @@ GCC_WARN_UNUSED_VARIABLE = YES; LLVM_BUILD_DIR = "$(OBJROOT)/llvm"; LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/"; - LLVM_CONFIGURATION = Release; + LLVM_CONFIGURATION = "Release+Debug"; LLVM_SOURCE_DIR = "$(SRCROOT)/llvm"; OTHER_CFLAGS = ( "-flimit-debug-info", "-Wparentheses", ); - VALID_ARCHS = "x86_64 i386"; + VALID_ARCHS = "armv4t armv5 armv6 armv7 i386 ppc ppc64 ppc7400 ppc970 x86_64"; }; name = BuildAndIntegration; }; @@ -3986,18 +3988,13 @@ FRAMEWORK_VERSION = A; GCC_ENABLE_OBJC_GC = supported; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_PREPROCESSOR_DEFINITIONS = ( - __STDC_CONSTANT_MACROS, - __STDC_LIMIT_MACROS, - LLDB_CONFIGURATION_BUILD_AND_INTEGRATION, - ); HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "resources/LLDB-Info.plist"; INSTALL_PATH = "$(DEVELOPER_DIR)/Library/PrivateFrameworks"; - LD_DYLIB_INSTALL_NAME = "@rpath/LLDB.framework/Versions/A/LLDB"; + LD_DYLIB_INSTALL_NAME = /Developer/Library/PrivateFrameworks/LLDB.framework/LLDB; LIBRARY_SEARCH_PATHS = ( + "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)", "$(inherited)", - "$(LLVM_BUILD_DIR)", ); OTHER_CPLUSPLUSFLAGS = ( "-fno-rtti", @@ -4006,6 +4003,12 @@ ); OTHER_LDFLAGS = ( "-framework", + Carbon, + "-framework", + DebugSymbols, + "-lpython", + "-lllvmclang", + "-framework", Foundation, "-framework", AppKit, @@ -4013,6 +4016,16 @@ "-t", "-Wl,-v", ); + "OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = ( + "-lllvmclang", + "-v", + "-t", + "-Wl,-v", + "-framework", + UIKit, + "-framework", + Foundation, + ); PRODUCT_NAME = LLDB; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; @@ -4023,6 +4036,7 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_IDENTITY = lldb_codesign; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = NO; DEAD_CODE_STRIPPING = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -4034,12 +4048,49 @@ GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_SYMBOLS_PRIVATE_EXTERN = NO; + INFOPLIST_PREPROCESSOR_DEFINITIONS = ( + "-lobjc", + "-lpython", + "-framework", + DebugSymbols, + "-framework", + Carbon, + "-framework", + Foundation, + "-framework", + AppKit, + "-v", + "-t", + "-Wl,-v", + ); INSTALL_PATH = "$(DEVELOPER_DIR)/usr/bin"; + LIBRARY_SEARCH_PATHS = ( + "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)", + "$(inherited)", + ); + LLVM_CONFIGURATION = Release; + "LLVM_CONFIGURATION[sdk=iphoneos*][arch=*]" = "Release+Debug"; OTHER_LDFLAGS = ( + "-lllvmclang", + "-lpython", + "-framework", + DebugSymbols, + "-framework", + Carbon, "-framework", Foundation, "-framework", AppKit, + "-v", + "-t", + "-Wl,-v", + ); + "OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = ( + "-lllvmclang", + "-framework", + Foundation, + "-framework", + UIKit, ); PRODUCT_NAME = "lldb-platform"; PROVISIONING_PROFILE = ""; @@ -4051,6 +4102,7 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_IDENTITY = lldb_codesign; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = YES; DEAD_CODE_STRIPPING = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -4060,12 +4112,49 @@ GCC_ENABLE_CPP_RTTI = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_SYMBOLS_PRIVATE_EXTERN = NO; + INFOPLIST_PREPROCESSOR_DEFINITIONS = ( + "-lobjc", + "-lpython", + "-framework", + DebugSymbols, + "-framework", + Carbon, + "-framework", + Foundation, + "-framework", + AppKit, + "-v", + "-t", + "-Wl,-v", + ); INSTALL_PATH = "$(DEVELOPER_DIR)/usr/bin"; + LIBRARY_SEARCH_PATHS = ( + "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)", + "$(inherited)", + ); + LLVM_CONFIGURATION = Release; + "LLVM_CONFIGURATION[sdk=iphoneos*][arch=*]" = "Release+Debug"; OTHER_LDFLAGS = ( + "-lllvmclang", + "-lpython", + "-framework", + DebugSymbols, + "-framework", + Carbon, "-framework", Foundation, "-framework", AppKit, + "-v", + "-t", + "-Wl,-v", + ); + "OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = ( + "-lllvmclang", + "-framework", + Foundation, + "-framework", + UIKit, ); PRODUCT_NAME = "lldb-platform"; PROVISIONING_PROFILE = ""; @@ -4084,12 +4173,49 @@ GCC_ENABLE_CPP_RTTI = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_SYMBOLS_PRIVATE_EXTERN = NO; + INFOPLIST_PREPROCESSOR_DEFINITIONS = ( + "-lobjc", + "-lpython", + "-framework", + DebugSymbols, + "-framework", + Carbon, + "-framework", + Foundation, + "-framework", + AppKit, + "-v", + "-t", + "-Wl,-v", + ); INSTALL_PATH = "$(DEVELOPER_DIR)/usr/bin"; + LIBRARY_SEARCH_PATHS = ( + "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)", + "$(inherited)", + ); + LLVM_CONFIGURATION = Release; + "LLVM_CONFIGURATION[sdk=iphoneos*][arch=*]" = "Release+Debug"; OTHER_LDFLAGS = ( + "-lllvmclang", + "-lpython", + "-framework", + DebugSymbols, + "-framework", + Carbon, "-framework", Foundation, "-framework", AppKit, + "-v", + "-t", + "-Wl,-v", + ); + "OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = ( + "-lllvmclang", + "-framework", + Foundation, + "-framework", + UIKit, ); PRODUCT_NAME = "lldb-platform"; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; Modified: lldb/trunk/scripts/Python/build-swig-Python.sh URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/build-swig-Python.sh?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/scripts/Python/build-swig-Python.sh (original) +++ lldb/trunk/scripts/Python/build-swig-Python.sh Thu Nov 3 22:34:56 2011 @@ -23,6 +23,8 @@ swig_python_extensions=${SRC_ROOT}/scripts/Python/python-extensions.swig swig_python_wrapper=${SRC_ROOT}/scripts/Python/python-wrapper.swig +if [ "x$SDKROOT" = "x" ] ; then + if [ -n "$debug_flag" -a "$debug_flag" == "-debug" ] then Debug=1 @@ -265,3 +267,9 @@ mv "${swig_output_file}.edited" ${swig_output_file} fi fi + +else + # SDKROOT was not empty, which currently means iOS cross build where python is disabled + rm -rf ${swig_output_file} + touch ${swig_output_file} +fi Modified: lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh (original) +++ lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh Thu Nov 3 22:34:56 2011 @@ -33,6 +33,10 @@ PYTHON_INSTALL_DIR=$4 debug_flag=$5 +# Make sure SDKROOT is not set, since if it is this is an iOS build where python +# is disabled +if [ "x$SDKROOT" = "x" ] ; then + if [ -n "$debug_flag" -a "$debug_flag" == "-debug" ] then Debug=1 @@ -180,5 +184,7 @@ fi fi +fi + exit 0 Modified: lldb/trunk/scripts/build-llvm.pl URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/build-llvm.pl?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/scripts/build-llvm.pl (original) +++ lldb/trunk/scripts/build-llvm.pl Thu Nov 3 22:34:56 2011 @@ -18,15 +18,33 @@ our $llvm_clang_outfile = $ENV{SCRIPT_OUTPUT_FILE_0}; our ($llvm_clang_basename, $llvm_clang_dirname) = fileparse ($llvm_clang_outfile); -our @llvm_clang_slices; # paths to the single architecture static libraries (archives) our $llvm_configuration = $ENV{LLVM_CONFIGURATION}; our $llvm_revision = "143472"; our $clang_revision = "143472"; -our $llvm_source_dir = "$ENV{SRCROOT}"; +our $SRCROOT = "$ENV{SRCROOT}"; +our $llvm_dstroot_zip = "$SRCROOT/llvm.zip"; our @archs = split (/\s+/, $ENV{ARCHS}); +my $os_release = 11; + +our %llvm_config_info = ( + 'Debug' => { configure_options => '--disable-optimized --disable-assertions', make_options => 'DEBUG_SYMBOLS=1'}, + 'Debug+Asserts' => { configure_options => '--disable-optimized --enable-assertions' , make_options => 'DEBUG_SYMBOLS=1'}, + 'Release' => { configure_options => '--enable-optimized --disable-assertions' , make_options => ''}, + 'Release+Debug' => { configure_options => '--enable-optimized --disable-assertions' , make_options => 'DEBUG_SYMBOLS=1'}, +); + +our $llvm_config_href = undef; +if (exists $llvm_config_info{"$llvm_configuration"}) +{ + $llvm_config_href = $llvm_config_info{$llvm_configuration}; +} +else +{ + die "Unsupported LLVM configuration: '$llvm_configuration'\n"; +} our @archive_files = ( "$llvm_configuration/lib/libclang.a", @@ -85,37 +103,71 @@ "$llvm_configuration/lib/libLLVMX86Utils.a", ); -if ($ENV{CONFIGURATION} ne "BuildAndIntegration" and -e "$llvm_srcroot/lib") +if (-e "$llvm_srcroot/lib") { - print "Using standard LLVM build directory...\n"; - # LLVM in the "lldb" root is a symlink which indicates we are using a - # standard LLVM build directory where everything is built into the - # same folder - create_single_llvm_arhive_for_arch ($llvm_dstroot, 1); - my $llvm_dstroot_archive = "$llvm_dstroot/$llvm_clang_basename"; - push @llvm_clang_slices, $llvm_dstroot_archive; - create_dstroot_file ($llvm_clang_basename, $llvm_clang_dirname, \@llvm_clang_slices, $llvm_clang_basename); - exit 0; + print "Using existing llvm sources in: '$llvm_srcroot'\n"; + print "Using standard LLVM build directory:\n SRC = '$llvm_srcroot'\n DST = '$llvm_dstroot'\n"; } - - -if ($ENV{CONFIGURATION} eq "Debug" or $ENV{CONFIGURATION} eq "Release") +elsif (-e $llvm_dstroot_zip) { # Check for an old llvm source install (not the minimal zip based # install by looking for a .svn file in the llvm directory - chomp(my $llvm_zip_md5 = `md5 -q $ENV{SRCROOT}/llvm.zip`); + chomp(my $llvm_zip_md5 = `md5 -q '$llvm_dstroot_zip'`); my $llvm_zip_md5_file = "$ENV{SRCROOT}/llvm/$llvm_zip_md5"; if (!-e "$llvm_zip_md5_file") { - print "Updating LLVM to use checkpoint from: '$ENV{SRCROOT}/llvm.zip'...\n"; + print "Updating LLVM to use checkpoint from: '$llvm_dstroot_zip'...\n"; if (-d "$ENV{SRCROOT}/llvm") { do_command ("cd '$ENV{SRCROOT}' && rm -rf llvm", "removing old llvm repository", 1); } do_command ("cd '$ENV{SRCROOT}' && unzip -q llvm.zip && touch '$llvm_zip_md5_file'", "expanding llvm.zip", 1); + + } + my $arch_idx = 0; + foreach my $arch (@archs) + { + my $llvm_dstroot_arch = "${llvm_dstroot}/${arch}"; + # Check for our symlink to our .a file + if (!-l "$llvm_dstroot_arch/$llvm_clang_basename") + { + # Symlink doesn't exist, make sure it isn't a normal file + if (-e "$llvm_dstroot_arch/$llvm_clang_basename") + { + # the .a file is a normal file which means it can't be from the + # zip file, we must remove the previous arch directory + do_command ("rm -rf '$llvm_dstroot_arch'", "Removing old '$llvm_dstroot_arch' directory", 1); + } + # Create the arch specific LLVM destination directory if needed + if (!-d $llvm_dstroot_arch) + { + do_command ("mkdir -p '$llvm_dstroot_arch'", "making llvm build directory '$llvm_dstroot_arch'", 1); + } + + # Create a symlink to the .a file from the zip file + do_command ("cd '$llvm_dstroot_arch' ; ln -s $ENV{SRCROOT}/llvm/$llvm_clang_basename", "making llvm archive symlink", 1); + } } exit 0; } +else +{ + print "Checking out llvm sources from revision $llvm_revision...\n"; + do_command ("cd '$SRCROOT' && svn co --quiet --revision $llvm_revision http://llvm.org/svn/llvm-project/llvm/trunk llvm", "checking out llvm from repository", 1); + print "Checking out clang sources from revision $clang_revision...\n"; + do_command ("cd '$llvm_srcroot/tools' && svn co --quiet --revision $clang_revision http://llvm.org/svn/llvm-project/cfe/trunk clang", "checking out clang from repository", 1); + print "Applying any local patches to LLVM..."; + + my @llvm_patches = bsd_glob("$ENV{SRCROOT}/scripts/llvm.*.diff"); + + foreach my $patch (@llvm_patches) + { + do_command ("cd '$llvm_srcroot' && patch -p0 < $patch"); + } + + print "Removing the llvm/test and llvm/tools/clang/test directories...\n"; + do_command ("cd '$llvm_srcroot' && rm -rf test && rm -rf tools/clang/test ", "removing test directories", 1); +} # If our output file already exists then we need not generate it again. if (-e $llvm_clang_outfile) @@ -140,34 +192,6 @@ sub build_llvm { #my $extra_svn_options = $debug ? "" : "--quiet"; - my $svn_options = "--quiet"; - if (-d "$llvm_source_dir/llvm") - { - print "Using existing llvm sources in: '$llvm_source_dir/llvm'\n"; - # print "Updating llvm to revision $llvm_revision\n"; - # do_command ("cd '$llvm_source_dir/llvm' && svn update $svn_options --revision $llvm_revision", "updating llvm from repository", 1); - # print "Updating clang to revision $llvm_revision\n"; - # do_command ("cd '$llvm_source_dir/llvm/tools/clang' && svn update $svn_options --revision $clang_revision", "updating clang from repository", 1); - } - else - { - print "Checking out llvm sources from revision $llvm_revision...\n"; - do_command ("cd '$llvm_source_dir' && svn co $svn_options --revision $llvm_revision http://llvm.org/svn/llvm-project/llvm/trunk llvm", "checking out llvm from repository", 1); - print "Checking out clang sources from revision $clang_revision...\n"; - do_command ("cd '$llvm_source_dir/llvm/tools' && svn co $svn_options --revision $clang_revision http://llvm.org/svn/llvm-project/cfe/trunk clang", "checking out clang from repository", 1); - print "Applying any local patches to LLVM..."; - - my @llvm_patches = bsd_glob("$ENV{SRCROOT}/scripts/llvm.*.diff"); - - foreach my $patch (@llvm_patches) - { - do_command ("cd '$llvm_source_dir/llvm' && patch -p0 < $patch"); - } - - print "Removing the llvm/test directory...\n"; - do_command ("cd '$llvm_source_dir' && rm -rf llvm/test", "removing test directory", 1); - } - # Make the llvm build directory my $arch_idx = 0; foreach my $arch (@archs) @@ -177,7 +201,8 @@ # if the arch destination root exists we have already built it my $do_configure = 0; my $do_make = 0; - + my $is_arm = $arch =~ /^arm/; + my $llvm_dstroot_arch_archive = "$llvm_dstroot_arch/$llvm_clang_basename"; print "LLVM architecture root for ${arch} exists at '$llvm_dstroot_arch'..."; if (-e $llvm_dstroot_arch) @@ -209,25 +234,59 @@ do_command ("mkdir -p '$llvm_dstroot_arch'", "making llvm build directory '$llvm_dstroot_arch'", 1); $do_configure = 1; $do_make = 1; - } - - # If this is the first architecture, then make a symbolic link - # for any header files that get generated. - if ($arch_idx == 0) - { - if (!-l "$llvm_dstroot/llvm") + + if ($is_arm) { - do_command ("cd $llvm_dstroot && ln -s './${arch}' llvm"); + my $llvm_dstroot_arch_bin = "${llvm_dstroot_arch}/bin"; + + if (!-d $llvm_dstroot_arch_bin) + { + do_command ("mkdir -p '$llvm_dstroot_arch_bin'", "making llvm build arch bin directory '$llvm_dstroot_arch_bin'", 1); + my @tools = ("ar", "nm", "ranlib", "strip", "lipo", "ld", "as"); + my $script_mode = 0755; + my $prog; + for $prog (@tools) + { + chomp(my $actual_prog_path = `xcrun -sdk '$ENV{SDKROOT}' -find ${prog}`); + my $script_prog_path = "$llvm_dstroot_arch_bin/arm-apple-darwin${os_release}-${prog}"; + open (SCRIPT, ">$script_prog_path") or die "Can't open $! for writing...\n"; + print SCRIPT "#!/bin/sh\nexec '$actual_prog_path' \"\$\@\"\n"; + close (SCRIPT); + chmod($script_mode, $script_prog_path); + } + # Tools that must have the "-arch" and "-sysroot" specified + my @arch_sysroot_tools = ("clang", "clang++", "gcc", "g++"); + for $prog (@arch_sysroot_tools) + { + chomp(my $actual_prog_path = `xcrun -sdk '$ENV{SDKROOT}' -find ${prog}`); + my $script_prog_path = "$llvm_dstroot_arch_bin/arm-apple-darwin${os_release}-${prog}"; + open (SCRIPT, ">$script_prog_path") or die "Can't open $! for writing...\n"; + print SCRIPT "#!/bin/sh\nexec '$actual_prog_path' -arch ${arch} -isysroot '$ENV{SDKROOT}' \"\$\@\"\n"; + close (SCRIPT); + chmod($script_mode, $script_prog_path); + } + my $new_path = "$ENV{PATH}:$llvm_dstroot_arch_bin"; + print "Setting new environment PATH = '$new_path'\n"; + $ENV{PATH} = $new_path; + } } } - + if ($do_configure) { # Build llvm and clang print "Configuring clang ($arch) in '$llvm_dstroot_arch'...\n"; - my $lldb_configuration_options = ''; - $llvm_configuration eq 'Release' and $lldb_configuration_options .= '--enable-optimized --disable-assertions'; - do_command ("cd '$llvm_dstroot_arch' && '$llvm_source_dir/llvm/configure' $lldb_configuration_options --enable-targets=x86_64,arm --build=$arch-apple-darwin10", + my $lldb_configuration_options = "--enable-targets=x86_64,arm $llvm_config_href->{configure_options}"; + + if ($is_arm) + { + $lldb_configuration_options .= " --host=arm-apple-darwin${os_release} --target=arm-apple-darwin${os_release} --build=i686-apple-darwin${os_release}"; + } + else + { + $lldb_configuration_options .= " --build=$arch-apple-darwin${os_release}"; + } + do_command ("cd '$llvm_dstroot_arch' && '$llvm_srcroot/configure' $lldb_configuration_options", "configuring llvm build", 1); } @@ -236,52 +295,22 @@ # Build llvm and clang my $num_cpus = parallel_guess(); print "Building clang using $num_cpus cpus ($arch)...\n"; - do_command ("cd '$llvm_dstroot_arch' && make -j$num_cpus clang-only VERBOSE=1 PROJECT_NAME='llvm'", "making llvm and clang", 1); - do_command ("cd '$llvm_dstroot_arch' && make -j$num_cpus tools-only VERBOSE=1 PROJECT_NAME='llvm' EDIS_VERSION=1", "making libedis", 1); + my $extra_make_flags = ''; + if ($is_arm) + { + $extra_make_flags = "UNIVERSAL=1 UNIVERSAL_ARCH=${arch} UNIVERSAL_SDK_PATH='$ENV{SDKROOT}'"; + } + do_command ("cd '$llvm_dstroot_arch' && make -j$num_cpus clang-only VERBOSE=1 $llvm_config_href->{make_options} NO_RUNTIME_LIBS=1 PROJECT_NAME='llvm' $extra_make_flags", "making llvm and clang", 1); + do_command ("cd '$llvm_dstroot_arch' && make -j$num_cpus tools-only VERBOSE=1 $llvm_config_href->{make_options} NO_RUNTIME_LIBS=1 PROJECT_NAME='llvm' $extra_make_flags EDIS_VERSION=1", "making libedis", 1); # Combine all .o files from a bunch of static libraries from llvm # and clang into a single .a file. create_single_llvm_arhive_for_arch ($llvm_dstroot_arch, 1); } - -f "$llvm_dstroot_arch_archive" and push @llvm_clang_slices, "$llvm_dstroot_arch_archive"; ++$arch_idx; } - - # Combine all skinny slices of the LLVM/Clang combined archive - create_dstroot_file ($llvm_clang_basename, $llvm_clang_dirname, \@llvm_clang_slices, $llvm_clang_basename); } -sub create_dstroot_file -{ - my $file = shift; - my $dir = shift; - my $fullpath = "$dir/$file"; # The path to the file to create - my $slice_aref = shift; # Array containing one or more skinny files that will be combined into $fullpath - my $what = shift; # Text describing the $fullpath - - print "create_dstroot_file file = '$file', dir = '$dir', slices = (" . join (', ', @$slice_aref) . ") for what = '$what'\n"; - - if (-d $dir) - { - if (@$slice_aref > 0) - { - print "Creating and installing $what into '$fullpath'...\n"; - my $lipo_command = "lipo -output '$fullpath' -create"; - foreach (@$slice_aref) { $lipo_command .= " '$_'"; } - do_command ($lipo_command, "creating $what universal output file", 1); - } - - - if (!-e $fullpath) - { - # die "error: '$fullpath' is missing\n"; - } - } - else - { - die "error: directory '$dir' doesn't exist to receive file '$file'\n"; - } -} #---------------------------------------------------------------------- # quote the path if needed and realpath it if the -r option was # specified Modified: lldb/trunk/source/API/SBCommandInterpreter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommandInterpreter.cpp?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/API/SBCommandInterpreter.cpp (original) +++ lldb/trunk/source/API/SBCommandInterpreter.cpp Thu Nov 3 22:34:56 2011 @@ -316,6 +316,7 @@ } +#ifndef LLDB_DISABLE_PYTHON extern "C" bool LLDBSwigPythonBreakpointCallbackFunction ( @@ -358,6 +359,10 @@ lldb_private::CommandReturnObject& cmd_retobj ); +// Defined in the SWIG source file +extern "C" void +init_lldb(void); + extern "C" bool LLDBSwigPythonCallModuleInit ( const std::string python_module_name, @@ -365,9 +370,18 @@ lldb::DebuggerSP& debugger ); +#else extern "C" void init_lldb(void); +// Usually defined in the SWIG source file, but we have sripting disabled +extern "C" void +init_lldb(void) +{ +} + +#endif + void SBCommandInterpreter::InitializeSWIG () { @@ -375,6 +389,7 @@ if (!g_initialized) { g_initialized = true; +#ifndef LLDB_DISABLE_PYTHON ScriptInterpreter::InitializeInterpreter (init_lldb, LLDBSwigPythonBreakpointCallbackFunction, LLDBSwigPythonCallTypeScript, @@ -386,5 +401,6 @@ LLDBSwigPython_UpdateSynthProviderInstance, LLDBSwigPythonCallCommand, LLDBSwigPythonCallModuleInit); +#endif } } Modified: lldb/trunk/source/Commands/CommandObjectType.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectType.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectType.cpp Thu Nov 3 22:34:56 2011 @@ -48,7 +48,7 @@ bool m_one_liner; bool m_regex; - ConstString* m_name; + ConstString m_name; std::string m_category; @@ -59,19 +59,19 @@ bool novl, bool onel, bool regx, - ConstString* name, + const ConstString& name, std::string catg) : - m_skip_pointers(sptr), - m_skip_references(sref), - m_cascade(casc), - m_target_types(), - m_user_source(), - m_no_children(noch), - m_no_value(novl), - m_one_liner(onel), - m_regex(regx), - m_name(name), - m_category(catg) + m_skip_pointers(sptr), + m_skip_references(sref), + m_cascade(casc), + m_target_types(), + m_user_source(), + m_no_children(noch), + m_no_value(novl), + m_one_liner(onel), + m_regex(regx), + m_name(name), + m_category(catg) { } @@ -157,7 +157,7 @@ bool m_skip_pointers; bool m_regex; std::string m_format_string; - ConstString* m_name; + ConstString m_name; std::string m_python_script; std::string m_python_function; bool m_is_add_script; @@ -753,7 +753,7 @@ } - +#ifndef LLDB_DISABLE_PYTHON //------------------------------------------------------------------------- // CommandObjectTypeSummaryAdd @@ -901,13 +901,18 @@ if (options->m_name) { - if ( (bool)(*(options->m_name)) ) + CommandObjectTypeSummaryAdd::AddSummary (options->m_name, + script_format, + CommandObjectTypeSummaryAdd::eNamedSummary, + options->m_category, + &error); + if (error.Fail()) { - CommandObjectTypeSummaryAdd::AddSummary(*(options->m_name), - script_format, - CommandObjectTypeSummaryAdd::eNamedSummary, - options->m_category, - &error); + CommandObjectTypeSummaryAdd::AddSummary (options->m_name, + script_format, + CommandObjectTypeSummaryAdd::eNamedSummary, + options->m_category, + &error); if (error.Fail()) { out_stream->Printf ("%s", error.AsCString()); @@ -922,9 +927,17 @@ return; } } + else + { + out_stream->PutCString (error.AsCString()); + out_stream->Flush(); + return; + } } }; +#endif // #ifndef LLDB_DISABLE_PYTHON + Error CommandObjectTypeSummaryAdd::CommandOptions::SetOptionValue (uint32_t option_idx, const char *option_arg) { @@ -961,7 +974,7 @@ m_regex = true; break; case 'n': - m_name = new ConstString(option_arg); + m_name.SetCString(option_arg); break; case 'o': m_python_script = std::string(option_arg); @@ -995,7 +1008,7 @@ m_skip_references = false; m_skip_pointers = false; m_regex = false; - m_name = NULL; + m_name.Clear(); m_python_script = ""; m_python_function = ""; m_format_string = ""; @@ -1003,6 +1016,7 @@ m_category = "default"; } +#ifndef LLDB_DISABLE_PYTHON void CommandObjectTypeSummaryAdd::CollectPythonScript (ScriptAddOptions *options, CommandReturnObject &result) @@ -1166,28 +1180,28 @@ if (m_options.m_name) { - if ( (bool)(*(m_options.m_name)) ) - { - AddSummary(*(m_options.m_name), script_format, eNamedSummary, m_options.m_category, &error); - if (error.Fail()) - { - result.AppendError(error.AsCString()); - result.AppendError("added to types, but not given a name"); - result.SetStatus(eReturnStatusFailed); - return false; - } - } - else + AddSummary(m_options.m_name, script_format, eNamedSummary, m_options.m_category, &error); + if (error.Fail()) { + result.AppendError(error.AsCString()); result.AppendError("added to types, but not given a name"); result.SetStatus(eReturnStatusFailed); return false; } } + else + { + result.AppendError("added to types, but not given a name"); + result.SetStatus(eReturnStatusFailed); + return false; + } return result.Succeeded(); } +#endif + + bool CommandObjectTypeSummaryAdd::Execute_StringSummary (Args& command, CommandReturnObject &result) { @@ -1263,24 +1277,21 @@ if (m_options.m_name) { - if ( (bool)(*(m_options.m_name)) ) - { - AddSummary(*(m_options.m_name), entry, eNamedSummary, m_options.m_category, &error); - if (error.Fail()) - { - result.AppendError(error.AsCString()); - result.AppendError("added to types, but not given a name"); - result.SetStatus(eReturnStatusFailed); - return false; - } - } - else + AddSummary(m_options.m_name, entry, eNamedSummary, m_options.m_category, &error); + if (error.Fail()) { + result.AppendError(error.AsCString()); result.AppendError("added to types, but not given a name"); result.SetStatus(eReturnStatusFailed); return false; } } + else + { + result.AppendError("added to types, but not given a name"); + result.SetStatus(eReturnStatusFailed); + return false; + } result.SetStatus(eReturnStatusSuccessFinishNoResult); return result.Succeeded(); @@ -1372,9 +1383,17 @@ CommandObjectTypeSummaryAdd::Execute (Args& command, CommandReturnObject &result) { if (m_options.m_is_add_script) + { +#ifndef LLDB_DISABLE_PYTHON return Execute_ScriptSummary(command, result); - else - return Execute_StringSummary(command, result); +#else + result.AppendError ("python is disabled"); + result.SetStatus(eReturnStatusFailed); + return false; +#endif + } + + return Execute_StringSummary(command, result); } bool @@ -2454,6 +2473,8 @@ { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL } }; +#ifndef LLDB_DISABLE_PYTHON + //------------------------------------------------------------------------- // CommandObjectTypeSynthList //------------------------------------------------------------------------- @@ -2664,6 +2685,7 @@ { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL } }; +#endif // #ifndef LLDB_DISABLE_PYTHON //------------------------------------------------------------------------- // CommandObjectTypeFilterDelete //------------------------------------------------------------------------- @@ -2826,6 +2848,8 @@ { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL } }; +#ifndef LLDB_DISABLE_PYTHON + //------------------------------------------------------------------------- // CommandObjectTypeSynthDelete //------------------------------------------------------------------------- @@ -2988,6 +3012,8 @@ { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL } }; +#endif // #ifndef LLDB_DISABLE_PYTHON + //------------------------------------------------------------------------- // CommandObjectTypeFilterClear //------------------------------------------------------------------------- @@ -3114,6 +3140,7 @@ { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL } }; +#ifndef LLDB_DISABLE_PYTHON //------------------------------------------------------------------------- // CommandObjectTypeSynthClear //------------------------------------------------------------------------- @@ -3240,8 +3267,9 @@ { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL } }; + //------------------------------------------------------------------------- -// CommandObjectTypeSynthAdd +// TypeSynthAddInputReader //------------------------------------------------------------------------- static const char *g_synth_addreader_instructions = "Enter your Python command(s). Type 'DONE' to end.\n" @@ -3257,11 +3285,9 @@ class TypeSynthAddInputReader : public InputReaderEZ { -private: - DISALLOW_COPY_AND_ASSIGN (TypeSynthAddInputReader); public: TypeSynthAddInputReader(Debugger& debugger) : - InputReaderEZ(debugger) + InputReaderEZ(debugger) {} virtual @@ -3402,6 +3428,9 @@ } } } + +private: + DISALLOW_COPY_AND_ASSIGN (TypeSynthAddInputReader); }; void @@ -3612,6 +3641,8 @@ { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL } }; +#endif // #ifndef LLDB_DISABLE_PYTHON + class CommandObjectTypeFilterAdd : public CommandObject { @@ -3918,6 +3949,8 @@ } }; +#ifndef LLDB_DISABLE_PYTHON + class CommandObjectTypeSynth : public CommandObjectMultiword { public: @@ -3939,6 +3972,8 @@ } }; +#endif // #ifndef LLDB_DISABLE_PYTHON + class CommandObjectTypeFilter : public CommandObjectMultiword { public: @@ -4016,7 +4051,9 @@ LoadSubCommand ("filter", CommandObjectSP (new CommandObjectTypeFilter (interpreter))); LoadSubCommand ("format", CommandObjectSP (new CommandObjectTypeFormat (interpreter))); LoadSubCommand ("summary", CommandObjectSP (new CommandObjectTypeSummary (interpreter))); +#ifndef LLDB_DISABLE_PYTHON LoadSubCommand ("synthetic", CommandObjectSP (new CommandObjectTypeSynth (interpreter))); +#endif } Modified: lldb/trunk/source/Commands/CommandObjectType.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.h?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectType.h (original) +++ lldb/trunk/source/Commands/CommandObjectType.h Thu Nov 3 22:34:56 2011 @@ -32,7 +32,6 @@ ~CommandObjectType (); }; - } // namespace lldb_private #endif // liblldb_CommandObjectType_h_ Modified: lldb/trunk/source/Core/FormatClasses.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatClasses.cpp?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/Core/FormatClasses.cpp (original) +++ lldb/trunk/source/Core/FormatClasses.cpp Thu Nov 3 22:34:56 2011 @@ -8,12 +8,21 @@ //===----------------------------------------------------------------------===// // C Includes + +#ifdef LLDB_DISABLE_PYTHON + +struct PyObject; + +#else // #ifdef LLDB_DISABLE_PYTHON + #if defined (__APPLE__) #include #else #include #endif +#endif // #ifdef LLDB_DISABLE_PYTHON + // C++ Includes #include @@ -145,6 +154,8 @@ return sstr.GetString(); } +#ifndef LLDB_DISABLE_PYTHON + ScriptSummaryFormat::ScriptSummaryFormat(bool casc, bool skipptr, bool skipref, @@ -187,6 +198,8 @@ } +#endif // #ifndef LLDB_DISABLE_PYTHON + std::string SyntheticFilter::GetDescription() { @@ -231,6 +244,8 @@ return sstr.GetString(); } +#ifndef LLDB_DISABLE_PYTHON + SyntheticScriptProvider::FrontEnd::FrontEnd(std::string pclass, lldb::ValueObjectSP be) : SyntheticChildrenFrontEnd(be), @@ -253,7 +268,7 @@ SyntheticScriptProvider::FrontEnd::~FrontEnd() { - Py_XDECREF((PyObject*)m_wrapper); + Py_XDECREF((PyObject*)m_wrapper); } lldb::ValueObjectSP @@ -278,6 +293,8 @@ return sstr.GetString(); } +#endif // #ifndef LLDB_DISABLE_PYTHON + int SyntheticArrayView::GetRealIndexForIndex(int i) { Modified: lldb/trunk/source/Core/FormatManager.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatManager.cpp?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/Core/FormatManager.cpp (original) +++ lldb/trunk/source/Core/FormatManager.cpp Thu Nov 3 22:34:56 2011 @@ -163,8 +163,10 @@ m_regex_summary_nav(new RegexSummaryNavigator("regex-summary",clist)), m_filter_nav(new FilterNavigator("filter",clist)), m_regex_filter_nav(new RegexFilterNavigator("regex-filter",clist)), +#ifndef LLDB_DISABLE_PYTHON m_synth_nav(new SynthNavigator("synth",clist)), m_regex_synth_nav(new RegexSynthNavigator("regex-synth",clist)), +#endif m_enabled(false), m_change_listener(clist), m_mutex(Mutex::eMutexTypeRecursive), @@ -189,59 +191,67 @@ bool FormatCategory::Get(ValueObject& valobj, - lldb::SyntheticChildrenSP& entry, + lldb::SyntheticChildrenSP& entry_sp, lldb::DynamicValueType use_dynamic, uint32_t* reason) { if (!IsEnabled()) return false; - SyntheticFilter::SharedPointer filter; - SyntheticScriptProvider::SharedPointer synth; - bool regex_filter, regex_synth; - uint32_t reason_filter; - uint32_t reason_synth; - - bool pick_synth = false; - + SyntheticFilter::SharedPointer filter_sp; + uint32_t reason_filter = 0; + bool regex_filter = false; // first find both Filter and Synth, and then check which is most recent - if (!GetFilterNavigator()->Get(valobj, filter, use_dynamic, &reason_filter)) - regex_filter = GetRegexFilterNavigator()->Get(valobj, filter, use_dynamic, &reason_filter); - + if (!GetFilterNavigator()->Get(valobj, filter_sp, use_dynamic, &reason_filter)) + regex_filter = GetRegexFilterNavigator()->Get (valobj, filter_sp, use_dynamic, &reason_filter); + +#ifndef LLDB_DISABLE_PYTHON + bool regex_synth = false; + uint32_t reason_synth = 0; + bool pick_synth = false; + SyntheticScriptProvider::SharedPointer synth; if (!GetSyntheticNavigator()->Get(valobj, synth, use_dynamic, &reason_synth)) - regex_synth = GetRegexSyntheticNavigator()->Get(valobj, synth, use_dynamic, &reason_synth); - - if (!filter.get() && !synth.get()) + regex_synth = GetRegexSyntheticNavigator()->Get (valobj, synth, use_dynamic, &reason_synth); + if (!filter_sp.get() && !synth.get()) return false; - - else if (!filter.get() && synth.get()) + else if (!filter_sp.get() && synth.get()) pick_synth = true; - else if (filter.get() && !synth.get()) + else if (filter_sp.get() && !synth.get()) pick_synth = false; - else /*if (filter.get() && synth.get())*/ + else /*if (filter_sp.get() && synth.get())*/ { - if (filter->m_my_revision > synth->m_my_revision) + if (filter_sp->m_my_revision > synth->m_my_revision) pick_synth = false; else pick_synth = true; } - if (pick_synth) { if (regex_synth && reason) *reason |= lldb_private::eFormatterChoiceCriterionRegularExpressionFilter; - entry = synth; + entry_sp = synth; return true; } else { if (regex_filter && reason) *reason |= lldb_private::eFormatterChoiceCriterionRegularExpressionFilter; - entry = filter; + entry_sp = filter_sp; return true; } + +#else + if (filter_sp) + { + entry_sp = filter_sp; + return true; + } +#endif + + return false; + } void @@ -255,10 +265,12 @@ m_filter_nav->Clear(); if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter ) m_regex_filter_nav->Clear(); +#ifndef LLDB_DISABLE_PYTHON if ( (items & eFormatCategoryItemSynth) == eFormatCategoryItemSynth ) m_synth_nav->Clear(); if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth ) m_regex_synth_nav->Clear(); +#endif } bool @@ -274,10 +286,12 @@ success = m_filter_nav->Delete(name) || success; if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter ) success = m_regex_filter_nav->Delete(name) || success; +#ifndef LLDB_DISABLE_PYTHON if ( (items & eFormatCategoryItemSynth) == eFormatCategoryItemSynth ) success = m_synth_nav->Delete(name) || success; if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth ) success = m_regex_synth_nav->Delete(name) || success; +#endif return success; } @@ -293,10 +307,12 @@ count += m_filter_nav->GetCount(); if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter ) count += m_regex_filter_nav->GetCount(); +#ifndef LLDB_DISABLE_PYTHON if ( (items & eFormatCategoryItemSynth) == eFormatCategoryItemSynth ) count += m_synth_nav->GetCount(); if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth ) count += m_regex_synth_nav->GetCount(); +#endif return count; } @@ -312,7 +328,9 @@ lldb::SummaryFormatSP summary; SyntheticFilter::SharedPointer filter; +#ifndef LLDB_DISABLE_PYTHON SyntheticScriptProvider::SharedPointer synth; +#endif if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary ) { @@ -358,6 +376,7 @@ return true; } } +#ifndef LLDB_DISABLE_PYTHON if ( (items & eFormatCategoryItemSynth) == eFormatCategoryItemSynth ) { if (m_synth_nav->Get(type_name, synth)) @@ -380,6 +399,7 @@ return true; } } +#endif return false; } @@ -597,6 +617,7 @@ gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string,std::allocator >"), std_string_summary_sp); +#ifndef LLDB_DISABLE_PYTHON gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::)?vector<.+>$")), SyntheticChildrenSP(new SyntheticScriptProvider(true, false, @@ -612,7 +633,7 @@ false, false, "gnu_libstdcpp.StdListSynthProvider"))); - +#endif // DO NOT change the order of these calls, unless you WANT a change in the priority of these categories EnableCategory(m_system_category_name); EnableCategory(m_gnu_cpp_category_name); Modified: lldb/trunk/source/Host/common/Host.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/Host/common/Host.cpp (original) +++ lldb/trunk/source/Host/common/Host.cpp Thu Nov 3 22:34:56 2011 @@ -910,7 +910,9 @@ if (framework_pos) { framework_pos += strlen("LLDB.framework"); +#if !defined (__arm__) ::strncpy (framework_pos, "/Resources", PATH_MAX - (framework_pos - raw_path)); +#endif } #endif FileSpec::Resolve (raw_path, resolved_path, sizeof(resolved_path)); Modified: lldb/trunk/source/Host/macosx/Host.mm URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/Host/macosx/Host.mm (original) +++ lldb/trunk/source/Host/macosx/Host.mm Thu Nov 3 22:34:56 2011 @@ -47,8 +47,12 @@ #include +#if defined(__arm__) +#include +#else #include #include +#endif #include #ifndef _POSIX_SPAWN_DISABLE_ASLR @@ -150,6 +154,9 @@ lldb::pid_t Host::LaunchApplication (const FileSpec &app_file_spec) { +#if defined (__arm__) + return LLDB_INVALID_PROCESS_ID; +#else char app_path[PATH_MAX]; app_file_spec.GetPath(app_path, sizeof(app_path)); @@ -181,6 +188,7 @@ ::pid_t pid = LLDB_INVALID_PROCESS_ID; error = ::GetProcessPID(&psn, &pid); return pid; +#endif } @@ -237,6 +245,7 @@ } return false; } +#if !defined(__arm__) static lldb::pid_t LaunchInNewTerminalWithCommandFile @@ -552,6 +561,8 @@ return error; } +#endif // #if !defined(__arm__) + // On MacOSX CrashReporter will display a string for each shared library if // the shared library has an exported symbol named "__crashreporter_info__". @@ -600,6 +611,9 @@ bool Host::OpenFileInExternalEditor (const FileSpec &file_spec, uint32_t line_no) { +#if defined(__arm__) + return false; +#else // We attach this to an 'odoc' event to specify a particular selection typedef struct { int16_t reserved0; // must be zero @@ -794,8 +808,8 @@ return false; } } - return true; +#endif // #if !defined(__arm__) } @@ -881,6 +895,19 @@ ) { +#if defined (__arm__) + major = UINT32_MAX; + minor = UINT32_MAX; + update = UINT32_MAX; + + NSString *system_version_nstr = [[UIDevice currentDevice] systemVersion]; + if (system_version_nstr) + { + const char *system_version_cstr = system_version_nstr.UTF8String; + Args::StringToVersion(system_version_cstr, major, minor, update); + } + return major != UINT32_MAX; +#else SInt32 version; OSErr err = ::Gestalt (gestaltSystemVersion, &version); @@ -911,6 +938,7 @@ } return true; +#endif } static bool Modified: lldb/trunk/source/Host/macosx/Symbols.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Symbols.cpp?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/Host/macosx/Symbols.cpp (original) +++ lldb/trunk/source/Host/macosx/Symbols.cpp Thu Nov 3 22:34:56 2011 @@ -35,12 +35,14 @@ using namespace lldb_private; using namespace llvm::MachO; +#if !defined (__arm__) // No DebugSymbols on the iOS devices extern "C" { CFURLRef DBGCopyFullDSYMURLForUUID (CFUUIDRef uuid, CFURLRef exec_url); CFDictionaryRef DBGCopyDSYMPropertyLists (CFURLRef dsym_url); } +#endif static bool SkinnyMachOFileContainsArchAndUUID @@ -287,6 +289,8 @@ if (out_dsym_fspec) out_dsym_fspec->Clear(); +#if !defined (__arm__) // No DebugSymbols on the iOS devices + if (uuid && uuid->IsValid()) { // Try and locate the dSYM file using DebugSymbols first @@ -424,6 +428,8 @@ } } } +#endif // #if !defined (__arm__) + return items_found; } Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original) +++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Thu Nov 3 22:34:56 2011 @@ -2276,12 +2276,16 @@ lldb::ScriptLanguage script_lang = GetDebugger().GetScriptLanguage(); switch (script_lang) { - case eScriptLanguageNone: - m_script_interpreter_ap.reset (new ScriptInterpreterNone (*this)); - break; case eScriptLanguagePython: +#ifndef LLDB_DISABLE_PYTHON m_script_interpreter_ap.reset (new ScriptInterpreterPython (*this)); break; +#else + // Fall through to the None case when python is disabled +#endif + case eScriptLanguageNone: + m_script_interpreter_ap.reset (new ScriptInterpreterNone (*this)); + break; default: break; }; Modified: lldb/trunk/source/Interpreter/ScriptInterpreter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/ScriptInterpreter.cpp?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/ScriptInterpreter.cpp (original) +++ lldb/trunk/source/Interpreter/ScriptInterpreter.cpp Thu Nov 3 22:34:56 2011 @@ -84,7 +84,6 @@ case eScriptLanguagePython: return_value = "Python"; break; - } return return_value; @@ -103,6 +102,7 @@ SWIGPythonCallCommand python_swig_call_command, SWIGPythonCallModuleInit python_swig_call_mod_init) { +#ifndef LLDB_DISABLE_PYTHON ScriptInterpreterPython::InitializeInterpreter (python_swig_init_callback, python_swig_breakpoint_callback, python_swig_typescript_callback, @@ -114,11 +114,14 @@ python_swig_update_provider, python_swig_call_command, python_swig_call_mod_init); +#endif // #ifndef LLDB_DISABLE_PYTHON } void ScriptInterpreter::TerminateInterpreter () { +#ifndef LLDB_DISABLE_PYTHON ScriptInterpreterPython::TerminateInterpreter (); +#endif // #ifndef LLDB_DISABLE_PYTHON } Modified: lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp (original) +++ lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp Thu Nov 3 22:34:56 2011 @@ -9,6 +9,11 @@ // In order to guarantee correct working with Python, Python.h *MUST* be // the *FIRST* header file included here. +#ifdef LLDB_DISABLE_PYTHON + +// Python is disabled in this build + +#else #if defined (__APPLE__) #include @@ -1998,3 +2003,5 @@ // // //// Py_Finalize (); //} + +#endif // #ifdef LLDB_DISABLE_PYTHON Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original) +++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Thu Nov 3 22:34:56 2011 @@ -229,19 +229,19 @@ if (executable) { - if (executable->GetArchitecture().GetAddressByteSize() == 8) + const ArchSpec &exe_arch = executable->GetArchitecture(); + if (exe_arch.GetAddressByteSize() == 8) { return ReadDYLDInfoFromMemoryAndSetNotificationCallback(0x7fff5fc00000ull); } -#if defined (__arm__) + else if (exe_arch.GetMachine() == llvm::Triple::arm || exe_arch.GetMachine() == llvm::Triple::thumb) + { + return ReadDYLDInfoFromMemoryAndSetNotificationCallback(0x2fe00000); + } else { - ArchSpec arm_arch("arm"); - if (arm_arch == executable->Arch()) - return ReadDYLDInfoFromMemoryAndSetNotificationCallback(0x2fe00000); + return ReadDYLDInfoFromMemoryAndSetNotificationCallback(0x8fe00000); } -#endif - return ReadDYLDInfoFromMemoryAndSetNotificationCallback(0x8fe00000); } return false; } Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp (original) +++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp Thu Nov 3 22:34:56 2011 @@ -30,8 +30,6 @@ // Project includes #include "ProcessKDPLog.h" -#define DEBUGSERVER_BASENAME "debugserver" - using namespace lldb; using namespace lldb_private; Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp (original) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp Thu Nov 3 22:34:56 2011 @@ -25,6 +25,8 @@ #include "lldb/Host/Endian.h" #include "llvm/Support/Compiler.h" +#include "Plugins/Process/Utility/InstructionUtils.h" + // Support building against older versions of LLVM, this macro was added // recently. #ifndef LLVM_EXTENSION @@ -982,7 +984,7 @@ uint32_t register_DBGDIDR; asm("mrc p14, 0, %0, c0, c0, 0" : "=r" (register_DBGDIDR)); - g_num_supported_hw_breakpoints = bits(register_DBGDIDR, 27, 24); + g_num_supported_hw_breakpoints = Bits32 (register_DBGDIDR, 27, 24); // Zero is reserved for the BRP count, so don't increment it if it is zero if (g_num_supported_hw_breakpoints > 0) g_num_supported_hw_breakpoints++; @@ -1111,7 +1113,7 @@ uint32_t register_DBGDIDR; asm("mrc p14, 0, %0, c0, c0, 0" : "=r" (register_DBGDIDR)); - g_num_supported_hw_watchpoints = bits(register_DBGDIDR, 31, 28) + 1; + g_num_supported_hw_watchpoints = Bits32 (register_DBGDIDR, 31, 28) + 1; // if (log) log->Printf ("DBGDIDR=0x%8.8x (number WRP pairs = %u)", register_DBGDIDR, g_num_supported_hw_watchpoints); } return g_num_supported_hw_watchpoints; Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp (original) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp Thu Nov 3 22:34:56 2011 @@ -147,6 +147,9 @@ } break; + // TOOD: need a better way to detect when "long double" types are + // the same bytes size as "double" +#if !defined(__arm__) case sizeof (long double): if (sizeof (long double) == sizeof(uint32_t)) { @@ -159,6 +162,7 @@ return true; } break; +#endif } break; } Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Thu Nov 3 22:34:56 2011 @@ -3059,7 +3059,7 @@ case clang::BuiltinType::BoundMember: case clang::BuiltinType::Half: case clang::BuiltinType::ARCUnbridgedCast: - case clang::BuiltinType::PseudoObject: + //case clang::BuiltinType::PseudoObject: return 1; } break; @@ -4899,7 +4899,7 @@ case clang::BuiltinType::BoundMember: case clang::BuiltinType::Half: case clang::BuiltinType::ARCUnbridgedCast: - case clang::BuiltinType::PseudoObject: + //case clang::BuiltinType::PseudoObject: break; } break; @@ -5035,7 +5035,7 @@ case clang::BuiltinType::BoundMember: case clang::BuiltinType::Half: case clang::BuiltinType::ARCUnbridgedCast: - case clang::BuiltinType::PseudoObject: + //case clang::BuiltinType::PseudoObject: break; } break; Modified: lldb/trunk/source/Symbol/ClangASTType.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/Symbol/ClangASTType.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTType.cpp Thu Nov 3 22:34:56 2011 @@ -572,7 +572,7 @@ case clang::BuiltinType::ObjCSel: case clang::BuiltinType::Half: case clang::BuiltinType::ARCUnbridgedCast: - case clang::BuiltinType::PseudoObject: + //case clang::BuiltinType::PseudoObject: return lldb::eFormatHex; } break; Modified: lldb/trunk/source/Target/StackFrameList.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrameList.cpp?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/source/Target/StackFrameList.cpp (original) +++ lldb/trunk/source/Target/StackFrameList.cpp Thu Nov 3 22:34:56 2011 @@ -238,7 +238,7 @@ frame->DumpUsingSettingsFormat (s); } else - s->Printf("frame #%ld", std::distance (begin, pos)); + s->Printf("frame #%u", (uint32_t)std::distance (begin, pos)); s->EOL(); } s->EOL(); Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original) +++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Thu Nov 3 22:34:56 2011 @@ -476,8 +476,6 @@ ); COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 150; - "GCC_VERSION[sdk=iphoneos*][arch=*]" = 4.2; - "GCC_VERSION[sdk=macosx*][arch=*]" = ""; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; SDKROOT = ""; @@ -533,6 +531,7 @@ 262419A21198A93E00067686 /* BuildAndIntegration */ = { isa = XCBuildConfiguration; buildSettings = { + "ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD_32_BIT)"; "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 150; @@ -544,6 +543,7 @@ ); "FRAMEWORK_SEARCH_PATHS[sdk=macosx*][arch=*]" = "$(SDKROOT)/System/Library/PrivateFrameworks"; GCC_PREPROCESSOR_DEFINITIONS = LLDB_DEBUGSERVER_BUILDANDINTEGRATION; + GCC_VERSION = com.apple.compilers.llvmgcc42; HEADER_SEARCH_PATHS = /System/Library/Frameworks/System.framework/PrivateHeaders; INSTALL_PATH = /Developer/usr/bin; LLDB_DEBUGSERVER = 1; @@ -572,6 +572,7 @@ 26CE0596115C31C30022F371 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + "ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD_32_BIT)"; "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign; COPY_PHASE_STRIP = YES; @@ -585,6 +586,7 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = LLDB_DEBUGSERVER_DEBUG; + GCC_VERSION = com.apple.compilers.llvmgcc42; INSTALL_PATH = /Developer/usr/bin; LLDB_DEBUGSERVER = 1; OTHER_CFLAGS = "-Wparentheses"; @@ -612,6 +614,7 @@ 26CE0597115C31C30022F371 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + "ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD_32_BIT)"; "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign; COPY_PHASE_STRIP = YES; @@ -624,6 +627,7 @@ ); "FRAMEWORK_SEARCH_PATHS[sdk=macosx*][arch=*]" = "$(SDKROOT)/System/Library/PrivateFrameworks"; GCC_PREPROCESSOR_DEFINITIONS = LLDB_DEBUGSERVER_RELEASE; + GCC_VERSION = com.apple.compilers.llvmgcc42; HEADER_SEARCH_PATHS = /System/Library/Frameworks/System.framework/PrivateHeaders; INSTALL_PATH = /Developer/usr/bin; LLDB_DEBUGSERVER = 1; Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/xcshareddata/xcschemes/debugserver.xcscheme URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/xcshareddata/xcschemes/debugserver.xcscheme?rev=143678&r1=143677&r2=143678&view=diff ============================================================================== --- lldb/trunk/tools/debugserver/debugserver.xcodeproj/xcshareddata/xcschemes/debugserver.xcscheme (original) +++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/xcshareddata/xcschemes/debugserver.xcscheme Thu Nov 3 22:34:56 2011 @@ -1,6 +1,6 @@ + version = "1.8"> @@ -28,6 +28,15 @@ buildConfiguration = "Debug"> + + + + + buildConfiguration = "Debug" + debugDocumentVersioning = "YES" + allowLocationSimulation = "YES"> + buildConfiguration = "Release" + debugDocumentVersioning = "YES"> Process()->Task().ReadMemory(curr_pc, 4, &opcode32) != 4) { - DNBLogError("unable to read opcode bits 31:0 for an ARM opcode at 0x%8.8lx", curr_pc); + DNBLogError("unable to read opcode bits 31:0 for an ARM opcode at 0x%8.8llx", (uint64_t)curr_pc); decodeReturnCode = ARM_ERROR; } else @@ -1769,7 +1769,7 @@ decodeReturnCode = ArmDisassembler((uint64_t)curr_pc, opcode32, false, decodedInstruction, NULL, 0, NULL, 0); if (decodeReturnCode != ARM_SUCCESS) - DNBLogError("Unable to decode ARM instruction 0x%8.8x at 0x%8.8lx", opcode32, curr_pc); + DNBLogError("Unable to decode ARM instruction 0x%8.8x at 0x%8.8llx", opcode32, (uint64_t)curr_pc); } break; @@ -1778,7 +1778,7 @@ // Read the a 16 bit Thumb opcode if (m_thread->Process()->Task().ReadMemory(curr_pc, 2, &opcode16) != 2) { - DNBLogError("unable to read opcode bits 15:0 for a thumb opcode at 0x%8.8lx", curr_pc); + DNBLogError("unable to read opcode bits 15:0 for a thumb opcode at 0x%8.8llx", (uint64_t)curr_pc); decodeReturnCode = ARM_ERROR; } else @@ -1794,7 +1794,7 @@ nextPC += 2; if (m_thread->Process()->Task().ReadMemory(curr_pc+2, 2, &opcode16) != 2) { - DNBLogError("unable to read opcode bits 15:0 for a thumb opcode at 0x%8.8lx", curr_pc+2); + DNBLogError("unable to read opcode bits 15:0 for a thumb opcode at 0x%8.8llx", (uint64_t)curr_pc+2); } else { @@ -1803,7 +1803,7 @@ decodeReturnCode = ThumbDisassembler((uint64_t)(curr_pc+2), opcode16, false, false, thumbStaticData, decodedInstruction, NULL, 0, NULL, 0); if (decodeReturnCode != ARM_SUCCESS) - DNBLogError("Unable to decode 2nd half of Thumb instruction 0x%8.4hx at 0x%8.8lx", opcode16, curr_pc+2); + DNBLogError("Unable to decode 2nd half of Thumb instruction 0x%8.4hx at 0x%8.8llx", opcode16, (uint64_t)curr_pc+2); break; } break; @@ -1813,7 +1813,7 @@ break; default: - DNBLogError("Unable to decode Thumb instruction 0x%8.4hx at 0x%8.8lx", opcode16, curr_pc); + DNBLogError("Unable to decode Thumb instruction 0x%8.4hx at 0x%8.8llx", opcode16, (uint64_t)curr_pc); decodeReturnCode = ARM_ERROR; break; } @@ -1878,7 +1878,7 @@ if (decodeReturnCode != ARM_SUCCESS) { err = KERN_INVALID_ARGUMENT; - DNBLogError("DNBArchMachARM::SetSingleStepSoftwareBreakpoints: Unable to disassemble instruction at 0x%8.8lx", curr_pc); + DNBLogError("DNBArchMachARM::SetSingleStepSoftwareBreakpoints: Unable to disassemble instruction at 0x%8.8llx", (uint64_t)curr_pc); } } else @@ -1970,7 +1970,7 @@ } else { - DNBLogError("FunctionProfiler::SetSingleStepSoftwareBreakpoints(): Unable to read opcode bits 31:16 for a 32 bit thumb opcode at pc=0x%8.8lx", nextPCInITBlock); + DNBLogError("FunctionProfiler::SetSingleStepSoftwareBreakpoints(): Unable to read opcode bits 31:16 for a 32 bit thumb opcode at pc=0x%8.8llx", (uint64_t)nextPCInITBlock); } } } @@ -2198,13 +2198,13 @@ byte_addr_select | // Set the correct byte address select so we only trigger on the correct opcode S_USER | // Which modes should this breakpoint stop in? BCR_ENABLE; // Enable this hardware breakpoint - DNBLogThreadedIf(LOG_BREAKPOINTS, "DNBArchMachARM::EnableHardwareBreakpoint( addr = %8.8p, size = %u ) - BVR%u/BCR%u = 0x%8.8x / 0x%8.8x (Thumb)", - addr, - size, - i, - i, - m_state.dbg.__bvr[i], - m_state.dbg.__bcr[i]); + DNBLogThreadedIf (LOG_BREAKPOINTS, "DNBArchMachARM::EnableHardwareBreakpoint( addr = 0x%8.8llx, size = %zu ) - BVR%u/BCR%u = 0x%8.8x / 0x%8.8x (Thumb)", + (uint64_t)addr, + size, + i, + i, + m_state.dbg.__bvr[i], + m_state.dbg.__bcr[i]); } else if (size == 4) { @@ -2213,13 +2213,13 @@ BAS_IMVA_ALL | // Stop on any of the four bytes following the IMVA S_USER | // Which modes should this breakpoint stop in? BCR_ENABLE; // Enable this hardware breakpoint - DNBLogThreadedIf(LOG_BREAKPOINTS, "DNBArchMachARM::EnableHardwareBreakpoint( addr = %8.8p, size = %u ) - BVR%u/BCR%u = 0x%8.8x / 0x%8.8x (ARM)", - addr, - size, - i, - i, - m_state.dbg.__bvr[i], - m_state.dbg.__bcr[i]); + DNBLogThreadedIf (LOG_BREAKPOINTS, "DNBArchMachARM::EnableHardwareBreakpoint( addr = 0x%8.8llx, size = %zu ) - BVR%u/BCR%u = 0x%8.8x / 0x%8.8x (ARM)", + (uint64_t)addr, + size, + i, + i, + m_state.dbg.__bvr[i], + m_state.dbg.__bcr[i]); } kret = SetDBGState(); @@ -2230,7 +2230,7 @@ } else { - DNBLogThreadedIf(LOG_BREAKPOINTS, "DNBArchMachARM::EnableHardwareBreakpoint(addr = %8.8p, size = %u) => all hardware breakpoint resources are being used.", addr, size); + DNBLogThreadedIf (LOG_BREAKPOINTS, "DNBArchMachARM::EnableHardwareBreakpoint(addr = 0x%8.8llx, size = %zu) => all hardware breakpoint resources are being used.", (uint64_t)addr, size); } } @@ -2267,7 +2267,7 @@ uint32_t DNBArchMachARM::EnableHardwareWatchpoint (nub_addr_t addr, nub_size_t size, bool read, bool write) { - DNBLogThreadedIf(LOG_WATCHPOINTS, "DNBArchMachARM::EnableHardwareWatchpoint(addr = %8.8p, size = %u, read = %u, write = %u)", addr, size, read, write); + DNBLogThreadedIf(LOG_WATCHPOINTS, "DNBArchMachARM::EnableHardwareWatchpoint(addr = 0x%8.8llx, size = %zu, read = %u, write = %u)", (uint64_t)addr, size, read, write); const uint32_t num_hw_watchpoints = NumSupportedHardwareWatchpoints(); From gclayton at apple.com Thu Nov 3 22:42:38 2011 From: gclayton at apple.com (Greg Clayton) Date: Fri, 04 Nov 2011 03:42:38 -0000 Subject: [Lldb-commits] [lldb] r143679 - /lldb/trunk/source/Host/common/Host.cpp Message-ID: <20111104034238.7C4072A6C12C@llvm.org> Author: gclayton Date: Thu Nov 3 22:42:38 2011 New Revision: 143679 URL: http://llvm.org/viewvc/llvm-project?rev=143679&view=rev Log: Fixed a build issue on an older Xcode. Modified: lldb/trunk/source/Host/common/Host.cpp Modified: lldb/trunk/source/Host/common/Host.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=143679&r1=143678&r2=143679&view=diff ============================================================================== --- lldb/trunk/source/Host/common/Host.cpp (original) +++ lldb/trunk/source/Host/common/Host.cpp Thu Nov 3 22:42:38 2011 @@ -438,7 +438,7 @@ case SIGILL: return "SIGILL"; // 4 illegal instruction (not reset when caught) case SIGTRAP: return "SIGTRAP"; // 5 trace trap (not reset when caught) case SIGABRT: return "SIGABRT"; // 6 abort() -#if defined(_POSIX_C_SOURCE) +#if (defined(_POSIX_C_SOURCE) && !defined(_DARWIN_C_SOURCE)) case SIGPOLL: return "SIGPOLL"; // 7 pollable event ([XSR] generated, not supported) #else // !_POSIX_C_SOURCE case SIGEMT: return "SIGEMT"; // 7 EMT instruction From benny.kra at googlemail.com Fri Nov 4 08:33:49 2011 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Fri, 04 Nov 2011 13:33:49 -0000 Subject: [Lldb-commits] [lldb] r143694 - /lldb/trunk/include/lldb/Target/Process.h Message-ID: <20111104133349.D239E2A6C12C@llvm.org> Author: d0k Date: Fri Nov 4 08:33:49 2011 New Revision: 143694 URL: http://llvm.org/viewvc/llvm-project?rev=143694&view=rev Log: Include limits.h for PATH_MAX. Modified: lldb/trunk/include/lldb/Target/Process.h Modified: lldb/trunk/include/lldb/Target/Process.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=143694&r1=143693&r2=143694&view=diff ============================================================================== --- lldb/trunk/include/lldb/Target/Process.h (original) +++ lldb/trunk/include/lldb/Target/Process.h Fri Nov 4 08:33:49 2011 @@ -11,6 +11,7 @@ #define liblldb_Process_h_ // C Includes +#include #include // C++ Includes From benny.kra at googlemail.com Fri Nov 4 11:06:40 2011 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Fri, 04 Nov 2011 16:06:40 -0000 Subject: [Lldb-commits] [lldb] r143703 - /lldb/trunk/source/Host/common/Host.cpp Message-ID: <20111104160640.BB9ED2A6C12C@llvm.org> Author: d0k Date: Fri Nov 4 11:06:40 2011 New Revision: 143703 URL: http://llvm.org/viewvc/llvm-project?rev=143703&view=rev Log: Fix linux build after r143679. Modified: lldb/trunk/source/Host/common/Host.cpp Modified: lldb/trunk/source/Host/common/Host.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=143703&r1=143702&r2=143703&view=diff ============================================================================== --- lldb/trunk/source/Host/common/Host.cpp (original) +++ lldb/trunk/source/Host/common/Host.cpp Fri Nov 4 11:06:40 2011 @@ -440,9 +440,10 @@ case SIGABRT: return "SIGABRT"; // 6 abort() #if (defined(_POSIX_C_SOURCE) && !defined(_DARWIN_C_SOURCE)) case SIGPOLL: return "SIGPOLL"; // 7 pollable event ([XSR] generated, not supported) -#else // !_POSIX_C_SOURCE +#endif +#if !defined(_POSIX_C_SOURCE) case SIGEMT: return "SIGEMT"; // 7 EMT instruction -#endif // !_POSIX_C_SOURCE +#endif case SIGFPE: return "SIGFPE"; // 8 floating point exception case SIGKILL: return "SIGKILL"; // 9 kill (cannot be caught or ignored) case SIGBUS: return "SIGBUS"; // 10 bus error From gclayton at apple.com Fri Nov 4 12:18:16 2011 From: gclayton at apple.com (Greg Clayton) Date: Fri, 04 Nov 2011 17:18:16 -0000 Subject: [Lldb-commits] [lldb] r143710 - /lldb/trunk/lldb.xcodeproj/project.pbxproj Message-ID: <20111104171816.5A9782A6C12C@llvm.org> Author: gclayton Date: Fri Nov 4 12:18:16 2011 New Revision: 143710 URL: http://llvm.org/viewvc/llvm-project?rev=143710&view=rev Log: Fixed the LD_DYLIB_INSTALL_NAME to the LLDB.framework. Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=143710&r1=143709&r2=143710&view=diff ============================================================================== --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri Nov 4 12:18:16 2011 @@ -3706,7 +3706,7 @@ HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "resources/LLDB-Info.plist"; INSTALL_PATH = "$(DEVELOPER_DIR)/Library/PrivateFrameworks"; - LD_DYLIB_INSTALL_NAME = /Developer/Library/PrivateFrameworks/LLDB.framework/LLDB; + LD_DYLIB_INSTALL_NAME = "@rpath/LLDB.framework/Versions/A/LLDB"; LIBRARY_SEARCH_PATHS = ( "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)", "$(inherited)", @@ -3767,7 +3767,7 @@ HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "resources/LLDB-Info.plist"; INSTALL_PATH = "$(DEVELOPER_DIR)/Library/PrivateFrameworks"; - LD_DYLIB_INSTALL_NAME = /Developer/Library/PrivateFrameworks/LLDB.framework/LLDB; + LD_DYLIB_INSTALL_NAME = "@rpath/LLDB.framework/Versions/A/LLDB"; LIBRARY_SEARCH_PATHS = ( "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)", "$(inherited)", @@ -3991,7 +3991,7 @@ HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "resources/LLDB-Info.plist"; INSTALL_PATH = "$(DEVELOPER_DIR)/Library/PrivateFrameworks"; - LD_DYLIB_INSTALL_NAME = /Developer/Library/PrivateFrameworks/LLDB.framework/LLDB; + LD_DYLIB_INSTALL_NAME = "@rpath/LLDB.framework/Versions/A/LLDB"; LIBRARY_SEARCH_PATHS = ( "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)", "$(inherited)", From gclayton at apple.com Fri Nov 4 12:36:01 2011 From: gclayton at apple.com (Greg Clayton) Date: Fri, 04 Nov 2011 17:36:01 -0000 Subject: [Lldb-commits] [lldb] r143713 - /lldb/trunk/lldb.xcodeproj/project.pbxproj Message-ID: <20111104173601.3B53B2A6C12C@llvm.org> Author: gclayton Date: Fri Nov 4 12:36:00 2011 New Revision: 143713 URL: http://llvm.org/viewvc/llvm-project?rev=143713&view=rev Log: For "Debug" and "Release" builds, don't build llvm into the $(OBJROOT) since we often nuke our "build" folder so we can do clean builds. This way if you are building your own LLVM you won't have to rebuild LLVM when you do remove your build folder. The new location for the LLVM build is: lldb/llvm-build Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=143713&r1=143712&r2=143713&view=diff ============================================================================== --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri Nov 4 12:36:00 2011 @@ -3589,7 +3589,7 @@ GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - LLVM_BUILD_DIR = "$(OBJROOT)/llvm"; + LLVM_BUILD_DIR = "$(SRCROOT)/llvm-build/$(LLVM_CONFIGURATION)"; LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/"; LLVM_CONFIGURATION = "Release+Debug"; LLVM_SOURCE_DIR = "$(SRCROOT)/llvm"; @@ -3638,7 +3638,7 @@ GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - LLVM_BUILD_DIR = "$(OBJROOT)/llvm"; + LLVM_BUILD_DIR = "$(SRCROOT)/llvm-build/$(LLVM_CONFIGURATION)"; LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/"; LLVM_CONFIGURATION = "Release+Debug"; LLVM_SOURCE_DIR = "$(SRCROOT)/llvm"; @@ -4068,8 +4068,6 @@ "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)", "$(inherited)", ); - LLVM_CONFIGURATION = Release; - "LLVM_CONFIGURATION[sdk=iphoneos*][arch=*]" = "Release+Debug"; OTHER_LDFLAGS = ( "-lllvmclang", "-lpython", @@ -4132,8 +4130,6 @@ "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)", "$(inherited)", ); - LLVM_CONFIGURATION = Release; - "LLVM_CONFIGURATION[sdk=iphoneos*][arch=*]" = "Release+Debug"; OTHER_LDFLAGS = ( "-lllvmclang", "-lpython", @@ -4193,8 +4189,6 @@ "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)", "$(inherited)", ); - LLVM_CONFIGURATION = Release; - "LLVM_CONFIGURATION[sdk=iphoneos*][arch=*]" = "Release+Debug"; OTHER_LDFLAGS = ( "-lllvmclang", "-lpython", @@ -4239,6 +4233,7 @@ INFOPLIST_FILE = "lldb-Info.plist"; INSTALL_PATH = "$(DEVELOPER_DIR)/usr/bin"; LIBRARY_SEARCH_PATHS = "$(inherited)"; + LLVM_BUILD_DIR_ARCH = "$(OBJROOT)/llvm"; OTHER_LDFLAGS = ( "-sectcreate", __TEXT, From scallanan at apple.com Fri Nov 4 19:08:13 2011 From: scallanan at apple.com (Sean Callanan) Date: Sat, 05 Nov 2011 00:08:13 -0000 Subject: [Lldb-commits] [lldb] r143756 - /lldb/trunk/source/Symbol/ClangASTImporter.cpp Message-ID: <20111105000813.3F9E32A6C12C@llvm.org> Author: spyffe Date: Fri Nov 4 19:08:12 2011 New Revision: 143756 URL: http://llvm.org/viewvc/llvm-project?rev=143756&view=rev Log: Wrapped some logging statements in conditionals, to prevent crashes. Modified: lldb/trunk/source/Symbol/ClangASTImporter.cpp Modified: lldb/trunk/source/Symbol/ClangASTImporter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTImporter.cpp?rev=143756&r1=143755&r2=143756&view=diff ============================================================================== --- lldb/trunk/source/Symbol/ClangASTImporter.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTImporter.cpp Fri Nov 4 19:08:12 2011 @@ -49,10 +49,13 @@ { lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); - if (NamedDecl *named_decl = dyn_cast(decl)) - log->Printf(" [ClangASTImporter] WARNING: Failed to import a %s '%s'", decl->getDeclKindName(), named_decl->getNameAsString().c_str()); - else - log->Printf(" [ClangASTImporter] WARNING: Failed to import a %s", decl->getDeclKindName()); + if (log) + { + if (NamedDecl *named_decl = dyn_cast(decl)) + log->Printf(" [ClangASTImporter] WARNING: Failed to import a %s '%s'", decl->getDeclKindName(), named_decl->getNameAsString().c_str()); + else + log->Printf(" [ClangASTImporter] WARNING: Failed to import a %s", decl->getDeclKindName()); + } } return result; From gclayton at apple.com Fri Nov 4 20:09:16 2011 From: gclayton at apple.com (Greg Clayton) Date: Sat, 05 Nov 2011 01:09:16 -0000 Subject: [Lldb-commits] [lldb] r143772 - in /lldb/trunk/source/Plugins/Process/Linux: ProcessLinux.cpp ProcessLinux.h ProcessMonitor.cpp Message-ID: <20111105010917.0574C2A6C12C@llvm.org> Author: gclayton Date: Fri Nov 4 20:09:16 2011 New Revision: 143772 URL: http://llvm.org/viewvc/llvm-project?rev=143772&view=rev Log: Patch from Dragos Tatulea which was a modified version of a patch from Joel Dillon that fixed 64 debugging for Linux. I also added a patch to fix up the ProcessLinux::DoLaunch() to be up to date. I wasn't able to verify it compiles, but it should b really close. Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp?rev=143772&r1=143771&r2=143772&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp (original) +++ lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp Fri Nov 4 20:09:16 2011 @@ -87,10 +87,16 @@ m_in_limbo(false), m_exit_now(false) { + +#if 0 // FIXME: Putting this code in the ctor and saving the byte order in a // member variable is a hack to avoid const qual issues in GetByteOrder. ObjectFile *obj_file = GetTarget().GetExecutableModule()->GetObjectFile(); m_byte_order = obj_file->GetByteOrder(); +#else + // XXX: Will work only for local processes. + m_byte_order = lldb::endian::InlHostByteOrder(); +#endif } ProcessLinux::~ProcessLinux() @@ -138,23 +144,48 @@ } Error -ProcessLinux::DoLaunch(Module *module, - char const *argv[], - char const *envp[], - uint32_t launch_flags, - const char *stdin_path, - const char *stdout_path, - const char *stderr_path, - const char *working_directory) +ProcessLinux::DoLaunch (Module *module, + const ProcessLaunchInfo &launch_info) { Error error; assert(m_monitor == NULL); SetPrivateState(eStateLaunching); - m_monitor = new ProcessMonitor(this, module, - argv, envp, - stdin_path, stdout_path, stderr_path, - error); + + uint32_t launch_flags = launch_info.GetFlags().Get(); + const char *stdin_path = NULL; + const char *stdout_path = NULL; + const char *stderr_path = NULL; + const char *working_dir = launch_info.GetWorkingDirectory(); + + const ProcessLaunchInfo::FileAction *file_action; + file_action = launch_info.GetFileActionForFD (STDIN_FILENO); + if (file_action) + { + if (file_action->GetAction () == ProcessLaunchInfo::FileAction::eFileActionOpen) + stdin_path = file_action->GetPath(); + } + file_action = launch_info.GetFileActionForFD (STDOUT_FILENO); + if (file_action) + { + if (file_action->GetAction () == ProcessLaunchInfo::FileAction::eFileActionOpen) + stdout_path = file_action->GetPath(); + } + file_action = launch_info.GetFileActionForFD (STDERR_FILENO); + if (file_action) + { + if (file_action->GetAction () == ProcessLaunchInfo::FileAction::eFileActionOpen) + stderr_path = file_action->GetPath(); + } + + m_monitor = new ProcessMonitor (this, + module, + launch_info.GetArguments().GetConstArgumentVector(), + launch_info.GetEnvironmentEntries().GetConstArgumentVector(), + stdin_path, + stdout_path, + stderr_path, + error); m_module = module; Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h?rev=143772&r1=143771&r2=143772&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h (original) +++ lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h Fri Nov 4 20:09:16 2011 @@ -67,14 +67,8 @@ DoAttachToProcessWithID(lldb::pid_t pid); virtual lldb_private::Error - DoLaunch(lldb_private::Module *module, - char const *argv[], - char const *envp[], - uint32_t launch_flags, - const char *stdin_path, - const char *stdout_path, - const char *stderr_path, - const char *working_directory); + DoLaunch (lldb_private::Module *exe_module, + const lldb_private::ProcessLaunchInfo &launch_info); virtual void DidLaunch(); Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp?rev=143772&r1=143771&r2=143772&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp (original) +++ lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp Fri Nov 4 20:09:16 2011 @@ -34,6 +34,8 @@ #include "ProcessMonitor.h" +#define DEBUG_PTRACE_MAXBYTES 20 + using namespace lldb_private; // FIXME: this code is host-dependent with respect to types and @@ -46,21 +48,91 @@ // avoid the additional indirection and checks. #ifndef LLDB_CONFIGURATION_BUILDANDINTEGRATION +static void +DisplayBytes (lldb_private::StreamString &s, void *bytes, uint32_t count) +{ + uint8_t *ptr = (uint8_t *)bytes; + const uint32_t loop_count = std::min(DEBUG_PTRACE_MAXBYTES, count); + for(uint32_t i=0; iPrintf("PTRACE_POKETEXT %s", buf.GetData()); + break; + } + case PTRACE_POKEDATA: + { + DisplayBytes(buf, &data, 8); + verbose_log->Printf("PTRACE_POKEDATA %s", buf.GetData()); + break; + } + case PTRACE_POKEUSER: + { + DisplayBytes(buf, &data, 8); + verbose_log->Printf("PTRACE_POKEUSER %s", buf.GetData()); + break; + } + case PTRACE_SETREGS: + { + DisplayBytes(buf, data, sizeof(user_regs_struct)); + verbose_log->Printf("PTRACE_SETREGS %s", buf.GetData()); + break; + } + case PTRACE_SETFPREGS: + { + DisplayBytes(buf, data, sizeof(user_fpregs_struct)); + verbose_log->Printf("PTRACE_SETFPREGS %s", buf.GetData()); + break; + } + case PTRACE_SETSIGINFO: + { + DisplayBytes(buf, data, sizeof(siginfo_t)); + verbose_log->Printf("PTRACE_SETSIGINFO %s", buf.GetData()); + break; + } + default: + { + } + } + } +} + // Wrapper for ptrace to catch errors and log calls. extern long PtraceWrapper(__ptrace_request req, pid_t pid, void *addr, void *data, const char* reqName, const char* file, int line) { - int result; + long int result; LogSP log (ProcessLinuxLog::GetLogIfAllCategoriesSet (LINUX_LOG_PTRACE)); + if (log) log->Printf("ptrace(%s, %u, %p, %p) called from file %s line %d", reqName, pid, addr, data, file, line); + + PtraceDisplayBytes(req, data); errno = 0; result = ptrace(req, pid, addr, data); + PtraceDisplayBytes(req, data); + if (log && (result == -1 || errno != 0)) { const char* str; @@ -352,7 +424,7 @@ // Set errno to zero so that we can detect a failed peek. errno = 0; - uint32_t data = PTRACE(PTRACE_PEEKUSER, pid, (void*)m_offset, NULL); + lldb::addr_t data = PTRACE(PTRACE_PEEKUSER, pid, (void*)m_offset, NULL); if (data == -1UL && errno) m_result = false; else From gclayton at apple.com Fri Nov 4 20:12:05 2011 From: gclayton at apple.com (Greg Clayton) Date: Sat, 05 Nov 2011 01:12:05 -0000 Subject: [Lldb-commits] [lldb] r143773 - /lldb/trunk/include/lldb/Core/FormatNavigator.h Message-ID: <20111105011205.A06CA2A6C12C@llvm.org> Author: gclayton Date: Fri Nov 4 20:12:05 2011 New Revision: 143773 URL: http://llvm.org/viewvc/llvm-project?rev=143773&view=rev Log: Missed part of a previous patch. Modified: lldb/trunk/include/lldb/Core/FormatNavigator.h Modified: lldb/trunk/include/lldb/Core/FormatNavigator.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatNavigator.h?rev=143773&r1=143772&r2=143773&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/FormatNavigator.h (original) +++ lldb/trunk/include/lldb/Core/FormatNavigator.h Fri Nov 4 20:12:05 2011 @@ -14,6 +14,7 @@ #include #include +#include // C++ Includes #include From peter at pcc.me.uk Fri Nov 4 20:35:32 2011 From: peter at pcc.me.uk (Peter Collingbourne) Date: Sat, 05 Nov 2011 01:35:32 -0000 Subject: [Lldb-commits] [lldb] r143774 - /lldb/trunk/source/Host/common/Host.cpp Message-ID: <20111105013532.0C2BD2A6C12C@llvm.org> Author: pcc Date: Fri Nov 4 20:35:31 2011 New Revision: 143774 URL: http://llvm.org/viewvc/llvm-project?rev=143774&view=rev Log: Update a missed getHostTriple call, fixes non-__APPLE__ build Modified: lldb/trunk/source/Host/common/Host.cpp Modified: lldb/trunk/source/Host/common/Host.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=143774&r1=143773&r2=143774&view=diff ============================================================================== --- lldb/trunk/source/Host/common/Host.cpp (original) +++ lldb/trunk/source/Host/common/Host.cpp Fri Nov 4 20:35:31 2011 @@ -310,7 +310,7 @@ if (g_supports_32 == false && g_supports_64 == false) { - llvm::Triple triple(llvm::sys::getHostTriple()); + llvm::Triple triple(llvm::sys::getDefaultTargetTriple()); g_host_arch_32.Clear(); g_host_arch_64.Clear();