From jingham at apple.com Mon Jun 20 12:32:44 2011 From: jingham at apple.com (Jim Ingham) Date: Mon, 20 Jun 2011 17:32:44 -0000 Subject: [Lldb-commits] [lldb] r133448 - in /lldb/trunk: include/lldb/Target/DynamicLoader.h lldb.xcodeproj/project.pbxproj source/Expression/ClangUserExpression.cpp source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h source/Plugins/Process/Utility/InferiorCallPOSIX.cpp source/Target/Process.cpp test/types/AbstractBase.py test/types/basic_type.cpp Message-ID: <20110620173245.105442A6C12C@llvm.org> Author: jingham Date: Mon Jun 20 12:32:44 2011 New Revision: 133448 URL: http://llvm.org/viewvc/llvm-project?rev=133448&view=rev Log: Use the dyld_mode, image_infos & image_infos_count passed into the shared library notification function to update libraries rather than reading the whole all_imaage_infos structure every time we get notified. Modified: lldb/trunk/include/lldb/Target/DynamicLoader.h lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/source/Expression/ClangUserExpression.cpp lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp lldb/trunk/source/Target/Process.cpp lldb/trunk/test/types/AbstractBase.py lldb/trunk/test/types/basic_type.cpp Modified: lldb/trunk/include/lldb/Target/DynamicLoader.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/DynamicLoader.h?rev=133448&r1=133447&r2=133448&view=diff ============================================================================== --- lldb/trunk/include/lldb/Target/DynamicLoader.h (original) +++ lldb/trunk/include/lldb/Target/DynamicLoader.h Mon Jun 20 12:32:44 2011 @@ -91,6 +91,8 @@ //------------------------------------------------------------------ virtual void DidLaunch () = 0; + + //------------------------------------------------------------------ /// Get whether the process should stop when images change. Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=133448&r1=133447&r2=133448&view=diff ============================================================================== --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Jun 20 12:32:44 2011 @@ -3292,7 +3292,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -3324,7 +3324,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_PREPROCESSOR_DEFINITIONS = ( __STDC_CONSTANT_MACROS, @@ -3616,7 +3616,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_PREPROCESSOR_DEFINITIONS = ( __STDC_CONSTANT_MACROS, Modified: lldb/trunk/source/Expression/ClangUserExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangUserExpression.cpp?rev=133448&r1=133447&r2=133448&view=diff ============================================================================== --- lldb/trunk/source/Expression/ClangUserExpression.cpp (original) +++ lldb/trunk/source/Expression/ClangUserExpression.cpp Mon Jun 20 12:32:44 2011 @@ -597,9 +597,9 @@ Error error; ExecutionResults execution_results = eExecutionSetupError; - if (exe_ctx.process == NULL) + if (exe_ctx.process == NULL || exe_ctx.process->GetState() != lldb::eStateStopped) { - error.SetErrorString ("Must have a process to evaluate expressions."); + error.SetErrorString ("Must have a live but stopped process to evaluate expressions."); result_valobj_sp = ValueObjectConstResult::Create (NULL, error); return eExecutionSetupError; 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=133448&r1=133447&r2=133448&view=diff ============================================================================== --- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original) +++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Mon Jun 20 12:32:44 2011 @@ -288,7 +288,7 @@ } // Update all image infos - UpdateAllImageInfos(); + InitializeFromAllImageInfos (); // If we didn't have an executable before, but now we do, then the // dyld module shared pointer might be unique and we may need to add @@ -442,11 +442,79 @@ // or not (based on global preference). //---------------------------------------------------------------------- bool -DynamicLoaderMacOSXDYLD::NotifyBreakpointHit (void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id) +DynamicLoaderMacOSXDYLD::NotifyBreakpointHit (void *baton, + StoppointCallbackContext *context, + lldb::user_id_t break_id, + lldb::user_id_t break_loc_id) { // Let the event know that the images have changed + // DYLD passes three arguments to the notification breakpoint. + // Arg1: enum dyld_image_mode mode - 0 = adding, 1 = removing + // Arg2: uint32_t infoCount - Number of shared libraries added + // Arg3: dyld_image_info info[] - Array of structs of the form: + // const struct mach_header *imageLoadAddress + // const char *imageFilePath + // uintptr_t imageFileModDate (a time_t) + DynamicLoaderMacOSXDYLD* dyld_instance = (DynamicLoaderMacOSXDYLD*) baton; - dyld_instance->UpdateAllImageInfos(); + + // First step is to see if we've already initialized the all image infos. If we haven't then this function + // will do so and return true. In the course of initializing the all_image_infos it will read the complete + // current state, so we don't need to figure out what has changed from the data passed in to us. + + if (dyld_instance->InitializeFromAllImageInfos()) + return dyld_instance->GetStopWhenImagesChange(); + + Process *process = context->exe_ctx.process; + const lldb::ABISP &abi = process->GetABI(); + if (abi != NULL) + { + // Build up the value array to store the three arguments given above, then get the values from the ABI: + + ClangASTContext *clang_ast_context = process->GetTarget().GetScratchClangASTContext(); + ValueList argument_values; + Value input_value; + + void *clang_void_ptr_type = clang_ast_context->GetVoidPtrType(false); + void *clang_uint32_type = clang_ast_context->GetBuiltinTypeForEncodingAndBitSize(lldb::eEncodingUint, 32); + input_value.SetValueType (Value::eValueTypeScalar); + input_value.SetContext (Value::eContextTypeClangType, clang_uint32_type); + argument_values.PushValue(input_value); + argument_values.PushValue(input_value); + input_value.SetContext (Value::eContextTypeClangType, clang_void_ptr_type); + argument_values.PushValue (input_value); + + if (abi->GetArgumentValues (*context->exe_ctx.thread, argument_values)) + { + uint32_t dyld_mode = argument_values.GetValueAtIndex(0)->GetScalar().UInt (-1); + if (dyld_mode != -1) + { + // Okay the mode was right, now get the number of elements, and the array of new elements... + uint32_t image_infos_count = argument_values.GetValueAtIndex(1)->GetScalar().UInt (-1); + if (image_infos_count != -1) + { + // Got the number added, now go through the array of added elements, putting out the mach header + // address, and adding the image. + // Note, I'm not putting in logging here, since the AddModules & RemoveModules functions do + // all the logging internally. + + lldb::addr_t image_infos_addr = argument_values.GetValueAtIndex(2)->GetScalar().ULongLong(); + if (dyld_mode == 0) + { + // This is add: + dyld_instance->AddModulesUsingImageInfosAddress (image_infos_addr, image_infos_count); + } + else + { + // This is remove: + dyld_instance->RemoveModulesUsingImageInfosAddress (image_infos_addr, image_infos_count); + } + + } + } + } + } + // Return true to stop the target, false to just let the target run return dyld_instance->GetStopWhenImagesChange(); } @@ -571,229 +639,297 @@ return false; } -//---------------------------------------------------------------------- -// If we have found where the "_dyld_all_image_infos" lives in memory, -// read the current info from it, and then update all image load -// addresses (or lack thereof). -//---------------------------------------------------------------------- -uint32_t -DynamicLoaderMacOSXDYLD::UpdateAllImageInfos() + +bool +DynamicLoaderMacOSXDYLD::AddModulesUsingImageInfosAddress (lldb::addr_t image_infos_addr, uint32_t image_infos_count) { + DYLDImageInfo::collection image_infos; LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER)); - ModuleList& target_images = m_process->GetTarget().GetImages(); + if (log) + log->Printf ("Adding %d modules.\n"); + + Mutex::Locker locker(m_mutex); + if (m_process->GetStopID() == m_dyld_image_infos_stop_id) + return true; - if (ReadAllImageInfosStructure ()) + if (!ReadImageInfos (image_infos_addr, image_infos_count, image_infos)) + return false; + + UpdateImageInfosHeaderAndLoadCommands (image_infos, image_infos_count, false); + bool return_value = AddModulesUsingImageInfos (image_infos); + m_dyld_image_infos_stop_id = m_process->GetStopID(); + return return_value; +} + +// Adds the modules in image_infos to m_dyld_image_infos. +// NB don't call this passing in m_dyld_image_infos. + +bool +DynamicLoaderMacOSXDYLD::AddModulesUsingImageInfos (DYLDImageInfo::collection &image_infos) +{ + // Now add these images to the main list. + ModuleList loaded_module_list; + LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER)); + + for (uint32_t idx = 0; idx < image_infos.size(); ++idx) { - Mutex::Locker locker(m_mutex); - if (m_process->GetStopID() == m_dyld_image_infos_stop_id) - m_dyld_image_infos.size(); - - uint32_t idx; - uint32_t i = 0; - // Since we can't downsize a vector, we must do this using the swap method - DYLDImageInfo::collection old_dyld_all_image_infos; - old_dyld_all_image_infos.swap(m_dyld_image_infos); - - // If we made it here, we are assuming that the all dylib info data should - // be valid, lets read the info array. - const ByteOrder endian = m_dyld.GetByteOrder(); - const uint32_t addr_size = m_dyld.GetAddressByteSize(); + if (log) + { + log->Printf ("Adding new image at address=0x%16.16llx.", image_infos[idx].address); + image_infos[idx].PutToLog (log.get()); + } + + m_dyld_image_infos.push_back(image_infos[idx]); + + ModuleSP image_module_sp (FindTargetModuleForDYLDImageInfo (image_infos[idx], true, NULL)); - if (m_dyld_all_image_infos.dylib_info_count > 0) + if (image_module_sp) { - if (m_dyld_all_image_infos.dylib_info_addr == 0) - { - // DYLD is updating the images right now... - } - else + if (image_infos[idx].header.filetype == llvm::MachO::HeaderFileTypeDynamicLinkEditor) + image_module_sp->SetIsDynamicLinkEditor (true); + + ObjectFile *objfile = image_module_sp->GetObjectFile (); + if (objfile) { - m_dyld_image_infos.resize(m_dyld_all_image_infos.dylib_info_count); - const size_t count = m_dyld_image_infos.size() * 3 * addr_size; - DataBufferHeap info_data(count, 0); - Error error; - const size_t bytes_read = m_process->ReadMemory (m_dyld_all_image_infos.dylib_info_addr, - info_data.GetBytes(), - info_data.GetByteSize(), - error); - if (bytes_read == count) + SectionList *sections = objfile->GetSectionList(); + if (sections) { - uint32_t info_data_offset = 0; - DataExtractor info_data_ref(info_data.GetBytes(), info_data.GetByteSize(), endian, addr_size); - for (i = 0; i < m_dyld_image_infos.size() && info_data_ref.ValidOffset(info_data_offset); i++) + ConstString commpage_dbstr("__commpage"); + Section *commpage_section = sections->FindSectionByName(commpage_dbstr).get(); + if (commpage_section) { - m_dyld_image_infos[i].address = info_data_ref.GetPointer(&info_data_offset); - lldb::addr_t path_addr = info_data_ref.GetPointer(&info_data_offset); - m_dyld_image_infos[i].mod_date = info_data_ref.GetPointer(&info_data_offset); - - char raw_path[PATH_MAX]; - m_process->ReadCStringFromMemory (path_addr, raw_path, sizeof(raw_path)); - // don't resolve the path - const bool resolve_path = false; - m_dyld_image_infos[i].file_spec.SetFile(raw_path, resolve_path); + ModuleList& target_images = m_process->GetTarget().GetImages(); + const FileSpec objfile_file_spec = objfile->GetFileSpec(); + ArchSpec arch (image_infos[idx].GetArchitecture ()); + ModuleSP commpage_image_module_sp(target_images.FindFirstModuleForFileSpec (objfile_file_spec, + &arch, + &commpage_dbstr)); + if (!commpage_image_module_sp) + { + commpage_image_module_sp + = m_process->GetTarget().GetSharedModule (image_infos[idx].file_spec, + arch, + NULL, + &commpage_dbstr, + objfile->GetOffset() + commpage_section->GetFileOffset()); + } + if (commpage_image_module_sp) + UpdateCommPageLoadAddress (commpage_image_module_sp.get()); } - - UpdateAllImageInfosHeaderAndLoadCommands(); - } - else - { - DEBUG_PRINTF( "unable to read all data for all_dylib_infos."); - m_dyld_image_infos.clear(); } } - } - // If our new list is smaller than our old list, we have unloaded - // some shared libraries - if (m_dyld_image_infos.size() != old_dyld_all_image_infos.size()) + // UpdateImageLoadAddress will return true if any segments + // change load address. We need to check this so we don't + // mention that all loaded shared libraries are newly loaded + // each time we hit out dyld breakpoint since dyld will list all + // shared libraries each time. + if (UpdateImageLoadAddress (image_module_sp.get(), image_infos[idx])) + { + loaded_module_list.AppendIfNeeded (image_module_sp); + } + } + } + + if (loaded_module_list.GetSize() > 0) + { + // FIXME: This should really be in the Runtime handlers class, which should get + // called by the target's ModulesDidLoad, but we're doing it all locally for now + // to save time. + // Also, I'm assuming there can be only one libobjc dylib loaded... + + ObjCLanguageRuntime *objc_runtime = m_process->GetObjCLanguageRuntime(); + if (objc_runtime != NULL && !objc_runtime->HasReadObjCLibrary()) { - ModuleList unloaded_module_list; - if (old_dyld_all_image_infos.size() == 0) + size_t num_modules = loaded_module_list.GetSize(); + for (int i = 0; i < num_modules; i++) { - // This is the first time we are loading shared libraries, - // we need to make sure to trim anything that isn't in the - // m_dyld_image_infos out of the target module list since - // we might have shared libraries that got loaded from - // elsewhere due to DYLD_FRAMEWORK_PATH, or DYLD_LIBRARY_PATH - // environment variables... - const size_t num_images = target_images.GetSize(); - for (idx = 0; idx < num_images; ++idx) + if (objc_runtime->IsModuleObjCLibrary (loaded_module_list.GetModuleAtIndex (i))) { - ModuleSP module_sp (target_images.GetModuleAtIndex (idx)); - - if (GetImageInfo (module_sp.get()) == NULL) - unloaded_module_list.AppendIfNeeded (module_sp); + objc_runtime->ReadObjCLibrary (loaded_module_list.GetModuleAtIndex (i)); + break; } } - else + } + if (log) + loaded_module_list.LogUUIDAndPaths (log, "DynamicLoaderMacOSXDYLD::ModulesDidLoad"); + m_process->GetTarget().ModulesDidLoad (loaded_module_list); + } + return true; +} + +bool +DynamicLoaderMacOSXDYLD::RemoveModulesUsingImageInfosAddress (lldb::addr_t image_infos_addr, uint32_t image_infos_count) +{ + DYLDImageInfo::collection image_infos; + LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER)); + + Mutex::Locker locker(m_mutex); + if (m_process->GetStopID() == m_dyld_image_infos_stop_id) + return true; + + // First read in the image_infos for the removed modules, and their headers & load commands. + if (!ReadImageInfos (image_infos_addr, image_infos_count, image_infos)) + { + if (log) + log->PutCString ("Failed reading image infos array."); + return false; + } + + if (log) + log->Printf ("Removing %d modules.", image_infos_count); + + ModuleList unloaded_module_list; + for (uint32_t idx = 0; idx < image_infos.size(); ++idx) + { + if (log) + { + log->Printf ("Removing module at address=0x%16.16llx.", image_infos[idx].address); + image_infos[idx].PutToLog (log.get()); + } + + // Remove this image_infos from the m_all_image_infos. We do the comparision by address + // rather than by file spec because we can have many modules with the same "file spec" in the + // case that they are modules loaded from memory. + // + // Also copy over the uuid from the old entry to the removed entry so we can + // use it to lookup the module in the module list. + + DYLDImageInfo::collection::iterator pos, end = m_dyld_image_infos.end(); + for (pos = m_dyld_image_infos.begin(); pos != end; pos++) + { + if (image_infos[idx].address == (*pos).address) { - uint32_t old_idx; - for (idx = 0; idx < old_dyld_all_image_infos.size(); ++idx) + image_infos[idx].uuid = (*pos).uuid; + + // Add the module from this image_info to the "unloaded_module_list". We'll remove them all at + // one go later on. + + ModuleSP unload_image_module_sp (FindTargetModuleForDYLDImageInfo (image_infos[idx], false, NULL)); + if (unload_image_module_sp.get()) { - for (old_idx = idx; old_idx < old_dyld_all_image_infos.size(); ++old_idx) - { - if (m_dyld_image_infos[idx].file_spec == old_dyld_all_image_infos[old_idx].file_spec) - { - old_dyld_all_image_infos[old_idx].address = LLDB_INVALID_ADDRESS; - break; - } - } + UnloadImageLoadAddress (unload_image_module_sp.get(), image_infos[idx]); + unloaded_module_list.AppendIfNeeded (unload_image_module_sp); } - - for (old_idx = 0; old_idx < old_dyld_all_image_infos.size(); ++old_idx) + else { - if (old_dyld_all_image_infos[old_idx].address != LLDB_INVALID_ADDRESS) + if (log) { - if (log) - old_dyld_all_image_infos[old_idx].PutToLog (log.get()); - ModuleSP unload_image_module_sp (FindTargetModuleForDYLDImageInfo (old_dyld_all_image_infos[old_idx], false, NULL)); - if (unload_image_module_sp.get()) - { - if (UnloadImageLoadAddress (unload_image_module_sp.get(), old_dyld_all_image_infos[old_idx])) - unloaded_module_list.AppendIfNeeded (unload_image_module_sp); - } + log->Printf ("Could not find module for unloading info entry:"); + image_infos[idx].PutToLog(log.get()); } } + + // Then remove it from the m_dyld_image_infos: + + m_dyld_image_infos.erase(pos); + break; } - - if (unloaded_module_list.GetSize() > 0) + } + + if (pos == end) + { + if (log) { - if (log) - { - log->PutCString("Unloaded:"); - unloaded_module_list.LogUUIDAndPaths (log, "DynamicLoaderMacOSXDYLD::ModulesDidUnload"); - } - m_process->GetTarget().ModulesDidUnload (unloaded_module_list); + log->Printf ("Could not find image_info entry for unloading image:"); + image_infos[idx].PutToLog(log.get()); } } - else + } + if (unloaded_module_list.GetSize() > 0) + { + if (log) { - if (log) - PutToLog(log.get()); + log->PutCString("Unloaded:"); + unloaded_module_list.LogUUIDAndPaths (log, "DynamicLoaderMacOSXDYLD::ModulesDidUnload"); + } + m_process->GetTarget().ModulesDidUnload (unloaded_module_list); + } + m_dyld_image_infos_stop_id = m_process->GetStopID(); + return true; +} + +bool +DynamicLoaderMacOSXDYLD::ReadImageInfos (lldb::addr_t image_infos_addr, + uint32_t image_infos_count, + DYLDImageInfo::collection &image_infos) +{ + const ByteOrder endian = m_dyld.GetByteOrder(); + const uint32_t addr_size = m_dyld.GetAddressByteSize(); + + image_infos.resize(image_infos_count); + const size_t count = image_infos.size() * 3 * addr_size; + DataBufferHeap info_data(count, 0); + Error error; + const size_t bytes_read = m_process->ReadMemory (image_infos_addr, + info_data.GetBytes(), + info_data.GetByteSize(), + error); + if (bytes_read == count) + { + uint32_t info_data_offset = 0; + DataExtractor info_data_ref(info_data.GetBytes(), info_data.GetByteSize(), endian, addr_size); + for (int i = 0; i < image_infos.size() && info_data_ref.ValidOffset(info_data_offset); i++) + { + image_infos[i].address = info_data_ref.GetPointer(&info_data_offset); + lldb::addr_t path_addr = info_data_ref.GetPointer(&info_data_offset); + image_infos[i].mod_date = info_data_ref.GetPointer(&info_data_offset); + + char raw_path[PATH_MAX]; + m_process->ReadCStringFromMemory (path_addr, raw_path, sizeof(raw_path)); + // don't resolve the path + const bool resolve_path = false; + image_infos[i].file_spec.SetFile(raw_path, resolve_path); } - m_dyld_image_infos_stop_id = m_process->GetStopID(); + return true; } else { - m_dyld_image_infos.clear(); + return false; } +} - const uint32_t num_dylibs = m_dyld_image_infos.size(); - if (num_dylibs > 0) +//---------------------------------------------------------------------- +// If we have found where the "_dyld_all_image_infos" lives in memory, +// read the current info from it, and then update all image load +// addresses (or lack thereof). Only do this if this is the first time +// we're reading the dyld infos. Return true if we actually read anything, +// and false otherwise. +//---------------------------------------------------------------------- +bool +DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos () +{ + LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER)); + + Mutex::Locker locker(m_mutex); + if (m_process->GetStopID() == m_dyld_image_infos_stop_id + || m_dyld_image_infos.size() != 0) + return false; + + if (ReadAllImageInfosStructure ()) { - ModuleList loaded_module_list; - for (uint32_t idx = 0; idx 0) { - ModuleSP image_module_sp (FindTargetModuleForDYLDImageInfo (m_dyld_image_infos[idx], true, NULL)); - - if (image_module_sp) + if (m_dyld_all_image_infos.dylib_info_addr == 0) { - if (m_dyld_image_infos[idx].header.filetype == llvm::MachO::HeaderFileTypeDynamicLinkEditor) - image_module_sp->SetIsDynamicLinkEditor (true); - - ObjectFile *objfile = image_module_sp->GetObjectFile (); - if (objfile) - { - SectionList *sections = objfile->GetSectionList(); - if (sections) - { - ConstString commpage_dbstr("__commpage"); - Section *commpage_section = sections->FindSectionByName(commpage_dbstr).get(); - if (commpage_section) - { - const FileSpec objfile_file_spec = objfile->GetFileSpec(); - ArchSpec arch (m_dyld_image_infos[idx].GetArchitecture ()); - ModuleSP commpage_image_module_sp(target_images.FindFirstModuleForFileSpec (objfile_file_spec, &arch, &commpage_dbstr)); - if (!commpage_image_module_sp) - { - commpage_image_module_sp = m_process->GetTarget().GetSharedModule (m_dyld_image_infos[idx].file_spec, - arch, - NULL, - &commpage_dbstr, - objfile->GetOffset() + commpage_section->GetFileOffset()); - } - if (commpage_image_module_sp) - UpdateCommPageLoadAddress (commpage_image_module_sp.get()); - } - } - } - - // UpdateImageLoadAddress will return true if any segments - // change load address. We need to check this so we don't - // mention that all loaded shared libraries are newly loaded - // each time we hit out dyld breakpoint since dyld will list all - // shared libraries each time. - if (UpdateImageLoadAddress (image_module_sp.get(), m_dyld_image_infos[idx])) - { - loaded_module_list.AppendIfNeeded (image_module_sp); - } + // DYLD is updating the images now. So we should say we have no images, and then we'll + // figure it out when we hit the added breakpoint. + return false; } - } - if (loaded_module_list.GetSize() > 0) - { - // FIXME: This should really be in the Runtime handlers class, which should get - // called by the target's ModulesDidLoad, but we're doing it all locally for now - // to save time. - // Also, I'm assuming there can be only one libobjc dylib loaded... - - ObjCLanguageRuntime *objc_runtime = m_process->GetObjCLanguageRuntime(); - if (objc_runtime != NULL && !objc_runtime->HasReadObjCLibrary()) + else { - size_t num_modules = loaded_module_list.GetSize(); - for (int i = 0; i < num_modules; i++) + if (!AddModulesUsingImageInfosAddress (m_dyld_all_image_infos.dylib_info_addr, + m_dyld_all_image_infos.dylib_info_count)) { - if (objc_runtime->IsModuleObjCLibrary (loaded_module_list.GetModuleAtIndex (i))) - { - objc_runtime->ReadObjCLibrary (loaded_module_list.GetModuleAtIndex (i)); - break; - } + DEBUG_PRINTF( "unable to read all data for all_dylib_infos."); + m_dyld_image_infos.clear(); } } - if (log) - loaded_module_list.LogUUIDAndPaths (log, "DynamicLoaderMacOSXDYLD::ModulesDidLoad"); - m_process->GetTarget().ModulesDidLoad (loaded_module_list); } + return true; } - return m_dyld_image_infos.size(); + else + return false; } //---------------------------------------------------------------------- @@ -968,40 +1104,41 @@ // Read the mach_header and load commands for each image that the // _dyld_all_image_infos structure points to and cache the results. //---------------------------------------------------------------------- + void -DynamicLoaderMacOSXDYLD::UpdateAllImageInfosHeaderAndLoadCommands() +DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands(DYLDImageInfo::collection &image_infos, + uint32_t infos_count, + bool update_executable) { uint32_t exe_idx = UINT32_MAX; LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER)); // Read any UUID values that we can get - for (uint32_t i = 0; i < m_dyld_all_image_infos.dylib_info_count; i++) + for (uint32_t i = 0; i < infos_count; i++) { - if (!m_dyld_image_infos[i].UUIDValid()) + if (!image_infos[i].UUIDValid()) { DataExtractor data; // Load command data - if (!ReadMachHeader (m_dyld_image_infos[i].address, &m_dyld_image_infos[i].header, &data)) + if (!ReadMachHeader (image_infos[i].address, &image_infos[i].header, &data)) continue; - ParseLoadCommands (data, m_dyld_image_infos[i], NULL); + ParseLoadCommands (data, image_infos[i], NULL); - if (m_dyld_image_infos[i].header.filetype == llvm::MachO::HeaderFileTypeExecutable) + if (image_infos[i].header.filetype == llvm::MachO::HeaderFileTypeExecutable) exe_idx = i; - if (log) - m_dyld_image_infos[i].PutToLog (log.get()); } } - if (exe_idx < m_dyld_image_infos.size()) + if (exe_idx < image_infos.size()) { - ModuleSP exe_module_sp (FindTargetModuleForDYLDImageInfo (m_dyld_image_infos[exe_idx], false, NULL)); + ModuleSP exe_module_sp (FindTargetModuleForDYLDImageInfo (image_infos[exe_idx], false, NULL)); if (!exe_module_sp) { - ArchSpec exe_arch_spec (m_dyld_image_infos[exe_idx].GetArchitecture ()); - exe_module_sp = m_process->GetTarget().GetSharedModule (m_dyld_image_infos[exe_idx].file_spec, + ArchSpec exe_arch_spec (image_infos[exe_idx].GetArchitecture ()); + exe_module_sp = m_process->GetTarget().GetSharedModule (image_infos[exe_idx].file_spec, exe_arch_spec, - &m_dyld_image_infos[exe_idx].uuid); + &image_infos[exe_idx].uuid); } if (exe_module_sp) Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h?rev=133448&r1=133447&r2=133448&view=diff ============================================================================== --- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h (original) +++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h Mon Jun 20 12:32:44 2011 @@ -103,19 +103,11 @@ bool ReadDYLDInfoFromMemoryAndSetNotificationCallback (lldb::addr_t addr); - uint32_t - UpdateAllImageInfos (); - static bool NotifyBreakpointHit (void *baton, lldb_private::StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id); - void - UpdateAllImageInfosHeaderAndLoadCommands (); - - bool - UpdateCommPageLoadAddress (lldb_private::Module *module); uint32_t AddrByteSize() @@ -380,8 +372,42 @@ bool SetNotificationBreakpoint (); + // There is a little tricky bit where you might initially attach while dyld is updating + // the all_image_infos, and you can't read the infos, so you have to continue and pick it + // up when you hit the update breakpoint. At that point, you need to run this initialize + // function, but when you do it that way you DON'T need to do the extra work you would at + // the breakpoint. + // So this function will only do actual work if the image infos haven't been read yet. + // If it does do any work, then it will return true, and false otherwise. That way you can + // call it in the breakpoint action, and if it returns true you're done. + bool + InitializeFromAllImageInfos (); + bool ReadAllImageInfosStructure (); + + bool + AddModulesUsingImageInfosAddress (lldb::addr_t image_infos_addr, uint32_t image_infos_count); + + bool + AddModulesUsingImageInfos (DYLDImageInfo::collection &image_infos); + + bool + RemoveModulesUsingImageInfosAddress (lldb::addr_t image_infos_addr, uint32_t image_infos_count); + + void + UpdateImageInfosHeaderAndLoadCommands(DYLDImageInfo::collection &image_infos, + uint32_t infos_count, + bool update_executable); + + bool + UpdateCommPageLoadAddress (lldb_private::Module *module); + + bool + ReadImageInfos (lldb::addr_t image_infos_addr, + uint32_t image_infos_count, + DYLDImageInfo::collection &image_infos); + DYLDImageInfo m_dyld; // Info about the current dyld being used lldb::addr_t m_dyld_all_image_infos_addr; Modified: lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp?rev=133448&r1=133447&r2=133448&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp (original) +++ lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp Mon Jun 20 12:32:44 2011 @@ -27,6 +27,8 @@ Thread *thread = process->GetThreadList().GetSelectedThread().get(); if (thread == NULL) thread = process->GetThreadList().GetThreadAtIndex(0).get(); + if (thread == NULL) + return false; const bool append = true; const bool include_symbols = true; Modified: lldb/trunk/source/Target/Process.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=133448&r1=133447&r2=133448&view=diff ============================================================================== --- lldb/trunk/source/Target/Process.cpp (original) +++ lldb/trunk/source/Target/Process.cpp Mon Jun 20 12:32:44 2011 @@ -1897,6 +1897,9 @@ addr_t Process::AllocateMemory(size_t size, uint32_t permissions, Error &error) { + if (GetPrivateState() != eStateStopped) + return LLDB_INVALID_ADDRESS; + #if defined (USE_ALLOCATE_MEMORY_CACHE) return m_allocated_memory_cache.AllocateMemory(size, permissions, error); #else Modified: lldb/trunk/test/types/AbstractBase.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/AbstractBase.py?rev=133448&r1=133447&r2=133448&view=diff ============================================================================== --- lldb/trunk/test/types/AbstractBase.py (original) +++ lldb/trunk/test/types/AbstractBase.py Mon Jun 20 12:32:44 2011 @@ -44,8 +44,13 @@ # Bring the program to the point where we can issue a series of # 'frame variable -T' command. self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) - self.runCmd("breakpoint set --name Puts") - self.runCmd("run", RUN_SUCCEEDED) + puts_line = line_number ("basic_type.cpp", "// Here is the line we will break on before stepping out") + self.expect("breakpoint set -f basic_type.cpp -l %d" % puts_line, + BREAKPOINT_CREATED, + startstr = "Breakpoint created: 1: file ='basic_type.cpp', line = %d, locations = 1" % + puts_line) + + self.expect("run", RUN_SUCCEEDED, patterns = [".*"]) self.runCmd("thread step-out", STEP_OUT_SUCCEEDED) #self.runCmd("frame variable -T") @@ -104,8 +109,16 @@ # Bring the program to the point where we can issue a series of # 'expr' command. self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) - self.runCmd("breakpoint set --name Puts") - self.runCmd("run", RUN_SUCCEEDED) + #self.runCmd("breakpoint set --name Puts") + #self.runCmd("run", RUN_SUCCEEDED) + puts_line = line_number ("basic_type.cpp", "// Here is the line we will break on before stepping out") + self.expect("breakpoint set -f basic_type.cpp -l %d" % puts_line, + BREAKPOINT_CREATED, + startstr = "Breakpoint created: 1: file ='basic_type.cpp', line = %d, locations = 1" % + puts_line) + self.expect("run", RUN_SUCCEEDED, patterns = [".*"]) + self.runCmd ("process status") + self.runCmd("thread step-out", STEP_OUT_SUCCEEDED) #self.runCmd("frame variable -T") Modified: lldb/trunk/test/types/basic_type.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/basic_type.cpp?rev=133448&r1=133447&r2=133448&view=diff ============================================================================== --- lldb/trunk/test/types/basic_type.cpp (original) +++ lldb/trunk/test/types/basic_type.cpp Mon Jun 20 12:32:44 2011 @@ -84,7 +84,7 @@ void Puts(char const *msg) { - puts(msg); + puts(msg); // Here is the line we will break on before stepping out } int From johnny.chen at apple.com Mon Jun 20 13:59:49 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Mon, 20 Jun 2011 18:59:49 -0000 Subject: [Lldb-commits] [lldb] r133455 - /lldb/trunk/source/Breakpoint/BreakpointOptions.cpp Message-ID: <20110620185949.9C08B2A6C12C@llvm.org> Author: johnny Date: Mon Jun 20 13:59:49 2011 New Revision: 133455 URL: http://llvm.org/viewvc/llvm-project?rev=133455&view=rev Log: Revert r133358 which forgoes printing of breakpoint command when doing a breakpoint list where the description level is not eDescriptionLevelBrief. It broke test/TestAliases.py. Besides, to have a brief breakpoint list, you can do "breakpoint list -b". Modified: lldb/trunk/source/Breakpoint/BreakpointOptions.cpp Modified: lldb/trunk/source/Breakpoint/BreakpointOptions.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointOptions.cpp?rev=133455&r1=133454&r2=133455&view=diff ============================================================================== --- lldb/trunk/source/Breakpoint/BreakpointOptions.cpp (original) +++ lldb/trunk/source/Breakpoint/BreakpointOptions.cpp Mon Jun 20 13:59:49 2011 @@ -309,6 +309,14 @@ } } + if (m_callback_baton_sp.get()) + { + if (level != eDescriptionLevelBrief) + { + s->EOL(); + m_callback_baton_sp->GetDescription (s, level); + } + } if (m_condition_ap.get()) { if (level != eDescriptionLevelBrief) From peter at pcc.me.uk Mon Jun 20 14:06:04 2011 From: peter at pcc.me.uk (Peter Collingbourne) Date: Mon, 20 Jun 2011 19:06:04 -0000 Subject: [Lldb-commits] [lldb] r133456 - in /lldb/trunk/test: global_variables/Makefile make/Makefile.rules Message-ID: <20110620190604.4B38E2A6C12C@llvm.org> Author: pcc Date: Mon Jun 20 14:06:04 2011 New Revision: 133456 URL: http://llvm.org/viewvc/llvm-project?rev=133456&view=rev Log: Add Linux rules to test makefile Modified: lldb/trunk/test/global_variables/Makefile lldb/trunk/test/make/Makefile.rules Modified: lldb/trunk/test/global_variables/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/global_variables/Makefile?rev=133456&r1=133455&r2=133456&view=diff ============================================================================== --- lldb/trunk/test/global_variables/Makefile (original) +++ lldb/trunk/test/global_variables/Makefile Mon Jun 20 14:06:04 2011 @@ -2,7 +2,7 @@ C_SOURCES := main.c -DYLIB_NAME := liba.dylib +DYLIB_NAME := a DYLIB_C_SOURCES := a.c include $(LEVEL)/Makefile.rules Modified: lldb/trunk/test/make/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/make/Makefile.rules?rev=133456&r1=133455&r2=133456&view=diff ============================================================================== --- lldb/trunk/test/make/Makefile.rules (original) +++ lldb/trunk/test/make/Makefile.rules Mon Jun 20 14:06:04 2011 @@ -12,11 +12,16 @@ #---------------------------------------------------------------------- # If ARCH is not defined, default to x86_64. +# If OS is not defined, use 'uname -s' to determine the OS name. #---------------------------------------------------------------------- ifeq "$(ARCH)" "" ARCH = x86_64 endif +ifeq "$(OS)" "" + OS = $(shell uname -s) +endif + #---------------------------------------------------------------------- # CC defaults to gcc. # See also these functions: @@ -31,15 +36,27 @@ #---------------------------------------------------------------------- # Change any build/tool options needed #---------------------------------------------------------------------- -DS := /usr/bin/dsymutil -DSFLAGS = -CFLAGS ?=-arch $(ARCH) -gdwarf-2 -O0 +CFLAGS ?= -gdwarf-2 -O0 CXXFLAGS +=$(CFLAGS) LD = $(CC) LDFLAGS ?= $(CFLAGS) OBJECTS = EXE ?= a.out -DSYM = $(EXE).dSYM + +ifeq "$(OS)" "Darwin" + CFLAGS += -arch $(ARCH) + DS := /usr/bin/dsymutil + DSFLAGS = + DSYM = $(EXE).dSYM +endif + +ifneq "$(DYLIB_NAME)" "" + ifeq "$(OS)" "Darwin" + DYLIB_FILENAME = lib$(DYLIB_NAME).dylib + else + DYLIB_FILENAME = lib$(DYLIB_NAME).so + endif +endif # Function that returns the counterpart C++ compiler, given $(CC) as arg. cxx_compiler = $(if $(findstring clang,$(1)), $(subst clang,clang++,$(1)), $(if $(findstring llvm-gcc,$(1)), $(subst llvm-gcc,llvm-g++,$(1)), $(subst gcc,g++,$(1)))) @@ -95,9 +112,11 @@ #---------------------------------------------------------------------- # Make the dSYM file from the executable if $(MAKE_DSYM) != "NO" #---------------------------------------------------------------------- -ifneq "$(MAKE_DSYM)" "NO" +ifeq "$(OS)" "Darwin" + ifneq "$(MAKE_DSYM)" "NO" $(DSYM) : $(EXE) $(DS) $(DSFLAGS) -o "$(DSYM)" "$(EXE)" + endif endif #---------------------------------------------------------------------- @@ -107,15 +126,19 @@ $(EXE) : $(OBJECTS) $(LD) $(LDFLAGS) $(OBJECTS) -o "$(EXE)" else -$(EXE) : $(OBJECTS) $(DYLIB_NAME) - $(LD) $(LDFLAGS) $(OBJECTS) -L. -l$(subst lib,,$(basename $(DYLIB_NAME))) -o "$(EXE)" +$(EXE) : $(OBJECTS) $(DYLIB_FILENAME) + $(LD) $(LDFLAGS) $(OBJECTS) -L. -l$(DYLIB_NAME) -o "$(EXE)" endif #---------------------------------------------------------------------- # Make the dylib #---------------------------------------------------------------------- -$(DYLIB_NAME) : $(DYLIB_OBJECTS) - $(LD) $(LDFLAGS) $(DYLIB_OBJECTS) -install_name "@executable_path/$(DYLIB_NAME)" -dynamiclib -o "$(DYLIB_NAME)" +$(DYLIB_FILENAME) : $(DYLIB_OBJECTS) +ifeq "$(OS)" "Darwin" + $(LD) $(LDFLAGS) $(DYLIB_OBJECTS) -install_name "@executable_path/$(DYLIB_FILENAME)" -dynamiclib -o "$(DYLIB_FILENAME)" +else + $(LD) $(LDFLAGS) $(DYLIB_OBJECTS) -shared -o "$(DYLIB_FILENAME)" +endif #---------------------------------------------------------------------- # Automatic variables based on items already entered. Below we create @@ -173,7 +196,7 @@ ifeq "$(DYLIB_NAME)" "" rm -rf "$(EXE)" "$(DSYM)" $(OBJECTS) $(PREREQS) else - rm -rf "$(EXE)" "$(DSYM)" $(OBJECTS) $(PREREQS) $(DYLIB_OBJECTS) $(DYLIB_NAME) $(DYLIB_NAME).dSYM + rm -rf "$(EXE)" "$(DSYM)" $(OBJECTS) $(PREREQS) $(DYLIB_OBJECTS) $(DYLIB_FILENAME) $(DYLIB_FILENAME).dSYM endif #---------------------------------------------------------------------- From peter at pcc.me.uk Mon Jun 20 14:06:20 2011 From: peter at pcc.me.uk (Peter Collingbourne) Date: Mon, 20 Jun 2011 19:06:20 -0000 Subject: [Lldb-commits] [lldb] r133457 - in /lldb/trunk/test: lldbtest.py plugins/builder_base.py plugins/builder_darwin.py plugins/builder_linux2.py plugins/darwin.py Message-ID: <20110620190620.64BB62A6C12C@llvm.org> Author: pcc Date: Mon Jun 20 14:06:20 2011 New Revision: 133457 URL: http://llvm.org/viewvc/llvm-project?rev=133457&view=rev Log: Add a builder module for Linux (plus some refactoring) Added: lldb/trunk/test/plugins/builder_base.py - copied, changed from r133456, lldb/trunk/test/plugins/darwin.py lldb/trunk/test/plugins/builder_darwin.py lldb/trunk/test/plugins/builder_linux2.py Removed: lldb/trunk/test/plugins/darwin.py Modified: lldb/trunk/test/lldbtest.py Modified: lldb/trunk/test/lldbtest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=133457&r1=133456&r2=133457&view=diff ============================================================================== --- lldb/trunk/test/lldbtest.py (original) +++ lldb/trunk/test/lldbtest.py Mon Jun 20 14:06:20 2011 @@ -338,6 +338,9 @@ except: return repr(obj) +def builder_module(): + return __import__("builder_" + sys.platform) + class TestBase(unittest2.TestCase): """ This abstract base class is meant to be subclassed. It provides default @@ -443,7 +446,7 @@ if doCleanup: # First, let's do the platform-specific cleanup. - module = __import__(sys.platform) + module = builder_module() if not module.cleanup(): raise Exception("Don't know how to do cleanup") @@ -717,13 +720,13 @@ # Perform registered teardown cleanup. if doCleanup and self.doTearDownCleanup: - module = __import__(sys.platform) + module = builder_module() if not module.cleanup(self, dictionary=self.dict): raise Exception("Don't know how to do cleanup with dictionary: " + self.dict) # In rare cases where there are multiple teardown cleanups added. if doCleanup and self.doTearDownCleanups: - module = __import__(sys.platform) + module = builder_module() if self.dicts: for dict in reversed(self.dicts): if not module.cleanup(self, dictionary=dict): @@ -874,12 +877,12 @@ def getArchitecture(self): """Returns the architecture in effect the test suite is running with.""" - module = __import__(sys.platform) + module = builder_module() return module.getArchitecture() def getCompiler(self): """Returns the compiler in effect the test suite is running with.""" - module = __import__(sys.platform) + module = builder_module() return module.getCompiler() def getRunOptions(self): @@ -899,19 +902,19 @@ def buildDefault(self, architecture=None, compiler=None, dictionary=None): """Platform specific way to build the default binaries.""" - module = __import__(sys.platform) + module = builder_module() if not module.buildDefault(self, architecture, compiler, dictionary): raise Exception("Don't know how to build default binary") def buildDsym(self, architecture=None, compiler=None, dictionary=None): """Platform specific way to build binaries with dsym info.""" - module = __import__(sys.platform) + module = builder_module() if not module.buildDsym(self, architecture, compiler, dictionary): raise Exception("Don't know how to build binary with dsym") def buildDwarf(self, architecture=None, compiler=None, dictionary=None): """Platform specific way to build binaries with dwarf maps.""" - module = __import__(sys.platform) + module = builder_module() if not module.buildDwarf(self, architecture, compiler, dictionary): raise Exception("Don't know how to build binary with dwarf") Copied: lldb/trunk/test/plugins/builder_base.py (from r133456, lldb/trunk/test/plugins/darwin.py) URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/plugins/builder_base.py?p2=lldb/trunk/test/plugins/builder_base.py&p1=lldb/trunk/test/plugins/darwin.py&r1=133456&r2=133457&rev=133457&view=diff ============================================================================== --- lldb/trunk/test/plugins/darwin.py (original) +++ lldb/trunk/test/plugins/builder_base.py Mon Jun 20 14:06:20 2011 @@ -15,8 +15,6 @@ import os import lldbtest -#print "Hello, darwin plugin!" - def getArchitecture(): """Returns the architecture in effect the test suite is running with.""" return os.environ["ARCH"] if "ARCH" in os.environ else "" @@ -76,18 +74,6 @@ # True signifies that we can handle building default. return True -def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None): - """Build the binaries with dsym debug info.""" - lldbtest.system(["/bin/sh", "-c", - "make clean" + getCmdLine(dictionary) - + "; make MAKE_DSYM=YES" - + getArchSpec(architecture) + getCCSpec(compiler) - + getCmdLine(dictionary)], - sender=sender) - - # True signifies that we can handle building dsym. - return True - def buildDwarf(sender=None, architecture=None, compiler=None, dictionary=None): """Build the binaries with dwarf debug info.""" lldbtest.system(["/bin/sh", "-c", Added: lldb/trunk/test/plugins/builder_darwin.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/plugins/builder_darwin.py?rev=133457&view=auto ============================================================================== --- lldb/trunk/test/plugins/builder_darwin.py (added) +++ lldb/trunk/test/plugins/builder_darwin.py Mon Jun 20 14:06:20 2011 @@ -0,0 +1,18 @@ +import os +import lldbtest + +from builder_base import * + +#print "Hello, darwin plugin!" + +def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None): + """Build the binaries with dsym debug info.""" + lldbtest.system(["/bin/sh", "-c", + "make clean" + getCmdLine(dictionary) + + "; make MAKE_DSYM=YES" + + getArchSpec(architecture) + getCCSpec(compiler) + + getCmdLine(dictionary)], + sender=sender) + + # True signifies that we can handle building dsym. + return True Added: lldb/trunk/test/plugins/builder_linux2.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/plugins/builder_linux2.py?rev=133457&view=auto ============================================================================== --- lldb/trunk/test/plugins/builder_linux2.py (added) +++ lldb/trunk/test/plugins/builder_linux2.py Mon Jun 20 14:06:20 2011 @@ -0,0 +1,4 @@ +from builder_base import * + +def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None): + return False Removed: lldb/trunk/test/plugins/darwin.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/plugins/darwin.py?rev=133456&view=auto ============================================================================== --- lldb/trunk/test/plugins/darwin.py (original) +++ lldb/trunk/test/plugins/darwin.py (removed) @@ -1,110 +0,0 @@ -""" -If the build* function is passed the compiler argument, for example, 'llvm-gcc', -it is passed as a make variable to the make command. Otherwise, we check the -LLDB_CC environment variable; if it is defined, it is passed as a make variable -to the make command. - -If neither the compiler keyword argument nor the LLDB_CC environment variable is -specified, no CC make variable is passed to the make command. The Makefile gets -to define the default CC being used. - -Same idea holds for LLDB_ARCH environment variable, which maps to the ARCH make -variable. -""" - -import os -import lldbtest - -#print "Hello, darwin plugin!" - -def getArchitecture(): - """Returns the architecture in effect the test suite is running with.""" - return os.environ["ARCH"] if "ARCH" in os.environ else "" - -def getCompiler(): - """Returns the compiler in effect the test suite is running with.""" - return os.environ["CC"] if "CC" in os.environ else "" - -def getArchSpec(architecture): - """ - Helper function to return the key-value string to specify the architecture - used for the make system. - """ - arch = architecture if architecture else None - if not arch and "ARCH" in os.environ: - arch = os.environ["ARCH"] - - # Note the leading space character. - return (" ARCH=" + arch) if arch else "" - -def getCCSpec(compiler): - """ - Helper function to return the key-value string to specify the compiler - used for the make system. - """ - cc = compiler if compiler else None - if not cc and "CC" in os.environ: - cc = os.environ["CC"] - - # Note the leading space character. - return (" CC=" + cc) if cc else "" - -def getCmdLine(d): - """ - Helper function to return a properly formatted command line argument(s) - string used for the make system. - """ - - # If d is None or an empty mapping, just return an empty string. - if not d: - return "" - - cmdline = " ".join(["%s='%s'" % (k, v) for k, v in d.items()]) - - # Note the leading space character. - return " " + cmdline - - -def buildDefault(sender=None, architecture=None, compiler=None, dictionary=None): - """Build the binaries the default way.""" - lldbtest.system(["/bin/sh", "-c", - "make clean" + getCmdLine(dictionary) + "; make" - + getArchSpec(architecture) + getCCSpec(compiler) - + getCmdLine(dictionary)], - sender=sender) - - # True signifies that we can handle building default. - return True - -def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None): - """Build the binaries with dsym debug info.""" - lldbtest.system(["/bin/sh", "-c", - "make clean" + getCmdLine(dictionary) - + "; make MAKE_DSYM=YES" - + getArchSpec(architecture) + getCCSpec(compiler) - + getCmdLine(dictionary)], - sender=sender) - - # True signifies that we can handle building dsym. - return True - -def buildDwarf(sender=None, architecture=None, compiler=None, dictionary=None): - """Build the binaries with dwarf debug info.""" - lldbtest.system(["/bin/sh", "-c", - "make clean" + getCmdLine(dictionary) - + "; make MAKE_DSYM=NO" - + getArchSpec(architecture) + getCCSpec(compiler) - + getCmdLine(dictionary)], - sender=sender) - - # True signifies that we can handle building dwarf. - return True - -def cleanup(sender=None, dictionary=None): - """Perform a platform-specific cleanup after the test.""" - if os.path.isfile("Makefile"): - lldbtest.system(["/bin/sh", "-c", "make clean"+getCmdLine(dictionary)], - sender=sender) - - # True signifies that we can handle cleanup. - return True From peter at pcc.me.uk Mon Jun 20 14:06:29 2011 From: peter at pcc.me.uk (Peter Collingbourne) Date: Mon, 20 Jun 2011 19:06:29 -0000 Subject: [Lldb-commits] [lldb] r133458 - /lldb/trunk/test/dotest.py Message-ID: <20110620190629.A40EA2A6C12C@llvm.org> Author: pcc Date: Mon Jun 20 14:06:29 2011 New Revision: 133458 URL: http://llvm.org/viewvc/llvm-project?rev=133458&view=rev Log: Have dotest.py search for test cases in its own directory by default, rather than the current directory. This is required to run the test suite outside of the source tree. Modified: lldb/trunk/test/dotest.py Modified: lldb/trunk/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=133458&r1=133457&r2=133458&view=diff ============================================================================== --- lldb/trunk/test/dotest.py (original) +++ lldb/trunk/test/dotest.py Mon Jun 20 14:06:29 2011 @@ -139,8 +139,8 @@ # Default verbosity is 0. verbose = 0 -# By default, search from the current working directory. -testdirs = [ os.getcwd() ] +# By default, search from the script directory. +testdirs = [ sys.path[0] ] # Separator string. separator = '-' * 70 From peter at pcc.me.uk Mon Jun 20 14:06:35 2011 From: peter at pcc.me.uk (Peter Collingbourne) Date: Mon, 20 Jun 2011 19:06:35 -0000 Subject: [Lldb-commits] [lldb] r133459 - /lldb/trunk/source/Interpreter/Makefile Message-ID: <20110620190636.088712A6C12D@llvm.org> Author: pcc Date: Mon Jun 20 14:06:35 2011 New Revision: 133459 URL: http://llvm.org/viewvc/llvm-project?rev=133459&view=rev Log: Create a _lldb.so symlink in the bin directory This is required to run the test suite without installing. 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=133459&r1=133458&r2=133459&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/Makefile (original) +++ lldb/trunk/source/Interpreter/Makefile Mon Jun 20 14:06:35 2011 @@ -16,15 +16,15 @@ include $(LLDB_LEVEL)/Makefile LLDB_PYTHON_SWIG_CPP = $(PROJ_OBJ_ROOT)/$(BuildMode)/LLDBWrapPython.cpp -LLDB_BIN_DIR := $(PROJ_OBJ_ROOT)/$(BuildMode)/bin -PYTHON_DIR := $(LLDB_BIN_DIR) +PYTHON_DIR := $(ToolDir) ifeq ($(HOST_OS),Darwin) PYTHON_DEST_DIR := /Library/Python/$(shell python -c 'import sys; print sys.version[:3]')/site-packages else PYTHON_DEST_DIR := $(shell python -c 'import sys; print sys.exec_prefix')/lib/python$(shell python -c 'import sys; print sys.version[:3]')/site-packages endif LLDB_SWIG_INCLUDE_DIRS:= -I"$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/include" -I./. -LIBLLDB := $(DESTDIR)$(PROJ_libdir)/liblldb$(SHLIBEXT) +LIBLLDB := $(LibDir)/liblldb$(SHLIBEXT) +DEST_LIBLLDB := $(DESTDIR)$(PROJ_libdir)/liblldb$(SHLIBEXT) # We need Swig to process stdint.h, but by default it will not inspect system # include directories. The following should cover the standard locations on @@ -35,21 +35,23 @@ LLDBWrapPython.cpp: $(Echo) Generating LLDBWrapPython.cpp $(Verb) swig -c++ -shadow -python $(LLDB_SWIG_INCLUDE_DIRS) \ - -D__STDC_LIMIT_MACROS -outdir "$(LLDB_BIN_DIR)" \ + -D__STDC_LIMIT_MACROS -outdir "$(PYTHON_DIR)" \ -o LLDBWrapPython.cpp "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/lldb.swig" $(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/modify-python-lldb.py" \ - "$(LLDB_BIN_DIR)" + "$(PYTHON_DIR)" $(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py" \ "$(PROJ_OBJ_DIR)" $(Verb) if test -f "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited"; then \ mv "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited" \ "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp"; fi $(Verb) cp "$(PROJ_SRC_DIR)/embedded_interpreter.py" "$(PYTHON_DIR)" + $(Verb) $(RM) -f $(PYTHON_DIR)/_lldb.so + $(Verb) $(AliasTool) $(LIBLLDB) $(PYTHON_DIR)/_lldb.so -install-local:: $(PYTHON_DIR)/lldb.py $(PYTHON_DIR)/embedded_interpreter.py $(LIBLLDB) +install-local:: $(PYTHON_DIR)/lldb.py $(PYTHON_DIR)/embedded_interpreter.py $(DEST_LIBLLDB) $(Echo) Installing $(BuildMode) LLDB python modules $(Verb) $(MKDIR) $(PYTHON_DEST_DIR)/lib-dynload $(Verb) $(DataInstall) $(PYTHON_DIR)/lldb.py $(PYTHON_DEST_DIR)/lldb.py $(Verb) $(DataInstall) $(PYTHON_DIR)/embedded_interpreter.py $(PYTHON_DEST_DIR)/embedded_interpreter.py $(Verb) $(RM) -f $(PYTHON_DEST_DIR)/lib-dynload/_lldb.so - $(Verb) $(AliasTool) $(LIBLLDB) $(PYTHON_DEST_DIR)/lib-dynload/_lldb.so + $(Verb) $(AliasTool) $(DEST_LIBLLDB) $(PYTHON_DEST_DIR)/lib-dynload/_lldb.so From peter at pcc.me.uk Mon Jun 20 14:06:45 2011 From: peter at pcc.me.uk (Peter Collingbourne) Date: Mon, 20 Jun 2011 19:06:45 -0000 Subject: [Lldb-commits] [lldb] r133460 - in /lldb/trunk/test: dotest.py help/TestHelp.py Message-ID: <20110620190645.3CF7D2A6C12C@llvm.org> Author: pcc Date: Mon Jun 20 14:06:45 2011 New Revision: 133460 URL: http://llvm.org/viewvc/llvm-project?rev=133460&view=rev Log: Modify TestHelp to search for LLDB-Info.plist in the correct place This is required to run the test suite outside of the source tree or on a case sensitive file system. Modified: lldb/trunk/test/dotest.py lldb/trunk/test/help/TestHelp.py Modified: lldb/trunk/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=133460&r1=133459&r2=133460&view=diff ============================================================================== --- lldb/trunk/test/dotest.py (original) +++ lldb/trunk/test/dotest.py Mon Jun 20 14:06:45 2011 @@ -531,6 +531,11 @@ os.environ["LLDB_TEST"] = rdir else: os.environ["LLDB_TEST"] = scriptPath + + # Set up the LLDB_SRC environment variable, so that the tests can locate + # the LLDB source code. + os.environ["LLDB_SRC"] = os.path.join(sys.path[0], os.pardir) + pluginPath = os.path.join(scriptPath, 'plugins') pexpectPath = os.path.join(scriptPath, 'pexpect-2.4') Modified: lldb/trunk/test/help/TestHelp.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/help/TestHelp.py?rev=133460&r1=133459&r2=133460&view=diff ============================================================================== --- lldb/trunk/test/help/TestHelp.py (original) +++ lldb/trunk/test/help/TestHelp.py Mon Jun 20 14:06:45 2011 @@ -20,7 +20,7 @@ def version_number_string(self): """Helper function to find the version number string of lldb.""" - plist = os.path.join(os.getcwd(), os.pardir, os.pardir, "resources", "LLDB-info.plist") + plist = os.path.join(os.environ["LLDB_SRC"], "resources", "LLDB-Info.plist") try: CFBundleVersionSegFound = False with open(plist, 'r') as f: From peter at pcc.me.uk Mon Jun 20 14:06:51 2011 From: peter at pcc.me.uk (Peter Collingbourne) Date: Mon, 20 Jun 2011 19:06:51 -0000 Subject: [Lldb-commits] [lldb] r133461 - /lldb/trunk/test/Makefile Message-ID: <20110620190651.602462A6C12D@llvm.org> Author: pcc Date: Mon Jun 20 14:06:51 2011 New Revision: 133461 URL: http://llvm.org/viewvc/llvm-project?rev=133461&view=rev Log: Add a default rule to test/Makefile which runs the test suite Modified: lldb/trunk/test/Makefile Modified: lldb/trunk/test/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/Makefile?rev=133461&r1=133460&r2=133461&view=diff ============================================================================== --- lldb/trunk/test/Makefile (original) +++ lldb/trunk/test/Makefile Mon Jun 20 14:06:51 2011 @@ -1,9 +1,14 @@ -.PHONY: clean all +LLDB_LEVEL := .. +include $(LLDB_LEVEL)/Makefile + +.PHONY: programs + +all:: check-local #---------------------------------------------------------------------- # Make all of the test programs #---------------------------------------------------------------------- -all: +programs: find . -type d -depth 1 | xargs -J % find % \ -name Makefile \ -exec echo \; \ @@ -11,11 +16,21 @@ -execdir make \; #---------------------------------------------------------------------- -# Make all of the test programs +# Clean all of the test programs #---------------------------------------------------------------------- -clean: +clean:: find . -type d -depth 1 | xargs -J % find % \ -name Makefile \ -exec echo \; \ -exec echo make -f '{}' clean \; \ -execdir make clean \; + +#---------------------------------------------------------------------- +# Run the tests +#---------------------------------------------------------------------- +check-local:: + rm -rf ../test-rdir + env PATH="$(ToolDir):$(PATH)" \ + PYTHONPATH=$(ToolDir) \ + $(SHLIBPATH_VAR)=$(LibDir) \ + python $(PROJ_SRC_DIR)/dotest.py -i -v -r ../test-rdir From peter at pcc.me.uk Mon Jun 20 14:06:57 2011 From: peter at pcc.me.uk (Peter Collingbourne) Date: Mon, 20 Jun 2011 19:06:57 -0000 Subject: [Lldb-commits] [lldb] r133462 - /lldb/trunk/Makefile Message-ID: <20110620190657.5DC492A6C12C@llvm.org> Author: pcc Date: Mon Jun 20 14:06:57 2011 New Revision: 133462 URL: http://llvm.org/viewvc/llvm-project?rev=133462&view=rev Log: Enable the "make test" rule in the root Makefile Modified: lldb/trunk/Makefile Modified: lldb/trunk/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/Makefile?rev=133462&r1=133461&r2=133462&view=diff ============================================================================== --- lldb/trunk/Makefile (original) +++ lldb/trunk/Makefile Mon Jun 20 14:06:57 2011 @@ -74,8 +74,8 @@ fi endif -#test:: -# @ $(MAKE) -C test +test:: + @ $(MAKE) -C test #report:: # @ $(MAKE) -C test report From peter at pcc.me.uk Mon Jun 20 14:07:07 2011 From: peter at pcc.me.uk (Peter Collingbourne) Date: Mon, 20 Jun 2011 19:07:07 -0000 Subject: [Lldb-commits] [lldb] r133463 - /lldb/trunk/source/Interpreter/Makefile Message-ID: <20110620190707.BF3E72A6C12C@llvm.org> Author: pcc Date: Mon Jun 20 14:07:07 2011 New Revision: 133463 URL: http://llvm.org/viewvc/llvm-project?rev=133463&view=rev Log: Add dependency tracking/clean rule to interpreter makefile 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=133463&r1=133462&r2=133463&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/Makefile (original) +++ lldb/trunk/source/Interpreter/Makefile Mon Jun 20 14:07:07 2011 @@ -14,8 +14,8 @@ BUILT_SOURCES := LLDBWrapPython.cpp include $(LLDB_LEVEL)/Makefile +-include $(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.d -LLDB_PYTHON_SWIG_CPP = $(PROJ_OBJ_ROOT)/$(BuildMode)/LLDBWrapPython.cpp PYTHON_DIR := $(ToolDir) ifeq ($(HOST_OS),Darwin) PYTHON_DEST_DIR := /Library/Python/$(shell python -c 'import sys; print sys.version[:3]')/site-packages @@ -32,11 +32,19 @@ LLDB_SWIG_INCLUDE_DIRS += -I"/usr/local/include" LLDB_SWIG_INCLUDE_DIRS += -I"/usr/include" -LLDBWrapPython.cpp: +SWIG_DEPEND_OPTIONS = -MMD -MF "$(PROJ_OBJ_DIR)/$*.cpp.d.tmp" \ + -MT "$*.cpp" -MT "$(PROJ_OBJ_DIR)/$*.cpp.d" +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 + +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 $(Echo) Generating LLDBWrapPython.cpp - $(Verb) swig -c++ -shadow -python $(LLDB_SWIG_INCLUDE_DIRS) \ + $(Verb) if swig -c++ -shadow -python $(LLDB_SWIG_INCLUDE_DIRS) \ -D__STDC_LIMIT_MACROS -outdir "$(PYTHON_DIR)" \ - -o LLDBWrapPython.cpp "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/lldb.swig" + $(SWIG_DEPEND_OPTIONS) \ + -o LLDBWrapPython.cpp "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/lldb.swig" ; \ + $(CPP_DEPEND_MOVEFILE) $(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/modify-python-lldb.py" \ "$(PYTHON_DIR)" $(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py" \ @@ -55,3 +63,7 @@ $(Verb) $(DataInstall) $(PYTHON_DIR)/embedded_interpreter.py $(PYTHON_DEST_DIR)/embedded_interpreter.py $(Verb) $(RM) -f $(PYTHON_DEST_DIR)/lib-dynload/_lldb.so $(Verb) $(AliasTool) $(DEST_LIBLLDB) $(PYTHON_DEST_DIR)/lib-dynload/_lldb.so + +clean-local:: + $(Verb) $(RM) -f LLDBWrapPython.cpp $(PYTHON_DIR)/_lldb.so \ + $(PYTHON_DIR)/embedded_interpreter.py $(PYTHON_DIR)/lldb.py From peter at pcc.me.uk Mon Jun 20 14:18:56 2011 From: peter at pcc.me.uk (Peter Collingbourne) Date: Mon, 20 Jun 2011 20:18:56 +0100 Subject: [Lldb-commits] [PATCH] Support for running test suite using makefiles on Linux In-Reply-To: <4DFE5456.7060301@mymail.mines.edu> References: <20110619003200.GA6464@pcc.me.uk> <4DFD81FE.4000407@mymail.mines.edu> <4DFE5456.7060301@mymail.mines.edu> Message-ID: <20110620191856.GA18583@pcc.me.uk> On Sun, Jun 19, 2011 at 01:56:06PM -0600, Charles Davis wrote: > > [From patch 1] > > > @@ -31,15 +36,27 @@ endif > > [...] > > > +ifeq "$(DYLIB_NAME)" "" > > You do mean "ifneq" here, right? Otherwise, you'll get back lib.so (or > > lib.dylib) as the shared library's filename. :) Yes, I do :). Fixed. > On 6/18/11 10:58 PM, Charles Davis wrote: > > On 6/18/11 6:32 PM, Peter Collingbourne wrote: > > [From patch 4] > >> @@ -35,21 +35,23 @@ LLDB_SWIG_INCLUDE_DIRS += -I"/usr/include" > >> LLDBWrapPython.cpp: > > [...] > >> + $(Verb) $(RM) -f $(PYTHON_DIR)/_lldb.so > >> + $(Verb) $(AliasTool) $(LIBLLDB) $(PYTHON_DIR)/_lldb.so > > This can't work. At least, it can't if the $(AliasTool) expects the > > source file to exist. At first, I thought you'd need to depend on > > liblldb.so; but that won't work either, because liblldb.so depends on > > LLDBWrapPython.cpp! You'll have to make the _lldb.so symlink elsewhere. > Never mind. ln -s works even if the source file doesn't exist, even on > Darwin. But it wouldn't work on Windows, where the $(AliasTool) is not > 'ln -s' but 'cp'/'copy'. But that's OK for now, because LLDB doesn't > even work on Windows :). I can't see any assignment to $(AliasTool) in the makefile system other than "ln -s". So I assume that on Windows these commands would end up using whatever the MinGW/MSYS/Cygwin emulation of symlinks are, which (if they are POSIX compliant) should deal with nonexistent source files. Thanks, -- Peter From johnny.chen at apple.com Mon Jun 20 15:08:26 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Mon, 20 Jun 2011 20:08:26 -0000 Subject: [Lldb-commits] [lldb] r133466 - /lldb/trunk/test/make/Makefile.rules Message-ID: <20110620200826.6B8692A6C12C@llvm.org> Author: johnny Date: Mon Jun 20 15:08:26 2011 New Revision: 133466 URL: http://llvm.org/viewvc/llvm-project?rev=133466&view=rev Log: Change to get around the nested ifeq woes on OS X Snow Leopard: ../make/Makefile.rules:217: *** missing `endif'. Stop. Modified: lldb/trunk/test/make/Makefile.rules Modified: lldb/trunk/test/make/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/make/Makefile.rules?rev=133466&r1=133465&r2=133466&view=diff ============================================================================== --- lldb/trunk/test/make/Makefile.rules (original) +++ lldb/trunk/test/make/Makefile.rules Mon Jun 20 15:08:26 2011 @@ -113,10 +113,10 @@ # Make the dSYM file from the executable if $(MAKE_DSYM) != "NO" #---------------------------------------------------------------------- ifeq "$(OS)" "Darwin" - ifneq "$(MAKE_DSYM)" "NO" +ifneq "$(MAKE_DSYM)" "NO" $(DSYM) : $(EXE) $(DS) $(DSFLAGS) -o "$(DSYM)" "$(EXE)" - endif +endif endif #---------------------------------------------------------------------- From johnny.chen at apple.com Mon Jun 20 17:30:48 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Mon, 20 Jun 2011 22:30:48 -0000 Subject: [Lldb-commits] [lldb] r133475 - in /lldb/trunk: include/lldb/API/SBCommunication.h include/lldb/API/SBInstructionList.h source/API/SBCommunication.cpp source/API/SBInstructionList.cpp test/python_api/default-constructor/ test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Message-ID: <20110620223048.BD9C12A6C12C@llvm.org> Author: johnny Date: Mon Jun 20 17:30:48 2011 New Revision: 133475 URL: http://llvm.org/viewvc/llvm-project?rev=133475&view=rev Log: Test lldb Python API object's default constructor and make sure it is invalid after initial construction. There are two exceptions to the above general rules, though; the API objects are SBCommadnReturnObject and SBStream. Added: lldb/trunk/test/python_api/default-constructor/ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Modified: lldb/trunk/include/lldb/API/SBCommunication.h lldb/trunk/include/lldb/API/SBInstructionList.h lldb/trunk/source/API/SBCommunication.cpp lldb/trunk/source/API/SBInstructionList.cpp Modified: lldb/trunk/include/lldb/API/SBCommunication.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBCommunication.h?rev=133475&r1=133474&r2=133475&view=diff ============================================================================== --- lldb/trunk/include/lldb/API/SBCommunication.h (original) +++ lldb/trunk/include/lldb/API/SBCommunication.h Mon Jun 20 17:30:48 2011 @@ -34,6 +34,9 @@ ~SBCommunication (); + bool + IsValid () const; + lldb::SBBroadcaster GetBroadcaster (); Modified: lldb/trunk/include/lldb/API/SBInstructionList.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBInstructionList.h?rev=133475&r1=133474&r2=133475&view=diff ============================================================================== --- lldb/trunk/include/lldb/API/SBInstructionList.h (original) +++ lldb/trunk/include/lldb/API/SBInstructionList.h Mon Jun 20 17:30:48 2011 @@ -31,6 +31,9 @@ ~SBInstructionList (); + bool + IsValid () const; + size_t GetSize (); Modified: lldb/trunk/source/API/SBCommunication.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommunication.cpp?rev=133475&r1=133474&r2=133475&view=diff ============================================================================== --- lldb/trunk/source/API/SBCommunication.cpp (original) +++ lldb/trunk/source/API/SBCommunication.cpp Mon Jun 20 17:30:48 2011 @@ -44,6 +44,12 @@ } bool +SBCommunication::IsValid () const +{ + return m_opaque != NULL; +} + +bool SBCommunication::GetCloseOnEOF () { if (m_opaque) Modified: lldb/trunk/source/API/SBInstructionList.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBInstructionList.cpp?rev=133475&r1=133474&r2=133475&view=diff ============================================================================== --- lldb/trunk/source/API/SBInstructionList.cpp (original) +++ lldb/trunk/source/API/SBInstructionList.cpp Mon Jun 20 17:30:48 2011 @@ -40,6 +40,12 @@ { } +bool +SBInstructionList::IsValid () const +{ + return m_opaque_sp.get() != NULL; +} + size_t SBInstructionList::GetSize () { Added: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py?rev=133475&view=auto ============================================================================== --- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (added) +++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Mon Jun 20 17:30:48 2011 @@ -0,0 +1,243 @@ +""" +Test lldb Python API object's default constructor to make sure it is invalid +after initial construction. + +There are two exceptions to the above general rules, though; the API objects are +SBCommadnReturnObject and SBStream. +""" + +import os, time +import re +import unittest2 +import lldb, lldbutil +from lldbtest import * + +class APIDefaultConstructorTestCase(TestBase): + + mydir = os.path.join("python_api", "default-constructor") + + @python_api_test + def test_SBAddress(self): + obj = lldb.SBAddress() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBBlock(self): + obj = lldb.SBBlock() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBBreakpoint(self): + obj = lldb.SBBreakpoint() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBBreakpointLocation(self): + obj = lldb.SBBreakpointLocation() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBBroadcaster(self): + obj = lldb.SBBroadcaster() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBCommandReturnObject(self): + """SBCommandReturnObject object is valid after default construction.""" + obj = lldb.SBCommandReturnObject() + if self.TraceOn(): + print obj + self.assertTrue(obj) + + @python_api_test + def test_SBCommunication(self): + obj = lldb.SBCommunication() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBCompileUnit(self): + obj = lldb.SBCompileUnit() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBDebugger(self): + obj = lldb.SBDebugger() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBError(self): + obj = lldb.SBError() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBEvent(self): + obj = lldb.SBEvent() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBFileSpec(self): + obj = lldb.SBFileSpec() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBFrame(self): + obj = lldb.SBFrame() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBFunction(self): + obj = lldb.SBFunction() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBInputReader(self): + obj = lldb.SBInputReader() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBInstruction(self): + obj = lldb.SBInstruction() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBInstructionList(self): + obj = lldb.SBInstructionList() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBLineEntry(self): + obj = lldb.SBLineEntry() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBListener(self): + obj = lldb.SBListener() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBModule(self): + obj = lldb.SBModule() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBProcess(self): + obj = lldb.SBProcess() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBStream(self): + """SBStream object is valid after default construction.""" + obj = lldb.SBStream() + if self.TraceOn(): + print obj + self.assertTrue(obj) + + @python_api_test + def test_SBStringList(self): + obj = lldb.SBStringList() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBSymbol(self): + obj = lldb.SBSymbol() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBSymbolContext(self): + obj = lldb.SBSymbolContext() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBSymbolContextList(self): + obj = lldb.SBSymbolContextList() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBTarget(self): + obj = lldb.SBTarget() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBThread(self): + obj = lldb.SBThread() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBType(self): + obj = lldb.SBType() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBValue(self): + obj = lldb.SBValue() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + @python_api_test + def test_SBValueList(self): + obj = lldb.SBValueList() + if self.TraceOn(): + print obj + self.assertFalse(obj) + + +if __name__ == '__main__': + import atexit + lldb.SBDebugger.Initialize() + atexit.register(lambda: lldb.SBDebugger.Terminate()) + unittest2.main() From johnny.chen at apple.com Mon Jun 20 17:33:35 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Mon, 20 Jun 2011 22:33:35 -0000 Subject: [Lldb-commits] [lldb] r133476 - /lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Message-ID: <20110620223335.BD0052A6C12C@llvm.org> Author: johnny Date: Mon Jun 20 17:33:35 2011 New Revision: 133476 URL: http://llvm.org/viewvc/llvm-project?rev=133476&view=rev Log: Minor module-level docstring change. Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py?rev=133476&r1=133475&r2=133476&view=diff ============================================================================== --- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original) +++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Mon Jun 20 17:33:35 2011 @@ -1,5 +1,5 @@ """ -Test lldb Python API object's default constructor to make sure it is invalid +Test lldb Python API object's default constructor and make sure it is invalid after initial construction. There are two exceptions to the above general rules, though; the API objects are From jingham at apple.com Mon Jun 20 18:38:12 2011 From: jingham at apple.com (Jim Ingham) Date: Mon, 20 Jun 2011 23:38:12 -0000 Subject: [Lldb-commits] [lldb] r133479 - /lldb/trunk/source/Commands/CommandObjectTarget.cpp Message-ID: <20110620233812.211532A6C12C@llvm.org> Author: jingham Date: Mon Jun 20 18:38:11 2011 New Revision: 133479 URL: http://llvm.org/viewvc/llvm-project?rev=133479&view=rev Log: The "-r" option should work for both "-n" and "-s", but it was only set to work for "-s". Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=133479&r1=133478&r2=133479&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Mon Jun 20 18:38:11 2011 @@ -2808,8 +2808,10 @@ { { LLDB_OPT_SET_1, true, "address", 'a', required_argument, NULL, 0, eArgTypeAddress, "Lookup an address in one or more target modules."}, { LLDB_OPT_SET_1, false, "offset", 'o', required_argument, NULL, 0, eArgTypeOffset, "When looking up an address subtract from any addresses before doing the lookup."}, + { LLDB_OPT_SET_2| LLDB_OPT_SET_4 + /* FIXME: re-enable this for types when the LookupTypeInModule actually uses the regex option: | LLDB_OPT_SET_5 */ , + false, "regex", 'r', no_argument, NULL, 0, eArgTypeNone, "The argument for name lookups are regular expressions."}, { LLDB_OPT_SET_2, true, "symbol", 's', required_argument, NULL, 0, eArgTypeSymbol, "Lookup a symbol by name in the symbol tables in one or more target modules."}, - { LLDB_OPT_SET_2, false, "regex", 'r', no_argument, NULL, 0, eArgTypeNone, "The argument for name lookups are regular expressions."}, { LLDB_OPT_SET_3, true, "file", 'f', required_argument, NULL, 0, eArgTypeFilename, "Lookup a file by fullpath or basename in one or more target modules."}, { LLDB_OPT_SET_3, false, "line", 'l', required_argument, NULL, 0, eArgTypeLineNum, "Lookup a line number in a file (must be used in conjunction with --file)."}, { LLDB_OPT_SET_3, false, "no-inlines", 'i', no_argument, NULL, 0, eArgTypeNone, "Check inline line entries (must be used in conjunction with --file)."}, From peter at pcc.me.uk Mon Jun 20 18:55:53 2011 From: peter at pcc.me.uk (Peter Collingbourne) Date: Mon, 20 Jun 2011 23:55:53 -0000 Subject: [Lldb-commits] [lldb] r133483 - /lldb/trunk/test/dotest.py Message-ID: <20110620235553.BBDD42A6C12C@llvm.org> Author: pcc Date: Mon Jun 20 18:55:53 2011 New Revision: 133483 URL: http://llvm.org/viewvc/llvm-project?rev=133483&view=rev Log: Set LLDB_SESSION_DIRNAME to absolute path This is to ensure that session files are written to the correct directory if the -r option is given. Modified: lldb/trunk/test/dotest.py Modified: lldb/trunk/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=133483&r1=133482&r2=133483&view=diff ============================================================================== --- lldb/trunk/test/dotest.py (original) +++ lldb/trunk/test/dotest.py Mon Jun 20 18:55:53 2011 @@ -822,7 +822,7 @@ # The windows platforms don't like ':' in the pathname. timestamp = datetime.datetime.now().strftime("%Y-%m-%d-%H_%M_%S") sdir_name = timestamp -os.environ["LLDB_SESSION_DIRNAME"] = sdir_name +os.environ["LLDB_SESSION_DIRNAME"] = os.path.join(os.getcwd(), sdir_name) sys.stderr.write("\nSession logs for test failures/errors/unexpected successes" " will go into directory '%s'\n" % sdir_name) From peter at pcc.me.uk Mon Jun 20 18:55:58 2011 From: peter at pcc.me.uk (Peter Collingbourne) Date: Mon, 20 Jun 2011 23:55:58 -0000 Subject: [Lldb-commits] [lldb] r133484 - /lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.h Message-ID: <20110620235558.D70B52A6C12D@llvm.org> Author: pcc Date: Mon Jun 20 18:55:58 2011 New Revision: 133484 URL: http://llvm.org/viewvc/llvm-project?rev=133484&view=rev Log: Remove duplicate m_monitor field from LaunchArgs Fixes segfault when launching process on Linux. Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.h Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.h?rev=133484&r1=133483&r2=133484&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.h (original) +++ lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.h Mon Jun 20 18:55:58 2011 @@ -200,7 +200,6 @@ ~LaunchArgs(); - ProcessMonitor *m_monitor; // The monitor performing the launch. lldb_private::Module *m_module; // The executable image to launch. char const **m_argv; // Process arguments. char const **m_envp; // Process environment. From johnny.chen at apple.com Mon Jun 20 19:13:15 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Tue, 21 Jun 2011 00:13:15 -0000 Subject: [Lldb-commits] [lldb] r133488 - in /lldb/trunk/test/types: AbstractBase.py basic_type.cpp Message-ID: <20110621001315.B40A42A6C12C@llvm.org> Author: johnny Date: Mon Jun 20 19:13:15 2011 New Revision: 133488 URL: http://llvm.org/viewvc/llvm-project?rev=133488&view=rev Log: Simplify the the generic AbstractBase.py test base for testing variable types. We still have the the issue where running: ./dotest.py -v types we have test failures where the inferior either runs to exited with status 0 or the inferior stops but not because of breakpoint (for example): runCmd: process status output: Process 90060 stopped * thread #1: tid = 0x2d03, 0x000000010000e2ca, stop reason = EXC_BAD_ACCESS (code=2, address=0x10000e2ca) frame #0: 0x000000010000e2ca There are two cases where the inferior stops for the breakpoint (good), but the expression parser prints out the wrong information. The two failures are: Failure-TestFloatTypesExpr.FloatTypesExprTestCase.test_double_type_with_dsym.log Failure-TestFloatTypesExpr.FloatTypesExprTestCase.test_double_type_with_dwarf.log I'll file a radar on the two expression parser misbehave, while continue investigating why the inferior stops for the wrong reason or does not stop at all. For now, you'll need to do: ./dotest.py -v -w types Modified: lldb/trunk/test/types/AbstractBase.py lldb/trunk/test/types/basic_type.cpp Modified: lldb/trunk/test/types/AbstractBase.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/AbstractBase.py?rev=133488&r1=133487&r2=133488&view=diff ============================================================================== --- lldb/trunk/test/types/AbstractBase.py (original) +++ lldb/trunk/test/types/AbstractBase.py Mon Jun 20 19:13:15 2011 @@ -44,14 +44,16 @@ # Bring the program to the point where we can issue a series of # 'frame variable -T' command. self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) - puts_line = line_number ("basic_type.cpp", "// Here is the line we will break on before stepping out") + puts_line = line_number ("basic_type.cpp", "// Here is the line we will break on to check variables") self.expect("breakpoint set -f basic_type.cpp -l %d" % puts_line, BREAKPOINT_CREATED, startstr = "Breakpoint created: 1: file ='basic_type.cpp', line = %d, locations = 1" % puts_line) - self.expect("run", RUN_SUCCEEDED, patterns = [".*"]) - self.runCmd("thread step-out", STEP_OUT_SUCCEEDED) + self.runCmd("run", RUN_SUCCEEDED) + self.expect("process status", STOPPED_DUE_TO_BREAKPOINT, + substrs = [" at basic_type.cpp:%d" % puts_line, + "stop reason = breakpoint"]) #self.runCmd("frame variable -T") @@ -109,17 +111,15 @@ # Bring the program to the point where we can issue a series of # 'expr' command. self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) - #self.runCmd("breakpoint set --name Puts") - #self.runCmd("run", RUN_SUCCEEDED) - puts_line = line_number ("basic_type.cpp", "// Here is the line we will break on before stepping out") + puts_line = line_number ("basic_type.cpp", "// Here is the line we will break on to check variables.") self.expect("breakpoint set -f basic_type.cpp -l %d" % puts_line, BREAKPOINT_CREATED, startstr = "Breakpoint created: 1: file ='basic_type.cpp', line = %d, locations = 1" % puts_line) - self.expect("run", RUN_SUCCEEDED, patterns = [".*"]) - self.runCmd ("process status") - - self.runCmd("thread step-out", STEP_OUT_SUCCEEDED) + self.runCmd("run", RUN_SUCCEEDED) + self.expect("process status", STOPPED_DUE_TO_BREAKPOINT, + substrs = [" at basic_type.cpp:%d" % puts_line, + "stop reason = breakpoint"]) #self.runCmd("frame variable -T") Modified: lldb/trunk/test/types/basic_type.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/basic_type.cpp?rev=133488&r1=133487&r2=133488&view=diff ============================================================================== --- lldb/trunk/test/types/basic_type.cpp (original) +++ lldb/trunk/test/types/basic_type.cpp Mon Jun 20 19:13:15 2011 @@ -82,11 +82,6 @@ #include #include -void Puts(char const *msg) -{ - puts(msg); // Here is the line we will break on before stepping out -} - int main (int argc, char const *argv[]) { @@ -173,6 +168,6 @@ printf ("(a_union_zero_t[]) a_union_zero_array_unbounded[1].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_unbounded[1].a); #endif - Puts("About to exit, break here to check values..."); + puts("About to exit, break here to check values..."); // Here is the line we will break on to check variables. return 0; } From johnny.chen at apple.com Mon Jun 20 19:53:00 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Tue, 21 Jun 2011 00:53:00 -0000 Subject: [Lldb-commits] [lldb] r133495 - in /lldb/trunk/test: lldbtest.py types/AbstractBase.py Message-ID: <20110621005300.B85FF2A6C12C@llvm.org> Author: johnny Date: Mon Jun 20 19:53:00 2011 New Revision: 133495 URL: http://llvm.org/viewvc/llvm-project?rev=133495&view=rev Log: For now, insert some delays between succesive test cases in the test/types directory if not already specified by the test driver (via ./dotest -w). Remove the AbstractBase.setUp() method definition when/if we find out the cause of the failures if no delays are inserted between these test cases. Modified: lldb/trunk/test/lldbtest.py lldb/trunk/test/types/AbstractBase.py Modified: lldb/trunk/test/lldbtest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=133495&r1=133494&r2=133495&view=diff ============================================================================== --- lldb/trunk/test/lldbtest.py (original) +++ lldb/trunk/test/lldbtest.py Mon Jun 20 19:53:00 2011 @@ -465,6 +465,15 @@ print >> sys.stderr, "Restore dir to:", cls.oldcwd os.chdir(cls.oldcwd) + def doDelay(self): + """See option -w of dotest.py.""" + if ("LLDB_WAIT_BETWEEN_TEST_CASES" in os.environ and + os.environ["LLDB_WAIT_BETWEEN_TEST_CASES"] == 'YES'): + waitTime = 1.0 + if "LLDB_TIME_WAIT_BETWEEN_TEST_CASES" in os.environ: + waitTime = float(os.environ["LLDB_TIME_WAIT_BETWEEN_TEST_CASES"]) + time.sleep(waitTime) + def setUp(self): #import traceback #traceback.print_stack() @@ -496,12 +505,8 @@ except AttributeError: pass - if ("LLDB_WAIT_BETWEEN_TEST_CASES" in os.environ and - os.environ["LLDB_WAIT_BETWEEN_TEST_CASES"] == 'YES'): - waitTime = 1.0 - if "LLDB_TIME_WAIT_BETWEEN_TEST_CASES" in os.environ: - waitTime = float(os.environ["LLDB_TIME_WAIT_BETWEEN_TEST_CASES"]) - time.sleep(waitTime) + # Insert some delay between successive test cases if specified. + self.doDelay() if "LLDB_MAX_LAUNCH_COUNT" in os.environ: self.maxLaunchCount = int(os.environ["LLDB_MAX_LAUNCH_COUNT"]) Modified: lldb/trunk/test/types/AbstractBase.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/AbstractBase.py?rev=133495&r1=133494&r2=133495&view=diff ============================================================================== --- lldb/trunk/test/types/AbstractBase.py (original) +++ lldb/trunk/test/types/AbstractBase.py Mon Jun 20 19:53:00 2011 @@ -20,6 +20,17 @@ # Assert message. DATA_TYPE_GROKKED = "Data type from expr parser output is parsed correctly" + # FIXME: Remove this method when/if we find out the cause of the failures + # if no delays are inserted between test cases. + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + # Insert some delay for running test cases under test/types if not + # already so by the TestBase.setUp(). + if "LLDB_WAIT_BETWEEN_TEST_CASES" not in os.environ: + #print "some delay, please ...." + time.sleep(1.0) + def generic_type_tester(self, atoms, quotedDisplay=False): """Test that variables with basic types are displayed correctly.""" From gclayton at apple.com Mon Jun 20 20:34:41 2011 From: gclayton at apple.com (Greg Clayton) Date: Tue, 21 Jun 2011 01:34:41 -0000 Subject: [Lldb-commits] [lldb] r133498 - in /lldb/trunk: include/lldb/API/SBDefines.h include/lldb/API/SBModule.h include/lldb/API/SBSymbolContextList.h include/lldb/API/SBTarget.h include/lldb/lldb-enumerations.h include/lldb/lldb-private-enumerations.h source/API/SBModule.cpp source/API/SBSymbolContextList.cpp source/API/SBTarget.cpp Message-ID: <20110621013441.BBFAA2A6C12C@llvm.org> Author: gclayton Date: Mon Jun 20 20:34:41 2011 New Revision: 133498 URL: http://llvm.org/viewvc/llvm-project?rev=133498&view=rev Log: Added the ability to find functions from either a SBModule (find functions only in a specific module), or in a SBTarget (all modules for a target). Modified: lldb/trunk/include/lldb/API/SBDefines.h lldb/trunk/include/lldb/API/SBModule.h lldb/trunk/include/lldb/API/SBSymbolContextList.h lldb/trunk/include/lldb/API/SBTarget.h lldb/trunk/include/lldb/lldb-enumerations.h lldb/trunk/include/lldb/lldb-private-enumerations.h lldb/trunk/source/API/SBModule.cpp lldb/trunk/source/API/SBSymbolContextList.cpp lldb/trunk/source/API/SBTarget.cpp Modified: lldb/trunk/include/lldb/API/SBDefines.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBDefines.h?rev=133498&r1=133497&r2=133498&view=diff ============================================================================== --- lldb/trunk/include/lldb/API/SBDefines.h (original) +++ lldb/trunk/include/lldb/API/SBDefines.h Mon Jun 20 20:34:41 2011 @@ -53,6 +53,7 @@ class SBStringList; class SBSymbol; class SBSymbolContext; +class SBSymbolContextList; class SBTarget; class SBThread; class SBValue; Modified: lldb/trunk/include/lldb/API/SBModule.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBModule.h?rev=133498&r1=133497&r2=133498&view=diff ============================================================================== --- lldb/trunk/include/lldb/API/SBModule.h (original) +++ lldb/trunk/include/lldb/API/SBModule.h Mon Jun 20 20:34:41 2011 @@ -74,6 +74,12 @@ lldb::SBSymbol GetSymbolAtIndex (size_t idx); + uint32_t + FindFunctions (const char *name, + uint32_t name_type_mask, // Logical OR one or more FunctionNameType enum bits + bool append, + lldb::SBSymbolContextList& sc_list); + private: friend class SBAddress; friend class SBFrame; Modified: lldb/trunk/include/lldb/API/SBSymbolContextList.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBSymbolContextList.h?rev=133498&r1=133497&r2=133498&view=diff ============================================================================== --- lldb/trunk/include/lldb/API/SBSymbolContextList.h (original) +++ lldb/trunk/include/lldb/API/SBSymbolContextList.h Mon Jun 20 20:34:41 2011 @@ -38,8 +38,14 @@ SBSymbolContext GetContextAtIndex (uint32_t idx); + void + Clear(); + protected: + friend class SBModule; + friend class SBTarget; + #ifndef SWIG lldb_private::SymbolContextList* Modified: lldb/trunk/include/lldb/API/SBTarget.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=133498&r1=133497&r2=133498&view=diff ============================================================================== --- lldb/trunk/include/lldb/API/SBTarget.h (original) +++ lldb/trunk/include/lldb/API/SBTarget.h Mon Jun 20 20:34:41 2011 @@ -183,6 +183,12 @@ lldb::SBModule FindModule (const lldb::SBFileSpec &file_spec); + uint32_t + FindFunctions (const char *name, + uint32_t name_type_mask, // Logical OR one or more FunctionNameType enum bits + bool append, + lldb::SBSymbolContextList& sc_list); + void Clear (); Modified: lldb/trunk/include/lldb/lldb-enumerations.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-enumerations.h?rev=133498&r1=133497&r2=133498&view=diff ============================================================================== --- lldb/trunk/include/lldb/lldb-enumerations.h (original) +++ lldb/trunk/include/lldb/lldb-enumerations.h Mon Jun 20 20:34:41 2011 @@ -472,6 +472,23 @@ eEmulateInstructionOptionIgnoreConditions = (1u << 1) } EmulateInstructionOptions; + typedef enum FunctionNameType + { + eFunctionNameTypeNone = 0u, + eFunctionNameTypeAuto = (1u << 1), // Automatically figure out which FunctionNameType + // bits to set based on the function name. + eFunctionNameTypeFull = (1u << 2), // The function name. + // For C this is the same as just the name of the function + // For C++ this is the mangled or demangled version of the mangled name. + // For ObjC this is the full function signature with the + or + // - and the square brackets and the class and selector + eFunctionNameTypeBase = (1u << 3), // The function name only, no namespaces or arguments and no class + // methods or selectors will be searched. + eFunctionNameTypeMethod = (1u << 4), // Find function by method name (C++) with no namespace or arguments + eFunctionNameTypeSelector = (1u << 5) // Find function by selector name (ObjC) names + } FunctionNameType; + + } // namespace lldb Modified: lldb/trunk/include/lldb/lldb-private-enumerations.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-enumerations.h?rev=133498&r1=133497&r2=133498&view=diff ============================================================================== --- lldb/trunk/include/lldb/lldb-private-enumerations.h (original) +++ lldb/trunk/include/lldb/lldb-private-enumerations.h Mon Jun 20 20:34:41 2011 @@ -75,22 +75,6 @@ kNumArchTypes } ArchitectureType; -typedef enum FunctionNameType -{ - eFunctionNameTypeNone = 0u, - eFunctionNameTypeAuto = (1u << 1), // Automatically figure out which FunctionNameType - // bits to set based on the function name. - eFunctionNameTypeFull = (1u << 2), // The function name. - // For C this is the same as just the name of the function - // For C++ this is the demangled version of the mangled name. - // For ObjC this is the full function signature with the + or - // - and the square brackets and the class and selector - eFunctionNameTypeBase = (1u << 3), // The function name only, no namespaces or arguments and no class - // methods or selectors will be searched. - eFunctionNameTypeMethod = (1u << 4), // Find function by method name (C++) with no namespace or arguments - eFunctionNameTypeSelector = (1u << 5) // Find function by selector name (ObjC) names -} FunctionNameType; - //---------------------------------------------------------------------- /// Settable state variable types. /// Modified: lldb/trunk/source/API/SBModule.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBModule.cpp?rev=133498&r1=133497&r2=133498&view=diff ============================================================================== --- lldb/trunk/source/API/SBModule.cpp (original) +++ lldb/trunk/source/API/SBModule.cpp Mon Jun 20 20:34:41 2011 @@ -10,8 +10,8 @@ #include "lldb/API/SBModule.h" #include "lldb/API/SBAddress.h" #include "lldb/API/SBFileSpec.h" -#include "lldb/API/SBFileSpec.h" #include "lldb/API/SBStream.h" +#include "lldb/API/SBSymbolContextList.h" #include "lldb/Core/Module.h" #include "lldb/Core/Log.h" #include "lldb/Core/StreamString.h" @@ -285,3 +285,24 @@ } return sb_symbol; } + +uint32_t +SBModule::FindFunctions (const char *name, + uint32_t name_type_mask, + bool append, + lldb::SBSymbolContextList& sc_list) +{ + if (!append) + sc_list.Clear(); + if (m_opaque_sp) + { + const bool symbols_ok = true; + return m_opaque_sp->FindFunctions (ConstString(name), + name_type_mask, + symbols_ok, + append, + *sc_list); + } + return 0; +} + Modified: lldb/trunk/source/API/SBSymbolContextList.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBSymbolContextList.cpp?rev=133498&r1=133497&r2=133498&view=diff ============================================================================== --- lldb/trunk/source/API/SBSymbolContextList.cpp (original) +++ lldb/trunk/source/API/SBSymbolContextList.cpp Mon Jun 20 20:34:41 2011 @@ -14,15 +14,13 @@ using namespace lldb_private; SBSymbolContextList::SBSymbolContextList () : - m_opaque_ap () + m_opaque_ap (new SymbolContextList()) { } SBSymbolContextList::SBSymbolContextList (const SBSymbolContextList& rhs) : - m_opaque_ap () + m_opaque_ap (new SymbolContextList(*rhs.m_opaque_ap)) { - if (rhs.IsValid()) - *m_opaque_ap = *rhs.m_opaque_ap; } SBSymbolContextList::~SBSymbolContextList () @@ -34,8 +32,7 @@ { if (this != &rhs) { - if (rhs.IsValid()) - m_opaque_ap.reset (new lldb_private::SymbolContextList(*rhs.m_opaque_ap.get())); + *m_opaque_ap = *rhs.m_opaque_ap; } return *this; } @@ -63,6 +60,13 @@ return sb_sc; } +void +SBSymbolContextList::Clear() +{ + if (m_opaque_ap.get()) + m_opaque_ap->Clear(); +} + bool SBSymbolContextList::IsValid () const Modified: lldb/trunk/source/API/SBTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=133498&r1=133497&r2=133498&view=diff ============================================================================== --- lldb/trunk/source/API/SBTarget.cpp (original) +++ lldb/trunk/source/API/SBTarget.cpp Mon Jun 20 20:34:41 2011 @@ -14,6 +14,7 @@ #include "lldb/API/SBFileSpec.h" #include "lldb/API/SBModule.h" #include "lldb/API/SBStream.h" +#include "lldb/API/SBSymbolContextList.h" #include "lldb/Breakpoint/BreakpointID.h" #include "lldb/Breakpoint/BreakpointIDList.h" #include "lldb/Breakpoint/BreakpointList.h" @@ -784,3 +785,25 @@ return true; } + + +uint32_t +SBTarget::FindFunctions (const char *name, + uint32_t name_type_mask, + bool append, + lldb::SBSymbolContextList& sc_list) +{ + if (!append) + sc_list.Clear(); + if (m_opaque_sp) + { + const bool symbols_ok = true; + return m_opaque_sp->GetImages().FindFunctions (ConstString(name), + name_type_mask, + symbols_ok, + append, + *sc_list); + } + return 0; +} + From jmolenda at apple.com Mon Jun 20 21:57:16 2011 From: jmolenda at apple.com (Jason Molenda) Date: Tue, 21 Jun 2011 02:57:16 -0000 Subject: [Lldb-commits] [lldb] r133500 - /lldb/trunk/tools/darwin-threads/examine-threads.c Message-ID: <20110621025716.160D52A6C12C@llvm.org> Author: jmolenda Date: Mon Jun 20 21:57:15 2011 New Revision: 133500 URL: http://llvm.org/viewvc/llvm-project?rev=133500&view=rev Log: Replace examine-threads.c with a similar little utility I wrote a while back. By default its output will be less verbose than the old examine-threads.c but adding the '-v' command line flag will give all the information that examine-threads.c provided plus some. Of note, this implementation can take a process name -- and it will use the libproc API so it can match program names longer than 16 characters. 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=133500&r1=133499&r2=133500&view=diff ============================================================================== --- lldb/trunk/tools/darwin-threads/examine-threads.c (original) +++ lldb/trunk/tools/darwin-threads/examine-threads.c Mon Jun 20 21:57:15 2011 @@ -1,104 +1,339 @@ -#include #include #include +#include +#include +#include +#include +#include +#include -void -dump_thread_basic_info (uint32_t index, uint32_t tid, struct thread_basic_info *i) +int +main (int argc, char **argv) { - const char * thread_run_state = NULL; + kern_return_t kr; + task_t task; + thread_t thread; + pid_t pid = 0; + char *procname = NULL; + int arg_is_procname = 0; + int do_loop = 0; + int verbose = 0; + mach_port_t mytask = mach_task_self (); - switch (i->run_state) + if (argc != 2 && argc != 3 && argc != 4) { - case TH_STATE_RUNNING: thread_run_state = "running"; break; // 1 thread is running normally - case TH_STATE_STOPPED: thread_run_state = "stopped"; break; // 2 thread is stopped - case TH_STATE_WAITING: thread_run_state = "waiting"; break; // 3 thread is waiting normally - case TH_STATE_UNINTERRUPTIBLE: thread_run_state = "uninter"; break; // 4 thread is in an uninterruptible wait - case TH_STATE_HALTED: thread_run_state = "halted "; break; // 5 thread is halted at a - default: thread_run_state = "???"; break; - } - -// printf("[%3u] tid: 0x%4.4x, pc: 0x%16.16llx, sp: 0x%16.16llx, user: %d.%06.6d, system: %d.%06.6d, cpu: %2d, policy: %2d, run_state: %2d (%s), flags: %2d, suspend_count: %2d (current %2d), sleep_time: %d", - printf("[%3u] tid: 0x%4.4x user: %d.%06d, system: %d.%06d, cpu: %2d, policy: %2d, run_state: %2d (%s), flags: %2d, suspend_count: %2d, sleep_time: %d\n", - index, - tid, - i->user_time.seconds, i->user_time.microseconds, - i->system_time.seconds, i->system_time.microseconds, - i->cpu_usage, - i->policy, - i->run_state, - thread_run_state, - i->flags, - i->suspend_count, - i->sleep_time); - //DumpRegisterState(0); -} - + printf ("Usage: tdump [-l] [-v] pid/procname\n"); + exit (1); + } + + if (argc == 3 || argc == 4) + { + int i = 1; + while (i < argc - 1) + { + if (strcmp (argv[i], "-l") == 0) + do_loop = 1; + if (strcmp (argv[i], "-v") == 0) + verbose = 1; + i++; + } + } -int main (int argc, char ** argv) -{ - kern_return_t kret; - task_t itask; - thread_array_t thread_list; - unsigned int nthreads; - pid_t pid; + char *c = argv[argc - 1]; + if (*c == '\0') + { + printf ("Usage: tdump [-l] [-v] pid/procname\n"); + exit (1); + } + while (*c != '\0') + { + if (!isdigit (*c)) + { + arg_is_procname = 1; + procname = argv[argc - 1]; + break; + } + c++; + } - if (argc < 2) + // the argument is a pid + if (arg_is_procname == 0) { - printf ("Usage: %s .\n", argv[0]); - return -1; + pid = atoi (argv[argc - 1]); + if (pid == 0) + { + printf ("Usage: tdump [-l] [-v] pid/procname\n"); + exit (1); + } } - pid = atoi (argv[1]); - printf ("Examining process: %d.\n", pid); + // Look up the pid for the provided process name + if (arg_is_procname) + { + int process_count = proc_listpids (PROC_ALL_PIDS, 0, NULL, 0) / sizeof (pid_t); + if (process_count < 1) + { + printf ("Only found %d processes running!\n", process_count); + exit (1); + } - kret = task_for_pid (mach_task_self (), pid, &itask); - if (kret != KERN_SUCCESS) + // Allocate a few extra slots in case new processes are spawned + int all_pids_size = sizeof (pid_t) * (process_count + 3); + pid_t *all_pids = (pid_t *) malloc (all_pids_size); + + // re-set process_count in case the number of processes changed (got smaller; we won't do bigger) + process_count = proc_listpids (PROC_ALL_PIDS, 0, all_pids, all_pids_size) / sizeof (pid_t); + + int i; + pid_t highest_pid = 0; + int match_count = 0; + for (i = 1; i < process_count; i++) + { + char pidpath[PATH_MAX]; + int pidpath_len = proc_pidpath (all_pids[i], pidpath, sizeof (pidpath)); + if (pidpath_len == 0) + continue; + char *j = strrchr (pidpath, '/'); + if ((j == NULL && strcmp (procname, pidpath) == 0) + || (j != NULL && strcmp (j + 1, procname) == 0)) + { + match_count++; + if (all_pids[i] > highest_pid) + highest_pid = all_pids[i]; + } + } + free (all_pids); + + if (match_count == 0) + { + printf ("Did not find process '%s'.\n", procname); + exit (1); + } + if (match_count > 1) + { + printf ("Warning: More than one process '%s'!\n", procname); + printf (" defaulting to the highest-pid one, %d\n", highest_pid); + } + pid = highest_pid; + } + + char process_name[PATH_MAX]; + char tmp_name[PATH_MAX]; + if (proc_pidpath (pid, tmp_name, sizeof (tmp_name)) == 0) { - printf ("Could not get task for pid %d.\n", pid); - return -1; + printf ("Could not find process with pid of %d\n", (int) pid); + exit (1); } + if (strrchr (tmp_name, '/')) + strcpy (process_name, strrchr (tmp_name, '/') + 1); + else + strcpy (process_name, tmp_name); - struct task_basic_info info_for_task; - unsigned int task_info_count = TASK_BASIC_INFO_COUNT; - kret = - task_info (itask, TASK_BASIC_INFO, (task_info_t) &info_for_task, &task_info_count); - if (kret != KERN_SUCCESS) + // At this point "pid" is the process id and "process_name" is the process name + // Now we have to get the process list from the kernel (which only has the truncated + // 16 char names) + + struct kinfo_proc *all_kinfos; + int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0 }; + size_t len; + if (sysctl (mib, 3, NULL, &len, NULL, 0) != 0) { - printf ("Could not get task info for task: 0x%4.4x.\n", itask); + printf ("Could not number of processes\n"); + exit (1); } - - printf ("Task suspend: %d.\n", info_for_task.suspend_count); + all_kinfos = (struct kinfo_proc *) malloc (len); + if (sysctl (mib, 3, all_kinfos, &len, NULL, 0) != 0) + { + printf ("Could not get process infos\n"); + exit (1); + } + + struct kinfo_proc *kinfo = NULL; + int proc_count, i; + proc_count = len / sizeof (struct kinfo_proc); + for (i = 0 ; i < proc_count; i++) + if (all_kinfos[i].kp_proc.p_pid == pid) + { + kinfo = &all_kinfos[i]; + break; + } + if (kinfo == NULL) + { + printf ("Did not find process '%s' when re-getting proc table.\n", process_name); + exit (1); + } + + printf ("pid %d (%s) is currently ", pid, process_name); + switch (kinfo->kp_proc.p_stat) { + case SIDL: printf ("being created by fork"); break; + case SRUN: printf ("runnable"); break; + case SSLEEP: printf ("sleeping on an address"); break; + case SSTOP: printf ("suspended"); break; + case SZOMB: printf ("zombie state - awaiting collection by parent"); break; + default: printf ("unknown"); + } + if (kinfo->kp_proc.p_flag & P_TRACED) + printf (" and is being debugged."); - kret = task_threads (itask, &thread_list, &nthreads); - if (kret != KERN_SUCCESS) + printf ("\n"); + + kr = task_for_pid (mach_task_self (), pid, &task); + if (kr != KERN_SUCCESS) { - printf ("Could not get task threads for task 0x%4.4x.\n", itask); - return -1; + printf ("Error - unable to task_for_pid()\n"); + exit (1); } - int i; - for (i = 0; i < nthreads; i++) + struct timespec *rqtp = (struct timespec *) malloc (sizeof (struct timespec)); + rqtp->tv_sec = 0; + rqtp->tv_nsec = 150000000; + + int loop_cnt = 1; + do { - struct thread_basic_info info; - unsigned int thread_info_count = THREAD_BASIC_INFO_COUNT; - kern_return_t kret; - - kret = thread_info (thread_list[i], THREAD_BASIC_INFO, - (thread_info_t) & info, &thread_info_count); + int i; + if (do_loop) + printf ("Iteration %d:\n", loop_cnt++); + thread_array_t thread_list; + mach_msg_type_number_t thread_count; - if (kret != KERN_SUCCESS) + kr = task_threads (task, &thread_list, &thread_count); + if (kr != KERN_SUCCESS) { - printf ("Error getting thread basic info for thread 0x%4.4x.\n", thread_list[i]); + printf ("Error - unable to get thread list\n"); + exit (1); } - else + printf ("pid %d has %d threads\n", pid, thread_count); + + for (i = 0; i < thread_count; i++) { - dump_thread_basic_info (i + 1, thread_list[i], &info); + thread_info_data_t thinfo; + mach_msg_type_number_t thread_info_count = THREAD_INFO_MAX; + kr = thread_info (thread_list[i], THREAD_BASIC_INFO, + (thread_info_t) thinfo, &thread_info_count); + if (kr != KERN_SUCCESS) + { + printf ("Error - unable to get basic thread info for a thread\n"); + exit (1); + } + thread_basic_info_t basic_info_th = (thread_basic_info_t) thinfo; + + thread_identifier_info_data_t tident; + mach_msg_type_number_t tident_count = THREAD_IDENTIFIER_INFO_COUNT; + kr = thread_info (thread_list[i], THREAD_IDENTIFIER_INFO, + (thread_info_t) &tident, &tident_count); + if (kr != KERN_SUCCESS) + { + printf ("Error - unable to get thread ident for a thread\n"); + exit (1); + } + + uint64_t pc; + int width; +#if defined (__x86_64__) || defined (__i386__) + x86_thread_state_t gp_regs; + mach_msg_type_number_t gp_count = x86_THREAD_STATE_COUNT; + kr = thread_get_state (thread_list[i], x86_THREAD_STATE, + (thread_state_t) &gp_regs, &gp_count); + if (kr != KERN_SUCCESS) + { + printf ("Error - unable to get registers for a thread\n"); + exit (1); + } + + if (gp_regs.tsh.flavor == x86_THREAD_STATE64) + { + pc = gp_regs.uts.ts64.__rip; + width = 8; + } + else + { + pc = gp_regs.uts.ts32.__eip; + width = 4; + } +#endif + +#if defined (__arm__) + arm_thread_state_t gp_regs; + mach_msg_type_number_t gp_count = ARM_THREAD_STATE_COUNT; + kr = thread_get_state (thread_list[i], ARM_THREAD_STATE, + (thread_state_t) &gp_regs, &gp_count); + if (kr != KERN_SUCCESS) + { + printf ("Error - unable to get registers for a thread\n"); + exit (1); + } + pc = gp_regs.__pc; + width = 4; +#endif + + printf ("thread #%d, unique tid %lld, suspend count is %d, ", i, + tident.thread_id, + basic_info_th->suspend_count); + if (width == 8) + printf ("pc 0x%016llx, ", pc); + else + printf ("pc 0x%08llx, ", pc); + printf ("run state is "); + switch (basic_info_th->run_state) { + case TH_STATE_RUNNING: puts ("running"); break; + case TH_STATE_STOPPED: puts ("stopped"); break; + case TH_STATE_WAITING: puts ("waiting"); break; + case TH_STATE_UNINTERRUPTIBLE: puts ("uninterruptible"); break; + case TH_STATE_HALTED: puts ("halted"); break; + default: puts (""); + } + if (verbose) + { + printf (" "); + printf ("mach thread #0x%4.4x ", (int) thread_list[i]); + printf ("pthread handle id 0x%llx ", (uint64_t) tident.thread_handle); + + struct proc_threadinfo pth; + pth.pth_name[0] = '\0'; + int ret = proc_pidinfo (pid, PROC_PIDTHREADINFO, tident.thread_handle, + &pth, sizeof (pth)); + if (ret != 0 && pth.pth_name[0] != '\0') + printf ("thread name '%s' ", pth.pth_name); + + printf ("\n "); + printf ("user %d.%06ds, system %d.%06ds", + basic_info_th->user_time.seconds, basic_info_th->user_time.microseconds, + basic_info_th->system_time.seconds, basic_info_th->system_time.microseconds); + if (basic_info_th->cpu_usage > 0) + { + float cpu_percentage = basic_info_th->cpu_usage / 10.0; + printf (", using %.1f%% cpu currently", cpu_percentage); + } + if (basic_info_th->sleep_time > 0) + printf (", this thread has slept for %d seconds", basic_info_th->sleep_time); + + printf ("\n "); + printf ("scheduling policy %d", basic_info_th->policy); + + if (basic_info_th->flags != 0) + { + printf (", flags %d", basic_info_th->flags); + if ((basic_info_th->flags | TH_FLAGS_SWAPPED) == TH_FLAGS_SWAPPED) + printf (" (thread is swapped out)"); + if ((basic_info_th->flags | TH_FLAGS_IDLE) == TH_FLAGS_IDLE) + printf (" (thread is idle)"); + } + if (ret != 0) + printf (", current pri %d, max pri %d", pth.pth_curpri, pth.pth_maxpriority); + + puts (""); + } } - if (argc > 2) printf("thread_resume (tid = 0x%4.4x) => %i\n", thread_list[i], thread_resume (thread_list[i])); - } + if (do_loop) + printf ("\n"); + vm_deallocate (mytask, (vm_address_t) thread_list, + thread_count * sizeof (thread_act_t)); + nanosleep (rqtp, NULL); + } while (do_loop); - if (argc > 2) printf("task_resume (task = 0x%4.4x) => %i\n", itask, task_resume (itask)); - return 1; + vm_deallocate (mytask, (vm_address_t) task, sizeof (task_t)); + return 0; } From johnny.chen at apple.com Tue Jun 21 14:25:45 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Tue, 21 Jun 2011 19:25:45 -0000 Subject: [Lldb-commits] [lldb] r133534 - /lldb/trunk/test/dotest.py Message-ID: <20110621192545.84F142A6C12C@llvm.org> Author: johnny Date: Tue Jun 21 14:25:45 2011 New Revision: 133534 URL: http://llvm.org/viewvc/llvm-project?rev=133534&view=rev Log: Fix the log channel for gdb-remote. It should be "gdb-remote" now, instead of "process.gdb-remote". Modified: lldb/trunk/test/dotest.py Modified: lldb/trunk/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=133534&r1=133533&r2=133534&view=diff ============================================================================== --- lldb/trunk/test/dotest.py (original) +++ lldb/trunk/test/dotest.py Tue Jun 21 14:25:45 2011 @@ -739,7 +739,7 @@ else: gdb_remote_log_option = "packets process" ci.HandleCommand( - "log enable -n -f " + os.environ["GDB_REMOTE_LOG"] + " process.gdb-remote " + "log enable -n -f " + os.environ["GDB_REMOTE_LOG"] + " gdb-remote " + gdb_remote_log_option, res) if not res.Succeeded(): From johnny.chen at apple.com Tue Jun 21 14:47:11 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Tue, 21 Jun 2011 19:47:11 -0000 Subject: [Lldb-commits] [lldb] r133537 - in /lldb/trunk/test/types: AbstractBase.py TestFailures.py Message-ID: <20110621194711.580EC2A6C12C@llvm.org> Author: johnny Date: Tue Jun 21 14:47:11 2011 New Revision: 133537 URL: http://llvm.org/viewvc/llvm-project?rev=133537&view=rev Log: Add a test file "TestFailures.py" to try to capture test failures which occur when running with no delay between successive test cases. This one happend to capture a test failure where the inferior shoud stop at a breakpoint but did not (radar will be filed to capture the log files as well as the test session files): [12:40:37] johnny:/Volumes/data/lldb/svn/trunk/test $ DEBUG_LLDB_LOG=/tmp/lldb.log DEBUG_GDB_REMOTE_LOG=/tmp/gdb-remote.log ./dotest.py -v -p TestFailures.py LLDB-63 Path: /Volumes/data/lldb/svn/trunk URL: https://johnny at llvm.org/svn/llvm-project/lldb/trunk Repository Root: https://johnny at llvm.org/svn/llvm-project Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8 Revision: 133529 Node Kind: directory Schedule: normal Last Changed Author: jmolenda Last Changed Rev: 133500 Last Changed Date: 2011-06-20 19:57:15 -0700 (Mon, 20 Jun 2011) Session logs for test failures/errors/unexpected successes will go into directory '2011-06-21-12_40_42' Command invoked: python ./dotest.py -v -p TestFailures.py ---------------------------------------------------------------------- Collected 10 tests 1: test_char_type_with_dsym (TestFailures.DebugIntegerTypesFailures) Test that char-type variables are displayed correctly. ... ok 2: test_char_type_with_dwarf (TestFailures.DebugIntegerTypesFailures) Test that char-type variables are displayed correctly. ... ok 3: test_int_type_with_dsym (TestFailures.DebugIntegerTypesFailures) Test that int-type variables are displayed correctly. ... ok 4: test_int_type_with_dwarf (TestFailures.DebugIntegerTypesFailures) Test that int-type variables are displayed correctly. ... ok 5: test_long_long_type_with_dsym (TestFailures.DebugIntegerTypesFailures) Test that 'long long'-type variables are displayed correctly. ... FAIL 6: test_long_long_type_with_dwarf (TestFailures.DebugIntegerTypesFailures) Test that 'long long'-type variables are displayed correctly. ... ok 7: test_long_type_with_dsym (TestFailures.DebugIntegerTypesFailures) Test that long-type variables are displayed correctly. ... TestFailures.DebugIntegerTypesFailures.test_long_type_with_dsym FAIL 8: test_long_type_with_dwarf (TestFailures.DebugIntegerTypesFailures) Test that long-type variables are displayed correctly. ... FAIL 9: test_short_type_with_dsym (TestFailures.DebugIntegerTypesFailures) Test that short-type variables are displayed correctly. ... ok 10: test_short_type_with_dwarf (TestFailures.DebugIntegerTypesFailures) Test that short-type variables are displayed correctly. ... ok ====================================================================== FAIL: test_long_long_type_with_dsym (TestFailures.DebugIntegerTypesFailures) Test that 'long long'-type variables are displayed correctly. ---------------------------------------------------------------------- Traceback (most recent call last): File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 102, in test_long_long_type_with_dsym self.long_long_type() File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 129, in long_long_type self.generic_type_tester(set(['long long'])) File "/Volumes/data/lldb/svn/trunk/test/types/AbstractBase.py", line 67, in generic_type_tester "stop reason = breakpoint"]) File "/Volumes/data/lldb/svn/trunk/test/lldbtest.py", line 863, in expect msg if msg else EXP_MSG(str, exe)) AssertionError: False is not True : Process should be stopped due to breakpoint ====================================================================== FAIL: test_long_type_with_dsym (TestFailures.DebugIntegerTypesFailures) Test that long-type variables are displayed correctly. ---------------------------------------------------------------------- Traceback (most recent call last): File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 87, in test_long_type_with_dsym self.long_type() File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 125, in long_type self.generic_type_tester(set(['long'])) File "/Volumes/data/lldb/svn/trunk/test/types/AbstractBase.py", line 67, in generic_type_tester "stop reason = breakpoint"]) File "/Volumes/data/lldb/svn/trunk/test/lldbtest.py", line 863, in expect msg if msg else EXP_MSG(str, exe)) AssertionError: False is not True : Process should be stopped due to breakpoint ====================================================================== FAIL: test_long_type_with_dwarf (TestFailures.DebugIntegerTypesFailures) Test that long-type variables are displayed correctly. ---------------------------------------------------------------------- Traceback (most recent call last): File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 94, in test_long_type_with_dwarf self.long_type() File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 125, in long_type self.generic_type_tester(set(['long'])) File "/Volumes/data/lldb/svn/trunk/test/types/AbstractBase.py", line 67, in generic_type_tester "stop reason = breakpoint"]) File "/Volumes/data/lldb/svn/trunk/test/lldbtest.py", line 863, in expect msg if msg else EXP_MSG(str, exe)) AssertionError: False is not True : Process should be stopped due to breakpoint ---------------------------------------------------------------------- Ran 10 tests in 5.617s FAILED (failures=3) Session logs for test failures/errors/unexpected successes can be found in directory '2011-06-21-12_40_42' [12:40:47] johnny:/Volumes/data/lldb/svn/trunk/test $ Added: lldb/trunk/test/types/TestFailures.py Modified: lldb/trunk/test/types/AbstractBase.py Modified: lldb/trunk/test/types/AbstractBase.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/AbstractBase.py?rev=133537&r1=133536&r2=133537&view=diff ============================================================================== --- lldb/trunk/test/types/AbstractBase.py (original) +++ lldb/trunk/test/types/AbstractBase.py Tue Jun 21 14:47:11 2011 @@ -22,14 +22,14 @@ # FIXME: Remove this method when/if we find out the cause of the failures # if no delays are inserted between test cases. - def setUp(self): - # Call super's setUp(). - TestBase.setUp(self) - # Insert some delay for running test cases under test/types if not - # already so by the TestBase.setUp(). - if "LLDB_WAIT_BETWEEN_TEST_CASES" not in os.environ: - #print "some delay, please ...." - time.sleep(1.0) +# def setUp(self): +# # Call super's setUp(). +# TestBase.setUp(self) +# # Insert some delay for running test cases under test/types if not +# # already so by the TestBase.setUp(). +# if "LLDB_WAIT_BETWEEN_TEST_CASES" not in os.environ: +# #print "some delay, please ...." +# time.sleep(1.0) def generic_type_tester(self, atoms, quotedDisplay=False): """Test that variables with basic types are displayed correctly.""" Added: lldb/trunk/test/types/TestFailures.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/TestFailures.py?rev=133537&view=auto ============================================================================== --- lldb/trunk/test/types/TestFailures.py (added) +++ lldb/trunk/test/types/TestFailures.py Tue Jun 21 14:47:11 2011 @@ -0,0 +1,136 @@ +""" +Test that variables of integer basic types are displayed correctly. +""" + +import AbstractBase +import unittest2 +import sys +import lldb +from lldbtest import * + +class DebugIntegerTypesFailures(AbstractBase.GenericTester): + + mydir = "types" + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + # If we're lucky, test_long_long_type_with_dsym fails. + # Let's turn on logging just for that. + if "test_long_long_type_with_dsym" in self.id(): + self.runCmd( + "log enable -n -f %s lldb event process state" % os.environ["DEBUG_LLDB_LOG"]) + self.runCmd( + "log enable -n -f %s gdb-remote packets process" % os.environ["DEBUG_GDB_REMOTE_LOG"]) + + def tearDown(self): + # Call super's tearDown(). + TestBase.tearDown(self) + # If we're lucky, test_long_long_type_with_dsym fails. + # Let's turn off logging just for that. + if "test_long_long_type_with_dsym" in self.id(): + self.runCmd("log disable lldb") + self.runCmd("log disable gdb-remote") + + @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") + def test_char_type_with_dsym(self): + """Test that char-type variables are displayed correctly.""" + d = {'CXX_SOURCES': 'char.cpp'} + self.buildDsym(dictionary=d) + self.setTearDownCleanup(dictionary=d) + self.char_type() + + def test_char_type_with_dwarf(self): + """Test that char-type variables are displayed correctly.""" + d = {'CXX_SOURCES': 'char.cpp'} + self.buildDwarf(dictionary=d) + self.setTearDownCleanup(dictionary=d) + self.char_type() + + @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") + def test_short_type_with_dsym(self): + """Test that short-type variables are displayed correctly.""" + d = {'CXX_SOURCES': 'short.cpp'} + self.buildDsym(dictionary=d) + self.setTearDownCleanup(dictionary=d) + self.short_type() + + def test_short_type_with_dwarf(self): + """Test that short-type variables are displayed correctly.""" + d = {'CXX_SOURCES': 'short.cpp'} + self.buildDwarf(dictionary=d) + self.setTearDownCleanup(dictionary=d) + self.short_type() + + @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") + def test_int_type_with_dsym(self): + """Test that int-type variables are displayed correctly.""" + d = {'CXX_SOURCES': 'int.cpp'} + self.buildDsym(dictionary=d) + self.setTearDownCleanup(dictionary=d) + self.int_type() + + def test_int_type_with_dwarf(self): + """Test that int-type variables are displayed correctly.""" + d = {'CXX_SOURCES': 'int.cpp'} + self.buildDwarf(dictionary=d) + self.setTearDownCleanup(dictionary=d) + self.int_type() + + @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") + def test_long_type_with_dsym(self): + """Test that long-type variables are displayed correctly.""" + d = {'CXX_SOURCES': 'long.cpp'} + print self.id() + self.buildDsym(dictionary=d) + self.setTearDownCleanup(dictionary=d) + self.long_type() + + def test_long_type_with_dwarf(self): + """Test that long-type variables are displayed correctly.""" + d = {'CXX_SOURCES': 'long.cpp'} + self.buildDwarf(dictionary=d) + self.setTearDownCleanup(dictionary=d) + self.long_type() + + @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") + def test_long_long_type_with_dsym(self): + """Test that 'long long'-type variables are displayed correctly.""" + d = {'CXX_SOURCES': 'long_long.cpp'} + self.buildDsym(dictionary=d) + self.setTearDownCleanup(dictionary=d) + self.long_long_type() + + def test_long_long_type_with_dwarf(self): + """Test that 'long long'-type variables are displayed correctly.""" + d = {'CXX_SOURCES': 'long_long.cpp'} + self.buildDwarf(dictionary=d) + self.setTearDownCleanup(dictionary=d) + self.long_long_type() + + def char_type(self): + """Test that char-type variables are displayed correctly.""" + self.generic_type_tester(set(['char']), quotedDisplay=True) + + def int_type(self): + """Test that int-type variables are displayed correctly.""" + self.generic_type_tester(set(['int'])) + + def short_type(self): + """Test that short-type variables are displayed correctly.""" + self.generic_type_tester(set(['short'])) + + def long_type(self): + """Test that long-type variables are displayed correctly.""" + self.generic_type_tester(set(['long'])) + + def long_long_type(self): + """Test that long long-type variables are displayed correctly.""" + self.generic_type_tester(set(['long long'])) + + +if __name__ == '__main__': + import atexit + lldb.SBDebugger.Initialize() + atexit.register(lambda: lldb.SBDebugger.Terminate()) + unittest2.main() From johnny.chen at apple.com Tue Jun 21 14:59:45 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Tue, 21 Jun 2011 19:59:45 -0000 Subject: [Lldb-commits] [lldb] r133538 - /lldb/trunk/test/types/TestFailures.py Message-ID: <20110621195945.82C5A2A6C12C@llvm.org> Author: johnny Date: Tue Jun 21 14:59:45 2011 New Revision: 133538 URL: http://llvm.org/viewvc/llvm-project?rev=133538&view=rev Log: rdar://problem/9649573 has captured the log files when running test_long_long_type_with_dsym() (which luckily failed) and the test session files for test failures. Modified: lldb/trunk/test/types/TestFailures.py Modified: lldb/trunk/test/types/TestFailures.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/TestFailures.py?rev=133538&r1=133537&r2=133538&view=diff ============================================================================== --- lldb/trunk/test/types/TestFailures.py (original) +++ lldb/trunk/test/types/TestFailures.py Tue Jun 21 14:59:45 2011 @@ -8,6 +8,8 @@ import lldb from lldbtest import * +# rdar://problem/9649573 +# Capture the lldb and gdb-remote log files for test failures when run with no "-w" option class DebugIntegerTypesFailures(AbstractBase.GenericTester): mydir = "types" From gclayton at apple.com Tue Jun 21 15:47:20 2011 From: gclayton at apple.com (Greg Clayton) Date: Tue, 21 Jun 2011 20:47:20 -0000 Subject: [Lldb-commits] [lldb] r133541 - /lldb/trunk/source/Core/Baton.cpp Message-ID: <20110621204720.960FE2A6C12C@llvm.org> Author: gclayton Date: Tue Jun 21 15:47:20 2011 New Revision: 133541 URL: http://llvm.org/viewvc/llvm-project?rev=133541&view=rev Log: Don't print out the baton pointer value for simple Baton classes. Modified: lldb/trunk/source/Core/Baton.cpp Modified: lldb/trunk/source/Core/Baton.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Baton.cpp?rev=133541&r1=133540&r2=133541&view=diff ============================================================================== --- lldb/trunk/source/Core/Baton.cpp (original) +++ lldb/trunk/source/Core/Baton.cpp Tue Jun 21 15:47:20 2011 @@ -21,5 +21,4 @@ void Baton::GetDescription (Stream *s, lldb::DescriptionLevel level) const { - s->Printf("baton: %p", m_data); } From johnny.chen at apple.com Tue Jun 21 17:16:07 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Tue, 21 Jun 2011 22:16:07 -0000 Subject: [Lldb-commits] [lldb] r133556 - /lldb/trunk/test/types/TestFailures.py Message-ID: <20110621221607.2AC992A6C12C@llvm.org> Author: johnny Date: Tue Jun 21 17:16:07 2011 New Revision: 133556 URL: http://llvm.org/viewvc/llvm-project?rev=133556&view=rev Log: Add logging of 'commands' category, too. Modified: lldb/trunk/test/types/TestFailures.py Modified: lldb/trunk/test/types/TestFailures.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/TestFailures.py?rev=133556&r1=133555&r2=133556&view=diff ============================================================================== --- lldb/trunk/test/types/TestFailures.py (original) +++ lldb/trunk/test/types/TestFailures.py Tue Jun 21 17:16:07 2011 @@ -21,7 +21,7 @@ # Let's turn on logging just for that. if "test_long_long_type_with_dsym" in self.id(): self.runCmd( - "log enable -n -f %s lldb event process state" % os.environ["DEBUG_LLDB_LOG"]) + "log enable -n -f %s lldb commands event process state" % os.environ["DEBUG_LLDB_LOG"]) self.runCmd( "log enable -n -f %s gdb-remote packets process" % os.environ["DEBUG_GDB_REMOTE_LOG"]) From johnny.chen at apple.com Tue Jun 21 17:40:34 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Tue, 21 Jun 2011 22:40:34 -0000 Subject: [Lldb-commits] [lldb] r133562 - /lldb/trunk/test/types/TestFailures.py Message-ID: <20110621224034.D49832A6C12C@llvm.org> Author: johnny Date: Tue Jun 21 17:40:34 2011 New Revision: 133562 URL: http://llvm.org/viewvc/llvm-project?rev=133562&view=rev Log: I messed up the test case id to turn logging on and then off. It is "test_long_type_with_dsym", not "test_long_long_type_with_dsym". Modified: lldb/trunk/test/types/TestFailures.py Modified: lldb/trunk/test/types/TestFailures.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/TestFailures.py?rev=133562&r1=133561&r2=133562&view=diff ============================================================================== --- lldb/trunk/test/types/TestFailures.py (original) +++ lldb/trunk/test/types/TestFailures.py Tue Jun 21 17:40:34 2011 @@ -17,9 +17,9 @@ def setUp(self): # Call super's setUp(). TestBase.setUp(self) - # If we're lucky, test_long_long_type_with_dsym fails. + # If we're lucky, test_long_type_with_dsym fails. # Let's turn on logging just for that. - if "test_long_long_type_with_dsym" in self.id(): + if "test_long_type_with_dsym" in self.id(): self.runCmd( "log enable -n -f %s lldb commands event process state" % os.environ["DEBUG_LLDB_LOG"]) self.runCmd( @@ -28,9 +28,9 @@ def tearDown(self): # Call super's tearDown(). TestBase.tearDown(self) - # If we're lucky, test_long_long_type_with_dsym fails. + # If we're lucky, test_long_type_with_dsym fails. # Let's turn off logging just for that. - if "test_long_long_type_with_dsym" in self.id(): + if "test_long_type_with_dsym" in self.id(): self.runCmd("log disable lldb") self.runCmd("log disable gdb-remote") From gclayton at apple.com Tue Jun 21 20:39:49 2011 From: gclayton at apple.com (Greg Clayton) Date: Wed, 22 Jun 2011 01:39:49 -0000 Subject: [Lldb-commits] [lldb] r133597 - in /lldb/trunk: include/lldb/Core/Disassembler.h source/Commands/CommandObjectDisassemble.cpp source/Core/Disassembler.cpp source/Target/StackFrame.cpp Message-ID: <20110622013949.E6C5A2A6C12C@llvm.org> Author: gclayton Date: Tue Jun 21 20:39:49 2011 New Revision: 133597 URL: http://llvm.org/viewvc/llvm-project?rev=133597&view=rev Log: Fixed an issue where SBFrame::GetDisassembly() was returning disassembly that contained the current line marker. This is now an option which is not enabled for the API disassembly call. Modified: lldb/trunk/include/lldb/Core/Disassembler.h lldb/trunk/source/Commands/CommandObjectDisassemble.cpp lldb/trunk/source/Core/Disassembler.cpp lldb/trunk/source/Target/StackFrame.cpp Modified: lldb/trunk/include/lldb/Core/Disassembler.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Disassembler.h?rev=133597&r1=133596&r2=133597&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/Disassembler.h (original) +++ lldb/trunk/include/lldb/Core/Disassembler.h Tue Jun 21 20:39:49 2011 @@ -184,6 +184,13 @@ { public: + enum + { + eOptionNone = 0u, + eOptionShowBytes = (1u << 0), + eOptionRawOuput = (1u << 1), + eOptionShowCurrentLine = (1u << 2) + }; static Disassembler* FindPlugin (const ArchSpec &arch, const char *plugin_name); @@ -202,8 +209,7 @@ const AddressRange &range, uint32_t num_instructions, uint32_t num_mixed_context_lines, - bool show_bytes, - bool raw, + uint32_t options, Stream &strm); static bool @@ -214,8 +220,7 @@ const Address &start, uint32_t num_instructions, uint32_t num_mixed_context_lines, - bool show_bytes, - bool raw, + uint32_t options, Stream &strm); static size_t @@ -226,8 +231,7 @@ SymbolContextList &sc_list, uint32_t num_instructions, uint32_t num_mixed_context_lines, - bool show_bytes, - bool raw, + uint32_t options, Stream &strm); static bool @@ -239,8 +243,7 @@ Module *module, uint32_t num_instructions, uint32_t num_mixed_context_lines, - bool show_bytes, - bool raw, + uint32_t options, Stream &strm); static bool @@ -250,8 +253,7 @@ const ExecutionContext &exe_ctx, uint32_t num_instructions, uint32_t num_mixed_context_lines, - bool show_bytes, - bool raw, + uint32_t options, Stream &strm); //------------------------------------------------------------------ @@ -269,8 +271,7 @@ const ExecutionContext &exe_ctx, uint32_t num_instructions, uint32_t num_mixed_context_lines, - bool show_bytes, - bool raw, + uint32_t options, Stream &strm); size_t Modified: lldb/trunk/source/Commands/CommandObjectDisassemble.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectDisassemble.cpp?rev=133597&r1=133596&r2=133597&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectDisassemble.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectDisassemble.cpp Tue Jun 21 20:39:49 2011 @@ -258,6 +258,16 @@ m_options.num_lines_context = 1; ExecutionContext exe_ctx(m_interpreter.GetExecutionContext()); + uint32_t options = 0; + + if (!m_options.show_mixed) + options |= Disassembler::eOptionShowCurrentLine; + + if (m_options.show_bytes) + options |= Disassembler::eOptionShowBytes; + + if (m_options.raw) + options |= Disassembler::eOptionRawOuput; if (!m_options.func_name.empty()) { @@ -271,8 +281,7 @@ NULL, // Module * m_options.num_instructions, m_options.show_mixed ? m_options.num_lines_context : 0, - m_options.show_bytes, - m_options.raw, + options, result.GetOutputStream())) { result.SetStatus (eReturnStatusSuccessFinishResult); @@ -369,8 +378,7 @@ range.GetBaseAddress(), m_options.num_instructions, m_options.show_mixed ? m_options.num_lines_context : 0, - m_options.show_bytes, - m_options.raw, + options, result.GetOutputStream())) { result.SetStatus (eReturnStatusSuccessFinishResult); @@ -413,8 +421,7 @@ range, m_options.num_instructions, m_options.show_mixed ? m_options.num_lines_context : 0, - m_options.show_bytes, - m_options.raw, + options, result.GetOutputStream())) { result.SetStatus (eReturnStatusSuccessFinishResult); Modified: lldb/trunk/source/Core/Disassembler.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=133597&r1=133596&r2=133597&view=diff ============================================================================== --- lldb/trunk/source/Core/Disassembler.cpp (original) +++ lldb/trunk/source/Core/Disassembler.cpp Tue Jun 21 20:39:49 2011 @@ -110,8 +110,7 @@ SymbolContextList &sc_list, uint32_t num_instructions, uint32_t num_mixed_context_lines, - bool show_bytes, - bool raw, + uint32_t options, Stream &strm ) { @@ -134,8 +133,7 @@ range, num_instructions, num_mixed_context_lines, - show_bytes, - raw, + options, strm)) { ++success_count; @@ -157,8 +155,7 @@ Module *module, uint32_t num_instructions, uint32_t num_mixed_context_lines, - bool show_bytes, - bool raw, + uint32_t options, Stream &strm ) { @@ -199,8 +196,7 @@ sc_list, num_instructions, num_mixed_context_lines, - show_bytes, - raw, + options, strm); } return false; @@ -242,8 +238,7 @@ const AddressRange &disasm_range, uint32_t num_instructions, uint32_t num_mixed_context_lines, - bool show_bytes, - bool raw, + uint32_t options, Stream &strm ) { @@ -267,8 +262,7 @@ exe_ctx, num_instructions, num_mixed_context_lines, - show_bytes, - raw, + options, strm); } } @@ -285,8 +279,7 @@ const Address &start_address, uint32_t num_instructions, uint32_t num_mixed_context_lines, - bool show_bytes, - bool raw, + uint32_t options, Stream &strm ) { @@ -307,8 +300,7 @@ exe_ctx, num_instructions, num_mixed_context_lines, - show_bytes, - raw, + options, strm); } } @@ -324,8 +316,7 @@ const ExecutionContext &exe_ctx, uint32_t num_instructions, uint32_t num_mixed_context_lines, - bool show_bytes, - bool raw, + uint32_t options, Stream &strm ) { @@ -384,7 +375,7 @@ sc.line_entry.line, num_mixed_context_lines, num_mixed_context_lines, - num_mixed_context_lines ? "->" : "", + ((options & eOptionShowCurrentLine) ? "->" : ""), &strm); } } @@ -421,6 +412,8 @@ else strm.PutCString(" "); } + const bool show_bytes = (options & eOptionShowBytes) != 0; + const bool raw = (options & eOptionRawOuput) != 0; inst->Dump(&strm, max_opcode_byte_size, true, show_bytes, &exe_ctx, raw); strm.EOL(); } @@ -443,8 +436,7 @@ const ExecutionContext &exe_ctx, uint32_t num_instructions, uint32_t num_mixed_context_lines, - bool show_bytes, - bool raw, + uint32_t options, Stream &strm ) { @@ -476,8 +468,7 @@ range, num_instructions, num_mixed_context_lines, - show_bytes, - raw, + options, strm); } Modified: lldb/trunk/source/Target/StackFrame.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=133597&r1=133596&r2=133597&view=diff ============================================================================== --- lldb/trunk/source/Target/StackFrame.cpp (original) +++ lldb/trunk/source/Target/StackFrame.cpp Tue Jun 21 20:39:49 2011 @@ -262,8 +262,7 @@ exe_ctx, 0, 0, - false, - false, + 0, m_disassembly); if (m_disassembly.GetSize() == 0) return NULL; From gclayton at apple.com Tue Jun 21 20:42:17 2011 From: gclayton at apple.com (Greg Clayton) Date: Wed, 22 Jun 2011 01:42:17 -0000 Subject: [Lldb-commits] [lldb] r133598 - /lldb/trunk/source/Target/Process.cpp Message-ID: <20110622014217.5E8E32A6C12C@llvm.org> Author: gclayton Date: Tue Jun 21 20:42:17 2011 New Revision: 133598 URL: http://llvm.org/viewvc/llvm-project?rev=133598&view=rev Log: Add a 10 second timeout to ensure that we don't lock up if we never get to the process entry point. Modified: lldb/trunk/source/Target/Process.cpp Modified: lldb/trunk/source/Target/Process.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=133598&r1=133597&r2=133598&view=diff ============================================================================== --- lldb/trunk/source/Target/Process.cpp (original) +++ lldb/trunk/source/Target/Process.cpp Tue Jun 21 20:42:17 2011 @@ -2060,9 +2060,19 @@ else { EventSP event_sp; - StateType state = WaitForProcessStopPrivate(NULL, event_sp); + TimeValue timeout_time; + timeout_time = TimeValue::Now(); + timeout_time.OffsetWithSeconds(10); + StateType state = WaitForProcessStopPrivate(&timeout_time, event_sp); - if (state == eStateStopped || state == eStateCrashed) + if (state == eStateInvalid || event_sp.get() == NULL) + { + // We were able to launch the process, but we failed to + // catch the initial stop. + SetExitStatus (0, "failed to catch stop after launch"); + Destroy(); + } + else if (state == eStateStopped || state == eStateCrashed) { DidLaunch (); From johnny.chen at apple.com Tue Jun 21 21:39:46 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Wed, 22 Jun 2011 02:39:46 -0000 Subject: [Lldb-commits] [lldb] r133602 - /lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Message-ID: <20110622023946.4F8492A6C12C@llvm.org> Author: johnny Date: Tue Jun 21 21:39:46 2011 New Revision: 133602 URL: http://llvm.org/viewvc/llvm-project?rev=133602&view=rev Log: Recent change to SBSymbolContextList (r133498) makes the default constructor return a valid SB API object. Modify the test case to accommodate. Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py?rev=133602&r1=133601&r2=133602&view=diff ============================================================================== --- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original) +++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Tue Jun 21 21:39:46 2011 @@ -2,8 +2,8 @@ Test lldb Python API object's default constructor and make sure it is invalid after initial construction. -There are two exceptions to the above general rules, though; the API objects are -SBCommadnReturnObject and SBStream. +There are three exceptions to the above general rules, though; the API objects are +SBCommadnReturnObject, SBStream, and SBSymbolContextList. """ import os, time @@ -198,7 +198,7 @@ obj = lldb.SBSymbolContextList() if self.TraceOn(): print obj - self.assertFalse(obj) + self.assertTrue(obj) @python_api_test def test_SBTarget(self): From johnny.chen at apple.com Tue Jun 21 21:49:57 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Wed, 22 Jun 2011 02:49:57 -0000 Subject: [Lldb-commits] [lldb] r133603 - /lldb/trunk/test/types/TestFailures.py Message-ID: <20110622024957.199982A6C12C@llvm.org> Author: johnny Date: Tue Jun 21 21:49:56 2011 New Revision: 133603 URL: http://llvm.org/viewvc/llvm-project?rev=133603&view=rev Log: This newly introduced test file (for debugging purpose) needs to handle the case where the environment variables for log files (DEBUG_LLDB_LOG and DEBUG_GDB_REMOTE_LOG) are not defined. Modified: lldb/trunk/test/types/TestFailures.py Modified: lldb/trunk/test/types/TestFailures.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/TestFailures.py?rev=133603&r1=133602&r2=133603&view=diff ============================================================================== --- lldb/trunk/test/types/TestFailures.py (original) +++ lldb/trunk/test/types/TestFailures.py Tue Jun 21 21:49:56 2011 @@ -19,11 +19,16 @@ TestBase.setUp(self) # If we're lucky, test_long_type_with_dsym fails. # Let's turn on logging just for that. - if "test_long_type_with_dsym" in self.id(): - self.runCmd( - "log enable -n -f %s lldb commands event process state" % os.environ["DEBUG_LLDB_LOG"]) - self.runCmd( - "log enable -n -f %s gdb-remote packets process" % os.environ["DEBUG_GDB_REMOTE_LOG"]) + try: + if "test_long_type_with_dsym" in self.id(): + self.runCmd( + "log enable -n -f %s lldb commands event process state" % + os.environ["DEBUG_LLDB_LOG"]) + self.runCmd( + "log enable -n -f %s gdb-remote packets process" % + os.environ["DEBUG_GDB_REMOTE_LOG"]) + except: + pass def tearDown(self): # Call super's tearDown(). From gclayton at apple.com Tue Jun 21 22:27:35 2011 From: gclayton at apple.com (Greg Clayton) Date: Wed, 22 Jun 2011 03:27:35 -0000 Subject: [Lldb-commits] [lldb] r133605 - in /lldb/trunk: lldb.xcodeproj/project.pbxproj resources/LLDB-Info.plist Message-ID: <20110622032735.A9C502A6C12C@llvm.org> Author: gclayton Date: Tue Jun 21 22:27:35 2011 New Revision: 133605 URL: http://llvm.org/viewvc/llvm-project?rev=133605&view=rev Log: Bump Xcode project version to 64. Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/resources/LLDB-Info.plist Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=133605&r1=133604&r2=133605&view=diff ============================================================================== --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Jun 21 22:27:35 2011 @@ -3394,10 +3394,10 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 63; + CURRENT_PROJECT_VERSION = 64; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 63; + DYLIB_CURRENT_VERSION = 64; EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3446,11 +3446,11 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 63; + CURRENT_PROJECT_VERSION = 64; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 63; + DYLIB_CURRENT_VERSION = 64; EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3497,8 +3497,8 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 63; - DYLIB_CURRENT_VERSION = 63; + CURRENT_PROJECT_VERSION = 64; + DYLIB_CURRENT_VERSION = 64; EXECUTABLE_EXTENSION = a; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3536,9 +3536,9 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 63; + CURRENT_PROJECT_VERSION = 64; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DYLIB_CURRENT_VERSION = 63; + DYLIB_CURRENT_VERSION = 64; EXECUTABLE_EXTENSION = a; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3576,9 +3576,9 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 63; + CURRENT_PROJECT_VERSION = 64; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DYLIB_CURRENT_VERSION = 63; + DYLIB_CURRENT_VERSION = 64; EXECUTABLE_EXTENSION = a; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3646,7 +3646,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 63; + CURRENT_PROJECT_VERSION = 64; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3677,11 +3677,11 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 63; + CURRENT_PROJECT_VERSION = 64; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 63; + DYLIB_CURRENT_VERSION = 64; EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3806,7 +3806,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 63; + CURRENT_PROJECT_VERSION = 64; DEBUG_INFORMATION_FORMAT = dwarf; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3838,7 +3838,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 63; + CURRENT_PROJECT_VERSION = 64; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", Modified: lldb/trunk/resources/LLDB-Info.plist URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/resources/LLDB-Info.plist?rev=133605&r1=133604&r2=133605&view=diff ============================================================================== --- lldb/trunk/resources/LLDB-Info.plist (original) +++ lldb/trunk/resources/LLDB-Info.plist Tue Jun 21 22:27:35 2011 @@ -17,7 +17,7 @@ CFBundleSignature ???? CFBundleVersion - 63 + 64 CFBundleName ${EXECUTABLE_NAME} From gclayton at apple.com Tue Jun 21 22:27:59 2011 From: gclayton at apple.com (Greg Clayton) Date: Wed, 22 Jun 2011 03:27:59 -0000 Subject: [Lldb-commits] [lldb] r133606 - /lldb/tags/lldb-64/ Message-ID: <20110622032759.62A552A6C12C@llvm.org> Author: gclayton Date: Tue Jun 21 22:27:59 2011 New Revision: 133606 URL: http://llvm.org/viewvc/llvm-project?rev=133606&view=rev Log: lldb-64 Added: lldb/tags/lldb-64/ - copied from r133605, lldb/trunk/ From cdavis at mymail.mines.edu Wed Jun 22 00:31:18 2011 From: cdavis at mymail.mines.edu (Charles Davis) Date: Tue, 21 Jun 2011 23:31:18 -0600 Subject: [Lldb-commits] [lldb] r133463 - /lldb/trunk/source/Interpreter/Makefile In-Reply-To: <20110620190707.BF3E72A6C12C@llvm.org> References: <20110620190707.BF3E72A6C12C@llvm.org> Message-ID: <4E017E26.3070803@mymail.mines.edu> On 6/20/11 1:07 PM, Peter Collingbourne wrote: > Author: pcc > Date: Mon Jun 20 14:07:07 2011 > New Revision: 133463 > > URL: http://llvm.org/viewvc/llvm-project?rev=133463&view=rev > Log: > Add dependency tracking/clean rule to interpreter makefile Unfortunately, this change doesn't work on Darwin because... > @@ -32,11 +32,19 @@ [...] > +SWIG_DEPEND_OPTIONS = -MMD -MF "$(PROJ_OBJ_DIR)/$*.cpp.d.tmp" \ > + -MT "$*.cpp" -MT "$(PROJ_OBJ_DIR)/$*.cpp.d" ...Darwin's swig (as of Snow Leopard) doesn't support -MT. And it's unlikely ever to, because Apple hates and fears the GPLv3. Chip From jingham at apple.com Wed Jun 22 13:23:52 2011 From: jingham at apple.com (Jim Ingham) Date: Wed, 22 Jun 2011 18:23:52 -0000 Subject: [Lldb-commits] [lldb] r133629 - /lldb/trunk/source/Target/ThreadPlanTracer.cpp Message-ID: <20110622182352.E810B2A6C12C@llvm.org> Author: jingham Date: Wed Jun 22 13:23:52 2011 New Revision: 133629 URL: http://llvm.org/viewvc/llvm-project?rev=133629&view=rev Log: Reverting switch to the AsyncOutputStream for the Thread Trace Logger. This change caused the logger to crash. Presumably we're printing at a time the debugger isn't ready to print. Modified: lldb/trunk/source/Target/ThreadPlanTracer.cpp Modified: lldb/trunk/source/Target/ThreadPlanTracer.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanTracer.cpp?rev=133629&r1=133628&r2=133629&view=diff ============================================================================== --- lldb/trunk/source/Target/ThreadPlanTracer.cpp (original) +++ lldb/trunk/source/Target/ThreadPlanTracer.cpp Wed Jun 22 13:23:52 2011 @@ -55,7 +55,7 @@ if (m_stream_sp.get()) return m_stream_sp.get(); else - return m_thread.GetProcess().GetTarget().GetDebugger().GetAsyncOutputStream().get(); + return &m_thread.GetProcess().GetTarget().GetDebugger().GetOutputStream(); } void From johnny.chen at apple.com Wed Jun 22 15:57:53 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Wed, 22 Jun 2011 20:57:53 -0000 Subject: [Lldb-commits] [lldb] r133644 - /lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Message-ID: <20110622205753.1AC222A6C12C@llvm.org> Author: johnny Date: Wed Jun 22 15:57:52 2011 New Revision: 133644 URL: http://llvm.org/viewvc/llvm-project?rev=133644&view=rev Log: Add docstring to test_SBSymbolContextList(self) explaining that upon default construction, the API object is valid. Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py?rev=133644&r1=133643&r2=133644&view=diff ============================================================================== --- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original) +++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Wed Jun 22 15:57:52 2011 @@ -195,6 +195,7 @@ @python_api_test def test_SBSymbolContextList(self): + """SBSymbolContextList object is valid after default construction.""" obj = lldb.SBSymbolContextList() if self.TraceOn(): print obj From jingham at apple.com Wed Jun 22 16:13:28 2011 From: jingham at apple.com (Jim Ingham) Date: Wed, 22 Jun 2011 21:13:28 -0000 Subject: [Lldb-commits] [lldb] r133647 - /lldb/trunk/source/Target/ThreadPlanTracer.cpp Message-ID: <20110622211328.F15942A6C12D@llvm.org> Author: jingham Date: Wed Jun 22 16:13:28 2011 New Revision: 133647 URL: http://llvm.org/viewvc/llvm-project?rev=133647&view=rev Log: Trivial fix - insert a space between the frame name and the instruction output. Modified: lldb/trunk/source/Target/ThreadPlanTracer.cpp Modified: lldb/trunk/source/Target/ThreadPlanTracer.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanTracer.cpp?rev=133647&r1=133646&r2=133647&view=diff ============================================================================== --- lldb/trunk/source/Target/ThreadPlanTracer.cpp (original) +++ lldb/trunk/source/Target/ThreadPlanTracer.cpp Wed Jun 22 16:13:28 2011 @@ -177,6 +177,7 @@ addr_valid = m_process.GetTarget().GetSectionLoadList().ResolveLoadAddress (pc, pc_addr); pc_addr.Dump(stream, &m_thread, Address::DumpStyleResolvedDescription, Address::DumpStyleModuleWithFileAddress); + stream->PutCString (" "); if (m_disassembler) { From johnny.chen at apple.com Wed Jun 22 16:15:10 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Wed, 22 Jun 2011 21:15:10 -0000 Subject: [Lldb-commits] [lldb] r133649 - in /lldb/trunk/test/types: AbstractBase.py HideTestFailures.py TestFailures.py TestFloatTypes.py TestFloatTypesExpr.py TestIntegerTypes.py TestIntegerTypesExpr.py Message-ID: <20110622211510.D946F2A6C12C@llvm.org> Author: johnny Date: Wed Jun 22 16:15:10 2011 New Revision: 133649 URL: http://llvm.org/viewvc/llvm-project?rev=133649&view=rev Log: Modify the test cases (there are a bunch of them) under test/types so that they employ different executable names when creating the target for lldb to debug. Comparing the log files for the same test case with success/failure results show that the failed one was setting the breakpoint on some different address than the succeeded one, leading us to suspect that the file system maybe think it knows better and caches the wrong executable file (they were all named 'a.out' before) which lldb subsequently reads from. Now './dotest.py -v types' passes without specifying the '-w' option. rdar://problem/9644488 rdar://problem/9649573 Added: lldb/trunk/test/types/HideTestFailures.py - copied unchanged from r133603, lldb/trunk/test/types/TestFailures.py Removed: lldb/trunk/test/types/TestFailures.py Modified: lldb/trunk/test/types/AbstractBase.py lldb/trunk/test/types/TestFloatTypes.py lldb/trunk/test/types/TestFloatTypesExpr.py lldb/trunk/test/types/TestIntegerTypes.py lldb/trunk/test/types/TestIntegerTypesExpr.py Modified: lldb/trunk/test/types/AbstractBase.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/AbstractBase.py?rev=133649&r1=133648&r2=133649&view=diff ============================================================================== --- lldb/trunk/test/types/AbstractBase.py (original) +++ lldb/trunk/test/types/AbstractBase.py Wed Jun 22 16:15:10 2011 @@ -20,23 +20,12 @@ # Assert message. DATA_TYPE_GROKKED = "Data type from expr parser output is parsed correctly" - # FIXME: Remove this method when/if we find out the cause of the failures - # if no delays are inserted between test cases. -# def setUp(self): -# # Call super's setUp(). -# TestBase.setUp(self) -# # Insert some delay for running test cases under test/types if not -# # already so by the TestBase.setUp(). -# if "LLDB_WAIT_BETWEEN_TEST_CASES" not in os.environ: -# #print "some delay, please ...." -# time.sleep(1.0) - - def generic_type_tester(self, atoms, quotedDisplay=False): + def generic_type_tester(self, exe_name, atoms, quotedDisplay=False): """Test that variables with basic types are displayed correctly.""" # First, capture the golden output emitted by the oracle, i.e., the # series of printf statements. - go = system("./a.out", sender=self)[0] + go = system("./%s" % exe_name, sender=self)[0] # This golden list contains a list of (variable, value) pairs extracted # from the golden output. gl = [] @@ -54,7 +43,7 @@ # Bring the program to the point where we can issue a series of # 'frame variable -T' command. - self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) + self.runCmd("file %s" % exe_name, CURRENT_EXECUTABLE_SET) puts_line = line_number ("basic_type.cpp", "// Here is the line we will break on to check variables") self.expect("breakpoint set -f basic_type.cpp -l %d" % puts_line, BREAKPOINT_CREATED, @@ -98,12 +87,12 @@ self.expect(output, Msg(var, val, True), exe=False, substrs = [nv]) - def generic_type_expr_tester(self, atoms, quotedDisplay=False): + def generic_type_expr_tester(self, exe_name, atoms, quotedDisplay=False): """Test that variable expressions with basic types are evaluated correctly.""" # First, capture the golden output emitted by the oracle, i.e., the # series of printf statements. - go = system("./a.out", sender=self)[0] + go = system("./%s" % exe_name, sender=self)[0] # This golden list contains a list of (variable, value) pairs extracted # from the golden output. gl = [] @@ -121,7 +110,7 @@ # Bring the program to the point where we can issue a series of # 'expr' command. - self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) + self.runCmd("file %s" % exe_name, CURRENT_EXECUTABLE_SET) puts_line = line_number ("basic_type.cpp", "// Here is the line we will break on to check variables.") self.expect("breakpoint set -f basic_type.cpp -l %d" % puts_line, BREAKPOINT_CREATED, Removed: lldb/trunk/test/types/TestFailures.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/TestFailures.py?rev=133648&view=auto ============================================================================== --- lldb/trunk/test/types/TestFailures.py (original) +++ lldb/trunk/test/types/TestFailures.py (removed) @@ -1,143 +0,0 @@ -""" -Test that variables of integer basic types are displayed correctly. -""" - -import AbstractBase -import unittest2 -import sys -import lldb -from lldbtest import * - -# rdar://problem/9649573 -# Capture the lldb and gdb-remote log files for test failures when run with no "-w" option -class DebugIntegerTypesFailures(AbstractBase.GenericTester): - - mydir = "types" - - def setUp(self): - # Call super's setUp(). - TestBase.setUp(self) - # If we're lucky, test_long_type_with_dsym fails. - # Let's turn on logging just for that. - try: - if "test_long_type_with_dsym" in self.id(): - self.runCmd( - "log enable -n -f %s lldb commands event process state" % - os.environ["DEBUG_LLDB_LOG"]) - self.runCmd( - "log enable -n -f %s gdb-remote packets process" % - os.environ["DEBUG_GDB_REMOTE_LOG"]) - except: - pass - - def tearDown(self): - # Call super's tearDown(). - TestBase.tearDown(self) - # If we're lucky, test_long_type_with_dsym fails. - # Let's turn off logging just for that. - if "test_long_type_with_dsym" in self.id(): - self.runCmd("log disable lldb") - self.runCmd("log disable gdb-remote") - - @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") - def test_char_type_with_dsym(self): - """Test that char-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'char.cpp'} - self.buildDsym(dictionary=d) - self.setTearDownCleanup(dictionary=d) - self.char_type() - - def test_char_type_with_dwarf(self): - """Test that char-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'char.cpp'} - self.buildDwarf(dictionary=d) - self.setTearDownCleanup(dictionary=d) - self.char_type() - - @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") - def test_short_type_with_dsym(self): - """Test that short-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'short.cpp'} - self.buildDsym(dictionary=d) - self.setTearDownCleanup(dictionary=d) - self.short_type() - - def test_short_type_with_dwarf(self): - """Test that short-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'short.cpp'} - self.buildDwarf(dictionary=d) - self.setTearDownCleanup(dictionary=d) - self.short_type() - - @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") - def test_int_type_with_dsym(self): - """Test that int-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'int.cpp'} - self.buildDsym(dictionary=d) - self.setTearDownCleanup(dictionary=d) - self.int_type() - - def test_int_type_with_dwarf(self): - """Test that int-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'int.cpp'} - self.buildDwarf(dictionary=d) - self.setTearDownCleanup(dictionary=d) - self.int_type() - - @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") - def test_long_type_with_dsym(self): - """Test that long-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'long.cpp'} - print self.id() - self.buildDsym(dictionary=d) - self.setTearDownCleanup(dictionary=d) - self.long_type() - - def test_long_type_with_dwarf(self): - """Test that long-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'long.cpp'} - self.buildDwarf(dictionary=d) - self.setTearDownCleanup(dictionary=d) - self.long_type() - - @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") - def test_long_long_type_with_dsym(self): - """Test that 'long long'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'long_long.cpp'} - self.buildDsym(dictionary=d) - self.setTearDownCleanup(dictionary=d) - self.long_long_type() - - def test_long_long_type_with_dwarf(self): - """Test that 'long long'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'long_long.cpp'} - self.buildDwarf(dictionary=d) - self.setTearDownCleanup(dictionary=d) - self.long_long_type() - - def char_type(self): - """Test that char-type variables are displayed correctly.""" - self.generic_type_tester(set(['char']), quotedDisplay=True) - - def int_type(self): - """Test that int-type variables are displayed correctly.""" - self.generic_type_tester(set(['int'])) - - def short_type(self): - """Test that short-type variables are displayed correctly.""" - self.generic_type_tester(set(['short'])) - - def long_type(self): - """Test that long-type variables are displayed correctly.""" - self.generic_type_tester(set(['long'])) - - def long_long_type(self): - """Test that long long-type variables are displayed correctly.""" - self.generic_type_tester(set(['long long'])) - - -if __name__ == '__main__': - import atexit - lldb.SBDebugger.Initialize() - atexit.register(lambda: lldb.SBDebugger.Terminate()) - unittest2.main() Modified: lldb/trunk/test/types/TestFloatTypes.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/TestFloatTypes.py?rev=133649&r1=133648&r2=133649&view=diff ============================================================================== --- lldb/trunk/test/types/TestFloatTypes.py (original) +++ lldb/trunk/test/types/TestFloatTypes.py Wed Jun 22 16:15:10 2011 @@ -12,42 +12,42 @@ mydir = "types" @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") - def test_float_types_with_dsym(self): + def test_float_type_with_dsym(self): """Test that float-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'float.cpp'} + d = {'CXX_SOURCES': 'float.cpp', 'EXE': 'float_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.float_type() + self.float_type('float_type_dsym') def test_float_type_with_dwarf(self): """Test that float-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'float.cpp'} + d = {'CXX_SOURCES': 'float.cpp', 'EXE': 'float_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.float_type() + self.float_type('float_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_double_type_with_dsym(self): """Test that double-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'double.cpp'} + d = {'CXX_SOURCES': 'double.cpp', 'EXE': 'double_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.double_type() + self.double_type('double_type_dsym') def test_double_type_with_dwarf(self): """Test that double-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'double.cpp'} + d = {'CXX_SOURCES': 'double.cpp', 'EXE': 'double_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.double_type() + self.double_type('double_type_dwarf') - def float_type(self): + def float_type(self, exe_name): """Test that float-type variables are displayed correctly.""" - self.generic_type_tester(set(['float'])) + self.generic_type_tester(exe_name, set(['float'])) - def double_type(self): + def double_type(self, exe_name): """Test that double-type variables are displayed correctly.""" - self.generic_type_tester(set(['double'])) + self.generic_type_tester(exe_name, set(['double'])) if __name__ == '__main__': Modified: lldb/trunk/test/types/TestFloatTypesExpr.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/TestFloatTypesExpr.py?rev=133649&r1=133648&r2=133649&view=diff ============================================================================== --- lldb/trunk/test/types/TestFloatTypesExpr.py (original) +++ lldb/trunk/test/types/TestFloatTypesExpr.py Wed Jun 22 16:15:10 2011 @@ -15,42 +15,42 @@ # test/types failures for Test*TypesExpr.py: element offset computed wrong and sign error? @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") - def test_float_types_with_dsym(self): + def test_float_type_with_dsym(self): """Test that float-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'float.cpp'} + d = {'CXX_SOURCES': 'float.cpp', 'EXE': 'float_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.float_type_expr() + self.float_type_expr('float_type_dsym') def test_float_type_with_dwarf(self): """Test that float-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'float.cpp'} + d = {'CXX_SOURCES': 'float.cpp', 'EXE': 'float_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.float_type_expr() + self.float_type_expr('float_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_double_type_with_dsym(self): """Test that double-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'double.cpp'} + d = {'CXX_SOURCES': 'double.cpp', 'EXE': 'double_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.double_type_expr() + self.double_type_expr('double_type_dsym') def test_double_type_with_dwarf(self): """Test that double-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'double.cpp'} + d = {'CXX_SOURCES': 'double.cpp', 'EXE': 'double_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.double_type_expr() + self.double_type_expr('double_type_dwarf') - def float_type_expr(self): + def float_type_expr(self, exe_name): """Test that float-type variable expressions are evaluated correctly.""" - self.generic_type_expr_tester(set(['float'])) + self.generic_type_expr_tester(exe_name, set(['float'])) - def double_type_expr(self): + def double_type_expr(self, exe_name): """Test that double-type variable expressions are evaluated correctly.""" - self.generic_type_expr_tester(set(['double'])) + self.generic_type_expr_tester(exe_name, set(['double'])) if __name__ == '__main__': Modified: lldb/trunk/test/types/TestIntegerTypes.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/TestIntegerTypes.py?rev=133649&r1=133648&r2=133649&view=diff ============================================================================== --- lldb/trunk/test/types/TestIntegerTypes.py (original) +++ lldb/trunk/test/types/TestIntegerTypes.py Wed Jun 22 16:15:10 2011 @@ -14,122 +14,122 @@ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_char_type_with_dsym(self): """Test that char-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'char.cpp'} + d = {'CXX_SOURCES': 'char.cpp', 'EXE': 'char_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.char_type() + self.char_type('char_type_dsym') def test_char_type_with_dwarf(self): """Test that char-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'char.cpp'} + d = {'CXX_SOURCES': 'char.cpp', 'EXE': 'char_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.char_type() + self.char_type('char_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_char_type_with_dsym(self): """Test that 'unsigned_char'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_char.cpp'} + d = {'CXX_SOURCES': 'unsigned_char.cpp', 'EXE': 'unsigned_char_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_char_type() + self.unsigned_char_type('unsigned_char_type_dsym') def test_unsigned_char_type_with_dwarf(self): """Test that 'unsigned char'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_char.cpp'} + d = {'CXX_SOURCES': 'unsigned_char.cpp', 'EXE': 'unsigned_char_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_char_type() + self.unsigned_char_type('unsigned_char_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_short_type_with_dsym(self): """Test that short-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'short.cpp'} + d = {'CXX_SOURCES': 'short.cpp', 'EXE': 'short_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.short_type() + self.short_type('short_type_dsym') def test_short_type_with_dwarf(self): """Test that short-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'short.cpp'} + d = {'CXX_SOURCES': 'short.cpp', 'EXE': 'short_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.short_type() + self.short_type('short_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_short_type_with_dsym(self): """Test that 'unsigned_short'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_short.cpp'} + d = {'CXX_SOURCES': 'unsigned_short.cpp', 'EXE': 'unsigned_short_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_short_type() + self.unsigned_short_type('unsigned_short_type_dsym') def test_unsigned_short_type_with_dwarf(self): """Test that 'unsigned short'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_short.cpp'} + d = {'CXX_SOURCES': 'unsigned_short.cpp', 'EXE': 'unsigned_short_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_short_type() + self.unsigned_short_type('unsigned_short_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_int_type_with_dsym(self): """Test that int-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'int.cpp'} + d = {'CXX_SOURCES': 'int.cpp', 'EXE': 'int_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.int_type() + self.int_type('int_type_dsym') def test_int_type_with_dwarf(self): """Test that int-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'int.cpp'} + d = {'CXX_SOURCES': 'int.cpp', 'EXE': 'int_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.int_type() + self.int_type('int_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_int_type_with_dsym(self): """Test that 'unsigned_int'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_int.cpp'} + d = {'CXX_SOURCES': 'unsigned_int.cpp', 'EXE': 'unsigned_int_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_int_type() + self.unsigned_int_type('unsigned_int_type_dsym') def test_unsigned_int_type_with_dwarf(self): """Test that 'unsigned int'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_int.cpp'} + d = {'CXX_SOURCES': 'unsigned_int.cpp', 'EXE': 'unsigned_int_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_int_type() + self.unsigned_int_type('unsigned_int_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_long_type_with_dsym(self): """Test that long-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'long.cpp'} + d = {'CXX_SOURCES': 'long.cpp', 'EXE': 'long_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.long_type() + self.long_type('long_type_dsym') def test_long_type_with_dwarf(self): """Test that long-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'long.cpp'} + d = {'CXX_SOURCES': 'long.cpp', 'EXE': 'long_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.long_type() + self.long_type('long_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_long_type_with_dsym(self): """Test that 'unsigned long'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_long.cpp'} + d = {'CXX_SOURCES': 'unsigned_long.cpp', 'EXE': 'unsigned_long_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_long_type() + self.unsigned_long_type('unsigned_long_type_dsym') def test_unsigned_long_type_with_dwarf(self): """Test that 'unsigned long'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_long.cpp'} + d = {'CXX_SOURCES': 'unsigned_long.cpp', 'EXE': 'unsigned_long_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_long_type() + self.unsigned_long_type('unsigned_long_type_dwarf') # rdar://problem/8482903 # test suite failure for types dir -- "long long" and "unsigned long long" @@ -137,72 +137,72 @@ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_long_long_type_with_dsym(self): """Test that 'long long'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'long_long.cpp'} + d = {'CXX_SOURCES': 'long_long.cpp', 'EXE': 'long_long_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.long_long_type() + self.long_long_type('long_long_type_dsym') def test_long_long_type_with_dwarf(self): """Test that 'long long'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'long_long.cpp'} + d = {'CXX_SOURCES': 'long_long.cpp', 'EXE': 'long_long_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.long_long_type() + self.long_long_type('long_long_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_long_long_type_with_dsym(self): """Test that 'unsigned long long'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_long_long.cpp'} + d = {'CXX_SOURCES': 'unsigned_long_long.cpp', 'EXE': 'unsigned_long_long_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_long_long_type() + self.unsigned_long_long_type('unsigned_long_long_type_dsym') def test_unsigned_long_long_type_with_dwarf(self): """Test that 'unsigned long long'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_long_long.cpp'} + d = {'CXX_SOURCES': 'unsigned_long_long.cpp', 'EXE': 'unsigned_long_long_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_long_long_type() + self.unsigned_long_long_type('unsigned_long_long_type_dwarf') - def char_type(self): + def char_type(self, exe_name): """Test that char-type variables are displayed correctly.""" - self.generic_type_tester(set(['char']), quotedDisplay=True) + self.generic_type_tester(exe_name, set(['char']), quotedDisplay=True) - def unsigned_char_type(self): + def unsigned_char_type(self, exe_name): """Test that 'unsigned char'-type variables are displayed correctly.""" - self.generic_type_tester(set(['unsigned', 'char']), quotedDisplay=True) + self.generic_type_tester(exe_name, set(['unsigned', 'char']), quotedDisplay=True) - def short_type(self): + def short_type(self, exe_name): """Test that short-type variables are displayed correctly.""" - self.generic_type_tester(set(['short'])) + self.generic_type_tester(exe_name, set(['short'])) - def unsigned_short_type(self): + def unsigned_short_type(self, exe_name): """Test that 'unsigned short'-type variables are displayed correctly.""" - self.generic_type_tester(set(['unsigned', 'short'])) + self.generic_type_tester(exe_name, set(['unsigned', 'short'])) - def int_type(self): + def int_type(self, exe_name): """Test that int-type variables are displayed correctly.""" - self.generic_type_tester(set(['int'])) + self.generic_type_tester(exe_name, set(['int'])) - def unsigned_int_type(self): + def unsigned_int_type(self, exe_name): """Test that 'unsigned int'-type variables are displayed correctly.""" - self.generic_type_tester(set(['unsigned', 'int'])) + self.generic_type_tester(exe_name, set(['unsigned', 'int'])) - def long_type(self): + def long_type(self, exe_name): """Test that long-type variables are displayed correctly.""" - self.generic_type_tester(set(['long'])) + self.generic_type_tester(exe_name, set(['long'])) - def unsigned_long_type(self): + def unsigned_long_type(self, exe_name): """Test that 'unsigned long'-type variables are displayed correctly.""" - self.generic_type_tester(set(['unsigned', 'long'])) + self.generic_type_tester(exe_name, set(['unsigned', 'long'])) - def long_long_type(self): + def long_long_type(self, exe_name): """Test that long long-type variables are displayed correctly.""" - self.generic_type_tester(set(['long long'])) + self.generic_type_tester(exe_name, set(['long long'])) - def unsigned_long_long_type(self): + def unsigned_long_long_type(self, exe_name): """Test that 'unsigned long long'-type variables are displayed correctly.""" - self.generic_type_tester(set(['unsigned', 'long long'])) + self.generic_type_tester(exe_name, set(['unsigned', 'long long'])) if __name__ == '__main__': Modified: lldb/trunk/test/types/TestIntegerTypesExpr.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/TestIntegerTypesExpr.py?rev=133649&r1=133648&r2=133649&view=diff ============================================================================== --- lldb/trunk/test/types/TestIntegerTypesExpr.py (original) +++ lldb/trunk/test/types/TestIntegerTypesExpr.py Wed Jun 22 16:15:10 2011 @@ -14,122 +14,122 @@ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_char_type_with_dsym(self): """Test that char-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'char.cpp'} + d = {'CXX_SOURCES': 'char.cpp', 'EXE': 'char_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.char_type_expr() + self.char_type_expr('char_type_dsym') def test_char_type_with_dwarf(self): """Test that char-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'char.cpp'} + d = {'CXX_SOURCES': 'char.cpp', 'EXE': 'char_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.char_type_expr() + self.char_type_expr('char_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_char_type_with_dsym(self): """Test that 'unsigned_char'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_char.cpp'} + d = {'CXX_SOURCES': 'unsigned_char.cpp', 'EXE': 'unsigned_char_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_char_type_expr() + self.unsigned_char_type_expr('unsigned_char_type_dsym') def test_unsigned_char_type_with_dwarf(self): """Test that 'unsigned char'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_char.cpp'} + d = {'CXX_SOURCES': 'unsigned_char.cpp', 'EXE': 'unsigned_char_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_char_type_expr() + self.unsigned_char_type_expr('unsigned_char_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_short_type_with_dsym(self): """Test that short-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'short.cpp'} + d = {'CXX_SOURCES': 'short.cpp', 'EXE': 'short_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.short_type_expr() + self.short_type_expr('short_type_dsym') def test_short_type_with_dwarf(self): """Test that short-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'short.cpp'} + d = {'CXX_SOURCES': 'short.cpp', 'EXE': 'short_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.short_type_expr() + self.short_type_expr('short_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_short_type_with_dsym(self): """Test that 'unsigned_short'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_short.cpp'} + d = {'CXX_SOURCES': 'unsigned_short.cpp', 'EXE': 'unsigned_short_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_short_type_expr() + self.unsigned_short_type_expr('unsigned_short_type_dsym') def test_unsigned_short_type_with_dwarf(self): """Test that 'unsigned short'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_short.cpp'} + d = {'CXX_SOURCES': 'unsigned_short.cpp', 'EXE': 'unsigned_short_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_short_type_expr() + self.unsigned_short_type_expr('unsigned_short_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_int_type_with_dsym(self): """Test that int-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'int.cpp'} + d = {'CXX_SOURCES': 'int.cpp', 'EXE': 'int_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.int_type_expr() + self.int_type_expr('int_type_dsym') def test_int_type_with_dwarf(self): """Test that int-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'int.cpp'} + d = {'CXX_SOURCES': 'int.cpp', 'EXE': 'int_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.int_type_expr() + self.int_type_expr('int_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_int_type_with_dsym(self): """Test that 'unsigned_int'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_int.cpp'} + d = {'CXX_SOURCES': 'unsigned_int.cpp', 'EXE': 'unsigned_int_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_int_type_expr() + self.unsigned_int_type_expr('unsigned_int_type_dsym') def test_unsigned_int_type_with_dwarf(self): """Test that 'unsigned int'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_int.cpp'} + d = {'CXX_SOURCES': 'unsigned_int.cpp', 'EXE': 'unsigned_int_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_int_type_expr() + self.unsigned_int_type_expr('unsigned_int_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_long_type_with_dsym(self): """Test that long-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'long.cpp'} + d = {'CXX_SOURCES': 'long.cpp', 'EXE': 'long_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.long_type_expr() + self.long_type_expr('long_type_dsym') def test_long_type_with_dwarf(self): """Test that long-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'long.cpp'} + d = {'CXX_SOURCES': 'long.cpp', 'EXE': 'long_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.long_type_expr() + self.long_type_expr('long_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_long_type_with_dsym(self): """Test that 'unsigned long'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_long.cpp'} + d = {'CXX_SOURCES': 'unsigned_long.cpp', 'EXE': 'unsigned_long_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_long_type_expr() + self.unsigned_long_type_expr('unsigned_long_type_dsym') def test_unsigned_long_type_with_dwarf(self): """Test that 'unsigned long'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_long.cpp'} + d = {'CXX_SOURCES': 'unsigned_long.cpp', 'EXE': 'unsigned_long_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_long_type_expr() + self.unsigned_long_type_expr('unsigned_long_type_dwarf') # rdar://problem/8482903 # test suite failure for types dir -- "long long" and "unsigned long long" @@ -137,72 +137,72 @@ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_long_long_type_with_dsym(self): """Test that 'long long'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'long_long.cpp'} + d = {'CXX_SOURCES': 'long_long.cpp', 'EXE': 'long_long_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.long_long_type_expr() + self.long_long_type_expr('long_long_type_dsym') def test_long_long_type_with_dwarf(self): """Test that 'long long'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'long_long.cpp'} + d = {'CXX_SOURCES': 'long_long.cpp', 'EXE': 'long_long_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.long_long_type_expr() + self.long_long_type_expr('long_long_type_dwarf') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_long_long_type_with_dsym(self): """Test that 'unsigned long long'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_long_long.cpp'} + d = {'CXX_SOURCES': 'unsigned_long_long.cpp', 'EXE': 'unsigned_long_long_type_dsym'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_long_long_type_expr() + self.unsigned_long_long_type_expr('unsigned_long_long_type_dsym') def test_unsigned_long_long_type_with_dwarf(self): """Test that 'unsigned long long'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_long_long.cpp'} + d = {'CXX_SOURCES': 'unsigned_long_long.cpp', 'EXE': 'unsigned_long_long_type_dwarf'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_long_long_type_expr() + self.unsigned_long_long_type_expr('unsigned_long_long_type_dwarf') - def char_type_expr(self): + def char_type_expr(self, exe_name): """Test that char-type variable expressions are evaluated correctly.""" - self.generic_type_expr_tester(set(['char']), quotedDisplay=True) + self.generic_type_expr_tester(exe_name, set(['char']), quotedDisplay=True) - def unsigned_char_type_expr(self): + def unsigned_char_type_expr(self, exe_name): """Test that 'unsigned char'-type variable expressions are evaluated correctly.""" - self.generic_type_expr_tester(set(['unsigned', 'char']), quotedDisplay=True) + self.generic_type_expr_tester(exe_name, set(['unsigned', 'char']), quotedDisplay=True) - def short_type_expr(self): + def short_type_expr(self, exe_name): """Test that short-type variable expressions are evaluated correctly.""" - self.generic_type_expr_tester(set(['short'])) + self.generic_type_expr_tester(exe_name, set(['short'])) - def unsigned_short_type_expr(self): + def unsigned_short_type_expr(self, exe_name): """Test that 'unsigned short'-type variable expressions are evaluated correctly.""" - self.generic_type_expr_tester(set(['unsigned', 'short'])) + self.generic_type_expr_tester(exe_name, set(['unsigned', 'short'])) - def int_type_expr(self): + def int_type_expr(self, exe_name): """Test that int-type variable expressions are evaluated correctly.""" - self.generic_type_expr_tester(set(['int'])) + self.generic_type_expr_tester(exe_name, set(['int'])) - def unsigned_int_type_expr(self): + def unsigned_int_type_expr(self, exe_name): """Test that 'unsigned int'-type variable expressions are evaluated correctly.""" - self.generic_type_expr_tester(set(['unsigned', 'int'])) + self.generic_type_expr_tester(exe_name, set(['unsigned', 'int'])) - def long_type_expr(self): + def long_type_expr(self, exe_name): """Test that long-type variable expressions are evaluated correctly.""" - self.generic_type_expr_tester(set(['long'])) + self.generic_type_expr_tester(exe_name, set(['long'])) - def unsigned_long_type_expr(self): + def unsigned_long_type_expr(self, exe_name): """Test that 'unsigned long'-type variable expressions are evaluated correctly.""" - self.generic_type_expr_tester(set(['unsigned', 'long'])) + self.generic_type_expr_tester(exe_name, set(['unsigned', 'long'])) - def long_long_type_expr(self): + def long_long_type_expr(self, exe_name): """Test that long long-type variable expressions are evaluated correctly.""" - self.generic_type_expr_tester(set(['long long'])) + self.generic_type_expr_tester(exe_name, set(['long long'])) - def unsigned_long_long_type_expr(self): + def unsigned_long_long_type_expr(self, exe_name): """Test that 'unsigned long long'-type variable expressions are evaluated correctly.""" - self.generic_type_expr_tester(set(['unsigned', 'long long'])) + self.generic_type_expr_tester(exe_name, set(['unsigned', 'long long'])) if __name__ == '__main__': From peter at pcc.me.uk Wed Jun 22 17:39:02 2011 From: peter at pcc.me.uk (Peter Collingbourne) Date: Wed, 22 Jun 2011 22:39:02 -0000 Subject: [Lldb-commits] [lldb] r133660 - /lldb/trunk/source/Interpreter/Makefile Message-ID: <20110622223902.EC29F2A6C12C@llvm.org> Author: pcc Date: Wed Jun 22 17:39:02 2011 New Revision: 133660 URL: http://llvm.org/viewvc/llvm-project?rev=133660&view=rev Log: Remove -MT options from SWIG invocation SWIG on Darwin does not support -MT, and it only means that we lose the .d target, which doesn't seem to be used or needed. Pointed out by Charles Davis. 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=133660&r1=133659&r2=133660&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/Makefile (original) +++ lldb/trunk/source/Interpreter/Makefile Wed Jun 22 17:39:02 2011 @@ -32,8 +32,7 @@ LLDB_SWIG_INCLUDE_DIRS += -I"/usr/local/include" LLDB_SWIG_INCLUDE_DIRS += -I"/usr/include" -SWIG_DEPEND_OPTIONS = -MMD -MF "$(PROJ_OBJ_DIR)/$*.cpp.d.tmp" \ - -MT "$*.cpp" -MT "$(PROJ_OBJ_DIR)/$*.cpp.d" +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 From peter at pcc.me.uk Wed Jun 22 17:45:08 2011 From: peter at pcc.me.uk (Peter Collingbourne) Date: Wed, 22 Jun 2011 23:45:08 +0100 Subject: [Lldb-commits] [lldb] r133463 - /lldb/trunk/source/Interpreter/Makefile In-Reply-To: <4E017E26.3070803@mymail.mines.edu> References: <20110620190707.BF3E72A6C12C@llvm.org> <4E017E26.3070803@mymail.mines.edu> Message-ID: <20110622224508.GA22651@pcc.me.uk> On Tue, Jun 21, 2011 at 11:31:18PM -0600, Charles Davis wrote: > On 6/20/11 1:07 PM, Peter Collingbourne wrote: > > Author: pcc > > Date: Mon Jun 20 14:07:07 2011 > > New Revision: 133463 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=133463&view=rev > > Log: > > Add dependency tracking/clean rule to interpreter makefile > Unfortunately, this change doesn't work on Darwin because... > > @@ -32,11 +32,19 @@ > [...] > > +SWIG_DEPEND_OPTIONS = -MMD -MF "$(PROJ_OBJ_DIR)/$*.cpp.d.tmp" \ > > + -MT "$*.cpp" -MT "$(PROJ_OBJ_DIR)/$*.cpp.d" > ...Darwin's swig (as of Snow Leopard) doesn't support -MT. And it's > unlikely ever to, because Apple hates and fears the GPLv3. That's too bad. But it seems that removing the -MT options isn't much of a loss here, as we only lose the .d target, which doesn't seem to be used or needed (I based this part of the Makefile on LLVM's Makefile.rules, and it isn't entirely clear whether the .d target is required there either). I removed -MT in r133660. Thanks, -- Peter From gclayton at apple.com Wed Jun 22 23:25:29 2011 From: gclayton at apple.com (Greg Clayton) Date: Thu, 23 Jun 2011 04:25:29 -0000 Subject: [Lldb-commits] [lldb] r133684 - in /lldb/trunk: include/lldb/Expression/ClangExpressionDeclMap.h source/Expression/ClangExpressionDeclMap.cpp source/Expression/IRForTarget.cpp Message-ID: <20110623042529.9D15E2A6C12C@llvm.org> Author: gclayton Date: Wed Jun 22 23:25:29 2011 New Revision: 133684 URL: http://llvm.org/viewvc/llvm-project?rev=133684&view=rev Log: Fixed an issue for ARM where data symbols would alway return invalid addresses. Modified: lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp lldb/trunk/source/Expression/IRForTarget.cpp Modified: lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h?rev=133684&r1=133683&r2=133684&view=diff ============================================================================== --- lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h (original) +++ lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h Wed Jun 22 23:25:29 2011 @@ -333,20 +333,15 @@ /// @param[in] name /// The name of the symbol. /// - /// @param[out] ptr - /// The absolute address of the function in the target. - /// /// @return - /// True if the address could be retrieved; false otherwise. + /// Valid load address for the symbol //------------------------------------------------------------------ - bool + lldb::addr_t GetSymbolAddress (Target &target, - const ConstString &name, - uint64_t &ptr); + const ConstString &name); - bool - GetSymbolAddress (const ConstString &name, - uint64_t &ptr); + lldb::addr_t + GetSymbolAddress (const ConstString &name); //------------------------------------------------------------------ /// [Used by CommandObjectExpression] Materialize the entire struct Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=133684&r1=133683&r2=133684&view=diff ============================================================================== --- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original) +++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Wed Jun 22 23:25:29 2011 @@ -557,37 +557,65 @@ return true; } -bool -ClangExpressionDeclMap::GetSymbolAddress -( - Target &target, - const ConstString &name, - uint64_t &ptr -) +addr_t +ClangExpressionDeclMap::GetSymbolAddress (Target &target, const ConstString &name) { SymbolContextList sc_list; target.GetImages().FindSymbolsWithNameAndType(name, eSymbolTypeAny, sc_list); - if (!sc_list.GetSize()) - return false; - - SymbolContext sym_ctx; - sc_list.GetContextAtIndex(0, sym_ctx); - - const Address *sym_address = &sym_ctx.symbol->GetAddressRangeRef().GetBaseAddress(); + const uint32_t num_matches = sc_list.GetSize(); + addr_t symbol_load_addr = LLDB_INVALID_ADDRESS; + + for (uint32_t i=0; iGetCallableLoadAddress(&target); + const Address *sym_address = &sym_ctx.symbol->GetAddressRangeRef().GetBaseAddress(); + if (sym_address) + { + switch (sym_ctx.symbol->GetType()) + { + case eSymbolTypeCode: + case eSymbolTypeTrampoline: + symbol_load_addr = sym_address->GetCallableLoadAddress (&target); + break; + + case eSymbolTypeData: + case eSymbolTypeRuntime: + case eSymbolTypeVariable: + case eSymbolTypeLocal: + case eSymbolTypeParam: + case eSymbolTypeInvalid: + case eSymbolTypeAbsolute: + case eSymbolTypeExtern: + case eSymbolTypeException: + case eSymbolTypeSourceFile: + case eSymbolTypeHeaderFile: + case eSymbolTypeObjectFile: + case eSymbolTypeCommonBlock: + case eSymbolTypeBlock: + case eSymbolTypeVariableType: + case eSymbolTypeLineEntry: + case eSymbolTypeLineHeader: + case eSymbolTypeScopeBegin: + case eSymbolTypeScopeEnd: + case eSymbolTypeAdditional: + case eSymbolTypeCompiler: + case eSymbolTypeInstrumentation: + case eSymbolTypeUndefined: + symbol_load_addr = sym_address->GetLoadAddress (&target); + break; + } + } + } - return true; + return symbol_load_addr; } -bool -ClangExpressionDeclMap::GetSymbolAddress -( - const ConstString &name, - uint64_t &ptr -) +addr_t +ClangExpressionDeclMap::GetSymbolAddress (const ConstString &name) { assert (m_parser_vars.get()); @@ -595,9 +623,7 @@ !m_parser_vars->m_exe_ctx->target) return false; - return GetSymbolAddress(*m_parser_vars->m_exe_ctx->target, - name, - ptr); + return GetSymbolAddress(*m_parser_vars->m_exe_ctx->target, name); } // Interface for CommandObjectExpression @@ -1238,9 +1264,9 @@ { location_value.reset(new Value); - uint64_t location_load_addr; + addr_t location_load_addr = GetSymbolAddress(*exe_ctx.target, name); - if (!GetSymbolAddress(*exe_ctx.target, name, location_load_addr)) + if (location_load_addr == LLDB_INVALID_ADDRESS) { if (log) err.SetErrorStringWithFormat ("Couldn't find value for global symbol %s", Modified: lldb/trunk/source/Expression/IRForTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRForTarget.cpp?rev=133684&r1=133683&r2=133684&view=diff ============================================================================== --- lldb/trunk/source/Expression/IRForTarget.cpp (original) +++ lldb/trunk/source/Expression/IRForTarget.cpp Wed Jun 22 23:25:29 2011 @@ -1327,9 +1327,9 @@ lldb_private::ConstString name(symbol->getName().str().c_str()); - uint64_t symbol_addr; + lldb::addr_t symbol_addr = m_decl_map->GetSymbolAddress (name); - if (!m_decl_map->GetSymbolAddress (name, symbol_addr)) + if (symbol_addr == LLDB_INVALID_ADDRESS) { if (log) log->Printf ("Symbol \"%s\" had no address", name.GetCString()); From cdavis at mines.edu Thu Jun 23 00:40:38 2011 From: cdavis at mines.edu (Charles Davis) Date: Thu, 23 Jun 2011 05:40:38 -0000 Subject: [Lldb-commits] [lldb] r133689 - /lldb/trunk/source/Interpreter/Makefile Message-ID: <20110623054038.3977F2A6C12C@llvm.org> Author: cdavis Date: Thu Jun 23 00:40:38 2011 New Revision: 133689 URL: http://llvm.org/viewvc/llvm-project?rev=133689&view=rev Log: When installing the Python modules: - Respect DESTDIR. - Use the realpath function on the path before prepending DESTDIR. - Don't depend on liblldb.{so,dylib} being installed already. - Don't put the DESTDIR into the _lldb.so symlink. Patch by Elias Pipping! 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=133689&r1=133688&r2=133689&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/Makefile (original) +++ lldb/trunk/source/Interpreter/Makefile Thu Jun 23 00:40:38 2011 @@ -18,13 +18,13 @@ PYTHON_DIR := $(ToolDir) ifeq ($(HOST_OS),Darwin) -PYTHON_DEST_DIR := /Library/Python/$(shell python -c 'import sys; print sys.version[:3]')/site-packages +PYTHON_DEST_DIR := $(DESTDIR)/$(call realpath /Library/Python/$(shell python -c 'import sys; print sys.version[:3]')/site-packages) else -PYTHON_DEST_DIR := $(shell python -c 'import sys; print sys.exec_prefix')/lib/python$(shell python -c 'import sys; print sys.version[:3]')/site-packages +PYTHON_DEST_DIR := $(DESTDIR)/$(call realpath $(shell python -c 'import sys; print sys.exec_prefix')/lib/python$(shell python -c 'import sys; print sys.version[:3]')/site-packages) endif LLDB_SWIG_INCLUDE_DIRS:= -I"$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/include" -I./. LIBLLDB := $(LibDir)/liblldb$(SHLIBEXT) -DEST_LIBLLDB := $(DESTDIR)$(PROJ_libdir)/liblldb$(SHLIBEXT) +INST_LIBLLDB := $(PROJ_libdir)/liblldb$(SHLIBEXT) # We need Swig to process stdint.h, but by default it will not inspect system # include directories. The following should cover the standard locations on @@ -55,13 +55,13 @@ $(Verb) $(RM) -f $(PYTHON_DIR)/_lldb.so $(Verb) $(AliasTool) $(LIBLLDB) $(PYTHON_DIR)/_lldb.so -install-local:: $(PYTHON_DIR)/lldb.py $(PYTHON_DIR)/embedded_interpreter.py $(DEST_LIBLLDB) +install-local:: $(PYTHON_DIR)/lldb.py $(PYTHON_DIR)/embedded_interpreter.py $(Echo) Installing $(BuildMode) LLDB python modules $(Verb) $(MKDIR) $(PYTHON_DEST_DIR)/lib-dynload $(Verb) $(DataInstall) $(PYTHON_DIR)/lldb.py $(PYTHON_DEST_DIR)/lldb.py $(Verb) $(DataInstall) $(PYTHON_DIR)/embedded_interpreter.py $(PYTHON_DEST_DIR)/embedded_interpreter.py $(Verb) $(RM) -f $(PYTHON_DEST_DIR)/lib-dynload/_lldb.so - $(Verb) $(AliasTool) $(DEST_LIBLLDB) $(PYTHON_DEST_DIR)/lib-dynload/_lldb.so + $(Verb) $(AliasTool) $(INST_LIBLLDB) $(PYTHON_DEST_DIR)/lib-dynload/_lldb.so clean-local:: $(Verb) $(RM) -f LLDBWrapPython.cpp $(PYTHON_DIR)/_lldb.so \ From vasil.georgiev.vasilev at cern.ch Thu Jun 23 01:46:50 2011 From: vasil.georgiev.vasilev at cern.ch (Vassil Vassilev) Date: Thu, 23 Jun 2011 08:46:50 +0200 Subject: [Lldb-commits] Hi All! In-Reply-To: <4DF22EFC.3040307@cern.ch> References: <4DF22EFC.3040307@cern.ch> Message-ID: <4E02E15A.5060603@cern.ch> Bump... On 06/10/2011 04:49 PM, Vassil Vassilev wrote: > Hi, > Can I say Hi to lldb community with the attached patch. > I saw that lldb didn't have doxygen documentation on the website and > decided to see what I could do. Recently I did that for cling so I've > made few changes to adapt it for lldb. It is customization of clang's > approach of generating documentation. Be careful it's slow and space > consuming ;) > There are few warnings given by doxygen parser (it claims that it > doesn't recognize the tags /bfalse and /btrue) > If you want you can give it a try and if it needs some more tweaking > I can do it. > > Vassil > > > _______________________________________________ > lldb-commits mailing list > lldb-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/lldb-commits/attachments/20110623/a1cd67c0/attachment.html From gclayton at apple.com Thu Jun 23 12:59:56 2011 From: gclayton at apple.com (Greg Clayton) Date: Thu, 23 Jun 2011 17:59:56 -0000 Subject: [Lldb-commits] [lldb] r133728 - in /lldb/trunk: include/lldb/Core/Debugger.h include/lldb/Core/FormatManager.h include/lldb/Symbol/ClangASTType.h lldb.xcodeproj/project.pbxproj source/Commands/CommandObjectType.cpp source/Commands/CommandObjectType.h source/Core/Debugger.cpp source/Core/FormatManager.cpp source/Interpreter/Args.cpp source/Interpreter/CommandInterpreter.cpp source/Symbol/ClangASTType.cpp Message-ID: <20110623175956.C6B0D2A6C12C@llvm.org> Author: gclayton Date: Thu Jun 23 12:59:56 2011 New Revision: 133728 URL: http://llvm.org/viewvc/llvm-project?rev=133728&view=rev Log: Committing type format code for Enrico Granata. This commit adds a new top level command named "type". Currently this command implements three commands: type format add [ ...] type format delete [ ...] type format list [ [] ...] This allows you to specify the default format that will be used to display types when you use "frame variable" or "expression", or the SBValue classes. Examples: // Format uint*_t as hex type format add x uint16_t uint32_t uint64_t // Format intptr_t as a pointer type format add p intptr_t The format characters are the same as "printf" for the most part with many additions. These format character specifiers are also used in many other commands ("frame variable" for one). The current list of format characters include: a - char buffer b - binary B - boolean c - char C - printable char d - signed decimal e - float f - float g - float i - signed decimal I - complex integer o - octal O - OSType p - pointer s - c-string u - unsigned decimal x - hex X - complex float y - bytes Y - bytes with ASCII Added: lldb/trunk/include/lldb/Core/FormatManager.h lldb/trunk/source/Commands/CommandObjectType.cpp lldb/trunk/source/Commands/CommandObjectType.h lldb/trunk/source/Core/FormatManager.cpp Modified: lldb/trunk/include/lldb/Core/Debugger.h lldb/trunk/include/lldb/Symbol/ClangASTType.h lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/source/Core/Debugger.cpp lldb/trunk/source/Interpreter/Args.cpp lldb/trunk/source/Interpreter/CommandInterpreter.cpp lldb/trunk/source/Symbol/ClangASTType.cpp Modified: lldb/trunk/include/lldb/Core/Debugger.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=133728&r1=133727&r2=133728&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/Debugger.h (original) +++ lldb/trunk/include/lldb/Core/Debugger.h Thu Jun 23 12:59:56 2011 @@ -17,7 +17,9 @@ #include +#include "lldb/lldb-public.h" #include "lldb/Core/Communication.h" +#include "lldb/Core/FormatManager.h" #include "lldb/Core/InputReaderStack.h" #include "lldb/Core/Listener.h" #include "lldb/Core/StreamFile.h" @@ -468,6 +470,20 @@ Debugger (); DISALLOW_COPY_AND_ASSIGN (Debugger); + +public: + + static bool + GetFormatForType (const ConstString &type, lldb::Format& format, bool& cascade); + + static void + AddFormatForType (const ConstString &type, lldb::Format format, bool cascade); + + static bool + DeleteFormatForType (const ConstString &type); + + static void + LoopThroughFormatList (FormatCallback cback, void* param); }; } // namespace lldb_private Added: lldb/trunk/include/lldb/Core/FormatManager.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatManager.h?rev=133728&view=auto ============================================================================== --- lldb/trunk/include/lldb/Core/FormatManager.h (added) +++ lldb/trunk/include/lldb/Core/FormatManager.h Thu Jun 23 12:59:56 2011 @@ -0,0 +1,91 @@ +//===-- FormatManager.h -------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef lldb_FormatManager_h_ +#define lldb_FormatManager_h_ + +// C Includes + +#include +#include + +// C++ Includes + +#ifdef __GNUC__ +#include + +namespace std +{ + using namespace __gnu_cxx; +} + +#else +#include +#endif + +#include +#include + +// Other libraries and framework includes +// Project includes +#include "lldb/lldb-public.h" +#include "lldb-enumerations.h" + +#include "lldb/Core/Communication.h" +#include "lldb/Core/InputReaderStack.h" +#include "lldb/Core/Listener.h" +#include "lldb/Core/Stream.h" +#include "lldb/Core/StreamFile.h" +#include "lldb/Core/SourceManager.h" +#include "lldb/Core/UserID.h" +#include "lldb/Core/UserSettingsController.h" +#include "lldb/Target/ExecutionContext.h" +#include "lldb/Target/Platform.h" +#include "lldb/Target/TargetList.h" + +namespace lldb_private { + + struct compareFormatMapKeys { + bool operator()(const char* k1, const char* k2) { + //return strcmp(k1,k2) == 0; + return (k1 == k2); + } + }; + + typedef struct format_entry_t { + lldb::Format FormatStyle; + bool Cascades; + format_entry_t(lldb::Format fmt) : FormatStyle(fmt), Cascades(false) {} + format_entry_t(lldb::Format fmt, bool csc) : FormatStyle(fmt), Cascades(csc) {} + format_entry_t() : FormatStyle((lldb::Format)0), Cascades(false) {} //eFormatDefault + } FormatEntry; + + typedef std::map FormatMap; + typedef FormatMap::iterator FormatIterator; + + typedef bool(*FormatCallback)(void*, const char*, lldb::Format, bool); + +class FormatManager +{ +public: + + FormatManager() : m_format_map(FormatMap()), m_format_map_mutex(Mutex::eMutexTypeRecursive) {} + bool GetFormatForType (const ConstString &type, lldb::Format& format, bool& cascade); + void AddFormatForType (const ConstString &type, lldb::Format format, bool cascade); + bool DeleteFormatForType (const ConstString &type); + void LoopThroughFormatList (FormatCallback cback, void* param); + +private: + FormatMap m_format_map; + Mutex m_format_map_mutex; +}; + +} // namespace lldb_private + +#endif // lldb_FormatManager_h_ Modified: lldb/trunk/include/lldb/Symbol/ClangASTType.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTType.h?rev=133728&r1=133727&r2=133728&view=diff ============================================================================== --- lldb/trunk/include/lldb/Symbol/ClangASTType.h (original) +++ lldb/trunk/include/lldb/Symbol/ClangASTType.h Thu Jun 23 12:59:56 2011 @@ -74,6 +74,9 @@ static ConstString GetClangTypeName (lldb::clang_type_t clang_type); + static ConstString + GetClangTypeName (clang::QualType qual_type); + uint32_t GetClangTypeBitWidth (); Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=133728&r1=133727&r2=133728&view=diff ============================================================================== --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Jun 23 12:59:56 2011 @@ -399,6 +399,8 @@ 4C74CB6312288704006A8171 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C74CB6212288704006A8171 /* Carbon.framework */; }; 4CABA9E0134A8BCD00539BDD /* ValueObjectMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CABA9DF134A8BCD00539BDD /* ValueObjectMemory.cpp */; }; 4CD0BD0F134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CD0BD0E134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp */; }; + 9415F61813B2C0EF00A52B36 /* FormatManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9415F61713B2C0EF00A52B36 /* FormatManager.cpp */; }; + 9463D4CD13B1798800C230D4 /* CommandObjectType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9463D4CC13B1798800C230D4 /* CommandObjectType.cpp */; }; 9A19A6AF1163BBB200E0D453 /* SBValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A19A6A51163BB7E00E0D453 /* SBValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9A19A6B01163BBB300E0D453 /* SBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A19A6AD1163BB9800E0D453 /* SBValue.cpp */; }; 9A22A161135E30370024DDC3 /* EmulateInstructionARM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A22A15D135E30370024DDC3 /* EmulateInstructionARM.cpp */; }; @@ -1156,6 +1158,10 @@ 69A01E1E1236C5D400C660B5 /* Mutex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Mutex.cpp; sourceTree = ""; }; 69A01E1F1236C5D400C660B5 /* Symbols.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Symbols.cpp; sourceTree = ""; }; 69A01E201236C5D400C660B5 /* TimeValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimeValue.cpp; sourceTree = ""; }; + 9415F61613B2C0DC00A52B36 /* FormatManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatManager.h; path = include/lldb/Core/FormatManager.h; sourceTree = ""; }; + 9415F61713B2C0EF00A52B36 /* FormatManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormatManager.cpp; path = source/Core/FormatManager.cpp; sourceTree = ""; }; + 9463D4CC13B1798800C230D4 /* CommandObjectType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectType.cpp; path = source/Commands/CommandObjectType.cpp; sourceTree = ""; }; + 9463D4CE13B179A500C230D4 /* CommandObjectType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandObjectType.h; path = source/Commands/CommandObjectType.h; sourceTree = ""; }; 961FABB81235DE1600F93A47 /* FuncUnwinders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FuncUnwinders.cpp; path = source/Symbol/FuncUnwinders.cpp; sourceTree = ""; }; 961FABB91235DE1600F93A47 /* UnwindPlan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnwindPlan.cpp; path = source/Symbol/UnwindPlan.cpp; sourceTree = ""; }; 961FABBA1235DE1600F93A47 /* UnwindTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnwindTable.cpp; path = source/Symbol/UnwindTable.cpp; sourceTree = ""; }; @@ -1899,6 +1905,8 @@ 26BC7D6310F1B77400F91463 /* FileSpecList.h */, 26BC7E7B10F1B85900F91463 /* FileSpecList.cpp */, 26BC7D6410F1B77400F91463 /* Flags.h */, + 9415F61613B2C0DC00A52B36 /* FormatManager.h */, + 9415F61713B2C0EF00A52B36 /* FormatManager.cpp */, 26F7305F139D8FC900FD51C7 /* History.h */, 26F73061139D8FDB00FD51C7 /* History.cpp */, 9AA69DBB118A029E00D753A0 /* InputReader.h */, @@ -2132,6 +2140,8 @@ 269416AD119A024800FF2715 /* CommandObjectTarget.cpp */, 26BC7D2D10F1B76300F91463 /* CommandObjectThread.h */, 26BC7E4610F1B84700F91463 /* CommandObjectThread.cpp */, + 9463D4CE13B179A500C230D4 /* CommandObjectType.h */, + 9463D4CC13B1798800C230D4 /* CommandObjectType.cpp */, B296983512C2FB2B002D92C3 /* CommandObjectVersion.h */, B296983412C2FB2B002D92C3 /* CommandObjectVersion.cpp */, ); @@ -3221,6 +3231,8 @@ 9A9E1EFF1398086D005AC039 /* InputReaderStack.cpp in Sources */, B28058A1139988B0002D96D0 /* InferiorCallPOSIX.cpp in Sources */, 26F73062139D8FDB00FD51C7 /* History.cpp in Sources */, + 9463D4CD13B1798800C230D4 /* CommandObjectType.cpp in Sources */, + 9415F61813B2C0EF00A52B36 /* FormatManager.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; Added: lldb/trunk/source/Commands/CommandObjectType.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=133728&view=auto ============================================================================== --- lldb/trunk/source/Commands/CommandObjectType.cpp (added) +++ lldb/trunk/source/Commands/CommandObjectType.cpp Thu Jun 23 12:59:56 2011 @@ -0,0 +1,415 @@ +//===-- CommandObjectType.cpp ----------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "CommandObjectType.h" + +// C Includes +// C++ Includes + +#include "lldb/Core/ConstString.h" +#include "lldb/Core/Debugger.h" +#include "lldb/Interpreter/CommandInterpreter.h" +#include "lldb/Interpreter/CommandObject.h" +#include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/Options.h" + +using namespace lldb; +using namespace lldb_private; + +//------------------------------------------------------------------------- +// CommandObjectTypeAdd +//------------------------------------------------------------------------- + +class CommandObjectTypeAdd : public CommandObject +{ + +private: + + class CommandOptions : public Options + { + public: + + CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter) + { + } + + virtual + ~CommandOptions (){} + + virtual Error + SetOptionValue (uint32_t option_idx, const char *option_arg) + { + Error error; + char short_option = (char) m_getopt_table[option_idx].val; + bool success; + + switch (short_option) + { + case 'c': + m_cascade = Args::StringToBoolean(option_arg, true, &success); + if (!success) + error.SetErrorStringWithFormat("Invalid value for cascade: %s.\n", option_arg); + break; + default: + error.SetErrorStringWithFormat ("Unrecognized option '%c'.\n", short_option); + break; + } + + return error; + } + + void + OptionParsingStarting () + { + m_cascade = true; + } + + 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 m_cascade; + }; + + CommandOptions m_options; + + virtual Options * + GetOptions () + { + return &m_options; + } + +public: + CommandObjectTypeAdd (CommandInterpreter &interpreter) : + CommandObject (interpreter, + "type format add", + "Add a new formatting style for a type.", + NULL), m_options (interpreter) + { + CommandArgumentEntry format_arg; + CommandArgumentData format_style_arg; + CommandArgumentEntry type_arg; + CommandArgumentData type_style_arg; + + format_style_arg.arg_type = eArgTypeFormat; + format_style_arg.arg_repetition = eArgRepeatPlain; + + type_style_arg.arg_type = eArgTypeName; + type_style_arg.arg_repetition = eArgRepeatPlus; + + format_arg.push_back (format_style_arg); + type_arg.push_back (type_style_arg); + + m_arguments.push_back (format_arg); + m_arguments.push_back (type_arg); + } + + ~CommandObjectTypeAdd () + { + } + + bool + Execute (Args& command, CommandReturnObject &result) + { + const size_t argc = command.GetArgumentCount(); + + if (argc < 2) + { + result.AppendErrorWithFormat ("%s takes two or more args.\n", m_cmd_name.c_str()); + result.SetStatus(eReturnStatusFailed); + return false; + } + + const char* formatA = command.GetArgumentAtIndex(0); + ConstString formatCS(formatA); + const char* formatU = formatCS.GetCString(); + lldb::Format format; + uint32_t byte_size_ptr; + Error fmt_error = Args::StringToFormat(formatU, format, &byte_size_ptr); + + if(fmt_error.Fail()) { + result.AppendError(fmt_error.AsCString()); + result.SetStatus(eReturnStatusFailed); + return false; + } + + // now I have a valid format, let's add it to every type + + for(int i = 1; i < argc; i++) { + const char* typeA = command.GetArgumentAtIndex(i); + ConstString typeCS(typeA); + Debugger::AddFormatForType(typeCS, format, m_options.m_cascade); + } + + + return result.Succeeded(); + } + +}; + +OptionDefinition +CommandObjectTypeAdd::CommandOptions::g_option_table[] = +{ + { LLDB_OPT_SET_ALL, false, "cascade", 'c', required_argument, NULL, 0, eArgTypeBoolean, "If true, cascade to derived typedefs."}, + { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL } +}; + + +//------------------------------------------------------------------------- +// CommandObjectTypeDelete +//------------------------------------------------------------------------- + +class CommandObjectTypeDelete : public CommandObject +{ +public: + CommandObjectTypeDelete (CommandInterpreter &interpreter) : + CommandObject (interpreter, + "type format delete", + "Delete an existing formatting style for a type.", + NULL) + { + CommandArgumentEntry type_arg; + CommandArgumentData type_style_arg; + + type_style_arg.arg_type = eArgTypeName; + type_style_arg.arg_repetition = eArgRepeatPlain; + + type_arg.push_back (type_style_arg); + + m_arguments.push_back (type_arg); + + } + + ~CommandObjectTypeDelete () + { + } + + bool + Execute (Args& command, CommandReturnObject &result) + { + const size_t argc = command.GetArgumentCount(); + + if (argc != 1) + { + result.AppendErrorWithFormat ("%s takes 1 arg.\n", m_cmd_name.c_str()); + result.SetStatus(eReturnStatusFailed); + return false; + } + + const char* typeA = command.GetArgumentAtIndex(0); + ConstString typeCS(typeA); + + if(Debugger::DeleteFormatForType(typeCS)) + return result.Succeeded(); + else + { + result.AppendErrorWithFormat ("no custom format for %s.\n", typeA); + result.SetStatus(eReturnStatusFailed); + return false; + } + + } + +}; + +//------------------------------------------------------------------------- +// CommandObjectTypeList +//------------------------------------------------------------------------- + +bool CommandObjectTypeList_LoopCallback(void* pt2self, const char* type, lldb::Format format, bool cascade); + +class CommandObjectTypeList; + +struct CommandObjectTypeList_LoopCallbackParam { + CommandObjectTypeList* self; + CommandReturnObject* result; + RegularExpression* regex; + CommandObjectTypeList_LoopCallbackParam(CommandObjectTypeList* S, CommandReturnObject* R, + RegularExpression* X = NULL) : self(S), result(R), regex(X) {} +}; + +class CommandObjectTypeList : public CommandObject +{ +public: + CommandObjectTypeList (CommandInterpreter &interpreter) : + CommandObject (interpreter, + "type format list", + "Show a list of current formatting styles.", + NULL) + { + CommandArgumentEntry type_arg; + CommandArgumentData type_style_arg; + + type_style_arg.arg_type = eArgTypeName; + type_style_arg.arg_repetition = eArgRepeatOptional; + + type_arg.push_back (type_style_arg); + + m_arguments.push_back (type_arg); + } + + ~CommandObjectTypeList () + { + } + + bool + Execute (Args& command, CommandReturnObject &result) + { + const size_t argc = command.GetArgumentCount(); + + CommandObjectTypeList_LoopCallbackParam *param; + + if (argc == 1) { + RegularExpression* regex = new RegularExpression(command.GetArgumentAtIndex(0)); + regex->Compile(command.GetArgumentAtIndex(0)); + param = new CommandObjectTypeList_LoopCallbackParam(this,&result,regex); + } + else + param = new CommandObjectTypeList_LoopCallbackParam(this,&result); + Debugger::LoopThroughFormatList(CommandObjectTypeList_LoopCallback, param); + delete param; + return result.Succeeded(); + } + +private: + + bool + LoopCallback ( + const char* type, + lldb::Format format, + bool cascade, + RegularExpression* regex, + CommandReturnObject *result + ) + { + if(regex && !regex->Execute(type)) return true; + Stream &ostrm = result->GetOutputStream(); + ostrm.Printf("(%s) %scascading ",type, cascade ? "" : "not "); + switch(format) { + case eFormatBytes: + ostrm.Printf("y\n"); + break; + case eFormatBytesWithASCII: + ostrm.Printf("Y\n"); + break; + case eFormatBinary: + ostrm.Printf("b\n"); + break; + case eFormatBoolean: + ostrm.Printf("B\n"); + break; + case eFormatCharArray: + ostrm.Printf("a\n"); + break; + case eFormatChar: + ostrm.Printf("c\n"); + break; + case eFormatCharPrintable: + ostrm.Printf("C\n"); + break; + case eFormatOctal: + ostrm.Printf("o\n"); + break; + case eFormatOSType: + ostrm.Printf("O\n"); + break; + case eFormatDecimal: + ostrm.Printf("i or d\n"); + break; + case eFormatComplexInteger: + ostrm.Printf("I\n"); + break; + case eFormatUnsigned: + ostrm.Printf("u\n"); + break; + case eFormatHex: + ostrm.Printf("x\n"); + break; + case eFormatComplex: + ostrm.Printf("X\n"); + break; + case eFormatFloat: + ostrm.Printf("f e or g\n"); + break; + case eFormatPointer: + ostrm.Printf("p\n"); + break; + case eFormatCString: + ostrm.Printf("s\n"); + break; + default: + ostrm.Printf("other\n"); + break; + } + return true; + } + + friend bool CommandObjectTypeList_LoopCallback(void* pt2self, const char* type, lldb::Format format, bool cascade); + +}; + +bool +CommandObjectTypeList_LoopCallback ( + void* pt2self, + const char* type, + lldb::Format format, + bool cascade) +{ + CommandObjectTypeList_LoopCallbackParam* param = (CommandObjectTypeList_LoopCallbackParam*)pt2self; + return param->self->LoopCallback(type, format, cascade, param->regex, param->result); +} + +class CommandObjectTypeFormat : public CommandObjectMultiword +{ +public: + CommandObjectTypeFormat (CommandInterpreter &interpreter) : + CommandObjectMultiword (interpreter, + "type format", + "A set of commands for editing variable display options", + "type format [] ") + { + LoadSubCommand ("add", CommandObjectSP (new CommandObjectTypeAdd (interpreter))); + LoadSubCommand ("delete", CommandObjectSP (new CommandObjectTypeDelete (interpreter))); + LoadSubCommand ("list", CommandObjectSP (new CommandObjectTypeList (interpreter))); + } + + + ~CommandObjectTypeFormat () + { + } +}; + +//------------------------------------------------------------------------- +// CommandObjectType +//------------------------------------------------------------------------- + +CommandObjectType::CommandObjectType (CommandInterpreter &interpreter) : + CommandObjectMultiword (interpreter, + "type", + "A set of commands for operating on the type system", + "type []") +{ + LoadSubCommand ("format", CommandObjectSP (new CommandObjectTypeFormat (interpreter))); +} + + +CommandObjectType::~CommandObjectType () +{ +} + + Added: lldb/trunk/source/Commands/CommandObjectType.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.h?rev=133728&view=auto ============================================================================== --- lldb/trunk/source/Commands/CommandObjectType.h (added) +++ lldb/trunk/source/Commands/CommandObjectType.h Thu Jun 23 12:59:56 2011 @@ -0,0 +1,42 @@ +//===-- CommandObjectType.h ------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef liblldb_CommandObjectType_h_ +#define liblldb_CommandObjectType_h_ + +// C Includes +// C++ Includes + + +// Other libraries and framework includes +// Project includes + +#include "lldb/lldb-types.h" +#include "lldb/Interpreter/CommandObjectMultiword.h" + +namespace lldb_private { + +//------------------------------------------------------------------------- +// CommandObjectMultiwordBreakpoint +//------------------------------------------------------------------------- + +class CommandObjectType : public CommandObjectMultiword +{ +public: + CommandObjectType (CommandInterpreter &interpreter); + + virtual + ~CommandObjectType (); +}; + + + +} // namespace lldb_private + +#endif // liblldb_CommandObjectType_h_ Modified: lldb/trunk/source/Core/Debugger.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=133728&r1=133727&r2=133728&view=diff ============================================================================== --- lldb/trunk/source/Core/Debugger.cpp (original) +++ lldb/trunk/source/Core/Debugger.cpp Thu Jun 23 12:59:56 2011 @@ -7,9 +7,13 @@ // //===----------------------------------------------------------------------===// +#include "lldb/Core/Debugger.h" + +#include + #include "lldb/lldb-private.h" #include "lldb/Core/ConnectionFileDescriptor.h" -#include "lldb/Core/Debugger.h" +#include "lldb/Core/FormatManager.h" #include "lldb/Core/InputReader.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Core/State.h" @@ -1309,6 +1313,37 @@ return success; } + +static FormatManager& +GetFormatManager() { + static FormatManager g_format_manager; + return g_format_manager; +} + +bool +Debugger::GetFormatForType (const ConstString &type, lldb::Format& format, bool& cascade) +{ + return GetFormatManager().GetFormatForType(type, format, cascade); +} + +void +Debugger::AddFormatForType (const ConstString &type, lldb::Format format, bool cascade) +{ + GetFormatManager().AddFormatForType(type,format, cascade); +} + +bool +Debugger::DeleteFormatForType (const ConstString &type) +{ + return GetFormatManager().DeleteFormatForType(type); +} + +void +Debugger::LoopThroughFormatList (FormatCallback cback, void* param) +{ + return GetFormatManager().LoopThroughFormatList(cback, param); +} + #pragma mark Debugger::SettingsController //-------------------------------------------------- Added: lldb/trunk/source/Core/FormatManager.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatManager.cpp?rev=133728&view=auto ============================================================================== --- lldb/trunk/source/Core/FormatManager.cpp (added) +++ lldb/trunk/source/Core/FormatManager.cpp Thu Jun 23 12:59:56 2011 @@ -0,0 +1,69 @@ +//===-- FormatManager.cpp -------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "lldb/Core/FormatManager.h" + +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes + +using namespace lldb; +using namespace lldb_private; + +bool FormatManager::GetFormatForType (const ConstString &type, lldb::Format& format, bool& cascade) +{ + Mutex::Locker locker (m_format_map_mutex); + FormatMap& fmtmap = m_format_map; + FormatMap::iterator iter = fmtmap.find(type.GetCString()); + if(iter == fmtmap.end()) + return false; + else { + format = iter->second.FormatStyle; + cascade = iter->second.Cascades; + return true; + } +} + +void FormatManager::AddFormatForType (const ConstString &type, lldb::Format format, bool cascade) +{ + format_entry_t entry(format, cascade); + Mutex::Locker locker (m_format_map_mutex); + FormatMap& fmtmap = m_format_map; + fmtmap[type.GetCString()] = entry; +} + +bool FormatManager::DeleteFormatForType (const ConstString &type) +{ + Mutex::Locker locker (m_format_map_mutex); + FormatMap& fmtmap = m_format_map; + const char* typeCS = type.GetCString(); + FormatMap::iterator iter = fmtmap.find(typeCS); + if (iter == fmtmap.end()) + return false; + else { + fmtmap.erase(typeCS); + return true; + } +} + +void FormatManager::LoopThroughFormatList (FormatCallback cback, void* param) +{ + Mutex::Locker locker (m_format_map_mutex); + FormatMap& fmtmap = m_format_map; + FormatIterator iter = fmtmap.begin(); + while(iter != fmtmap.end()) { + const char* type = iter->first; + lldb::Format format = iter->second.FormatStyle; + bool cascade = iter->second.Cascades; + if(!cback(param, type,format, cascade)) break; + iter++; + } +} + Modified: lldb/trunk/source/Interpreter/Args.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=133728&r1=133727&r2=133728&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/Args.cpp (original) +++ lldb/trunk/source/Interpreter/Args.cpp Thu Jun 23 12:59:56 2011 @@ -941,7 +941,7 @@ " f - float\n" " g - float\n" " i - signed decimal\n" - " i - complex integer\n" + " I - complex integer\n" " o - octal\n" " O - OSType\n" " p - pointer\n" Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=133728&r1=133727&r2=133728&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original) +++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Thu Jun 23 12:59:56 2011 @@ -13,13 +13,14 @@ #include #include +#include "CommandObjectScript.h" +#include "CommandObjectRegexCommand.h" + #include "../Commands/CommandObjectApropos.h" #include "../Commands/CommandObjectArgs.h" #include "../Commands/CommandObjectBreakpoint.h" -//#include "../Commands/CommandObjectCall.h" #include "../Commands/CommandObjectDisassemble.h" #include "../Commands/CommandObjectExpression.h" -//#include "../Commands/CommandObjectFile.h" #include "../Commands/CommandObjectFrame.h" #include "../Commands/CommandObjectHelp.h" #include "../Commands/CommandObjectLog.h" @@ -27,15 +28,14 @@ #include "../Commands/CommandObjectPlatform.h" #include "../Commands/CommandObjectProcess.h" #include "../Commands/CommandObjectQuit.h" -#include "lldb/Interpreter/CommandObjectRegexCommand.h" #include "../Commands/CommandObjectRegister.h" -#include "CommandObjectScript.h" #include "../Commands/CommandObjectSettings.h" #include "../Commands/CommandObjectSource.h" #include "../Commands/CommandObjectCommands.h" #include "../Commands/CommandObjectSyntax.h" #include "../Commands/CommandObjectTarget.h" #include "../Commands/CommandObjectThread.h" +#include "../Commands/CommandObjectType.h" #include "../Commands/CommandObjectVersion.h" #include "lldb/Interpreter/Args.h" @@ -261,6 +261,7 @@ m_command_dict["source"] = CommandObjectSP (new CommandObjectMultiwordSource (*this)); m_command_dict["target"] = CommandObjectSP (new CommandObjectMultiwordTarget (*this)); m_command_dict["thread"] = CommandObjectSP (new CommandObjectMultiwordThread (*this)); + m_command_dict["type"] = CommandObjectSP (new CommandObjectType (*this)); m_command_dict["version"] = CommandObjectSP (new CommandObjectVersion (*this)); std::auto_ptr Modified: lldb/trunk/source/Symbol/ClangASTType.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=133728&r1=133727&r2=133728&view=diff ============================================================================== --- lldb/trunk/source/Symbol/ClangASTType.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTType.cpp Thu Jun 23 12:59:56 2011 @@ -16,6 +16,7 @@ #include "clang/AST/DeclObjC.h" #include "clang/AST/DeclGroup.h" #include "clang/AST/RecordLayout.h" +#include "clang/AST/Type.h" #include "clang/Basic/Builtins.h" #include "clang/Basic/IdentifierTable.h" @@ -36,6 +37,9 @@ #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Process.h" + +#include "Debugger.h" + using namespace lldb; using namespace lldb_private; @@ -55,22 +59,9 @@ ConstString clang_type_name; if (clang_type) { - clang::QualType qual_type(clang::QualType::getFromOpaquePtr(clang_type)); - - const clang::TypedefType *typedef_type = qual_type->getAs(); - if (typedef_type) - { - const clang::TypedefNameDecl *typedef_decl = typedef_type->getDecl(); - std::string clang_typedef_name (typedef_decl->getQualifiedNameAsString()); - if (!clang_typedef_name.empty()) - clang_type_name.SetCString (clang_typedef_name.c_str()); - } - else - { - std::string type_name(qual_type.getAsString()); - if (!type_name.empty()) - clang_type_name.SetCString (type_name.c_str()); - } + clang::QualType qual_type(clang::QualType::getFromOpaquePtr(clang_type)); + return GetClangTypeName(qual_type); + } else { @@ -80,6 +71,26 @@ return clang_type_name; } +ConstString +ClangASTType::GetClangTypeName (clang::QualType qual_type) +{ + ConstString clang_type_name; + const clang::TypedefType *typedef_type = qual_type->getAs(); + if (typedef_type) + { + const clang::TypedefNameDecl *typedef_decl = typedef_type->getDecl(); + std::string clang_typedef_name (typedef_decl->getQualifiedNameAsString()); + if (!clang_typedef_name.empty()) + clang_type_name.SetCString (clang_typedef_name.c_str()); + } + else + { + std::string type_name(qual_type.getAsString()); + if (!type_name.empty()) + clang_type_name.SetCString (type_name.c_str()); + } + return clang_type_name; +} clang_type_t ClangASTType::GetPointeeType () @@ -237,8 +248,25 @@ lldb::Format ClangASTType::GetFormat (clang_type_t clang_type) { + // first of all, check for a valid format for this type itself clang::QualType qual_type(clang::QualType::getFromOpaquePtr(clang_type)); - + lldb::Format format; + bool cascade; + if(Debugger::GetFormatForType(GetClangTypeName(qual_type), format, cascade)) + return format; // return it if found + + // here, I know this type does not have a direct format. two things can happen: + // 1) this is a typedef - I expand this to its parent type and look there + // 2) this is not a typedef - I use the default formatting options + const clang::TypedefType *typedef_type = qual_type->getAs(); + while (typedef_type) { + qual_type = typedef_type->getDecl()->getUnderlyingType(); + std::string name = qual_type.getAsString(); + if(Debugger::GetFormatForType(GetClangTypeName(qual_type), format, cascade) && cascade) // if I have a cascading format... + return format; // ...use it + typedef_type = qual_type->getAs(); // try to expand another level + } + switch (qual_type->getTypeClass()) { case clang::Type::FunctionNoProto: From gclayton at apple.com Thu Jun 23 13:38:25 2011 From: gclayton at apple.com (Greg Clayton) Date: Thu, 23 Jun 2011 18:38:25 -0000 Subject: [Lldb-commits] [lldb] r133743 - in /lldb/trunk: include/lldb/Core/ValueObject.h source/Core/ValueObject.cpp Message-ID: <20110623183825.8A9DD2A6C12D@llvm.org> Author: gclayton Date: Thu Jun 23 13:38:25 2011 New Revision: 133743 URL: http://llvm.org/viewvc/llvm-project?rev=133743&view=rev Log: Another patch from Enrico Granata. Added a fix for where you might have already displayed something with a given type, then did a "type format add ...", then you display the type again. This patch will figure out that the format changed and allow us to display the type with the correct new format. Modified: lldb/trunk/include/lldb/Core/ValueObject.h lldb/trunk/source/Core/ValueObject.cpp Modified: lldb/trunk/include/lldb/Core/ValueObject.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=133743&r1=133742&r2=133743&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/ValueObject.h (original) +++ lldb/trunk/include/lldb/Core/ValueObject.h Thu Jun 23 13:38:25 2011 @@ -505,6 +505,7 @@ ValueObject *m_deref_valobj; lldb::Format m_format; + lldb::Format m_last_format; bool m_value_is_valid:1, m_value_did_change:1, m_children_count_valid:1, Modified: lldb/trunk/source/Core/ValueObject.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=133743&r1=133742&r2=133743&view=diff ============================================================================== --- lldb/trunk/source/Core/ValueObject.cpp (original) +++ lldb/trunk/source/Core/ValueObject.cpp Thu Jun 23 13:38:25 2011 @@ -661,6 +661,23 @@ { if (UpdateValueIfNeeded()) { + /* + this is a quick fix for the case in which we display a variable, then change its format with + type format add and the old display string keeps showing until one steps through the code + */ + { + const Value::ContextType context_type = m_value.GetContextType(); + switch (context_type) + { + case Value::eContextTypeClangType: + case Value::eContextTypeLLDBType: + case Value::eContextTypeVariable: + Format format = GetFormat(); + if (format != m_last_format) + m_value_str.clear(); + break; + } + } if (m_value_str.empty()) { const Value::ContextType context_type = m_value.GetContextType(); @@ -682,7 +699,7 @@ if (ClangASTType::DumpTypeValue (GetClangAST(), // The clang AST clang_type, // The clang type to display &sstr, - format, // Format to display this type with + m_last_format = format, // Format to display this type with m_data, // Data to extract from 0, // Byte offset into "m_data" GetByteSize(), // Byte size of item in "m_data" From cdavis at mines.edu Thu Jun 23 13:47:17 2011 From: cdavis at mines.edu (Charles Davis) Date: Thu, 23 Jun 2011 18:47:17 -0000 Subject: [Lldb-commits] [lldb] r133744 - /lldb/trunk/source/Interpreter/Makefile Message-ID: <20110623184717.9398C2A6C12C@llvm.org> Author: cdavis Date: Thu Jun 23 13:47:17 2011 New Revision: 133744 URL: http://llvm.org/viewvc/llvm-project?rev=133744&view=rev Log: Fix typo spotted by Elias Pipping. 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=133744&r1=133743&r2=133744&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/Makefile (original) +++ lldb/trunk/source/Interpreter/Makefile Thu Jun 23 13:47:17 2011 @@ -18,9 +18,9 @@ PYTHON_DIR := $(ToolDir) ifeq ($(HOST_OS),Darwin) -PYTHON_DEST_DIR := $(DESTDIR)/$(call realpath /Library/Python/$(shell python -c 'import sys; print sys.version[:3]')/site-packages) +PYTHON_DEST_DIR := $(DESTDIR)/$(call realpath,/Library/Python/$(shell python -c 'import sys; print sys.version[:3]')/site-packages) else -PYTHON_DEST_DIR := $(DESTDIR)/$(call realpath $(shell python -c 'import sys; print sys.exec_prefix')/lib/python$(shell python -c 'import sys; print sys.version[:3]')/site-packages) +PYTHON_DEST_DIR := $(DESTDIR)/$(call realpath,$(shell python -c 'import sys; print sys.exec_prefix')/lib/python$(shell python -c 'import sys; print sys.version[:3]')/site-packages) endif LLDB_SWIG_INCLUDE_DIRS:= -I"$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/include" -I./. LIBLLDB := $(LibDir)/liblldb$(SHLIBEXT) From johnny.chen at apple.com Thu Jun 23 15:10:24 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Thu, 23 Jun 2011 20:10:24 -0000 Subject: [Lldb-commits] [lldb] r133749 - in /lldb/trunk/test/types: AbstractBase.py TestFloatTypes.py TestFloatTypesExpr.py TestIntegerTypes.py TestIntegerTypesExpr.py Message-ID: <20110623201024.167272A6C12C@llvm.org> Author: johnny Date: Thu Jun 23 15:10:23 2011 New Revision: 133749 URL: http://llvm.org/viewvc/llvm-project?rev=133749&view=rev Log: Refactorings of the test/types directory to more elegantly express the uniqueness of executable names given to each test method. Modified: lldb/trunk/test/types/AbstractBase.py lldb/trunk/test/types/TestFloatTypes.py lldb/trunk/test/types/TestFloatTypesExpr.py lldb/trunk/test/types/TestIntegerTypes.py lldb/trunk/test/types/TestIntegerTypesExpr.py Modified: lldb/trunk/test/types/AbstractBase.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/AbstractBase.py?rev=133749&r1=133748&r2=133749&view=diff ============================================================================== --- lldb/trunk/test/types/AbstractBase.py (original) +++ lldb/trunk/test/types/AbstractBase.py Thu Jun 23 15:10:23 2011 @@ -20,6 +20,15 @@ # Assert message. DATA_TYPE_GROKKED = "Data type from expr parser output is parsed correctly" + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + # We'll use the test method name as the exe_name. + # There are a bunch of test cases under test/types and we don't want the + # module cacheing subsystem to be confused with executable name "a.out" + # used for all the test cases. + self.exe_name = self._testMethodName + def generic_type_tester(self, exe_name, atoms, quotedDisplay=False): """Test that variables with basic types are displayed correctly.""" Modified: lldb/trunk/test/types/TestFloatTypes.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/TestFloatTypes.py?rev=133749&r1=133748&r2=133749&view=diff ============================================================================== --- lldb/trunk/test/types/TestFloatTypes.py (original) +++ lldb/trunk/test/types/TestFloatTypes.py Thu Jun 23 15:10:23 2011 @@ -14,32 +14,32 @@ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_float_type_with_dsym(self): """Test that float-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'float.cpp', 'EXE': 'float_type_dsym'} + d = {'CXX_SOURCES': 'float.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.float_type('float_type_dsym') + self.float_type(self.exe_name) def test_float_type_with_dwarf(self): """Test that float-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'float.cpp', 'EXE': 'float_type_dwarf'} + d = {'CXX_SOURCES': 'float.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.float_type('float_type_dwarf') + self.float_type(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_double_type_with_dsym(self): """Test that double-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'double.cpp', 'EXE': 'double_type_dsym'} + d = {'CXX_SOURCES': 'double.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.double_type('double_type_dsym') + self.double_type(self.exe_name) def test_double_type_with_dwarf(self): """Test that double-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'double.cpp', 'EXE': 'double_type_dwarf'} + d = {'CXX_SOURCES': 'double.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.double_type('double_type_dwarf') + self.double_type(self.exe_name) def float_type(self, exe_name): """Test that float-type variables are displayed correctly.""" Modified: lldb/trunk/test/types/TestFloatTypesExpr.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/TestFloatTypesExpr.py?rev=133749&r1=133748&r2=133749&view=diff ============================================================================== --- lldb/trunk/test/types/TestFloatTypesExpr.py (original) +++ lldb/trunk/test/types/TestFloatTypesExpr.py Thu Jun 23 15:10:23 2011 @@ -17,32 +17,32 @@ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_float_type_with_dsym(self): """Test that float-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'float.cpp', 'EXE': 'float_type_dsym'} + d = {'CXX_SOURCES': 'float.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.float_type_expr('float_type_dsym') + self.float_type_expr(self.exe_name) def test_float_type_with_dwarf(self): """Test that float-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'float.cpp', 'EXE': 'float_type_dwarf'} + d = {'CXX_SOURCES': 'float.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.float_type_expr('float_type_dwarf') + self.float_type_expr(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_double_type_with_dsym(self): """Test that double-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'double.cpp', 'EXE': 'double_type_dsym'} + d = {'CXX_SOURCES': 'double.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.double_type_expr('double_type_dsym') + self.double_type_expr(self.exe_name) def test_double_type_with_dwarf(self): """Test that double-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'double.cpp', 'EXE': 'double_type_dwarf'} + d = {'CXX_SOURCES': 'double.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.double_type_expr('double_type_dwarf') + self.double_type_expr(self.exe_name) def float_type_expr(self, exe_name): """Test that float-type variable expressions are evaluated correctly.""" Modified: lldb/trunk/test/types/TestIntegerTypes.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/TestIntegerTypes.py?rev=133749&r1=133748&r2=133749&view=diff ============================================================================== --- lldb/trunk/test/types/TestIntegerTypes.py (original) +++ lldb/trunk/test/types/TestIntegerTypes.py Thu Jun 23 15:10:23 2011 @@ -14,122 +14,122 @@ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_char_type_with_dsym(self): """Test that char-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'char.cpp', 'EXE': 'char_type_dsym'} + d = {'CXX_SOURCES': 'char.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.char_type('char_type_dsym') + self.char_type(self.exe_name) def test_char_type_with_dwarf(self): """Test that char-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'char.cpp', 'EXE': 'char_type_dwarf'} + d = {'CXX_SOURCES': 'char.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.char_type('char_type_dwarf') + self.char_type(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_char_type_with_dsym(self): """Test that 'unsigned_char'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_char.cpp', 'EXE': 'unsigned_char_type_dsym'} + d = {'CXX_SOURCES': 'unsigned_char.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_char_type('unsigned_char_type_dsym') + self.unsigned_char_type(self.exe_name) def test_unsigned_char_type_with_dwarf(self): """Test that 'unsigned char'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_char.cpp', 'EXE': 'unsigned_char_type_dwarf'} + d = {'CXX_SOURCES': 'unsigned_char.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_char_type('unsigned_char_type_dwarf') + self.unsigned_char_type(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_short_type_with_dsym(self): """Test that short-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'short.cpp', 'EXE': 'short_type_dsym'} + d = {'CXX_SOURCES': 'short.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.short_type('short_type_dsym') + self.short_type(self.exe_name) def test_short_type_with_dwarf(self): """Test that short-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'short.cpp', 'EXE': 'short_type_dwarf'} + d = {'CXX_SOURCES': 'short.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.short_type('short_type_dwarf') + self.short_type(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_short_type_with_dsym(self): """Test that 'unsigned_short'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_short.cpp', 'EXE': 'unsigned_short_type_dsym'} + d = {'CXX_SOURCES': 'unsigned_short.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_short_type('unsigned_short_type_dsym') + self.unsigned_short_type(self.exe_name) def test_unsigned_short_type_with_dwarf(self): """Test that 'unsigned short'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_short.cpp', 'EXE': 'unsigned_short_type_dwarf'} + d = {'CXX_SOURCES': 'unsigned_short.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_short_type('unsigned_short_type_dwarf') + self.unsigned_short_type(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_int_type_with_dsym(self): """Test that int-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'int.cpp', 'EXE': 'int_type_dsym'} + d = {'CXX_SOURCES': 'int.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.int_type('int_type_dsym') + self.int_type(self.exe_name) def test_int_type_with_dwarf(self): """Test that int-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'int.cpp', 'EXE': 'int_type_dwarf'} + d = {'CXX_SOURCES': 'int.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.int_type('int_type_dwarf') + self.int_type(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_int_type_with_dsym(self): """Test that 'unsigned_int'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_int.cpp', 'EXE': 'unsigned_int_type_dsym'} + d = {'CXX_SOURCES': 'unsigned_int.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_int_type('unsigned_int_type_dsym') + self.unsigned_int_type(self.exe_name) def test_unsigned_int_type_with_dwarf(self): """Test that 'unsigned int'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_int.cpp', 'EXE': 'unsigned_int_type_dwarf'} + d = {'CXX_SOURCES': 'unsigned_int.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_int_type('unsigned_int_type_dwarf') + self.unsigned_int_type(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_long_type_with_dsym(self): """Test that long-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'long.cpp', 'EXE': 'long_type_dsym'} + d = {'CXX_SOURCES': 'long.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.long_type('long_type_dsym') + self.long_type(self.exe_name) def test_long_type_with_dwarf(self): """Test that long-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'long.cpp', 'EXE': 'long_type_dwarf'} + d = {'CXX_SOURCES': 'long.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.long_type('long_type_dwarf') + self.long_type(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_long_type_with_dsym(self): """Test that 'unsigned long'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_long.cpp', 'EXE': 'unsigned_long_type_dsym'} + d = {'CXX_SOURCES': 'unsigned_long.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_long_type('unsigned_long_type_dsym') + self.unsigned_long_type(self.exe_name) def test_unsigned_long_type_with_dwarf(self): """Test that 'unsigned long'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_long.cpp', 'EXE': 'unsigned_long_type_dwarf'} + d = {'CXX_SOURCES': 'unsigned_long.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_long_type('unsigned_long_type_dwarf') + self.unsigned_long_type(self.exe_name) # rdar://problem/8482903 # test suite failure for types dir -- "long long" and "unsigned long long" @@ -137,32 +137,32 @@ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_long_long_type_with_dsym(self): """Test that 'long long'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'long_long.cpp', 'EXE': 'long_long_type_dsym'} + d = {'CXX_SOURCES': 'long_long.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.long_long_type('long_long_type_dsym') + self.long_long_type(self.exe_name) def test_long_long_type_with_dwarf(self): """Test that 'long long'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'long_long.cpp', 'EXE': 'long_long_type_dwarf'} + d = {'CXX_SOURCES': 'long_long.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.long_long_type('long_long_type_dwarf') + self.long_long_type(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_long_long_type_with_dsym(self): """Test that 'unsigned long long'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_long_long.cpp', 'EXE': 'unsigned_long_long_type_dsym'} + d = {'CXX_SOURCES': 'unsigned_long_long.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_long_long_type('unsigned_long_long_type_dsym') + self.unsigned_long_long_type(self.exe_name) def test_unsigned_long_long_type_with_dwarf(self): """Test that 'unsigned long long'-type variables are displayed correctly.""" - d = {'CXX_SOURCES': 'unsigned_long_long.cpp', 'EXE': 'unsigned_long_long_type_dwarf'} + d = {'CXX_SOURCES': 'unsigned_long_long.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_long_long_type('unsigned_long_long_type_dwarf') + self.unsigned_long_long_type(self.exe_name) def char_type(self, exe_name): """Test that char-type variables are displayed correctly.""" Modified: lldb/trunk/test/types/TestIntegerTypesExpr.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/TestIntegerTypesExpr.py?rev=133749&r1=133748&r2=133749&view=diff ============================================================================== --- lldb/trunk/test/types/TestIntegerTypesExpr.py (original) +++ lldb/trunk/test/types/TestIntegerTypesExpr.py Thu Jun 23 15:10:23 2011 @@ -14,122 +14,122 @@ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_char_type_with_dsym(self): """Test that char-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'char.cpp', 'EXE': 'char_type_dsym'} + d = {'CXX_SOURCES': 'char.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.char_type_expr('char_type_dsym') + self.char_type_expr(self.exe_name) def test_char_type_with_dwarf(self): """Test that char-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'char.cpp', 'EXE': 'char_type_dwarf'} + d = {'CXX_SOURCES': 'char.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.char_type_expr('char_type_dwarf') + self.char_type_expr(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_char_type_with_dsym(self): """Test that 'unsigned_char'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_char.cpp', 'EXE': 'unsigned_char_type_dsym'} + d = {'CXX_SOURCES': 'unsigned_char.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_char_type_expr('unsigned_char_type_dsym') + self.unsigned_char_type_expr(self.exe_name) def test_unsigned_char_type_with_dwarf(self): """Test that 'unsigned char'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_char.cpp', 'EXE': 'unsigned_char_type_dwarf'} + d = {'CXX_SOURCES': 'unsigned_char.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_char_type_expr('unsigned_char_type_dwarf') + self.unsigned_char_type_expr(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_short_type_with_dsym(self): """Test that short-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'short.cpp', 'EXE': 'short_type_dsym'} + d = {'CXX_SOURCES': 'short.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.short_type_expr('short_type_dsym') + self.short_type_expr(self.exe_name) def test_short_type_with_dwarf(self): """Test that short-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'short.cpp', 'EXE': 'short_type_dwarf'} + d = {'CXX_SOURCES': 'short.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.short_type_expr('short_type_dwarf') + self.short_type_expr(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_short_type_with_dsym(self): """Test that 'unsigned_short'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_short.cpp', 'EXE': 'unsigned_short_type_dsym'} + d = {'CXX_SOURCES': 'unsigned_short.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_short_type_expr('unsigned_short_type_dsym') + self.unsigned_short_type_expr(self.exe_name) def test_unsigned_short_type_with_dwarf(self): """Test that 'unsigned short'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_short.cpp', 'EXE': 'unsigned_short_type_dwarf'} + d = {'CXX_SOURCES': 'unsigned_short.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_short_type_expr('unsigned_short_type_dwarf') + self.unsigned_short_type_expr(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_int_type_with_dsym(self): """Test that int-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'int.cpp', 'EXE': 'int_type_dsym'} + d = {'CXX_SOURCES': 'int.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.int_type_expr('int_type_dsym') + self.int_type_expr(self.exe_name) def test_int_type_with_dwarf(self): """Test that int-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'int.cpp', 'EXE': 'int_type_dwarf'} + d = {'CXX_SOURCES': 'int.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.int_type_expr('int_type_dwarf') + self.int_type_expr(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_int_type_with_dsym(self): """Test that 'unsigned_int'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_int.cpp', 'EXE': 'unsigned_int_type_dsym'} + d = {'CXX_SOURCES': 'unsigned_int.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_int_type_expr('unsigned_int_type_dsym') + self.unsigned_int_type_expr(self.exe_name) def test_unsigned_int_type_with_dwarf(self): """Test that 'unsigned int'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_int.cpp', 'EXE': 'unsigned_int_type_dwarf'} + d = {'CXX_SOURCES': 'unsigned_int.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_int_type_expr('unsigned_int_type_dwarf') + self.unsigned_int_type_expr(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_long_type_with_dsym(self): """Test that long-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'long.cpp', 'EXE': 'long_type_dsym'} + d = {'CXX_SOURCES': 'long.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.long_type_expr('long_type_dsym') + self.long_type_expr(self.exe_name) def test_long_type_with_dwarf(self): """Test that long-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'long.cpp', 'EXE': 'long_type_dwarf'} + d = {'CXX_SOURCES': 'long.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.long_type_expr('long_type_dwarf') + self.long_type_expr(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_long_type_with_dsym(self): """Test that 'unsigned long'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_long.cpp', 'EXE': 'unsigned_long_type_dsym'} + d = {'CXX_SOURCES': 'unsigned_long.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_long_type_expr('unsigned_long_type_dsym') + self.unsigned_long_type_expr(self.exe_name) def test_unsigned_long_type_with_dwarf(self): """Test that 'unsigned long'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_long.cpp', 'EXE': 'unsigned_long_type_dwarf'} + d = {'CXX_SOURCES': 'unsigned_long.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_long_type_expr('unsigned_long_type_dwarf') + self.unsigned_long_type_expr(self.exe_name) # rdar://problem/8482903 # test suite failure for types dir -- "long long" and "unsigned long long" @@ -137,32 +137,32 @@ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_long_long_type_with_dsym(self): """Test that 'long long'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'long_long.cpp', 'EXE': 'long_long_type_dsym'} + d = {'CXX_SOURCES': 'long_long.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.long_long_type_expr('long_long_type_dsym') + self.long_long_type_expr(self.exe_name) def test_long_long_type_with_dwarf(self): """Test that 'long long'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'long_long.cpp', 'EXE': 'long_long_type_dwarf'} + d = {'CXX_SOURCES': 'long_long.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.long_long_type_expr('long_long_type_dwarf') + self.long_long_type_expr(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_unsigned_long_long_type_with_dsym(self): """Test that 'unsigned long long'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_long_long.cpp', 'EXE': 'unsigned_long_long_type_dsym'} + d = {'CXX_SOURCES': 'unsigned_long_long.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_long_long_type_expr('unsigned_long_long_type_dsym') + self.unsigned_long_long_type_expr(self.exe_name) def test_unsigned_long_long_type_with_dwarf(self): """Test that 'unsigned long long'-type variable expressions are evaluated correctly.""" - d = {'CXX_SOURCES': 'unsigned_long_long.cpp', 'EXE': 'unsigned_long_long_type_dwarf'} + d = {'CXX_SOURCES': 'unsigned_long_long.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.unsigned_long_long_type_expr('unsigned_long_long_type_dwarf') + self.unsigned_long_long_type_expr(self.exe_name) def char_type_expr(self, exe_name): """Test that char-type variable expressions are evaluated correctly.""" From peter at pcc.me.uk Thu Jun 23 15:37:26 2011 From: peter at pcc.me.uk (Peter Collingbourne) Date: Thu, 23 Jun 2011 20:37:26 -0000 Subject: [Lldb-commits] [lldb] r133755 - in /lldb/trunk: include/lldb/Core/FormatManager.h source/Interpreter/CommandInterpreter.cpp source/Symbol/ClangASTType.cpp Message-ID: <20110623203726.322612A6C12C@llvm.org> Author: pcc Date: Thu Jun 23 15:37:26 2011 New Revision: 133755 URL: http://llvm.org/viewvc/llvm-project?rev=133755&view=rev Log: Fix header paths Modified: lldb/trunk/include/lldb/Core/FormatManager.h lldb/trunk/source/Interpreter/CommandInterpreter.cpp lldb/trunk/source/Symbol/ClangASTType.cpp Modified: lldb/trunk/include/lldb/Core/FormatManager.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatManager.h?rev=133755&r1=133754&r2=133755&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/FormatManager.h (original) +++ lldb/trunk/include/lldb/Core/FormatManager.h Thu Jun 23 15:37:26 2011 @@ -35,7 +35,7 @@ // Other libraries and framework includes // Project includes #include "lldb/lldb-public.h" -#include "lldb-enumerations.h" +#include "lldb/lldb-enumerations.h" #include "lldb/Core/Communication.h" #include "lldb/Core/InputReaderStack.h" Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=133755&r1=133754&r2=133755&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original) +++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Thu Jun 23 15:37:26 2011 @@ -14,7 +14,7 @@ #include #include "CommandObjectScript.h" -#include "CommandObjectRegexCommand.h" +#include "lldb/Interpreter/CommandObjectRegexCommand.h" #include "../Commands/CommandObjectApropos.h" #include "../Commands/CommandObjectArgs.h" Modified: lldb/trunk/source/Symbol/ClangASTType.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=133755&r1=133754&r2=133755&view=diff ============================================================================== --- lldb/trunk/source/Symbol/ClangASTType.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTType.cpp Thu Jun 23 15:37:26 2011 @@ -30,6 +30,7 @@ #include "lldb/Core/ConstString.h" #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataExtractor.h" +#include "lldb/Core/Debugger.h" #include "lldb/Core/Scalar.h" #include "lldb/Core/Stream.h" #include "lldb/Core/StreamString.h" @@ -38,8 +39,6 @@ #include "lldb/Target/Process.h" -#include "Debugger.h" - using namespace lldb; using namespace lldb_private; From johnny.chen at apple.com Thu Jun 23 16:22:01 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Thu, 23 Jun 2011 21:22:01 -0000 Subject: [Lldb-commits] [lldb] r133764 - /lldb/trunk/test/python_api/thread/TestThreadAPI.py Message-ID: <20110623212201.C2C272A6C12C@llvm.org> Author: johnny Date: Thu Jun 23 16:22:01 2011 New Revision: 133764 URL: http://llvm.org/viewvc/llvm-project?rev=133764&view=rev Log: For now, use 'b.out' compiled from main2.cpp as the executable name for test_run_to_address_with_dsym/dwarf() to distinguish between other test cases which use 'a.out' compiled from main.cpp. Modified: lldb/trunk/test/python_api/thread/TestThreadAPI.py Modified: lldb/trunk/test/python_api/thread/TestThreadAPI.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/thread/TestThreadAPI.py?rev=133764&r1=133763&r2=133764&view=diff ============================================================================== --- lldb/trunk/test/python_api/thread/TestThreadAPI.py (original) +++ lldb/trunk/test/python_api/thread/TestThreadAPI.py Thu Jun 23 16:22:01 2011 @@ -43,19 +43,19 @@ def test_run_to_address_with_dsym(self): """Test Python SBThread.RunToAddress() API.""" # We build a different executable than the default buildDwarf() does. - d = {'CXX_SOURCES': 'main2.cpp'} + d = {'CXX_SOURCES': 'main2.cpp', 'EXE': 'b.out'} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.run_to_address() + self.run_to_address('b.out') @python_api_test def test_run_to_address_with_dwarf(self): """Test Python SBThread.RunToAddress() API.""" # We build a different executable than the default buildDwarf() does. - d = {'CXX_SOURCES': 'main2.cpp'} + d = {'CXX_SOURCES': 'main2.cpp', 'EXE': 'b.out'} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.run_to_address() + self.run_to_address('b.out') @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") @python_api_test @@ -220,14 +220,9 @@ self.assertTrue(thread.GetStopReason() == lldb.eStopReasonPlanComplete) self.assertTrue(lineEntry.GetLine() == self.line3) - def run_to_address(self): + def run_to_address(self, exe_name): """Test Python SBThread.RunToAddress() API.""" - # We build a different executable than the default buildDwarf() does. - d = {'CXX_SOURCES': 'main2.cpp'} - self.buildDwarf(dictionary=d) - self.setTearDownCleanup(dictionary=d) - - exe = os.path.join(os.getcwd(), "a.out") + exe = os.path.join(os.getcwd(), exe_name) target = self.dbg.CreateTarget(exe) self.assertTrue(target, VALID_TARGET) From gclayton at apple.com Thu Jun 23 16:22:24 2011 From: gclayton at apple.com (Greg Clayton) Date: Thu, 23 Jun 2011 21:22:24 -0000 Subject: [Lldb-commits] [lldb] r133765 - in /lldb/trunk: include/lldb/Core/Debugger.h include/lldb/Core/FormatManager.h include/lldb/Core/State.h include/lldb/lldb-enumerations.h source/Commands/CommandObjectMemory.cpp source/Commands/CommandObjectType.cpp source/Core/Debugger.cpp source/Core/FormatManager.cpp source/Core/State.cpp source/Core/ValueObject.cpp source/Interpreter/Args.cpp source/Interpreter/NamedOptionValue.cpp Message-ID: <20110623212224.8B5DA2A6C12C@llvm.org> Author: gclayton Date: Thu Jun 23 16:22:24 2011 New Revision: 133765 URL: http://llvm.org/viewvc/llvm-project?rev=133765&view=rev Log: Centralized all of the format to c-string and to format character code inside the FormatManager class. Modified the format arguments in any commands to be able to use a single character format, or a full format name, or a partial format name if no full format names match. Modified any code that was displaying formats to use the new FormatManager calls so that our help text and errors never get out of date. Modified the display of the "type format list" command to be a bit more human readable by showing the format as a format string rather than the single character format char. Modified: lldb/trunk/include/lldb/Core/Debugger.h lldb/trunk/include/lldb/Core/FormatManager.h lldb/trunk/include/lldb/Core/State.h lldb/trunk/include/lldb/lldb-enumerations.h lldb/trunk/source/Commands/CommandObjectMemory.cpp lldb/trunk/source/Commands/CommandObjectType.cpp lldb/trunk/source/Core/Debugger.cpp lldb/trunk/source/Core/FormatManager.cpp lldb/trunk/source/Core/State.cpp lldb/trunk/source/Core/ValueObject.cpp lldb/trunk/source/Interpreter/Args.cpp lldb/trunk/source/Interpreter/NamedOptionValue.cpp Modified: lldb/trunk/include/lldb/Core/Debugger.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=133765&r1=133764&r2=133765&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/Debugger.h (original) +++ lldb/trunk/include/lldb/Core/Debugger.h Thu Jun 23 16:22:24 2011 @@ -483,7 +483,8 @@ DeleteFormatForType (const ConstString &type); static void - LoopThroughFormatList (FormatCallback cback, void* param); + LoopThroughFormatList (FormatManager::Callback callback, + void* callback_baton); }; } // namespace lldb_private Modified: lldb/trunk/include/lldb/Core/FormatManager.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatManager.h?rev=133765&r1=133764&r2=133765&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/FormatManager.h (original) +++ lldb/trunk/include/lldb/Core/FormatManager.h Thu Jun 23 16:22:24 2011 @@ -51,37 +51,57 @@ namespace lldb_private { - struct compareFormatMapKeys { - bool operator()(const char* k1, const char* k2) { - //return strcmp(k1,k2) == 0; - return (k1 == k2); - } - }; - - typedef struct format_entry_t { - lldb::Format FormatStyle; - bool Cascades; - format_entry_t(lldb::Format fmt) : FormatStyle(fmt), Cascades(false) {} - format_entry_t(lldb::Format fmt, bool csc) : FormatStyle(fmt), Cascades(csc) {} - format_entry_t() : FormatStyle((lldb::Format)0), Cascades(false) {} //eFormatDefault - } FormatEntry; - - typedef std::map FormatMap; - typedef FormatMap::iterator FormatIterator; - - typedef bool(*FormatCallback)(void*, const char*, lldb::Format, bool); class FormatManager { public: - - FormatManager() : m_format_map(FormatMap()), m_format_map_mutex(Mutex::eMutexTypeRecursive) {} - bool GetFormatForType (const ConstString &type, lldb::Format& format, bool& cascade); - void AddFormatForType (const ConstString &type, lldb::Format format, bool cascade); - bool DeleteFormatForType (const ConstString &type); - void LoopThroughFormatList (FormatCallback cback, void* param); + + typedef bool(*Callback)(void*, const char*, lldb::Format, bool); + + FormatManager() : + m_format_map(FormatMap()), + m_format_map_mutex(Mutex::eMutexTypeRecursive) + { + } + + bool + GetFormatForType (const ConstString &type, lldb::Format& format, bool& cascade); + + void + AddFormatForType (const ConstString &type, lldb::Format format, bool cascade); + + bool + DeleteFormatForType (const ConstString &type); + + void + LoopThroughFormatList (Callback cback, void* param); + + static bool + GetFormatFromCString (const char *format_cstr, + bool partial_match_ok, + lldb::Format &format); + + static char + GetFormatAsFormatChar (lldb::Format format); + + static const char * + GetFormatAsCString (lldb::Format format); private: + struct Entry + { + lldb::Format format; + bool cascades; + Entry (lldb::Format f = lldb::eFormatInvalid, bool c = false) : + format (f), + cascades (c) + { + } + }; + + typedef std::map FormatMap; + typedef FormatMap::iterator FormatIterator; + FormatMap m_format_map; Mutex m_format_map_mutex; }; Modified: lldb/trunk/include/lldb/Core/State.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/State.h?rev=133765&r1=133764&r2=133765&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/State.h (original) +++ lldb/trunk/include/lldb/Core/State.h Thu Jun 23 16:22:24 2011 @@ -37,9 +37,6 @@ bool StateIsStoppedState (lldb::StateType state); - -const char * -GetFormatAsCString (lldb::Format format); const char * GetPermissionsAsCString (uint32_t permissions); Modified: lldb/trunk/include/lldb/lldb-enumerations.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-enumerations.h?rev=133765&r1=133764&r2=133765&view=diff ============================================================================== --- lldb/trunk/include/lldb/lldb-enumerations.h (original) +++ lldb/trunk/include/lldb/lldb-enumerations.h Thu Jun 23 16:22:24 2011 @@ -92,7 +92,6 @@ eFormatBytesWithASCII, eFormatChar, eFormatCharPrintable, // Only printable characters, space if not printable - eFormatCharArray, // Print characters with no single quotes, used for character arrays that can contain non printable characters eFormatComplex, // Floating point complex type eFormatComplexFloat = eFormatComplex, eFormatCString, // NULL terminated C strings @@ -118,8 +117,9 @@ eFormatVectorOfFloat32, eFormatVectorOfFloat64, eFormatVectorOfUInt128, - eFormatComplexInteger // Integer complex type - + eFormatComplexInteger, // Integer complex type + eFormatCharArray, // Print characters with no single quotes, used for character arrays that can contain non printable characters + kNumFormats } Format; //---------------------------------------------------------------------- Modified: lldb/trunk/source/Commands/CommandObjectMemory.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMemory.cpp?rev=133765&r1=133764&r2=133765&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectMemory.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectMemory.cpp Thu Jun 23 16:22:24 2011 @@ -988,6 +988,7 @@ switch (m_options.m_format) { + case kNumFormats: case eFormatFloat: // TODO: add support for floats soon case eFormatCharPrintable: case eFormatBytesWithASCII: Modified: lldb/trunk/source/Commands/CommandObjectType.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=133765&r1=133764&r2=133765&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectType.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectType.cpp Thu Jun 23 16:22:24 2011 @@ -14,6 +14,8 @@ #include "lldb/Core/ConstString.h" #include "lldb/Core/Debugger.h" +#include "lldb/Core/FormatManager.h" +#include "lldb/Core/State.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandObject.h" #include "lldb/Interpreter/CommandReturnObject.h" @@ -135,15 +137,13 @@ return false; } - const char* formatA = command.GetArgumentAtIndex(0); - ConstString formatCS(formatA); - const char* formatU = formatCS.GetCString(); + const char* format_cstr = command.GetArgumentAtIndex(0); lldb::Format format; - uint32_t byte_size_ptr; - Error fmt_error = Args::StringToFormat(formatU, format, &byte_size_ptr); + Error error = Args::StringToFormat(format_cstr, format, NULL); - if(fmt_error.Fail()) { - result.AppendError(fmt_error.AsCString()); + if (error.Fail()) + { + result.AppendError(error.AsCString()); result.SetStatus(eReturnStatusFailed); return false; } @@ -289,72 +289,15 @@ private: bool - LoopCallback ( - const char* type, + LoopCallback (const char* type, lldb::Format format, bool cascade, RegularExpression* regex, - CommandReturnObject *result - ) + CommandReturnObject *result) { - if(regex && !regex->Execute(type)) return true; - Stream &ostrm = result->GetOutputStream(); - ostrm.Printf("(%s) %scascading ",type, cascade ? "" : "not "); - switch(format) { - case eFormatBytes: - ostrm.Printf("y\n"); - break; - case eFormatBytesWithASCII: - ostrm.Printf("Y\n"); - break; - case eFormatBinary: - ostrm.Printf("b\n"); - break; - case eFormatBoolean: - ostrm.Printf("B\n"); - break; - case eFormatCharArray: - ostrm.Printf("a\n"); - break; - case eFormatChar: - ostrm.Printf("c\n"); - break; - case eFormatCharPrintable: - ostrm.Printf("C\n"); - break; - case eFormatOctal: - ostrm.Printf("o\n"); - break; - case eFormatOSType: - ostrm.Printf("O\n"); - break; - case eFormatDecimal: - ostrm.Printf("i or d\n"); - break; - case eFormatComplexInteger: - ostrm.Printf("I\n"); - break; - case eFormatUnsigned: - ostrm.Printf("u\n"); - break; - case eFormatHex: - ostrm.Printf("x\n"); - break; - case eFormatComplex: - ostrm.Printf("X\n"); - break; - case eFormatFloat: - ostrm.Printf("f e or g\n"); - break; - case eFormatPointer: - ostrm.Printf("p\n"); - break; - case eFormatCString: - ostrm.Printf("s\n"); - break; - default: - ostrm.Printf("other\n"); - break; + if (regex == NULL || regex->Execute(type)) + { + result->GetOutputStream().Printf ("%s: %s\n", type, FormatManager::GetFormatAsCString (format)); } return true; } Modified: lldb/trunk/source/Core/Debugger.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=133765&r1=133764&r2=133765&view=diff ============================================================================== --- lldb/trunk/source/Core/Debugger.cpp (original) +++ lldb/trunk/source/Core/Debugger.cpp Thu Jun 23 16:22:24 2011 @@ -1339,9 +1339,9 @@ } void -Debugger::LoopThroughFormatList (FormatCallback cback, void* param) +Debugger::LoopThroughFormatList (FormatManager::Callback callback, void* callback_baton) { - return GetFormatManager().LoopThroughFormatList(cback, param); + return GetFormatManager().LoopThroughFormatList(callback, callback_baton); } #pragma mark Debugger::SettingsController Modified: lldb/trunk/source/Core/FormatManager.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatManager.cpp?rev=133765&r1=133764&r2=133765&view=diff ============================================================================== --- lldb/trunk/source/Core/FormatManager.cpp (original) +++ lldb/trunk/source/Core/FormatManager.cpp Thu Jun 23 16:22:24 2011 @@ -17,53 +17,195 @@ using namespace lldb; using namespace lldb_private; -bool FormatManager::GetFormatForType (const ConstString &type, lldb::Format& format, bool& cascade) + +struct FormatInfo +{ + Format format; + const char format_char; // One or more format characters that can be used for this format. + const char *format_name; // Long format name that can be used to specify the current format +}; + +static FormatInfo +g_format_infos[] = +{ + { eFormatDefault , '\0' , "default" }, + { eFormatBoolean , 'B' , "boolean" }, + { eFormatBinary , 'b' , "binary" }, + { eFormatBytes , 'y' , "bytes" }, + { eFormatBytesWithASCII , 'Y' , "bytes with ASCII" }, + { eFormatChar , 'c' , "character" }, + { eFormatCharPrintable , 'C' , "printable character" }, + { eFormatComplexFloat , 'F' , "complex float" }, + { eFormatCString , 's' , "c-string" }, + { eFormatDecimal , 'i' , "signed decimal" }, + { eFormatEnum , 'E' , "enumeration" }, + { eFormatHex , 'x' , "hex" }, + { eFormatFloat , 'f' , "float" }, + { eFormatOctal , 'o' , "octal" }, + { eFormatOSType , 'O' , "OSType" }, + { eFormatUnicode16 , 'U' , "unicode16" }, + { eFormatUnicode32 , '\0' , "unicode32" }, + { eFormatUnsigned , 'u' , "unsigned decimal" }, + { eFormatPointer , 'p' , "pointer" }, + { eFormatVectorOfChar , '\0' , "char[]" }, + { eFormatVectorOfSInt8 , '\0' , "int8_t[]" }, + { eFormatVectorOfUInt8 , '\0' , "uint8_t[]" }, + { eFormatVectorOfSInt16 , '\0' , "int16_t[]" }, + { eFormatVectorOfUInt16 , '\0' , "uint16_t[]" }, + { eFormatVectorOfSInt32 , '\0' , "int16_t[]" }, + { eFormatVectorOfUInt32 , '\0' , "uint16_t[]" }, + { eFormatVectorOfSInt64 , '\0' , "int16_t[]" }, + { eFormatVectorOfUInt64 , '\0' , "uint16_t[]" }, + { eFormatVectorOfFloat32, '\0' , "float32[]" }, + { eFormatVectorOfFloat64, '\0' , "float64[]" }, + { eFormatVectorOfUInt128, '\0' , "uint128_t[]" }, + { eFormatComplexInteger , 'I' , "complex integer" }, + { eFormatCharArray , 'a' , "character array" } +}; + +static uint32_t +g_num_format_infos = sizeof(g_format_infos)/sizeof(FormatInfo); + +static bool +GetFormatFromFormatChar (char format_char, Format &format) +{ + for (uint32_t i=0; i= eFormatDefault && format < kNumFormats) + return g_format_infos[format].format_name; + return NULL; +} + +bool +FormatManager::GetFormatForType (const ConstString &type_name, lldb::Format& format, bool& cascade) { Mutex::Locker locker (m_format_map_mutex); FormatMap& fmtmap = m_format_map; - FormatMap::iterator iter = fmtmap.find(type.GetCString()); + FormatMap::iterator iter = fmtmap.find(type_name.GetCString()); if(iter == fmtmap.end()) return false; else { - format = iter->second.FormatStyle; - cascade = iter->second.Cascades; + format = iter->second.format; + cascade = iter->second.cascades; return true; } } -void FormatManager::AddFormatForType (const ConstString &type, lldb::Format format, bool cascade) +void +FormatManager::AddFormatForType (const ConstString &type_name, lldb::Format format, bool cascade) { - format_entry_t entry(format, cascade); + Entry entry(format, cascade); Mutex::Locker locker (m_format_map_mutex); FormatMap& fmtmap = m_format_map; - fmtmap[type.GetCString()] = entry; + fmtmap[type_name.GetCString()] = entry; } -bool FormatManager::DeleteFormatForType (const ConstString &type) +bool +FormatManager::DeleteFormatForType (const ConstString &type_name) { Mutex::Locker locker (m_format_map_mutex); FormatMap& fmtmap = m_format_map; - const char* typeCS = type.GetCString(); + const char* typeCS = type_name.GetCString(); FormatMap::iterator iter = fmtmap.find(typeCS); - if (iter == fmtmap.end()) - return false; - else { + if (iter != fmtmap.end()) + { fmtmap.erase(typeCS); return true; } + return false; } -void FormatManager::LoopThroughFormatList (FormatCallback cback, void* param) +void +FormatManager::LoopThroughFormatList (Callback callback, void* param) { - Mutex::Locker locker (m_format_map_mutex); - FormatMap& fmtmap = m_format_map; - FormatIterator iter = fmtmap.begin(); - while(iter != fmtmap.end()) { - const char* type = iter->first; - lldb::Format format = iter->second.FormatStyle; - bool cascade = iter->second.Cascades; - if(!cback(param, type,format, cascade)) break; - iter++; + if (callback) + { + Mutex::Locker locker (m_format_map_mutex); + FormatIterator pos, end = m_format_map.end(); + for (pos = m_format_map.begin(); pos != end; ++pos) + { + const char* type = pos->first; + lldb::Format format = pos->second.format; + bool cascade = pos->second.cascades; + if (!callback(param, type, format, cascade)) + break; + } } } Modified: lldb/trunk/source/Core/State.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/State.cpp?rev=133765&r1=133764&r2=133765&view=diff ============================================================================== --- lldb/trunk/source/Core/State.cpp (original) +++ lldb/trunk/source/Core/State.cpp Thu Jun 23 16:22:24 2011 @@ -41,52 +41,6 @@ } const char * -lldb_private::GetFormatAsCString (lldb::Format format) -{ - switch (format) - { - case eFormatDefault: return "default"; - case eFormatBoolean: return "boolean"; - case eFormatBinary: return "binary"; - case eFormatBytes: return "bytes"; - case eFormatBytesWithASCII: return "bytes with ASCII"; - case eFormatChar: return "character"; - case eFormatCharArray: return "character array"; - case eFormatCharPrintable: return "printable character"; - case eFormatComplexFloat: return "complet float"; - case eFormatCString: return "c-string"; - case eFormatDecimal: return "signed decimal"; - case eFormatEnum: return "enumeration"; - case eFormatHex: return "hex"; - case eFormatFloat: return "float"; - case eFormatOctal: return "octal"; - case eFormatOSType: return "OSType"; - case eFormatUnicode16: return "Unicode16"; - case eFormatUnicode32: return "Unicode32"; - case eFormatUnsigned: return "unsigned decimal"; - case eFormatPointer: return "pointer"; - case eFormatVectorOfChar: return "vector of characters"; - case eFormatVectorOfSInt8: return "vector of int8_t"; - case eFormatVectorOfUInt8: return "vector of uint8_t"; - case eFormatVectorOfSInt16: return "vector of int16_t"; - case eFormatVectorOfUInt16: return "vector of uint16_t"; - case eFormatVectorOfSInt32: return "vector of int32_t"; - case eFormatVectorOfUInt32: return "vector of uint32_t"; - case eFormatVectorOfSInt64: return "vector of int64_t"; - case eFormatVectorOfUInt64: return "vector of uint64_t"; - case eFormatVectorOfFloat32:return "vector of float32"; - case eFormatVectorOfFloat64:return "vector of float64"; - case eFormatVectorOfUInt128:return "vector of uint128_t"; - case eFormatComplexInteger: return "complex integer"; - default: break; - } - static char unknown_format_string[64]; - snprintf(unknown_format_string, sizeof (unknown_format_string), "Format = %u", format); - return unknown_format_string; -} - - -const char * lldb_private::GetPermissionsAsCString (uint32_t permissions) { switch (permissions) Modified: lldb/trunk/source/Core/ValueObject.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=133765&r1=133764&r2=133765&view=diff ============================================================================== --- lldb/trunk/source/Core/ValueObject.cpp (original) +++ lldb/trunk/source/Core/ValueObject.cpp Thu Jun 23 16:22:24 2011 @@ -672,9 +672,14 @@ case Value::eContextTypeClangType: case Value::eContextTypeLLDBType: case Value::eContextTypeVariable: - Format format = GetFormat(); - if (format != m_last_format) - m_value_str.clear(); + { + Format format = GetFormat(); + if (format != m_last_format) + m_value_str.clear(); + } + break; + + default: break; } } Modified: lldb/trunk/source/Interpreter/Args.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=133765&r1=133764&r2=133765&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/Args.cpp (original) +++ lldb/trunk/source/Interpreter/Args.cpp Thu Jun 23 16:22:24 2011 @@ -14,6 +14,7 @@ // Other libraries and framework includes // Project includes #include "lldb/Interpreter/Args.h" +#include "lldb/Core/FormatManager.h" #include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/StreamString.h" @@ -899,61 +900,25 @@ *byte_size_ptr = 0; } - bool success = s[1] == '\0'; - if (success) + const bool partial_match_ok = true; + if (!FormatManager::GetFormatFromCString (s, partial_match_ok, format)) { - switch (s[0]) + StreamString error_strm; + error_strm.Printf ("Invalid format character or name '%s'. Valid values are:\n", s); + for (Format f = eFormatDefault; f < kNumFormats; ++f) { - case 'y': format = eFormatBytes; break; - case 'Y': format = eFormatBytesWithASCII; break; - case 'b': format = eFormatBinary; break; - case 'B': format = eFormatBoolean; break; - case 'a': format = eFormatCharArray; break; - case 'c': format = eFormatChar; break; - case 'C': format = eFormatCharPrintable; break; - case 'o': format = eFormatOctal; break; - case 'O': format = eFormatOSType; break; - case 'i': - case 'd': format = eFormatDecimal; break; - case 'I': format = eFormatComplexInteger; break; - case 'u': format = eFormatUnsigned; break; - case 'x': format = eFormatHex; break; - case 'X': format = eFormatComplex; break; - case 'f': - case 'e': - case 'g': format = eFormatFloat; break; - case 'p': format = eFormatPointer; break; - case 's': format = eFormatCString; break; - default: - success = false; - break; + char format_char = FormatManager::GetFormatAsFormatChar(f); + if (format_char) + error_strm.Printf ("'%c' or ", format_char); + + error_strm.Printf ("\"%s\"", FormatManager::GetFormatAsCString(f)); + error_strm.EOL(); } + + if (byte_size_ptr) + error_strm.PutCString ("An optional byte size can precede the format character.\n"); + error.SetErrorString(error_strm.GetString().c_str()); } - if (!success) - error.SetErrorStringWithFormat ("Invalid format specification '%s'. Valid values are:\n" - " a - char buffer\n" - " b - binary\n" - " B - boolean\n" - " c - char\n" - " C - printable char\n" - " d - signed decimal\n" - " e - float\n" - " f - float\n" - " g - float\n" - " i - signed decimal\n" - " I - complex integer\n" - " o - octal\n" - " O - OSType\n" - " p - pointer\n" - " s - c-string\n" - " u - unsigned decimal\n" - " x - hex\n" - " X - complex float\n" - " y - bytes\n" - " Y - bytes with ASCII\n%s", - s, - byte_size_ptr ? "An optional byte size can precede the format character.\n" : ""); - if (error.Fail()) return error; Modified: lldb/trunk/source/Interpreter/NamedOptionValue.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/NamedOptionValue.cpp?rev=133765&r1=133764&r2=133765&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/NamedOptionValue.cpp (original) +++ lldb/trunk/source/Interpreter/NamedOptionValue.cpp Thu Jun 23 16:22:24 2011 @@ -13,6 +13,7 @@ // C++ Includes // Other libraries and framework includes // Project includes +#include "lldb/Core/FormatManager.h" #include "lldb/Core/State.h" #include "lldb/Core/Stream.h" #include "lldb/Interpreter/Args.h" @@ -339,7 +340,7 @@ void OptionValueFormat::DumpValue (Stream &strm) { - strm.PutCString (GetFormatAsCString (m_current_value)); + strm.PutCString (FormatManager::GetFormatAsCString (m_current_value)); } Error From johnny.chen at apple.com Thu Jun 23 17:11:20 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Thu, 23 Jun 2011 22:11:20 -0000 Subject: [Lldb-commits] [lldb] r133768 - in /lldb/trunk/test: lldbtest.py load_unload/TestLoadUnload.py python_api/thread/TestThreadAPI.py types/AbstractBase.py Message-ID: <20110623221120.8C8BC2A6C12C@llvm.org> Author: johnny Date: Thu Jun 23 17:11:20 2011 New Revision: 133768 URL: http://llvm.org/viewvc/llvm-project?rev=133768&view=rev Log: o lldbtest.py: Assign the test method name to self.testMethodName. This can be useful for the test directory (see test/types for a good example) which houses a bunch of executables compiled from different source files. The default build action is to create a.out as the binary executable, which can confuse the module cacheing mechanism and result in the debugger getting a stale image as the target to be debugged, and chaos ensues. o AbstractBase.py, TestThreadAPI.py: Use self.testMethodName to our advantage. o TestLoadUnload.py: Add expected failure marker to test case test_modules_search_paths(). Modified: lldb/trunk/test/lldbtest.py lldb/trunk/test/load_unload/TestLoadUnload.py lldb/trunk/test/python_api/thread/TestThreadAPI.py lldb/trunk/test/types/AbstractBase.py Modified: lldb/trunk/test/lldbtest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=133768&r1=133767&r2=133768&view=diff ============================================================================== --- lldb/trunk/test/lldbtest.py (original) +++ lldb/trunk/test/lldbtest.py Thu Jun 23 17:11:20 2011 @@ -356,6 +356,7 @@ - The setUp method sets up things to facilitate subsequent interactions with the debugger as part of the test. These include: + - populate the test method name - create/get a debugger set with synchronous mode (self.dbg) - get the command interpreter from with the debugger (self.ci) - create a result object for use with the command interpreter @@ -478,6 +479,14 @@ #import traceback #traceback.print_stack() + # Assign the test method name to self.testMethodName. + # + # For an example of the use of this attribute, look at test/types dir. + # There are a bunch of test cases under test/types and we don't want the + # module cacheing subsystem to be confused with executable name "a.out" + # used for all the test cases. + self.testMethodName = self._testMethodName + if "LLDB_EXEC" in os.environ: self.lldbExec = os.environ["LLDB_EXEC"] Modified: lldb/trunk/test/load_unload/TestLoadUnload.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/load_unload/TestLoadUnload.py?rev=133768&r1=133767&r2=133768&view=diff ============================================================================== --- lldb/trunk/test/load_unload/TestLoadUnload.py (original) +++ lldb/trunk/test/load_unload/TestLoadUnload.py Thu Jun 23 17:11:20 2011 @@ -21,6 +21,7 @@ self.line_d_function = line_number('d.c', '// Find this line number within d_dunction().') + @unittest2.expectedFailure def test_modules_search_paths(self): """Test target modules list after moving libd.dylib, and verifies that it works with 'target modules search-paths add'.""" Modified: lldb/trunk/test/python_api/thread/TestThreadAPI.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/thread/TestThreadAPI.py?rev=133768&r1=133767&r2=133768&view=diff ============================================================================== --- lldb/trunk/test/python_api/thread/TestThreadAPI.py (original) +++ lldb/trunk/test/python_api/thread/TestThreadAPI.py Thu Jun 23 17:11:20 2011 @@ -43,66 +43,69 @@ def test_run_to_address_with_dsym(self): """Test Python SBThread.RunToAddress() API.""" # We build a different executable than the default buildDwarf() does. - d = {'CXX_SOURCES': 'main2.cpp', 'EXE': 'b.out'} + d = {'CXX_SOURCES': 'main2.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.run_to_address('b.out') + self.run_to_address(self.exe_name) @python_api_test def test_run_to_address_with_dwarf(self): """Test Python SBThread.RunToAddress() API.""" # We build a different executable than the default buildDwarf() does. - d = {'CXX_SOURCES': 'main2.cpp', 'EXE': 'b.out'} + d = {'CXX_SOURCES': 'main2.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.run_to_address('b.out') + self.run_to_address(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") @python_api_test def test_step_out_of_malloc_into_function_b_with_dsym(self): """Test Python SBThread.StepOut() API to step out of a malloc call where the call site is at function b().""" # We build a different executable than the default buildDsym() does. - d = {'CXX_SOURCES': 'main2.cpp'} + d = {'CXX_SOURCES': 'main2.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.step_out_of_malloc_into_function_b() + self.step_out_of_malloc_into_function_b(self.exe_name) @python_api_test def test_step_out_of_malloc_into_function_b_with_dwarf(self): """Test Python SBThread.StepOut() API to step out of a malloc call where the call site is at function b().""" # We build a different executable than the default buildDwarf() does. - d = {'CXX_SOURCES': 'main2.cpp'} + d = {'CXX_SOURCES': 'main2.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.step_out_of_malloc_into_function_b() + self.step_out_of_malloc_into_function_b(self.exe_name) @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") @python_api_test def test_step_over_3_times_with_dsym(self): """Test Python SBThread.StepOver() API.""" # We build a different executable than the default buildDsym() does. - d = {'CXX_SOURCES': 'main2.cpp'} + d = {'CXX_SOURCES': 'main2.cpp', 'EXE': self.exe_name} self.buildDsym(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.step_over_3_times() + self.step_over_3_times(self.exe_name) @python_api_test def test_step_over_3_times_with_dwarf(self): """Test Python SBThread.StepOver() API.""" # We build a different executable than the default buildDwarf() does. - d = {'CXX_SOURCES': 'main2.cpp'} + d = {'CXX_SOURCES': 'main2.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) - self.step_over_3_times() + self.step_over_3_times(self.exe_name) def setUp(self): # Call super's setUp(). TestBase.setUp(self) # Find the line number within main.cpp to break inside main(). - self.line = line_number("main.cpp", "// Set break point at this line and check variable 'my_char'.") - # Find the line numbers within main2.cpp for step_over_3_times() and step_out_of_malloc_into_function_b(). - self.line2 = line_number("main2.cpp", "// thread step-out of malloc into function b.") - self.line3 = line_number("main2.cpp", "// we should reach here after 3 step-over's.") + self.break_line = line_number("main.cpp", "// Set break point at this line and check variable 'my_char'.") + # Find the line numbers within main2.cpp for step_out_of_malloc_into_function_b() and step_over_3_times(). + self.step_out_of_malloc = line_number("main2.cpp", "// thread step-out of malloc into function b.") + self.after_3_step_overs = line_number("main2.cpp", "// we should reach here after 3 step-over's.") + + # We'll use the test method name as the exe_name for executable comppiled from main2.cpp. + self.exe_name = self.testMethodName def get_process(self): """Test Python SBThread.GetProcess() API.""" @@ -111,7 +114,7 @@ target = self.dbg.CreateTarget(exe) self.assertTrue(target, VALID_TARGET) - breakpoint = target.BreakpointCreateByLocation("main.cpp", self.line) + breakpoint = target.BreakpointCreateByLocation("main.cpp", self.break_line) self.assertTrue(breakpoint, VALID_BREAKPOINT) self.runCmd("breakpoint list") @@ -133,7 +136,7 @@ target = self.dbg.CreateTarget(exe) self.assertTrue(target, VALID_TARGET) - breakpoint = target.BreakpointCreateByLocation("main.cpp", self.line) + breakpoint = target.BreakpointCreateByLocation("main.cpp", self.break_line) self.assertTrue(breakpoint, VALID_BREAKPOINT) #self.runCmd("breakpoint list") @@ -151,9 +154,9 @@ self.expect(stop_description, exe=False, startstr = 'breakpoint') - def step_out_of_malloc_into_function_b(self): + def step_out_of_malloc_into_function_b(self, exe_name): """Test Python SBThread.StepOut() API to step out of a malloc call where the call site is at function b().""" - exe = os.path.join(os.getcwd(), "a.out") + exe = os.path.join(os.getcwd(), exe_name) target = self.dbg.CreateTarget(exe) self.assertTrue(target, VALID_TARGET) @@ -181,17 +184,17 @@ thread.StepOut() self.runCmd("thread backtrace") #self.runCmd("process status") - self.assertTrue(thread.GetFrameAtIndex(0).GetLineEntry().GetLine() == self.line2, + self.assertTrue(thread.GetFrameAtIndex(0).GetLineEntry().GetLine() == self.step_out_of_malloc, "step out of malloc into function b is successful") - def step_over_3_times(self): + def step_over_3_times(self, exe_name): """Test Python SBThread.StepOver() API.""" - exe = os.path.join(os.getcwd(), "a.out") + exe = os.path.join(os.getcwd(), exe_name) target = self.dbg.CreateTarget(exe) self.assertTrue(target, VALID_TARGET) - breakpoint = target.BreakpointCreateByLocation('main2.cpp', self.line2) + breakpoint = target.BreakpointCreateByLocation('main2.cpp', self.step_out_of_malloc) self.assertTrue(breakpoint, VALID_BREAKPOINT) self.runCmd("breakpoint list") @@ -200,14 +203,14 @@ self.assertTrue(process, PROCESS_IS_VALID) - # Frame #0 should be on self.line2. + # Frame #0 should be on self.step_out_of_malloc. self.assertTrue(process.GetState() == lldb.eStateStopped) thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint) self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition") self.runCmd("thread backtrace") frame0 = thread.GetFrameAtIndex(0) lineEntry = frame0.GetLineEntry() - self.assertTrue(lineEntry.GetLine() == self.line2) + self.assertTrue(lineEntry.GetLine() == self.step_out_of_malloc) thread.StepOver() thread.StepOver() @@ -218,7 +221,7 @@ frame0 = thread.GetFrameAtIndex(0) lineEntry = frame0.GetLineEntry() self.assertTrue(thread.GetStopReason() == lldb.eStopReasonPlanComplete) - self.assertTrue(lineEntry.GetLine() == self.line3) + self.assertTrue(lineEntry.GetLine() == self.after_3_step_overs) def run_to_address(self, exe_name): """Test Python SBThread.RunToAddress() API.""" @@ -227,7 +230,7 @@ target = self.dbg.CreateTarget(exe) self.assertTrue(target, VALID_TARGET) - breakpoint = target.BreakpointCreateByLocation('main2.cpp', self.line2) + breakpoint = target.BreakpointCreateByLocation('main2.cpp', self.step_out_of_malloc) self.assertTrue(breakpoint, VALID_BREAKPOINT) self.runCmd("breakpoint list") @@ -236,14 +239,14 @@ self.assertTrue(process, PROCESS_IS_VALID) - # Frame #0 should be on self.line2. + # Frame #0 should be on self.step_out_of_malloc. self.assertTrue(process.GetState() == lldb.eStateStopped) thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint) self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition") self.runCmd("thread backtrace") frame0 = thread.GetFrameAtIndex(0) lineEntry = frame0.GetLineEntry() - self.assertTrue(lineEntry.GetLine() == self.line2) + self.assertTrue(lineEntry.GetLine() == self.step_out_of_malloc) # Get the start/end addresses for this line entry. start_addr = lineEntry.GetStartAddress().GetLoadAddress(target) @@ -262,7 +265,7 @@ self.runCmd("thread backtrace") # Now ask SBThread to run to the address 'start_addr' we got earlier, which - # corresponds to self.line2 line entry's start address. + # corresponds to self.step_out_of_malloc line entry's start address. thread.RunToAddress(start_addr) self.runCmd("process status") #self.runCmd("thread backtrace") Modified: lldb/trunk/test/types/AbstractBase.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/AbstractBase.py?rev=133768&r1=133767&r2=133768&view=diff ============================================================================== --- lldb/trunk/test/types/AbstractBase.py (original) +++ lldb/trunk/test/types/AbstractBase.py Thu Jun 23 17:11:20 2011 @@ -27,7 +27,7 @@ # There are a bunch of test cases under test/types and we don't want the # module cacheing subsystem to be confused with executable name "a.out" # used for all the test cases. - self.exe_name = self._testMethodName + self.exe_name = self.testMethodName def generic_type_tester(self, exe_name, atoms, quotedDisplay=False): """Test that variables with basic types are displayed correctly.""" From johnny.chen at apple.com Thu Jun 23 18:14:10 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Thu, 23 Jun 2011 23:14:10 -0000 Subject: [Lldb-commits] [lldb] r133772 - in /lldb/trunk: source/Commands/CommandObjectType.cpp test/data-formatter/ test/data-formatter/Makefile test/data-formatter/TestDataFormatter.py test/data-formatter/main.cpp Message-ID: <20110623231410.3BACE2A6C12C@llvm.org> Author: johnny Date: Thu Jun 23 18:14:10 2011 New Revision: 133772 URL: http://llvm.org/viewvc/llvm-project?rev=133772&view=rev Log: Add an initial test file for the newly added data formatter command. main.cpp is contributed from Enrico. Modify CommandObjectType.cpp to set status on the CommandReturnObject when succeeded as well. Added: lldb/trunk/test/data-formatter/ lldb/trunk/test/data-formatter/Makefile lldb/trunk/test/data-formatter/TestDataFormatter.py lldb/trunk/test/data-formatter/main.cpp Modified: lldb/trunk/source/Commands/CommandObjectType.cpp Modified: lldb/trunk/source/Commands/CommandObjectType.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=133772&r1=133771&r2=133772&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectType.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectType.cpp Thu Jun 23 18:14:10 2011 @@ -156,7 +156,7 @@ Debugger::AddFormatForType(typeCS, format, m_options.m_cascade); } - + result.SetStatus(eReturnStatusSuccessFinishNoResult); return result.Succeeded(); } @@ -214,8 +214,11 @@ const char* typeA = command.GetArgumentAtIndex(0); ConstString typeCS(typeA); - if(Debugger::DeleteFormatForType(typeCS)) + if (Debugger::DeleteFormatForType(typeCS)) + { + result.SetStatus(eReturnStatusSuccessFinishNoResult); return result.Succeeded(); + } else { result.AppendErrorWithFormat ("no custom format for %s.\n", typeA); @@ -283,6 +286,7 @@ param = new CommandObjectTypeList_LoopCallbackParam(this,&result); Debugger::LoopThroughFormatList(CommandObjectTypeList_LoopCallback, param); delete param; + result.SetStatus(eReturnStatusSuccessFinishResult); return result.Succeeded(); } Added: lldb/trunk/test/data-formatter/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/data-formatter/Makefile?rev=133772&view=auto ============================================================================== --- lldb/trunk/test/data-formatter/Makefile (added) +++ lldb/trunk/test/data-formatter/Makefile Thu Jun 23 18:14:10 2011 @@ -0,0 +1,5 @@ +LEVEL = ../make + +CXX_SOURCES := main.cpp + +include $(LEVEL)/Makefile.rules Added: lldb/trunk/test/data-formatter/TestDataFormatter.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/data-formatter/TestDataFormatter.py?rev=133772&view=auto ============================================================================== --- lldb/trunk/test/data-formatter/TestDataFormatter.py (added) +++ lldb/trunk/test/data-formatter/TestDataFormatter.py Thu Jun 23 18:14:10 2011 @@ -0,0 +1,96 @@ +""" +Test lldb data formatter subsystem. +""" + +import os, time +import unittest2 +import lldb +from lldbtest import * + +class DataFormatterTestCase(TestBase): + + mydir = "data-formatter" + + @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") + def test_with_dsym_and_run_command(self): + """Test data formatter commands.""" + self.buildDsym() + self.data_formatter_commands() + + def test_with_dwarf_and_run_command(self): + """Test data formatter commands.""" + self.buildDwarf() + self.data_formatter_commands() + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + # Find the line number to break at. + self.line = line_number('main.cpp', '// Set break point at this line.') + + def data_formatter_commands(self): + """Test that that file and class static variables display correctly.""" + self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) + + self.expect("breakpoint set -f main.cpp -l %d" % self.line, + BREAKPOINT_CREATED, + startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" % + self.line) + + self.runCmd("run", RUN_SUCCEEDED) + + # The stop reason of the thread should be breakpoint. + self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, + substrs = ['stopped', + 'stop reason = breakpoint']) + + self.expect("frame variable", + substrs = ['(Speed) SPILookHex = 5.55' # Speed by default is 5.55. + ]); + + # This is the function to remove the custom formats in order to have a + # clean slate for the next test case. + def cleanup(): + self.runCmd('type format delete Speed', check=False) + self.runCmd('type format delete Bitfield', check=False) + self.runCmd('type format delete RealNumber', check=False) + self.runCmd('type format delete Type2', check=False) + self.runCmd('type format delete Type1', check=False) + + # Execute the cleanup function during test case tear down. + self.addTearDownHook(cleanup) + + self.runCmd("type format add -c yes x Speed BitField") + self.runCmd("type format add -c no c RealNumber") + self.runCmd("type format add -c no x Type2") + self.runCmd("type format add -c yes c Type1") + + # The type format list should show our custom formats. + self.expect("type format list", + substrs = ['RealNumber', + 'Speed', + 'BitField', + 'Type1', + 'Type2']) + + self.expect("frame variable", + patterns = ['\(Speed\) SPILookHex = 0x[0-9a-f]+' # Speed should look hex-ish now. + ]); + + # Now let's delete the 'Speed' custom format. + self.runCmd("type format delete Speed") + + # The type format list should not show 'Speed' at this point. + self.expect("type format list", matching=False, + substrs = ['Speed']) + + # Delete type format for 'Speed', we should expect an error message. + self.expect("type format delete Speed", error=True, + substrs = ['no custom format for Speed']) + + +if __name__ == '__main__': + import atexit + lldb.SBDebugger.Initialize() + atexit.register(lambda: lldb.SBDebugger.Terminate()) + unittest2.main() Added: lldb/trunk/test/data-formatter/main.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/data-formatter/main.cpp?rev=133772&view=auto ============================================================================== --- lldb/trunk/test/data-formatter/main.cpp (added) +++ lldb/trunk/test/data-formatter/main.cpp Thu Jun 23 18:14:10 2011 @@ -0,0 +1,62 @@ +//===-- main.cpp ------------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include +#include +#include + +typedef float RealNumber; // should show as char +typedef RealNumber Temperature; // should show as float +typedef RealNumber Speed; // should show as hex + +typedef int Counter; // should show as int +typedef int BitField; // should show as hex + +typedef BitField SignalMask; // should show as hex +typedef BitField Modifiers; // should show as hex + +typedef Counter Accumulator; // should show as int + +typedef int Type1; // should show as char +typedef Type1 Type2; // should show as hex +typedef Type2 Type3; // should show as char +typedef Type3 Type4; // should show as char + +typedef int ChildType; // should show as int +typedef int AnotherChildType; // should show as int + +int main (int argc, const char * argv[]) +{ + + int iAmInt = 1; + const float& IAmFloat = float(2.45); + + RealNumber RNILookChar = 3.14; + Temperature TMILookFloat = 4.97; + Speed SPILookHex = 5.55; + + Counter CTILookInt = 6; + BitField BFILookHex = 7; + SignalMask SMILookHex = 8; + Modifiers MFILookHex = 9; + + Accumulator* ACILookInt = new Accumulator(10); + + const Type1& T1ILookChar = 11; + Type2 T2ILookHex = 12; + Type3 T3ILookChar = 13; + Type4 T4ILookChar = 14; + + AnotherChildType AHILookInt = 15; + + Speed* SPPtrILookHex = new Speed(16); + + return 0; // Set break point at this line. +} + From johnny.chen at apple.com Thu Jun 23 19:06:53 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Fri, 24 Jun 2011 00:06:53 -0000 Subject: [Lldb-commits] [lldb] r133778 - in /lldb/trunk/test/python_api/default-constructor: TestDefaultConstructorForAPIObjects.py sb_address.py Message-ID: <20110624000653.EBD822A6C12C@llvm.org> Author: johnny Date: Thu Jun 23 19:06:53 2011 New Revision: 133778 URL: http://llvm.org/viewvc/llvm-project?rev=133778&view=rev Log: Start adding API calls to the invalid SB API object after default construction. It should not crash lldb. This checkin adds calls for SBAddress. Added: lldb/trunk/test/python_api/default-constructor/sb_address.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py?rev=133778&r1=133777&r2=133778&view=diff ============================================================================== --- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original) +++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Thu Jun 23 19:06:53 2011 @@ -22,6 +22,9 @@ if self.TraceOn(): print obj self.assertFalse(obj) + # Do fuzz testing on the invalid obj, it should not crash lldb. + import sb_address + sb_address.fuzz_obj(obj) @python_api_test def test_SBBlock(self): Added: lldb/trunk/test/python_api/default-constructor/sb_address.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_address.py?rev=133778&view=auto ============================================================================== --- lldb/trunk/test/python_api/default-constructor/sb_address.py (added) +++ lldb/trunk/test/python_api/default-constructor/sb_address.py Thu Jun 23 19:06:53 2011 @@ -0,0 +1,12 @@ +""" +Fuzz tests an object after the default construction to make sure it does not crash lldb. +""" + +import sys +import lldb + +def fuzz_obj(obj): + obj.GetFileAddress() + obj.GetLoadAddress(lldb.SBTarget()) + obj.OffsetAddress(sys.maxint) + obj.GetDescription(lldb.SBStream()) From johnny.chen at apple.com Thu Jun 23 19:21:36 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Fri, 24 Jun 2011 00:21:36 -0000 Subject: [Lldb-commits] [lldb] r133780 - in /lldb/trunk/test/python_api/default-constructor: TestDefaultConstructorForAPIObjects.py sb_block.py Message-ID: <20110624002136.F108B2A6C12C@llvm.org> Author: johnny Date: Thu Jun 23 19:21:36 2011 New Revision: 133780 URL: http://llvm.org/viewvc/llvm-project?rev=133780&view=rev Log: Add fuzz calls for SBBlock. Added: lldb/trunk/test/python_api/default-constructor/sb_block.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py?rev=133780&r1=133779&r2=133780&view=diff ============================================================================== --- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original) +++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Thu Jun 23 19:21:36 2011 @@ -32,6 +32,9 @@ if self.TraceOn(): print obj self.assertFalse(obj) + # Do fuzz testing on the invalid obj, it should not crash lldb. + import sb_block + sb_block.fuzz_obj(obj) @python_api_test def test_SBBreakpoint(self): Added: lldb/trunk/test/python_api/default-constructor/sb_block.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_block.py?rev=133780&view=auto ============================================================================== --- lldb/trunk/test/python_api/default-constructor/sb_block.py (added) +++ lldb/trunk/test/python_api/default-constructor/sb_block.py Thu Jun 23 19:21:36 2011 @@ -0,0 +1,17 @@ +""" +Fuzz tests an object after the default construction to make sure it does not crash lldb. +""" + +import sys +import lldb + +def fuzz_obj(obj): + obj.IsInlined() + obj.GetInlinedName() + obj.GetInlinedCallSiteFile() + obj.GetInlinedCallSiteLine() + obj.GetInlinedCallSiteColumn() + obj.GetParent() + obj.GetSibling() + obj.GetFirstChild() + obj.GetDescription(lldb.SBStream()) From peter at pcc.me.uk Thu Jun 23 20:12:22 2011 From: peter at pcc.me.uk (Peter Collingbourne) Date: Fri, 24 Jun 2011 01:12:22 -0000 Subject: [Lldb-commits] [lldb] r133781 - /lldb/trunk/source/Interpreter/Args.cpp Message-ID: <20110624011222.691C82A6C12C@llvm.org> Author: pcc Date: Thu Jun 23 20:12:22 2011 New Revision: 133781 URL: http://llvm.org/viewvc/llvm-project?rev=133781&view=rev Log: ++ cannot be used to increment an enum, so do it another way Modified: lldb/trunk/source/Interpreter/Args.cpp Modified: lldb/trunk/source/Interpreter/Args.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=133781&r1=133780&r2=133781&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/Args.cpp (original) +++ lldb/trunk/source/Interpreter/Args.cpp Thu Jun 23 20:12:22 2011 @@ -905,7 +905,7 @@ { StreamString error_strm; error_strm.Printf ("Invalid format character or name '%s'. Valid values are:\n", s); - for (Format f = eFormatDefault; f < kNumFormats; ++f) + for (Format f = eFormatDefault; f < kNumFormats; f = Format(f+1)) { char format_char = FormatManager::GetFormatAsFormatChar(f); if (format_char) From gclayton at apple.com Thu Jun 23 22:21:43 2011 From: gclayton at apple.com (Greg Clayton) Date: Fri, 24 Jun 2011 03:21:43 -0000 Subject: [Lldb-commits] [lldb] r133785 - in /lldb/trunk/source: API/SBProcess.cpp API/SBTarget.cpp Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Message-ID: <20110624032143.554492A6C12C@llvm.org> Author: gclayton Date: Thu Jun 23 22:21:43 2011 New Revision: 133785 URL: http://llvm.org/viewvc/llvm-project?rev=133785&view=rev Log: Fixed SBTarget attach calls to properly deal with being connected to a remotely connected process connection. Also added support for more kinds of continue packet when multiple threads need to continue where some want to continue with signals. Modified: lldb/trunk/source/API/SBProcess.cpp lldb/trunk/source/API/SBTarget.cpp lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Modified: lldb/trunk/source/API/SBProcess.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBProcess.cpp?rev=133785&r1=133784&r2=133785&view=diff ============================================================================== --- lldb/trunk/source/API/SBProcess.cpp (original) +++ lldb/trunk/source/API/SBProcess.cpp Thu Jun 23 22:21:43 2011 @@ -479,15 +479,15 @@ SBError SBProcess::Continue () { - Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex()); - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) log->Printf ("SBProcess(%p)::Continue ()...", m_opaque_sp.get()); SBError sb_error; - if (IsValid()) + if (m_opaque_sp) { + Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex()); + Error error (m_opaque_sp->Resume()); if (error.Success()) { @@ -545,7 +545,7 @@ SBProcess::Stop () { SBError sb_error; - if (IsValid()) + if (m_opaque_sp) { Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex()); sb_error.SetError (m_opaque_sp->Halt()); Modified: lldb/trunk/source/API/SBTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=133785&r1=133784&r2=133785&view=diff ============================================================================== --- lldb/trunk/source/API/SBTarget.cpp (original) +++ lldb/trunk/source/API/SBTarget.cpp Thu Jun 23 22:21:43 2011 @@ -282,11 +282,43 @@ if (m_opaque_sp) { Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex()); - if (listener.IsValid()) - sb_process.SetProcess (m_opaque_sp->CreateProcess (listener.ref())); + + StateType state = eStateInvalid; + sb_process.SetProcess (m_opaque_sp->GetProcessSP()); + if (sb_process.IsValid()) + { + state = sb_process->GetState(); + + if (sb_process->IsAlive() && state != eStateConnected) + { + if (state == eStateAttaching) + error.SetErrorString ("process attach is in progress"); + else + error.SetErrorString ("a process is already being debugged"); + sb_process.Clear(); + return sb_process; + } + } + + if (state == eStateConnected) + { + // If we are already connected, then we have already specified the + // listener, so if a valid listener is supplied, we need to error out + // to let the client know. + if (listener.IsValid()) + { + error.SetErrorString ("process is connected and already has a listener, pass empty listener"); + sb_process.Clear(); + return sb_process; + } + } else - sb_process.SetProcess (m_opaque_sp->CreateProcess (m_opaque_sp->GetDebugger().GetListener())); - + { + if (listener.IsValid()) + sb_process.SetProcess (m_opaque_sp->CreateProcess (listener.ref())); + else + sb_process.SetProcess (m_opaque_sp->CreateProcess (m_opaque_sp->GetDebugger().GetListener())); + } if (sb_process.IsValid()) { @@ -323,10 +355,42 @@ { Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex()); - if (listener.IsValid()) - sb_process.SetProcess (m_opaque_sp->CreateProcess (listener.ref())); + StateType state = eStateInvalid; + sb_process.SetProcess (m_opaque_sp->GetProcessSP()); + if (sb_process.IsValid()) + { + state = sb_process->GetState(); + + if (sb_process->IsAlive() && state != eStateConnected) + { + if (state == eStateAttaching) + error.SetErrorString ("process attach is in progress"); + else + error.SetErrorString ("a process is already being debugged"); + sb_process.Clear(); + return sb_process; + } + } + + if (state == eStateConnected) + { + // If we are already connected, then we have already specified the + // listener, so if a valid listener is supplied, we need to error out + // to let the client know. + if (listener.IsValid()) + { + error.SetErrorString ("process is connected and already has a listener, pass empty listener"); + sb_process.Clear(); + return sb_process; + } + } else - sb_process.SetProcess (m_opaque_sp->CreateProcess (m_opaque_sp->GetDebugger().GetListener())); + { + if (listener.IsValid()) + sb_process.SetProcess (m_opaque_sp->CreateProcess (listener.ref())); + else + sb_process.SetProcess (m_opaque_sp->CreateProcess (m_opaque_sp->GetDebugger().GetListener())); + } if (sb_process.IsValid()) { Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=133785&r1=133784&r2=133785&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Thu Jun 23 22:21:43 2011 @@ -901,7 +901,6 @@ if (continue_packet_error) { - continue_packet_error = false; // Either no vCont support, or we tried to use part of the vCont // packet that wasn't supported by the remote GDB server. // We need to try and make a simple packet that can do our continue @@ -916,7 +915,8 @@ { // All threads are resuming... m_gdb_comm.SetCurrentThreadForRun (-1); - continue_packet.PutChar ('c'); + continue_packet.PutChar ('c'); + continue_packet_error = false; } else if (num_continue_c_tids == 1 && num_continue_C_tids == 0 && @@ -926,57 +926,60 @@ // Only one thread is continuing m_gdb_comm.SetCurrentThreadForRun (m_continue_c_tids.front()); continue_packet.PutChar ('c'); - } - else - { - // We can't represent this continue packet.... - continue_packet_error = true; + continue_packet_error = false; } } - if (!continue_packet_error && num_continue_C_tids > 0) + if (continue_packet_error && num_continue_C_tids > 0) { - if (num_continue_C_tids == num_threads) + if ((num_continue_C_tids + num_continue_c_tids) == num_threads && + num_continue_C_tids > 0 && + num_continue_s_tids == 0 && + num_continue_S_tids == 0 ) { const int continue_signo = m_continue_C_tids.front().second; + // Only one thread is continuing if (num_continue_C_tids > 1) { - for (size_t i=1; i 1) { - if (m_continue_C_tids[i].second != continue_signo) - continue_packet_error = true; + continue_packet_error = false; + for (size_t i=1; i 0) + if (continue_packet_error && num_continue_s_tids > 0) { if (num_continue_s_tids == num_threads) { // All threads are resuming... m_gdb_comm.SetCurrentThreadForRun (-1); - continue_packet.PutChar ('s'); + continue_packet.PutChar ('s'); + continue_packet_error = false; } else if (num_continue_c_tids == 0 && num_continue_C_tids == 0 && @@ -986,11 +989,7 @@ // Only one thread is stepping m_gdb_comm.SetCurrentThreadForRun (m_continue_s_tids.front()); continue_packet.PutChar ('s'); - } - else - { - // We can't represent this continue packet.... - continue_packet_error = true; + continue_packet_error = false; } } @@ -1000,6 +999,7 @@ { const int step_signo = m_continue_S_tids.front().second; // Are all threads trying to step with the same signal? + continue_packet_error = false; if (num_continue_S_tids > 1) { for (size_t i=1; i Author: gclayton Date: Thu Jun 23 22:47:23 2011 New Revision: 133786 URL: http://llvm.org/viewvc/llvm-project?rev=133786&view=rev Log: Remove an assertion and replace with safe code that emits a warning. Modified: lldb/trunk/source/Symbol/Function.cpp Modified: lldb/trunk/source/Symbol/Function.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Function.cpp?rev=133786&r1=133785&r2=133786&view=diff ============================================================================== --- lldb/trunk/source/Symbol/Function.cpp (original) +++ lldb/trunk/source/Symbol/Function.cpp Thu Jun 23 22:47:23 2011 @@ -305,8 +305,19 @@ { SymbolContext sc; CalculateSymbolContext(&sc); - assert(sc.module_sp); - sc.module_sp->GetSymbolVendor()->ParseFunctionBlocks(sc); + if (sc.module_sp) + { + sc.module_sp->GetSymbolVendor()->ParseFunctionBlocks(sc); + } + else + { + ::fprintf (stderr, + "unable to find module shared pointer for function '%s' in %s%s%s\n", + GetName().GetCString(), + m_comp_unit->GetDirectory().GetCString(), + m_comp_unit->GetDirectory() ? "/" : "", + m_comp_unit->GetFilename().GetCString()); + } m_block.SetBlockInfoHasBeenParsed (true, true); } return m_block; From johnny.chen at apple.com Fri Jun 24 13:49:27 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Fri, 24 Jun 2011 18:49:27 -0000 Subject: [Lldb-commits] [lldb] r133809 - in /lldb/trunk/test/python_api/default-constructor: TestDefaultConstructorForAPIObjects.py sb_breakpoint.py Message-ID: <20110624184927.632332A6C12C@llvm.org> Author: johnny Date: Fri Jun 24 13:49:27 2011 New Revision: 133809 URL: http://llvm.org/viewvc/llvm-project?rev=133809&view=rev Log: Add fuzz calls for SBBreakpoint. Added: lldb/trunk/test/python_api/default-constructor/sb_breakpoint.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py?rev=133809&r1=133808&r2=133809&view=diff ============================================================================== --- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original) +++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Fri Jun 24 13:49:27 2011 @@ -2,8 +2,9 @@ Test lldb Python API object's default constructor and make sure it is invalid after initial construction. -There are three exceptions to the above general rules, though; the API objects are -SBCommadnReturnObject, SBStream, and SBSymbolContextList. +There are three exceptions to the above general rules, though; API objects +SBCommadnReturnObject, SBStream, and SBSymbolContextList, are all valid objects +after default construction. """ import os, time @@ -42,6 +43,9 @@ if self.TraceOn(): print obj self.assertFalse(obj) + # Do fuzz testing on the invalid obj, it should not crash lldb. + import sb_breakpoint + sb_breakpoint.fuzz_obj(obj) @python_api_test def test_SBBreakpointLocation(self): Added: lldb/trunk/test/python_api/default-constructor/sb_breakpoint.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_breakpoint.py?rev=133809&view=auto ============================================================================== --- lldb/trunk/test/python_api/default-constructor/sb_breakpoint.py (added) +++ lldb/trunk/test/python_api/default-constructor/sb_breakpoint.py Fri Jun 24 13:49:27 2011 @@ -0,0 +1,33 @@ +""" +Fuzz tests an object after the default construction to make sure it does not crash lldb. +""" + +import sys +import lldb + +def fuzz_obj(obj): + obj.GetID() + obj.ClearAllBreakpointSites() + obj.FindLocationByAddress(sys.maxint) + obj.FindLocationIDByAddress(sys.maxint) + obj.FindLocationByID(0) + obj.GetLocationAtIndex(0) + obj.SetEnabled(True) + obj.IsEnabled() + obj.GetHitCount() + obj.SetIgnoreCount(1) + obj.GetIgnoreCount() + obj.SetCondition("i >= 10") + obj.GetCondition() + obj.SetThreadID(0) + obj.GetThreadID() + obj.SetThreadIndex(0) + obj.GetThreadIndex() + obj.SetThreadName("worker thread") + obj.GetThreadName() + obj.SetQueueName("my queue") + obj.GetQueueName() + obj.SetCallback(None, None) + obj.GetNumResolvedLocations() + obj.GetNumLocations() + obj.GetDescription(lldb.SBStream()) From johnny.chen at apple.com Fri Jun 24 14:00:22 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Fri, 24 Jun 2011 19:00:22 -0000 Subject: [Lldb-commits] [lldb] r133810 - in /lldb/trunk/test/python_api/default-constructor: TestDefaultConstructorForAPIObjects.py sb_breakpointlocation.py Message-ID: <20110624190022.D3A8D2A6C12C@llvm.org> Author: johnny Date: Fri Jun 24 14:00:22 2011 New Revision: 133810 URL: http://llvm.org/viewvc/llvm-project?rev=133810&view=rev Log: Add fuzz calls for SBBreakpointLocation. Added: lldb/trunk/test/python_api/default-constructor/sb_breakpointlocation.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py?rev=133810&r1=133809&r2=133810&view=diff ============================================================================== --- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original) +++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Fri Jun 24 14:00:22 2011 @@ -53,6 +53,9 @@ if self.TraceOn(): print obj self.assertFalse(obj) + # Do fuzz testing on the invalid obj, it should not crash lldb. + import sb_breakpointlocation + sb_breakpointlocation.fuzz_obj(obj) @python_api_test def test_SBBroadcaster(self): Added: lldb/trunk/test/python_api/default-constructor/sb_breakpointlocation.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_breakpointlocation.py?rev=133810&view=auto ============================================================================== --- lldb/trunk/test/python_api/default-constructor/sb_breakpointlocation.py (added) +++ lldb/trunk/test/python_api/default-constructor/sb_breakpointlocation.py Fri Jun 24 14:00:22 2011 @@ -0,0 +1,27 @@ +""" +Fuzz tests an object after the default construction to make sure it does not crash lldb. +""" + +import sys +import lldb + +def fuzz_obj(obj): + obj.GetLoadAddress() + obj.SetEnabled(True) + obj.IsEnabled() + obj.SetCondition("i >= 10") + obj.GetCondition() + obj.SetThreadID(0) + obj.GetThreadID() + obj.SetThreadIndex(0) + obj.GetThreadIndex() + obj.SetThreadName("worker thread") + obj.GetThreadName() + obj.SetQueueName("my queue") + obj.GetQueueName() + obj.IsResolved() + obj.GetDescription(lldb.SBStream(), lldb.eDescriptionLevelVerbose) + breakpoint = obj.GetBreakpoint() + # Do fuzz testing on the breakpoint obj, it should not crash lldb. + import sb_breakpoint + sb_breakpoint.fuzz_obj(breakpoint) From jingham at apple.com Fri Jun 24 17:03:24 2011 From: jingham at apple.com (Jim Ingham) Date: Fri, 24 Jun 2011 22:03:24 -0000 Subject: [Lldb-commits] [lldb] r133831 - in /lldb/trunk: include/lldb/ include/lldb/Symbol/ include/lldb/Target/ lldb.xcodeproj/ source/API/ source/Core/ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/ source/Symbol/ source/Target/ test/objc-ivar-offsets/ Message-ID: <20110624220325.067292A6C12C@llvm.org> Author: jingham Date: Fri Jun 24 17:03:24 2011 New Revision: 133831 URL: http://llvm.org/viewvc/llvm-project?rev=133831&view=rev Log: Add support for looking up ivar offset from the ObjC runtime. Added: lldb/trunk/test/objc-ivar-offsets/ lldb/trunk/test/objc-ivar-offsets/Makefile lldb/trunk/test/objc-ivar-offsets/TestObjCIvarOffsets.py lldb/trunk/test/objc-ivar-offsets/main.m lldb/trunk/test/objc-ivar-offsets/objc-ivar-offsets.h lldb/trunk/test/objc-ivar-offsets/objc-ivar-offsets.m Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h lldb/trunk/include/lldb/lldb-defines.h lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/source/API/SBType.cpp lldb/trunk/source/Core/ValueObject.cpp lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h lldb/trunk/source/Symbol/ClangASTContext.cpp lldb/trunk/source/Target/ObjCLanguageRuntime.cpp Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=133831&r1=133830&r2=133831&view=diff ============================================================================== --- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Fri Jun 24 17:03:24 2011 @@ -399,7 +399,8 @@ GetNumPointeeChildren (lldb::clang_type_t clang_type); lldb::clang_type_t - GetChildClangTypeAtIndex (const char *parent_name, + GetChildClangTypeAtIndex (ExecutionContext *exe_ctx, + const char *parent_name, lldb::clang_type_t parent_clang_type, uint32_t idx, bool transparent_pointers, @@ -413,7 +414,8 @@ bool &child_is_deref_of_parent); static lldb::clang_type_t - GetChildClangTypeAtIndex (clang::ASTContext *ast, + GetChildClangTypeAtIndex (ExecutionContext *exe_ctx, + clang::ASTContext *ast, const char *parent_name, lldb::clang_type_t parent_clang_type, uint32_t idx, Modified: lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h?rev=133831&r1=133830&r2=133831&view=diff ============================================================================== --- lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h (original) +++ lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h Fri Jun 24 17:03:24 2011 @@ -73,6 +73,12 @@ return eObjC_VersionUnknown; } + // Finds the byte offset of the child_type ivar in parent_type. If it can't find the + // offset, returns LLDB_INVALID_IVAR_OFFSET. + + virtual size_t + GetByteOffsetForIvar (ClangASTType &parent_qual_type, const char *ivar_name); + protected: //------------------------------------------------------------------ // Classes that inherit from ObjCLanguageRuntime can see and modify these Modified: lldb/trunk/include/lldb/lldb-defines.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-defines.h?rev=133831&r1=133830&r2=133831&view=diff ============================================================================== --- lldb/trunk/include/lldb/lldb-defines.h (original) +++ lldb/trunk/include/lldb/lldb-defines.h Fri Jun 24 17:03:24 2011 @@ -69,6 +69,7 @@ //---------------------------------------------------------------------- #define LLDB_INVALID_ADDRESS UINT64_MAX #define LLDB_INVALID_INDEX32 UINT32_MAX +#define LLDB_INVALID_IVAR_OFFSET UINT32_MAX #define LLDB_INVALID_IMAGE_TOKEN UINT32_MAX #define LLDB_INVALID_REGNUM UINT32_MAX #define LLDB_INVALID_UID UINT32_MAX Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=133831&r1=133830&r2=133831&view=diff ============================================================================== --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri Jun 24 17:03:24 2011 @@ -200,12 +200,6 @@ 2689008C13353E4200698AC0 /* DisassemblerLLVM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C897410F57C5600BB2B04 /* DisassemblerLLVM.cpp */; }; 2689008D13353E4200698AC0 /* DynamicLoaderMacOSXDYLD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C897A10F57C5600BB2B04 /* DynamicLoaderMacOSXDYLD.cpp */; }; 2689008E13353E4200698AC0 /* DynamicLoaderStatic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268A683D1321B53B000E3FB8 /* DynamicLoaderStatic.cpp */; }; - 2689009013353E4200698AC0 /* ItaniumABILanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CB4436A124944B000C13DC2 /* ItaniumABILanguageRuntime.cpp */; }; - 2689009113353E4200698AC0 /* AppleObjCRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C61978812823D4300FAFFCC /* AppleObjCRuntime.cpp */; }; - 2689009213353E4200698AC0 /* AppleObjCRuntimeV1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C61978A12823D4300FAFFCC /* AppleObjCRuntimeV1.cpp */; }; - 2689009313353E4200698AC0 /* AppleObjCTrampolineHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C0A91D412511CB900CA6636 /* AppleObjCTrampolineHandler.cpp */; }; - 2689009413353E4200698AC0 /* AppleThreadPlanStepThroughObjCTrampoline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C0A91D612511CB900CA6636 /* AppleThreadPlanStepThroughObjCTrampoline.cpp */; }; - 2689009513353E4200698AC0 /* AppleObjCRuntimeV2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C139EA3124A8B03000BFF8D /* AppleObjCRuntimeV2.cpp */; }; 2689009613353E4200698AC0 /* ObjectContainerBSDArchive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A3B4AC1181454800381BC2 /* ObjectContainerBSDArchive.cpp */; }; 2689009713353E4200698AC0 /* ObjectContainerUniversalMachO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C898010F57C5600BB2B04 /* ObjectContainerUniversalMachO.cpp */; }; 2689009813353E4200698AC0 /* ELFHeader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D27C9D11ED3A4E0024D721 /* ELFHeader.cpp */; }; @@ -398,6 +392,12 @@ 49C8507C1384A786007DB519 /* ProcessDataAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49C850781384A0CA007DB519 /* ProcessDataAllocator.cpp */; }; 4C74CB6312288704006A8171 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C74CB6212288704006A8171 /* Carbon.framework */; }; 4CABA9E0134A8BCD00539BDD /* ValueObjectMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CABA9DF134A8BCD00539BDD /* ValueObjectMemory.cpp */; }; + 4CCA644D13B40B82003BDF98 /* ItaniumABILanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA643D13B40B82003BDF98 /* ItaniumABILanguageRuntime.cpp */; }; + 4CCA645013B40B82003BDF98 /* AppleObjCRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644213B40B82003BDF98 /* AppleObjCRuntime.cpp */; }; + 4CCA645213B40B82003BDF98 /* AppleObjCRuntimeV1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644413B40B82003BDF98 /* AppleObjCRuntimeV1.cpp */; }; + 4CCA645413B40B82003BDF98 /* AppleObjCRuntimeV2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644613B40B82003BDF98 /* AppleObjCRuntimeV2.cpp */; }; + 4CCA645613B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644813B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp */; }; + 4CCA645813B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644A13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp */; }; 4CD0BD0F134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CD0BD0E134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp */; }; 9415F61813B2C0EF00A52B36 /* FormatManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9415F61713B2C0EF00A52B36 /* FormatManager.cpp */; }; 9463D4CD13B1798800C230D4 /* CommandObjectType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9463D4CC13B1798800C230D4 /* CommandObjectType.cpp */; }; @@ -1105,12 +1105,6 @@ 4C08CDEB11C81F1E001610A8 /* ThreadSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadSpec.h; path = include/lldb/Target/ThreadSpec.h; sourceTree = ""; }; 4C09CB73116BD98B00C7A725 /* CommandCompletions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandCompletions.h; path = include/lldb/Interpreter/CommandCompletions.h; sourceTree = ""; }; 4C09CB74116BD98B00C7A725 /* CommandCompletions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandCompletions.cpp; path = source/Commands/CommandCompletions.cpp; sourceTree = ""; }; - 4C0A91D412511CB900CA6636 /* AppleObjCTrampolineHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppleObjCTrampolineHandler.cpp; path = LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp; sourceTree = ""; }; - 4C0A91D512511CB900CA6636 /* AppleObjCTrampolineHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppleObjCTrampolineHandler.h; path = LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h; sourceTree = ""; }; - 4C0A91D612511CB900CA6636 /* AppleThreadPlanStepThroughObjCTrampoline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppleThreadPlanStepThroughObjCTrampoline.cpp; path = LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp; sourceTree = ""; }; - 4C0A91D712511CB900CA6636 /* AppleThreadPlanStepThroughObjCTrampoline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppleThreadPlanStepThroughObjCTrampoline.h; path = LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h; sourceTree = ""; }; - 4C139EA3124A8B03000BFF8D /* AppleObjCRuntimeV2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppleObjCRuntimeV2.cpp; path = LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp; sourceTree = ""; }; - 4C139EA4124A8B03000BFF8D /* AppleObjCRuntimeV2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppleObjCRuntimeV2.h; path = LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h; sourceTree = ""; }; 4C1AB23A1263E5F400D0F04A /* ThreadPlanTestCondition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanTestCondition.cpp; path = source/Target/ThreadPlanTestCondition.cpp; sourceTree = ""; }; 4C1AB23E1263E61100D0F04A /* ThreadPlanTestCondition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanTestCondition.h; path = include/lldb/Target/ThreadPlanTestCondition.h; sourceTree = ""; }; 4C2FAE2E135E3A70001EDE44 /* SharedCluster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SharedCluster.h; path = include/lldb/Utility/SharedCluster.h; sourceTree = ""; }; @@ -1122,10 +1116,6 @@ 4C43DF8A11069C3200E55CBF /* ThreadPlanStepOverRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanStepOverRange.cpp; path = source/Target/ThreadPlanStepOverRange.cpp; sourceTree = ""; }; 4C5DBBC611E3FEC60035160F /* CommandObjectCommands.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectCommands.cpp; path = source/Commands/CommandObjectCommands.cpp; sourceTree = ""; }; 4C5DBBC711E3FEC60035160F /* CommandObjectCommands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectCommands.h; path = source/Commands/CommandObjectCommands.h; sourceTree = ""; }; - 4C61978812823D4300FAFFCC /* AppleObjCRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppleObjCRuntime.cpp; path = LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp; sourceTree = ""; }; - 4C61978912823D4300FAFFCC /* AppleObjCRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppleObjCRuntime.h; path = LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h; sourceTree = ""; }; - 4C61978A12823D4300FAFFCC /* AppleObjCRuntimeV1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppleObjCRuntimeV1.cpp; path = LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp; sourceTree = ""; }; - 4C61978B12823D4300FAFFCC /* AppleObjCRuntimeV1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppleObjCRuntimeV1.h; path = LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h; sourceTree = ""; }; 4C626533130F1B0A00C889F6 /* StreamTee.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StreamTee.h; path = include/lldb/Core/StreamTee.h; sourceTree = ""; }; 4C74CB6212288704006A8171 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; 4C7CF7E31295E10E00B4FBB5 /* ThreadPlanCallUserExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanCallUserExpression.h; path = include/lldb/Target/ThreadPlanCallUserExpression.h; sourceTree = ""; }; @@ -1142,14 +1132,24 @@ 4CAFCE031101218900CA63DB /* ThreadPlanRunToAddress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanRunToAddress.cpp; path = source/Target/ThreadPlanRunToAddress.cpp; sourceTree = ""; }; 4CB4430912491DDA00C13DC2 /* LanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LanguageRuntime.h; path = include/lldb/Target/LanguageRuntime.h; sourceTree = ""; }; 4CB4430A12491DDA00C13DC2 /* LanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LanguageRuntime.cpp; path = source/Target/LanguageRuntime.cpp; sourceTree = ""; }; - 4CB44369124944B000C13DC2 /* ItaniumABILanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ItaniumABILanguageRuntime.h; path = LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h; sourceTree = ""; }; - 4CB4436A124944B000C13DC2 /* ItaniumABILanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ItaniumABILanguageRuntime.cpp; path = LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp; sourceTree = ""; }; 4CB443BB1249920C00C13DC2 /* CPPLanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPPLanguageRuntime.h; path = include/lldb/Target/CPPLanguageRuntime.h; sourceTree = ""; }; 4CB443BC1249920C00C13DC2 /* CPPLanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CPPLanguageRuntime.cpp; path = source/Target/CPPLanguageRuntime.cpp; sourceTree = ""; }; 4CB443F212499B5000C13DC2 /* ObjCLanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ObjCLanguageRuntime.cpp; path = source/Target/ObjCLanguageRuntime.cpp; sourceTree = ""; }; 4CB443F612499B6E00C13DC2 /* ObjCLanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ObjCLanguageRuntime.h; path = include/lldb/Target/ObjCLanguageRuntime.h; sourceTree = ""; }; 4CC2A148128C73ED001531C4 /* ThreadPlanTracer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanTracer.cpp; path = source/Target/ThreadPlanTracer.cpp; sourceTree = ""; }; 4CC2A14C128C7409001531C4 /* ThreadPlanTracer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanTracer.h; path = include/lldb/Target/ThreadPlanTracer.h; sourceTree = ""; }; + 4CCA643D13B40B82003BDF98 /* ItaniumABILanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ItaniumABILanguageRuntime.cpp; sourceTree = ""; }; + 4CCA643E13B40B82003BDF98 /* ItaniumABILanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItaniumABILanguageRuntime.h; sourceTree = ""; }; + 4CCA644213B40B82003BDF98 /* AppleObjCRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleObjCRuntime.cpp; sourceTree = ""; }; + 4CCA644313B40B82003BDF98 /* AppleObjCRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleObjCRuntime.h; sourceTree = ""; }; + 4CCA644413B40B82003BDF98 /* AppleObjCRuntimeV1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleObjCRuntimeV1.cpp; sourceTree = ""; }; + 4CCA644513B40B82003BDF98 /* AppleObjCRuntimeV1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleObjCRuntimeV1.h; sourceTree = ""; }; + 4CCA644613B40B82003BDF98 /* AppleObjCRuntimeV2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleObjCRuntimeV2.cpp; sourceTree = ""; }; + 4CCA644713B40B82003BDF98 /* AppleObjCRuntimeV2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleObjCRuntimeV2.h; sourceTree = ""; }; + 4CCA644813B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleObjCTrampolineHandler.cpp; sourceTree = ""; }; + 4CCA644913B40B82003BDF98 /* AppleObjCTrampolineHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleObjCTrampolineHandler.h; sourceTree = ""; }; + 4CCA644A13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleThreadPlanStepThroughObjCTrampoline.cpp; sourceTree = ""; }; + 4CCA644B13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleThreadPlanStepThroughObjCTrampoline.h; sourceTree = ""; }; 4CD0BD0C134BFAB600CB44D4 /* ValueObjectDynamicValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectDynamicValue.h; path = include/lldb/Core/ValueObjectDynamicValue.h; sourceTree = ""; }; 4CD0BD0E134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectDynamicValue.cpp; path = source/Core/ValueObjectDynamicValue.cpp; sourceTree = ""; }; 4CEDAED311754F5E00E875A6 /* ThreadPlanStepUntil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepUntil.h; path = include/lldb/Target/ThreadPlanStepUntil.h; sourceTree = ""; }; @@ -1364,7 +1364,7 @@ 260C897210F57C5600BB2B04 /* Disassembler */, 260C897810F57C5600BB2B04 /* DynamicLoader */, 26D9FDCA12F785120003F2EE /* Instruction */, - 4CB443651249446F00C13DC2 /* LanguageRuntime */, + 4CCA643A13B40B82003BDF98 /* LanguageRuntime */, 260C897E10F57C5600BB2B04 /* ObjectContainer */, 260C898210F57C5600BB2B04 /* ObjectFile */, 26C5577E132575B6008FD8FE /* Platform */, @@ -2498,55 +2498,55 @@ sourceTree = ""; usesTabs = 0; }; - 4C139EA0124A8AC7000BFF8D /* CPlusPlus */ = { + 4CCA643A13B40B82003BDF98 /* LanguageRuntime */ = { isa = PBXGroup; children = ( - 4CB443661249448300C13DC2 /* ItaniumABI */, + 4CCA643B13B40B82003BDF98 /* CPlusPlus */, + 4CCA644013B40B82003BDF98 /* ObjC */, ); - name = CPlusPlus; + path = LanguageRuntime; sourceTree = ""; }; - 4C139EA1124A8AD5000BFF8D /* ObjC */ = { + 4CCA643B13B40B82003BDF98 /* CPlusPlus */ = { isa = PBXGroup; children = ( - 4C139EA2124A8AE5000BFF8D /* AppleRuntime */, + 4CCA643C13B40B82003BDF98 /* ItaniumABI */, ); - name = ObjC; + path = CPlusPlus; sourceTree = ""; }; - 4C139EA2124A8AE5000BFF8D /* AppleRuntime */ = { + 4CCA643C13B40B82003BDF98 /* ItaniumABI */ = { isa = PBXGroup; children = ( - 4C61978812823D4300FAFFCC /* AppleObjCRuntime.cpp */, - 4C61978912823D4300FAFFCC /* AppleObjCRuntime.h */, - 4C61978A12823D4300FAFFCC /* AppleObjCRuntimeV1.cpp */, - 4C61978B12823D4300FAFFCC /* AppleObjCRuntimeV1.h */, - 4C0A91D512511CB900CA6636 /* AppleObjCTrampolineHandler.h */, - 4C0A91D412511CB900CA6636 /* AppleObjCTrampolineHandler.cpp */, - 4C0A91D712511CB900CA6636 /* AppleThreadPlanStepThroughObjCTrampoline.h */, - 4C0A91D612511CB900CA6636 /* AppleThreadPlanStepThroughObjCTrampoline.cpp */, - 4C139EA4124A8B03000BFF8D /* AppleObjCRuntimeV2.h */, - 4C139EA3124A8B03000BFF8D /* AppleObjCRuntimeV2.cpp */, + 4CCA643D13B40B82003BDF98 /* ItaniumABILanguageRuntime.cpp */, + 4CCA643E13B40B82003BDF98 /* ItaniumABILanguageRuntime.h */, ); - name = AppleRuntime; + path = ItaniumABI; sourceTree = ""; }; - 4CB443651249446F00C13DC2 /* LanguageRuntime */ = { + 4CCA644013B40B82003BDF98 /* ObjC */ = { isa = PBXGroup; children = ( - 4C139EA0124A8AC7000BFF8D /* CPlusPlus */, - 4C139EA1124A8AD5000BFF8D /* ObjC */, + 4CCA644113B40B82003BDF98 /* AppleObjCRuntime */, ); - name = LanguageRuntime; + path = ObjC; sourceTree = ""; }; - 4CB443661249448300C13DC2 /* ItaniumABI */ = { + 4CCA644113B40B82003BDF98 /* AppleObjCRuntime */ = { isa = PBXGroup; children = ( - 4CB44369124944B000C13DC2 /* ItaniumABILanguageRuntime.h */, - 4CB4436A124944B000C13DC2 /* ItaniumABILanguageRuntime.cpp */, + 4CCA644213B40B82003BDF98 /* AppleObjCRuntime.cpp */, + 4CCA644313B40B82003BDF98 /* AppleObjCRuntime.h */, + 4CCA644413B40B82003BDF98 /* AppleObjCRuntimeV1.cpp */, + 4CCA644513B40B82003BDF98 /* AppleObjCRuntimeV1.h */, + 4CCA644613B40B82003BDF98 /* AppleObjCRuntimeV2.cpp */, + 4CCA644713B40B82003BDF98 /* AppleObjCRuntimeV2.h */, + 4CCA644813B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp */, + 4CCA644913B40B82003BDF98 /* AppleObjCTrampolineHandler.h */, + 4CCA644A13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp */, + 4CCA644B13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.h */, ); - name = ItaniumABI; + path = AppleObjCRuntime; sourceTree = ""; }; 4CEE62F71145F1C70064CF93 /* GDB Remote */ = { @@ -3069,12 +3069,6 @@ 2689008C13353E4200698AC0 /* DisassemblerLLVM.cpp in Sources */, 2689008D13353E4200698AC0 /* DynamicLoaderMacOSXDYLD.cpp in Sources */, 2689008E13353E4200698AC0 /* DynamicLoaderStatic.cpp in Sources */, - 2689009013353E4200698AC0 /* ItaniumABILanguageRuntime.cpp in Sources */, - 2689009113353E4200698AC0 /* AppleObjCRuntime.cpp in Sources */, - 2689009213353E4200698AC0 /* AppleObjCRuntimeV1.cpp in Sources */, - 2689009313353E4200698AC0 /* AppleObjCTrampolineHandler.cpp in Sources */, - 2689009413353E4200698AC0 /* AppleThreadPlanStepThroughObjCTrampoline.cpp in Sources */, - 2689009513353E4200698AC0 /* AppleObjCRuntimeV2.cpp in Sources */, 2689009613353E4200698AC0 /* ObjectContainerBSDArchive.cpp in Sources */, 2689009713353E4200698AC0 /* ObjectContainerUniversalMachO.cpp in Sources */, 2689009813353E4200698AC0 /* ELFHeader.cpp in Sources */, @@ -3231,6 +3225,12 @@ 9A9E1EFF1398086D005AC039 /* InputReaderStack.cpp in Sources */, B28058A1139988B0002D96D0 /* InferiorCallPOSIX.cpp in Sources */, 26F73062139D8FDB00FD51C7 /* History.cpp in Sources */, + 4CCA644D13B40B82003BDF98 /* ItaniumABILanguageRuntime.cpp in Sources */, + 4CCA645013B40B82003BDF98 /* AppleObjCRuntime.cpp in Sources */, + 4CCA645213B40B82003BDF98 /* AppleObjCRuntimeV1.cpp in Sources */, + 4CCA645413B40B82003BDF98 /* AppleObjCRuntimeV2.cpp in Sources */, + 4CCA645613B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp in Sources */, + 4CCA645813B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp in Sources */, 9463D4CD13B1798800C230D4 /* CommandObjectType.cpp in Sources */, 9415F61813B2C0EF00A52B36 /* FormatManager.cpp in Sources */, ); Modified: lldb/trunk/source/API/SBType.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBType.cpp?rev=133831&r1=133830&r2=133831&view=diff ============================================================================== --- lldb/trunk/source/API/SBType.cpp (original) +++ lldb/trunk/source/API/SBType.cpp Fri Jun 24 17:03:24 2011 @@ -118,7 +118,8 @@ if (IsValid ()) { - child_clang_type = ClangASTContext::GetChildClangTypeAtIndex (static_cast(m_ast), + child_clang_type = ClangASTContext::GetChildClangTypeAtIndex (NULL, + static_cast(m_ast), NULL, m_type, idx, Modified: lldb/trunk/source/Core/ValueObject.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=133831&r1=133830&r2=133831&view=diff ============================================================================== --- lldb/trunk/source/Core/ValueObject.cpp (original) +++ lldb/trunk/source/Core/ValueObject.cpp Fri Jun 24 17:03:24 2011 @@ -407,7 +407,12 @@ clang::ASTContext *clang_ast = GetClangAST(); clang_type_t clang_type = GetClangType(); clang_type_t child_clang_type; - child_clang_type = ClangASTContext::GetChildClangTypeAtIndex (clang_ast, + + ExecutionContext exe_ctx; + GetExecutionContextScope()->CalculateExecutionContext (exe_ctx); + + child_clang_type = ClangASTContext::GetChildClangTypeAtIndex (&exe_ctx, + clang_ast, GetName().GetCString(), clang_type, idx, @@ -1436,7 +1441,12 @@ clang::ASTContext *clang_ast = GetClangAST(); clang_type_t clang_type = GetClangType(); clang_type_t child_clang_type; - child_clang_type = ClangASTContext::GetChildClangTypeAtIndex (clang_ast, + + ExecutionContext exe_ctx; + GetExecutionContextScope()->CalculateExecutionContext (exe_ctx); + + child_clang_type = ClangASTContext::GetChildClangTypeAtIndex (&exe_ctx, + clang_ast, GetName().GetCString(), clang_type, 0, Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h?rev=133831&r1=133830&r2=133831&view=diff ============================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h (original) +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h Fri Jun 24 17:03:24 2011 @@ -28,7 +28,7 @@ { public: - ~AppleObjCRuntime() { } + virtual ~AppleObjCRuntime() { } // These are generic runtime functions: virtual bool Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h?rev=133831&r1=133830&r2=133831&view=diff ============================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h (original) +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h Fri Jun 24 17:03:24 2011 @@ -28,7 +28,7 @@ public AppleObjCRuntime { public: - ~AppleObjCRuntimeV1() { } + virtual ~AppleObjCRuntimeV1() { } // These are generic runtime functions: virtual bool 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=133831&r1=133830&r2=133831&view=diff ============================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original) +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Fri Jun 24 17:03:24 2011 @@ -7,13 +7,18 @@ // //===----------------------------------------------------------------------===// -#include "AppleObjCRuntimeV2.h" -#include "AppleObjCTrampolineHandler.h" -#include "llvm/Support/MachO.h" -#include "clang/AST/Type.h" +#include +#include +#include +#include + +#include "lldb/lldb-enumerations.h" +#include "lldb/Core/ClangForward.h" +#include "lldb/Symbol/ClangASTType.h" #include "lldb/Breakpoint/BreakpointLocation.h" +#include "lldb/Core/ClangForward.h" #include "lldb/Core/ConstString.h" #include "lldb/Core/Error.h" #include "lldb/Core/Log.h" @@ -31,10 +36,15 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "AppleObjCRuntimeV2.h" +#include "AppleObjCTrampolineHandler.h" + + #include using namespace lldb; using namespace lldb_private; + static const char *pluginName = "AppleObjCRuntimeV2"; static const char *pluginDesc = "Apple Objective C Language Runtime - Version 2"; @@ -514,3 +524,41 @@ return new ClangUtilityFunction(check_function_code, name); } + +size_t +AppleObjCRuntimeV2::GetByteOffsetForIvar (ClangASTType &parent_ast_type, const char *ivar_name) +{ + const char *class_name = parent_ast_type.GetClangTypeName().AsCString(); + + if (!class_name || *class_name == '\0' || !ivar_name || *ivar_name == '\0') + return LLDB_INVALID_IVAR_OFFSET; + + std::string buffer("OBJC_IVAR_$_"); + buffer.append (class_name); + buffer.push_back ('.'); + buffer.append (ivar_name); + ConstString ivar_const_str (buffer.c_str()); + + SymbolContextList sc_list; + Target *target = &(m_process->GetTarget()); + + target->GetImages().FindSymbolsWithNameAndType(ivar_const_str, eSymbolTypeRuntime, sc_list); + + SymbolContext ivar_offset_symbol; + if (sc_list.GetSize() != 1 + || !sc_list.GetContextAtIndex(0, ivar_offset_symbol) + || ivar_offset_symbol.symbol == NULL) + return LLDB_INVALID_IVAR_OFFSET; + + lldb::addr_t ivar_offset_address = ivar_offset_symbol.symbol->GetValue().GetLoadAddress(target); + + Error error; + + uint32_t ivar_offset = m_process->ReadUnsignedIntegerFromMemory (ivar_offset_address, + 4, + LLDB_INVALID_IVAR_OFFSET, + error); + return ivar_offset; +} + + Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h?rev=133831&r1=133830&r2=133831&view=diff ============================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h (original) +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h Fri Jun 24 17:03:24 2011 @@ -28,7 +28,7 @@ public AppleObjCRuntime { public: - ~AppleObjCRuntimeV2() { } + virtual ~AppleObjCRuntimeV2() { } // These are generic runtime functions: virtual bool @@ -73,6 +73,10 @@ { return eAppleObjC_V2; } + + virtual size_t + GetByteOffsetForIvar (ClangASTType &parent_qual_type, const char *ivar_name); + protected: Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=133831&r1=133830&r2=133831&view=diff ============================================================================== --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Fri Jun 24 17:03:24 2011 @@ -58,6 +58,10 @@ #include "lldb/Core/dwarf.h" #include "lldb/Core/Flags.h" #include "lldb/Core/Log.h" +#include "lldb/Target/ExecutionContext.h" +#include "lldb/Target/Process.h" +#include "lldb/Target/ObjCLanguageRuntime.h" + #include @@ -2445,6 +2449,7 @@ clang_type_t ClangASTContext::GetChildClangTypeAtIndex ( + ExecutionContext *exe_ctx, const char *parent_name, clang_type_t parent_clang_type, uint32_t idx, @@ -2461,7 +2466,8 @@ { if (parent_clang_type) - return GetChildClangTypeAtIndex (getASTContext(), + return GetChildClangTypeAtIndex (exe_ctx, + getASTContext(), parent_name, parent_clang_type, idx, @@ -2480,6 +2486,7 @@ clang_type_t ClangASTContext::GetChildClangTypeAtIndex ( + ExecutionContext *exe_ctx, ASTContext *ast, const char *parent_name, clang_type_t parent_clang_type, @@ -2677,8 +2684,27 @@ child_byte_size = ivar_type_info.first / 8; // Figure out the field offset within the current struct/union/class type - bit_offset = interface_layout.getFieldOffset (child_idx - superclass_idx); - child_byte_offset = bit_offset / 8; + // For ObjC objects, we can't trust the bit offset we get from the Clang AST, since + // that doesn't account for the space taken up by unbacked properties, or from + // the changing size of base classes that are newer than this class. + // So if we have a process around that we can ask about this object, do so. + child_byte_offset = LLDB_INVALID_IVAR_OFFSET; + + if (exe_ctx && exe_ctx->process) + { + ObjCLanguageRuntime *objc_runtime = exe_ctx->process->GetObjCLanguageRuntime(); + if (objc_runtime != NULL) + { + ClangASTType parent_ast_type (parent_qual_type.getAsOpaquePtr(), ast); + child_byte_offset = objc_runtime->GetByteOffsetForIvar (parent_ast_type, ivar_decl->getNameAsString().c_str()); + } + } + + if (child_byte_offset == LLDB_INVALID_IVAR_OFFSET) + { + bit_offset = interface_layout.getFieldOffset (child_idx - superclass_idx); + child_byte_offset = bit_offset / 8; + } return ivar_qual_type.getAsOpaquePtr(); } @@ -2699,7 +2725,8 @@ { child_is_deref_of_parent = false; bool tmp_child_is_deref_of_parent = false; - return GetChildClangTypeAtIndex (ast, + return GetChildClangTypeAtIndex (exe_ctx, + ast, parent_name, pointer_type->getPointeeType().getAsOpaquePtr(), idx, @@ -2772,7 +2799,8 @@ { child_is_deref_of_parent = false; bool tmp_child_is_deref_of_parent = false; - return GetChildClangTypeAtIndex (ast, + return GetChildClangTypeAtIndex (exe_ctx, + ast, parent_name, pointer_type->getPointeeType().getAsOpaquePtr(), idx, @@ -2819,7 +2847,8 @@ { child_is_deref_of_parent = false; bool tmp_child_is_deref_of_parent = false; - return GetChildClangTypeAtIndex (ast, + return GetChildClangTypeAtIndex (exe_ctx, + ast, parent_name, pointee_clang_type, idx, @@ -2855,7 +2884,8 @@ break; case clang::Type::Typedef: - return GetChildClangTypeAtIndex (ast, + return GetChildClangTypeAtIndex (exe_ctx, + ast, parent_name, cast(parent_qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(), idx, Modified: lldb/trunk/source/Target/ObjCLanguageRuntime.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ObjCLanguageRuntime.cpp?rev=133831&r1=133830&r2=133831&view=diff ============================================================================== --- lldb/trunk/source/Target/ObjCLanguageRuntime.cpp (original) +++ lldb/trunk/source/Target/ObjCLanguageRuntime.cpp Fri Jun 24 17:03:24 2011 @@ -93,3 +93,10 @@ return (*pos).second; return TypeAndOrName (); } + +size_t +ObjCLanguageRuntime::GetByteOffsetForIvar (ClangASTType &parent_qual_type, const char *ivar_name) +{ + return LLDB_INVALID_IVAR_OFFSET; +} + Added: lldb/trunk/test/objc-ivar-offsets/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/objc-ivar-offsets/Makefile?rev=133831&view=auto ============================================================================== --- lldb/trunk/test/objc-ivar-offsets/Makefile (added) +++ lldb/trunk/test/objc-ivar-offsets/Makefile Fri Jun 24 17:03:24 2011 @@ -0,0 +1,6 @@ +LEVEL = ../make + +OBJC_SOURCES := objc-ivar-offsets.m main.m +LDFLAGS = $(CFLAGS) -lobjc -framework Foundation + +include $(LEVEL)/Makefile.rules Added: lldb/trunk/test/objc-ivar-offsets/TestObjCIvarOffsets.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/objc-ivar-offsets/TestObjCIvarOffsets.py?rev=133831&view=auto ============================================================================== --- lldb/trunk/test/objc-ivar-offsets/TestObjCIvarOffsets.py (added) +++ lldb/trunk/test/objc-ivar-offsets/TestObjCIvarOffsets.py Fri Jun 24 17:03:24 2011 @@ -0,0 +1,75 @@ +"""Test printing ObjC objects that use unbacked properties - so that the static ivar offsets are incorrect.""" + +import os, time +import unittest2 +import lldb +from lldbtest import * +import lldbutil + +class TestObjCIvarOffsets(TestBase): + + mydir = "objc-ivar-offsets" + + @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") + @python_api_test + def test_with_dsym_and_python_api(self): + """Test printing ObjC objects that use unbacked properties""" + self.buildDsym() + self.objc_ivar_offsets() + + @python_api_test + def test_with_dwarf_and_python_api(self): + """Test printing ObjC objects that use unbacked properties""" + self.buildDwarf() + self.objc_ivar_offsets() + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + # Find the line numbers to break inside main(). + self.main_source = "main.m" + self.stop_line = line_number(self.main_source, '// Set breakpoint here.') + + def objc_ivar_offsets(self): + """Use Python APIs to test stepping into ObjC methods.""" + exe = os.path.join(os.getcwd(), "a.out") + + target = self.dbg.CreateTarget(exe) + self.assertTrue(target, VALID_TARGET) + + breakpoint = target.BreakpointCreateByLocation(self.main_source, self.stop_line) + self.assertTrue(breakpoint, VALID_BREAKPOINT) + + process = target.LaunchSimple (None, None, os.getcwd()) + self.assertTrue (process, "Created a process.") + self.assertTrue (process.GetState() == lldb.eStateStopped, "Stopped it too.") + + thread_list = lldbutil.get_threads_stopped_at_breakpoint (process, breakpoint) + self.assertTrue (len(thread_list) == 1) + thread = thread_list[0] + + frame = thread.GetFrameAtIndex(0) + self.assertTrue (frame, "frame 0 is valid") + + mine = thread.GetFrameAtIndex(0).FindVariable("mine") + self.assertTrue(mine, "Found local variable mine.") + + # Test the value object value for BaseClass->_backed_int + + mine_backed_int = mine.GetChildMemberWithName ("_backed_int") + self.assertTrue(mine_backed_int, "Found mine->backed_int local variable.") + backed_value = int (mine_backed_int.GetValue (frame), 0) + self.assertTrue (backed_value == 1111) + + # Test the value object value for DerivedClass->_derived_backed_int + + mine_derived_backed_int = mine.GetChildMemberWithName ("_derived_backed_int") + self.assertTrue(mine_derived_backed_int, "Found mine->derived_backed_int local variable.") + derived_backed_value = int (mine_derived_backed_int.GetValue (frame), 0) + self.assertTrue (derived_backed_value == 3333) + +if __name__ == '__main__': + import atexit + lldb.SBDebugger.Initialize() + atexit.register(lambda: lldb.SBDebugger.Terminate()) + unittest2.main() Added: lldb/trunk/test/objc-ivar-offsets/main.m URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/objc-ivar-offsets/main.m?rev=133831&view=auto ============================================================================== --- lldb/trunk/test/objc-ivar-offsets/main.m (added) +++ lldb/trunk/test/objc-ivar-offsets/main.m Fri Jun 24 17:03:24 2011 @@ -0,0 +1,13 @@ +#include "objc-ivar-offsets.h" + +int +main () +{ + DerivedClass *mine = [[DerivedClass alloc] init]; + mine.backed_int = 1111; + mine.unbacked_int = 2222; + mine.derived_backed_int = 3333; + mine.derived_unbacked_int = 4444; + + return 0; // Set breakpoint here. +} Added: lldb/trunk/test/objc-ivar-offsets/objc-ivar-offsets.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/objc-ivar-offsets/objc-ivar-offsets.h?rev=133831&view=auto ============================================================================== --- lldb/trunk/test/objc-ivar-offsets/objc-ivar-offsets.h (added) +++ lldb/trunk/test/objc-ivar-offsets/objc-ivar-offsets.h Fri Jun 24 17:03:24 2011 @@ -0,0 +1,23 @@ +#import + + at interface BaseClass : NSObject +{ + int _backed_int; +#if !__OBJC2__ + int _unbacked_int; +#endif +} + at property int backed_int; + at property int unbacked_int; + at end + + at interface DerivedClass : BaseClass +{ + int _derived_backed_int; +#if !__OBJC2__ + int _unbacked_int; +#endif +} + at property int derived_backed_int; + at property int derived_unbacked_int; + at end Added: lldb/trunk/test/objc-ivar-offsets/objc-ivar-offsets.m URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/objc-ivar-offsets/objc-ivar-offsets.m?rev=133831&view=auto ============================================================================== --- lldb/trunk/test/objc-ivar-offsets/objc-ivar-offsets.m (added) +++ lldb/trunk/test/objc-ivar-offsets/objc-ivar-offsets.m Fri Jun 24 17:03:24 2011 @@ -0,0 +1,19 @@ +#import "objc-ivar-offsets.h" + + at implementation BaseClass + at synthesize backed_int = _backed_int; +#if __OBJC2__ + at synthesize unbacked_int; +#else + at synthesize unbacked_int = _unbacked_int; +#endif + at end + + at implementation DerivedClass + at synthesize derived_backed_int = _derived_backed_int; +#if __OBJC2__ + at synthesize derived_unbacked_int; +#else + at synthesize derived_unbacked_int = _derived_unbacked_int; +#endif + at end From gclayton at apple.com Fri Jun 24 17:31:10 2011 From: gclayton at apple.com (Greg Clayton) Date: Fri, 24 Jun 2011 22:31:10 -0000 Subject: [Lldb-commits] [lldb] r133834 - in /lldb/trunk/source: Commands/CommandObjectExpression.cpp Expression/ClangUserExpression.cpp Message-ID: <20110624223110.60D812A6C12D@llvm.org> Author: gclayton Date: Fri Jun 24 17:31:10 2011 New Revision: 133834 URL: http://llvm.org/viewvc/llvm-project?rev=133834&view=rev Log: Cleanup error output on expressions. Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp lldb/trunk/source/Expression/ClangUserExpression.cpp Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=133834&r1=133833&r2=133834&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Fri Jun 24 17:31:10 2011 @@ -335,7 +335,22 @@ } else { - error_stream->PutCString(result_valobj_sp->GetError().AsCString()); + const char *error_cstr = result_valobj_sp->GetError().AsCString(); + if (error_cstr && error_cstr[0]) + { + int error_cstr_len = strlen (error_cstr); + const bool ends_with_newline = error_cstr[error_cstr_len - 1] == '\n'; + if (strstr(error_cstr, "error:") != error_cstr) + error_stream->PutCString ("error: "); + error_stream->Write(error_cstr, error_cstr_len); + if (!ends_with_newline) + error_stream->EOL(); + } + else + { + error_stream->PutCString ("error: unknown error\n"); + } + if (result) result->SetStatus (eReturnStatusFailed); } Modified: lldb/trunk/source/Expression/ClangUserExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangUserExpression.cpp?rev=133834&r1=133833&r2=133834&view=diff ============================================================================== --- lldb/trunk/source/Expression/ClangUserExpression.cpp (original) +++ lldb/trunk/source/Expression/ClangUserExpression.cpp Fri Jun 24 17:31:10 2011 @@ -599,7 +599,7 @@ if (exe_ctx.process == NULL || exe_ctx.process->GetState() != lldb::eStateStopped) { - error.SetErrorString ("Must have a live but stopped process to evaluate expressions."); + error.SetErrorString ("must have a stopped process to evaluate expressions."); result_valobj_sp = ValueObjectConstResult::Create (NULL, error); return eExecutionSetupError; From gclayton at apple.com Fri Jun 24 17:32:10 2011 From: gclayton at apple.com (Greg Clayton) Date: Fri, 24 Jun 2011 22:32:10 -0000 Subject: [Lldb-commits] [lldb] r133835 - in /lldb/trunk/source/Plugins/Process/gdb-remote: ProcessGDBRemote.cpp ProcessGDBRemote.h Message-ID: <20110624223210.F019B2A6C12D@llvm.org> Author: gclayton Date: Fri Jun 24 17:32:10 2011 New Revision: 133835 URL: http://llvm.org/viewvc/llvm-project?rev=133835&view=rev Log: Removed an member variable "m_local_debugserver" that is no longer needed. We now check with the platform to see if we are doing local or remote debugging and setup the stdio accordingly. Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=133835&r1=133834&r2=133835&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Fri Jun 24 17:32:10 2011 @@ -132,7 +132,6 @@ m_dispatch_queue_offsets_addr (LLDB_INVALID_ADDRESS), m_max_memory_size (512), m_waiting_for_attach (false), - m_local_debugserver (true), m_thread_observation_bps() { m_async_broadcaster.SetEventName (eBroadcastBitAsyncThreadShouldExit, "async thread should exit"); @@ -464,7 +463,8 @@ // a pseudo terminal to instead of relying on the 'O' packets for stdio // since 'O' packets can really slow down debugging if the inferior // does a lot of output. - if (m_local_debugserver && !disable_stdio) + PlatformSP platform_sp (m_target.GetPlatform()); + if (platform_sp && platform_sp->IsHost() && !disable_stdio) { const char *slave_name = NULL; if (stdin_path == NULL || stdout_path == NULL || stderr_path == NULL) 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=133835&r1=133834&r2=133835&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h Fri Jun 24 17:32:10 2011 @@ -311,7 +311,6 @@ lldb::addr_t m_dispatch_queue_offsets_addr; size_t m_max_memory_size; // The maximum number of bytes to read/write when reading and writing memory bool m_waiting_for_attach; - bool m_local_debugserver; // Is the debugserver process we are talking to local or on another machine. std::vector m_thread_observation_bps; MMapMap m_addr_to_mmap_size; bool From johnny.chen at apple.com Fri Jun 24 17:52:05 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Fri, 24 Jun 2011 22:52:05 -0000 Subject: [Lldb-commits] [lldb] r133836 - /lldb/trunk/test/dotest.py Message-ID: <20110624225205.2D5B32A6C12C@llvm.org> Author: johnny Date: Fri Jun 24 17:52:05 2011 New Revision: 133836 URL: http://llvm.org/viewvc/llvm-project?rev=133836&view=rev Log: Compute svn_info for git-svn bridge, too. Modified: lldb/trunk/test/dotest.py Modified: lldb/trunk/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=133836&r1=133835&r2=133836&view=diff ============================================================================== --- lldb/trunk/test/dotest.py (original) +++ lldb/trunk/test/dotest.py Fri Jun 24 17:52:05 2011 @@ -591,8 +591,12 @@ os.system('%s -v' % lldbExec) import subprocess - pipe = subprocess.Popen(["svn", "info", base], stdout = subprocess.PIPE) - svn_info = pipe.stdout.read() + if os.path.isdir(os.path.join(base, '.svn')): + pipe = subprocess.Popen(["svn", "info", base], stdout = subprocess.PIPE) + svn_info = pipe.stdout.read() + elif os.path.isdir(os.path.join(base, '.git')): + pipe = subprocess.Popen(["git", "svn", "info", base], stdout = subprocess.PIPE) + svn_info = pipe.stdout.read() print svn_info global ignore From johnny.chen at apple.com Fri Jun 24 17:53:12 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Fri, 24 Jun 2011 22:53:12 -0000 Subject: [Lldb-commits] [lldb] r133837 - in /lldb/trunk/test/python_api/default-constructor: TestDefaultConstructorForAPIObjects.py sb_broadcaster.py Message-ID: <20110624225312.4CA402A6C12C@llvm.org> Author: johnny Date: Fri Jun 24 17:53:12 2011 New Revision: 133837 URL: http://llvm.org/viewvc/llvm-project?rev=133837&view=rev Log: Add fuzz calls for SBBroadcaster. Added: lldb/trunk/test/python_api/default-constructor/sb_broadcaster.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py?rev=133837&r1=133836&r2=133837&view=diff ============================================================================== --- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original) +++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Fri Jun 24 17:53:12 2011 @@ -63,6 +63,9 @@ if self.TraceOn(): print obj self.assertFalse(obj) + # Do fuzz testing on the invalid obj, it should not crash lldb. + import sb_broadcaster + sb_broadcaster.fuzz_obj(obj) @python_api_test def test_SBCommandReturnObject(self): Added: lldb/trunk/test/python_api/default-constructor/sb_broadcaster.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_broadcaster.py?rev=133837&view=auto ============================================================================== --- lldb/trunk/test/python_api/default-constructor/sb_broadcaster.py (added) +++ lldb/trunk/test/python_api/default-constructor/sb_broadcaster.py Fri Jun 24 17:53:12 2011 @@ -0,0 +1,19 @@ +""" +Fuzz tests an object after the default construction to make sure it does not crash lldb. +""" + +import sys +import lldb + +def fuzz_obj(obj): + obj.BroadcastEventByType(lldb.eBreakpointEventTypeInvalidType, True) + obj.BroadcastEvent(lldb.SBEvent(), False) + listener = lldb.SBListener("fuzz_testing") + obj.AddInitialEventsToListener(listener, 0xffffffff) + obj.AddInitialEventsToListener(listener, 0) + obj.AddListener(listener, 0xffffffff) + obj.AddListener(listener, 0) + obj.GetName() + obj.EventTypeHasListeners(0) + obj.RemoveListener(listener, 0xffffffff) + obj.RemoveListener(listener, 0) From johnny.chen at apple.com Fri Jun 24 18:16:27 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Fri, 24 Jun 2011 23:16:27 -0000 Subject: [Lldb-commits] [lldb] r133839 - in /lldb/trunk/test/python_api/default-constructor: TestDefaultConstructorForAPIObjects.py sb_communication.py Message-ID: <20110624231627.967082A6C12C@llvm.org> Author: johnny Date: Fri Jun 24 18:16:27 2011 New Revision: 133839 URL: http://llvm.org/viewvc/llvm-project?rev=133839&view=rev Log: Add fuzz calls for SBCommunication. Added: lldb/trunk/test/python_api/default-constructor/sb_communication.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py?rev=133839&r1=133838&r2=133839&view=diff ============================================================================== --- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original) +++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Fri Jun 24 18:16:27 2011 @@ -81,6 +81,9 @@ if self.TraceOn(): print obj self.assertFalse(obj) + # Do fuzz testing on the invalid obj, it should not crash lldb. + import sb_communication + sb_communication.fuzz_obj(obj) @python_api_test def test_SBCompileUnit(self): Added: lldb/trunk/test/python_api/default-constructor/sb_communication.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_communication.py?rev=133839&view=auto ============================================================================== --- lldb/trunk/test/python_api/default-constructor/sb_communication.py (added) +++ lldb/trunk/test/python_api/default-constructor/sb_communication.py Fri Jun 24 18:16:27 2011 @@ -0,0 +1,27 @@ +""" +Fuzz tests an object after the default construction to make sure it does not crash lldb. +""" + +import sys +import lldb + +def fuzz_obj(obj): + broadcaster = obj.GetBroadcaster() + # Do fuzz testing on the broadcaster obj, it should not crash lldb. + import sb_broadcaster + sb_broadcaster.fuzz_obj(broadcaster) + obj.AdoptFileDesriptor(0, False) + obj.AdoptFileDesriptor(1, False) + obj.AdoptFileDesriptor(2, False) + obj.Connect("file:/tmp/myfile") + obj.Disconnect() + obj.IsConnected() + obj.GetCloseOnEOF() + obj.SetCloseOnEOF(True) + obj.SetCloseOnEOF(False) + #obj.Write(None, sys.maxint, None) + #obj.Read(None, sys.maxint, 0xffffffff, None) + obj.ReadThreadStart() + obj.ReadThreadStop() + obj.ReadThreadIsRunning() + obj.SetReadThreadBytesReceivedCallback(None, None) From johnny.chen at apple.com Fri Jun 24 18:33:03 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Fri, 24 Jun 2011 23:33:03 -0000 Subject: [Lldb-commits] [lldb] r133843 - in /lldb/trunk/test/python_api/default-constructor: TestDefaultConstructorForAPIObjects.py sb_compileunit.py Message-ID: <20110624233303.576882A6C12C@llvm.org> Author: johnny Date: Fri Jun 24 18:33:03 2011 New Revision: 133843 URL: http://llvm.org/viewvc/llvm-project?rev=133843&view=rev Log: Add fuzz calls for SBCompileUnit. Added: lldb/trunk/test/python_api/default-constructor/sb_compileunit.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py?rev=133843&r1=133842&r2=133843&view=diff ============================================================================== --- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original) +++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Fri Jun 24 18:33:03 2011 @@ -91,6 +91,9 @@ if self.TraceOn(): print obj self.assertFalse(obj) + # Do fuzz testing on the invalid obj, it should not crash lldb. + import sb_compileunit + sb_compileunit.fuzz_obj(obj) @python_api_test def test_SBDebugger(self): Added: lldb/trunk/test/python_api/default-constructor/sb_compileunit.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_compileunit.py?rev=133843&view=auto ============================================================================== --- lldb/trunk/test/python_api/default-constructor/sb_compileunit.py (added) +++ lldb/trunk/test/python_api/default-constructor/sb_compileunit.py Fri Jun 24 18:33:03 2011 @@ -0,0 +1,13 @@ +""" +Fuzz tests an object after the default construction to make sure it does not crash lldb. +""" + +import sys +import lldb + +def fuzz_obj(obj): + obj.GetFileSpec() + obj.GetNumLineEntries() + obj.GetLineEntryAtIndex(0xffffffff) + obj.FindLineEntryIndex(0, 0xffffffff, None) + obj.GetDescription(lldb.SBStream()) From johnny.chen at apple.com Fri Jun 24 19:09:29 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Sat, 25 Jun 2011 00:09:29 -0000 Subject: [Lldb-commits] [lldb] r133848 - in /lldb/trunk/test/python_api/default-constructor: TestDefaultConstructorForAPIObjects.py sb_debugger.py Message-ID: <20110625000929.7B8A92A6C12C@llvm.org> Author: johnny Date: Fri Jun 24 19:09:29 2011 New Revision: 133848 URL: http://llvm.org/viewvc/llvm-project?rev=133848&view=rev Log: Add fuzz calls for SBDebugger. Added: lldb/trunk/test/python_api/default-constructor/sb_debugger.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py?rev=133848&r1=133847&r2=133848&view=diff ============================================================================== --- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original) +++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Fri Jun 24 19:09:29 2011 @@ -101,6 +101,9 @@ if self.TraceOn(): print obj self.assertFalse(obj) + # Do fuzz testing on the invalid obj, it should not crash lldb. + import sb_debugger + sb_debugger.fuzz_obj(obj) @python_api_test def test_SBError(self): Added: lldb/trunk/test/python_api/default-constructor/sb_debugger.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_debugger.py?rev=133848&view=auto ============================================================================== --- lldb/trunk/test/python_api/default-constructor/sb_debugger.py (added) +++ lldb/trunk/test/python_api/default-constructor/sb_debugger.py Fri Jun 24 19:09:29 2011 @@ -0,0 +1,51 @@ +""" +Fuzz tests an object after the default construction to make sure it does not crash lldb. +""" + +import sys +import lldb + +def fuzz_obj(obj): + obj.SetAsync(True) + obj.SetAsync(False) + obj.SkipLLDBInitFiles(True) + obj.SetInputFileHandle(None, True) + obj.SetOutputFileHandle(None, True) + obj.SetErrorFileHandle(None, True) + obj.GetInputFileHandle() + obj.GetOutputFileHandle() + obj.GetErrorFileHandle() + obj.GetCommandInterpreter() + obj.HandleCommand("nothing here") + listener = obj.GetListener() + obj.HandleProcessEvent(lldb.SBProcess(), lldb.SBEvent(), None, None) + obj.CreateTargetWithFileAndTargetTriple("a.out", "A-B-C") + obj.CreateTargetWithFileAndArch("b.out", "arm") + obj.CreateTarget("c.out") + obj.DeleteTarget(lldb.SBTarget()) + obj.GetTargetAtIndex(0xffffffff) + obj.FindTargetWithProcessID(0) + obj.FindTargetWithFileAndArch("a.out", "arm") + obj.GetNumTargets() + obj.GetSelectedTarget() + obj.GetSourceManager() + obj.SetCurrentPlatformSDKRoot("tmp/sdk-root") + obj.DispatchInput(None, None, 0) + obj.DispatchInputInterrupt() + obj.DispatchInputEndOfFile() + obj.PushInputReader(lldb.SBInputReader()) + obj.NotifyTopInputReader(lldb.eInputReaderActivate) + obj.InputReaderIsTopReader(lldb.SBInputReader()) + obj.GetInstanceName() + obj.GetDescription(lldb.SBStream()) + obj.GetTerminalWidth() + obj.SetTerminalWidth(0xffffffff) + obj.GetID() + obj.GetPrompt() + obj.SetPrompt("Hi, Mom!") + obj.GetScriptLanguage() + obj.SetScriptLanguage(lldb.eScriptLanguageNone) + obj.SetScriptLanguage(lldb.eScriptLanguagePython) + obj.GetCloseInputOnEOF() + obj.SetCloseInputOnEOF(True) + obj.SetCloseInputOnEOF(False) From johnny.chen at apple.com Fri Jun 24 19:21:00 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Sat, 25 Jun 2011 00:21:00 -0000 Subject: [Lldb-commits] [lldb] r133850 - in /lldb/trunk/test/python_api/default-constructor: TestDefaultConstructorForAPIObjects.py sb_error.py Message-ID: <20110625002101.08DDC2A6C12C@llvm.org> Author: johnny Date: Fri Jun 24 19:21:00 2011 New Revision: 133850 URL: http://llvm.org/viewvc/llvm-project?rev=133850&view=rev Log: Add fuzz calls for SBError. Added: lldb/trunk/test/python_api/default-constructor/sb_error.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py?rev=133850&r1=133849&r2=133850&view=diff ============================================================================== --- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original) +++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Fri Jun 24 19:21:00 2011 @@ -111,6 +111,9 @@ if self.TraceOn(): print obj self.assertFalse(obj) + # Do fuzz testing on the invalid obj, it should not crash lldb. + import sb_error + sb_error.fuzz_obj(obj) @python_api_test def test_SBEvent(self): Added: lldb/trunk/test/python_api/default-constructor/sb_error.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_error.py?rev=133850&view=auto ============================================================================== --- lldb/trunk/test/python_api/default-constructor/sb_error.py (added) +++ lldb/trunk/test/python_api/default-constructor/sb_error.py Fri Jun 24 19:21:00 2011 @@ -0,0 +1,19 @@ +""" +Fuzz tests an object after the default construction to make sure it does not crash lldb. +""" + +import sys +import lldb + +def fuzz_obj(obj): + obj.GetCString() + obj.Fail() + obj.Success() + obj.GetError() + obj.GetType() + obj.SetError(5, lldb.eErrorTypeGeneric) + obj.SetErrorToErrno() + obj.SetErrorToGenericError() + obj.SetErrorString("xyz") + obj.SetErrorStringWithFormat("%s!", "error") + obj.GetDescription(lldb.SBStream()) From gclayton at apple.com Fri Jun 24 19:44:06 2011 From: gclayton at apple.com (Greg Clayton) Date: Sat, 25 Jun 2011 00:44:06 -0000 Subject: [Lldb-commits] [lldb] r133852 - in /lldb/trunk: include/lldb/Expression/ include/lldb/Symbol/ lldb.xcodeproj/ source/Expression/ source/Plugins/SymbolFile/DWARF/ source/Symbol/ Message-ID: <20110625004407.0BD192A6C12C@llvm.org> Author: gclayton Date: Fri Jun 24 19:44:06 2011 New Revision: 133852 URL: http://llvm.org/viewvc/llvm-project?rev=133852&view=rev Log: This commit adds broad architectural support for hierarchical inspection of namespaces in the expression parser. ClangExpressionDeclMap hitherto reported that namespaces had been completely imported, even though the namespaces are returned empty. To deal with this situation, ClangASTSource was recently extended with an API to complete incomplete type definitions, and, for greater efficiency, to complete these definitions partially, returning only those objects that have a given name. This commit supports these APIs on LLDB's side, and uses it to provide information on types resident in namespaces. Namespaces are now imported as they were -- that is to say, empty -- but with minimal import mode on. This means that Clang will come back and request their contents by name as needed. We now respond with information on the contained types; this will be followed soon by information on functions and variables. Added: lldb/trunk/include/lldb/Symbol/ClangASTImporter.h lldb/trunk/source/Symbol/ClangASTImporter.cpp Modified: lldb/trunk/include/lldb/Expression/ClangASTSource.h lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h lldb/trunk/include/lldb/Symbol/ClangASTContext.h lldb/trunk/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/source/Expression/ClangASTSource.cpp lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp lldb/trunk/source/Symbol/ClangASTContext.cpp lldb/trunk/source/Symbol/ClangExternalASTSourceCallbacks.cpp Modified: lldb/trunk/include/lldb/Expression/ClangASTSource.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangASTSource.h?rev=133852&r1=133851&r2=133852&view=diff ============================================================================== --- lldb/trunk/include/lldb/Expression/ClangASTSource.h (original) +++ lldb/trunk/include/lldb/Expression/ClangASTSource.h Fri Jun 24 19:44:06 2011 @@ -251,6 +251,26 @@ /// The opaque QualType for the TypeDecl being registered. //------------------------------------------------------------------ clang::NamedDecl *AddTypeDecl(void *type); + + + //------------------------------------------------------------------ + /// Add Decls from the provided DeclContextLookupResult to the list + /// of results. + /// + /// @param[in] result + /// The DeclContextLookupResult, usually returned as the result + /// of querying a DeclContext. + //------------------------------------------------------------------ + void AddLookupResult (clang::DeclContextLookupConstResult result); + + //------------------------------------------------------------------ + /// Add a NamedDecl to the list of results. + /// + /// @param[in] decl + /// The NamedDecl, usually returned as the result + /// of querying a DeclContext. + //------------------------------------------------------------------ + void AddNamedDecl (clang::NamedDecl *decl); }; } Modified: lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h?rev=133852&r1=133851&r2=133852&view=diff ============================================================================== --- lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h (original) +++ lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h Fri Jun 24 19:44:06 2011 @@ -25,6 +25,7 @@ #include "lldb/Core/ClangForward.h" #include "lldb/Core/Value.h" #include "lldb/Expression/ClangExpressionVariable.h" +#include "lldb/Symbol/ClangASTImporter.h" #include "lldb/Symbol/TaggedASTType.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Target/ExecutionContext.h" @@ -471,6 +472,23 @@ const ConstString &name); //------------------------------------------------------------------ + /// [Used by ClangASTSource] Fill in all the members of a (potentially + /// incomplete) DeclContext. + /// + /// @param[in] ast_context + /// The parser's AST context, in which the DeclContext is resident + /// + /// @param[in] decl_context + /// The DeclContext that needs to be filled in. + /// + /// @return + /// The completed context on success; NULL otherwise. + //------------------------------------------------------------------ + const clang::DeclContext * + CompleteDeclContext (clang::ASTContext *ast_context, + const clang::DeclContext *decl_context); + + //------------------------------------------------------------------ /// [Used by ClangASTSource] Report whether a $__lldb variable has /// been searched for yet. This is the trigger for beginning to /// actually look for externally-defined names. (Names that come @@ -535,11 +553,24 @@ m_sym_ctx.target_sp.get(); return NULL; } + + ClangASTImporter *GetASTImporter (clang::ASTContext *ast_context) + { + if (!m_ast_importer.get()) + m_ast_importer.reset(new ClangASTImporter(ast_context)); + + if (m_ast_importer->TargetASTContext() != ast_context) + return NULL; + + return m_ast_importer.get(); + } + ExecutionContext *m_exe_ctx; ///< The execution context to use when parsing. SymbolContext m_sym_ctx; ///< The symbol context to use in finding variables and types. ClangPersistentVariables *m_persistent_vars; ///< The persistent variables for the process. bool m_enable_lookups; ///< Set to true during parsing if we have found the first "$__lldb" name. bool m_ignore_lookups; ///< True during an import when we should be ignoring type lookups. + std::auto_ptr m_ast_importer; ///< The importer used to import types on the parser's behalf. private: DISALLOW_COPY_AND_ASSIGN (ParserVars); }; Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=133852&r1=133851&r2=133852&view=diff ============================================================================== --- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Fri Jun 24 19:44:06 2011 @@ -123,6 +123,16 @@ GetCompleteType (clang::ASTContext *ast, lldb::clang_type_t clang_type); + bool + GetCompleteDecl (clang::Decl *decl) + { + return ClangASTContext::GetCompleteDecl(getASTContext(), decl); + } + + static bool + GetCompleteDecl (clang::ASTContext *ast, + clang::Decl *decl); + //------------------------------------------------------------------ // Basic Types //------------------------------------------------------------------ Added: lldb/trunk/include/lldb/Symbol/ClangASTImporter.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTImporter.h?rev=133852&view=auto ============================================================================== --- lldb/trunk/include/lldb/Symbol/ClangASTImporter.h (added) +++ lldb/trunk/include/lldb/Symbol/ClangASTImporter.h Fri Jun 24 19:44:06 2011 @@ -0,0 +1,164 @@ +//===-- ClangASTImporter.h --------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef liblldb_ClangASTImporter_h_ +#define liblldb_ClangASTImporter_h_ + +#include + +#include "lldb/lldb-types.h" + +#include "clang/AST/ASTImporter.h" +#include "clang/Basic/FileManager.h" +#include "clang/Basic/FileSystemOptions.h" + +namespace lldb_private { + +class ClangASTImporter +{ +public: + ClangASTImporter (clang::ASTContext *target_ctx) : + m_target_ctx(target_ctx), + m_file_manager(clang::FileSystemOptions()) + { + } + + clang::ASTContext * + TargetASTContext () + { + return m_target_ctx; + } + + clang::QualType + CopyType (clang::ASTContext *src_ctx, + clang::QualType type); + + clang::Decl * + CopyDecl (clang::ASTContext *src_ctx, + clang::Decl *decl); + + const clang::DeclContext * + CompleteDeclContext (const clang::DeclContext *decl_context); + + bool + ResolveDeclOrigin (const clang::Decl *decl, clang::Decl **original_decl, clang::ASTContext **original_ctx) + { + DeclOrigin origin = GetDeclOrigin(decl); + + if (original_decl) + *original_decl = origin.decl; + + if (original_ctx) + *original_ctx = origin.ctx; + + return origin.Valid(); + } + +private: + + struct DeclOrigin + { + DeclOrigin () : + ctx(NULL), + decl(NULL) + { + } + + DeclOrigin (clang::ASTContext *_ctx, + clang::Decl *_decl) : + ctx(_ctx), + decl(_decl) + { + } + + DeclOrigin (const DeclOrigin &rhs) + { + ctx = rhs.ctx; + decl = rhs.decl; + } + + bool + Valid () + { + return (ctx != NULL || decl != NULL); + } + + clang::ASTContext *ctx; + clang::Decl *decl; + }; + + typedef std::map OriginMap; + + class Minion : public clang::ASTImporter + { + public: + Minion (ClangASTImporter &master, + clang::ASTContext *source_ctx, + bool minimal) : + clang::ASTImporter(*master.m_target_ctx, + master.m_file_manager, + *source_ctx, + master.m_file_manager, + minimal), + m_master(master), + m_source_ctx(source_ctx) + { + } + + clang::Decl *Imported (clang::Decl *from, clang::Decl *to) + { + m_master.m_origins[to] = DeclOrigin (m_source_ctx, from); + + return clang::ASTImporter::Imported(from, to); + } + + ClangASTImporter &m_master; + clang::ASTContext *m_source_ctx; + }; + + typedef lldb::SharedPtr::Type MinionSP; + typedef std::map MinionMap; + + MinionSP + GetMinion (clang::ASTContext *source_ctx, bool minimal) + { + MinionMap *minions; + + if (minimal) + minions = &m_minimal_minions; + else + minions = &m_minions; + + if (minions->find(source_ctx) == minions->end()) + (*minions)[source_ctx] = MinionSP(new Minion(*this, source_ctx, minimal)); + + return (*minions)[source_ctx]; + } + + DeclOrigin + GetDeclOrigin (const clang::Decl *decl) + { + OriginMap::iterator iter = m_origins.find(decl); + + if (iter != m_origins.end()) + return iter->second; + else + return DeclOrigin(); + } + + clang::FileManager m_file_manager; + clang::ASTContext *m_target_ctx; + MinionMap m_minions; + MinionMap m_minimal_minions; + OriginMap m_origins; +}; + +} + +#endif \ No newline at end of file Modified: lldb/trunk/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h?rev=133852&r1=133851&r2=133852&view=diff ============================================================================== --- lldb/trunk/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h (original) +++ lldb/trunk/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h Fri Jun 24 19:44:06 2011 @@ -58,17 +58,19 @@ typedef void (*CompleteTagDeclCallback)(void *baton, clang::TagDecl *); typedef void (*CompleteObjCInterfaceDeclCallback)(void *baton, clang::ObjCInterfaceDecl *); - + typedef void (*FindExternalVisibleDeclsByNameCallback)(void *baton, const clang::DeclContext *DC, clang::DeclarationName Name, llvm::SmallVectorImpl *results); ClangExternalASTSourceCallbacks (CompleteTagDeclCallback tag_decl_callback, CompleteObjCInterfaceDeclCallback objc_decl_callback, + FindExternalVisibleDeclsByNameCallback find_by_name_callback, void *callback_baton) : m_callback_tag_decl (tag_decl_callback), m_callback_objc_decl (objc_decl_callback), + m_callback_find_by_name (find_by_name_callback), m_callback_baton (callback_baton) { } - + //------------------------------------------------------------------ // clang::ExternalASTSource //------------------------------------------------------------------ @@ -140,10 +142,12 @@ void SetExternalSourceCallbacks (CompleteTagDeclCallback tag_decl_callback, CompleteObjCInterfaceDeclCallback objc_decl_callback, + FindExternalVisibleDeclsByNameCallback find_by_name_callback, void *callback_baton) { m_callback_tag_decl = tag_decl_callback; m_callback_objc_decl = objc_decl_callback; + m_callback_find_by_name = find_by_name_callback; m_callback_baton = callback_baton; } @@ -154,6 +158,7 @@ { m_callback_tag_decl = NULL; m_callback_objc_decl = NULL; + m_callback_find_by_name = NULL; } } @@ -163,6 +168,7 @@ //------------------------------------------------------------------ CompleteTagDeclCallback m_callback_tag_decl; CompleteObjCInterfaceDeclCallback m_callback_objc_decl; + FindExternalVisibleDeclsByNameCallback m_callback_find_by_name; void * m_callback_baton; }; Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=133852&r1=133851&r2=133852&view=diff ============================================================================== --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri Jun 24 19:44:06 2011 @@ -390,6 +390,7 @@ 26F73062139D8FDB00FD51C7 /* History.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F73061139D8FDB00FD51C7 /* History.cpp */; }; 49C850771384A02F007DB519 /* ProcessDataAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 49C850761384A02F007DB519 /* ProcessDataAllocator.h */; }; 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 */; }; 4CABA9E0134A8BCD00539BDD /* ValueObjectMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CABA9DF134A8BCD00539BDD /* ValueObjectMemory.cpp */; }; 4CCA644D13B40B82003BDF98 /* ItaniumABILanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA643D13B40B82003BDF98 /* ItaniumABILanguageRuntime.cpp */; }; @@ -1091,6 +1092,8 @@ 49D4FE871210B61C00CDB854 /* ClangPersistentVariables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangPersistentVariables.cpp; path = source/Expression/ClangPersistentVariables.cpp; sourceTree = ""; }; 49D7072611B5AD03001AD875 /* ClangASTSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangASTSource.h; path = include/lldb/Expression/ClangASTSource.h; sourceTree = ""; }; 49D7072811B5AD11001AD875 /* ClangASTSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangASTSource.cpp; path = source/Expression/ClangASTSource.cpp; sourceTree = ""; }; + 49D8FB3513B558DE00411094 /* ClangASTImporter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangASTImporter.cpp; path = source/Symbol/ClangASTImporter.cpp; sourceTree = ""; }; + 49D8FB3713B5594900411094 /* ClangASTImporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangASTImporter.h; path = include/lldb/Symbol/ClangASTImporter.h; sourceTree = ""; }; 49DA742F11DE6A5A006AEF7E /* IRToDWARF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IRToDWARF.cpp; path = source/Expression/IRToDWARF.cpp; sourceTree = ""; }; 49DA743411DE6BB2006AEF7E /* IRToDWARF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IRToDWARF.h; path = include/lldb/Expression/IRToDWARF.h; sourceTree = ""; }; 49E45FA911F660DC008F7B28 /* ClangASTType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangASTType.h; path = include/lldb/Symbol/ClangASTType.h; sourceTree = ""; }; @@ -2001,6 +2004,8 @@ 26BC7F1310F1B8EC00F91463 /* Block.cpp */, 26BC7C5610F1B6E900F91463 /* ClangASTContext.h */, 26BC7F1410F1B8EC00F91463 /* ClangASTContext.cpp */, + 49D8FB3713B5594900411094 /* ClangASTImporter.h */, + 49D8FB3513B558DE00411094 /* ClangASTImporter.cpp */, 49E45FA911F660DC008F7B28 /* ClangASTType.h */, 49E45FAD11F660FE008F7B28 /* ClangASTType.cpp */, 26E6902E129C6BD500DDECD9 /* ClangExternalASTSourceCallbacks.h */, @@ -3233,6 +3238,7 @@ 4CCA645813B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp in Sources */, 9463D4CD13B1798800C230D4 /* CommandObjectType.cpp in Sources */, 9415F61813B2C0EF00A52B36 /* FormatManager.cpp in Sources */, + 49D8FB3913B5598F00411094 /* ClangASTImporter.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; Modified: lldb/trunk/source/Expression/ClangASTSource.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangASTSource.cpp?rev=133852&r1=133851&r2=133852&view=diff ============================================================================== --- lldb/trunk/source/Expression/ClangASTSource.cpp (original) +++ lldb/trunk/source/Expression/ClangASTSource.cpp Fri Jun 24 19:44:06 2011 @@ -266,3 +266,18 @@ } return NULL; } + +void +NameSearchContext::AddLookupResult (clang::DeclContextLookupConstResult result) +{ + for (clang::NamedDecl * const *decl_iterator = result.first; + decl_iterator != result.second; + ++decl_iterator) + m_decls.push_back (*decl_iterator); +} + +void +NameSearchContext::AddNamedDecl (clang::NamedDecl *decl) +{ + m_decls.push_back (decl); +} Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=133852&r1=133851&r2=133852&view=diff ============================================================================== --- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original) +++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Fri Jun 24 19:44:06 2011 @@ -1656,6 +1656,69 @@ log->Printf("Ignoring a query during an import"); return; } + + do + { + if (isa(context.m_decl_context)) + break; + + if (log) + log->Printf("'%s' is in something other than a translation unit", name.GetCString()); + + const Decl *context_decl = dyn_cast(context.m_decl_context); + + if (!context_decl) + return; + + if (const NamespaceDecl *namespace_decl = dyn_cast(context_decl)) + { + Decl *original_decl; + ASTContext *original_ctx; + + if (log) + log->Printf("Resolving the containing context's origin..."); + + if (!m_parser_vars->GetASTImporter(context.GetASTContext())->ResolveDeclOrigin(namespace_decl, &original_decl, &original_ctx)) + break; + + if (log) + log->Printf("Casting it to a DeclContext..."); + + DeclContext *original_decl_context = dyn_cast(original_decl); + + if (!original_decl_context) + break; + + if (log) + { + std::string s; + llvm::raw_string_ostream os(s); + original_decl->print(os); + os.flush(); + + log->Printf("Containing context:"); + log->Printf("%s", s.c_str()); + } + + if (!original_ctx->getExternalSource()) + break; + + DeclContextLookupConstResult original_lookup_result = original_ctx->getExternalSource()->FindExternalVisibleDeclsByName(original_decl_context, context.m_decl_name); + + NamedDecl *const *iter; + + for (iter = original_lookup_result.first; + iter != original_lookup_result.second; + ++iter) + { + clang::NamedDecl *copied_result = dyn_cast(m_parser_vars->GetASTImporter(context.GetASTContext())->CopyDecl(original_ctx, *iter)); + + if (copied_result) + context.AddNamedDecl(copied_result); + } + } + } + while (0); SymbolContextList sc_list; @@ -1721,14 +1784,6 @@ else if (non_extern_symbol) AddOneFunction (context, NULL, non_extern_symbol); } - - ClangNamespaceDecl namespace_decl (m_parser_vars->m_sym_ctx.FindNamespace(name)); - if (namespace_decl) - { - clang::NamespaceDecl *clang_namespace_decl = AddNamespace(context, namespace_decl); - if (clang_namespace_decl) - clang_namespace_decl->setHasExternalLexicalStorage(); - } } else { @@ -1741,6 +1796,26 @@ AddOneGenericVariable(context, *data_symbol); } } + + ClangNamespaceDecl namespace_decl (m_parser_vars->m_sym_ctx.FindNamespace(name)); + + if (namespace_decl) + { + if (log) + { + std::string s; + llvm::raw_string_ostream os(s); + namespace_decl.GetNamespaceDecl()->print(os); + os.flush(); + + log->Printf("Added namespace decl:"); + log->Printf("%s", s.c_str()); + } + + clang::NamespaceDecl *clang_namespace_decl = AddNamespace(context, namespace_decl); + if (clang_namespace_decl) + clang_namespace_decl->setHasExternalLexicalStorage(); + } } else { @@ -1883,7 +1958,47 @@ AddOneType(context, user_type, false); } } + +const clang::DeclContext * +ClangExpressionDeclMap::CompleteDeclContext (clang::ASTContext *ast_context, + const clang::DeclContext *decl_context) +{ + lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); + + if (log) + { + const NamedDecl *named_decl = dyn_cast(decl_context); + if (named_decl) + log->Printf("Completing a '%s' DeclContext named '%s'", decl_context->getDeclKindName(), named_decl->getDeclName().getAsString().c_str()); + else + log->Printf("Completing a '%s' DeclContext", decl_context->getDeclKindName()); + } + + assert (m_parser_vars.get()); + + if (!m_parser_vars->GetASTImporter (ast_context)->CompleteDeclContext(decl_context)) + return NULL; + + if (log) + { + const Decl *decl = dyn_cast(decl_context); + + if (decl) + { + std::string s; + llvm::raw_string_ostream os(s); + decl->print(os); + os.flush(); + + log->Printf("After:"); + log->Printf("%s", s.c_str()); + } + } + + return decl_context; +} + Value * ClangExpressionDeclMap::GetVariableValue ( @@ -2247,9 +2362,10 @@ { lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); - clang::Decl *copied_decl = ClangASTContext::CopyDecl (context.GetASTContext(), - namespace_decl.GetASTContext(), - namespace_decl.GetNamespaceDecl()); + assert (m_parser_vars.get()); + + clang::Decl *copied_decl = m_parser_vars->GetASTImporter(context.GetASTContext())->CopyDecl(namespace_decl.GetASTContext(), + namespace_decl.GetNamespaceDecl()); return dyn_cast(copied_decl); } @@ -2393,9 +2509,12 @@ m_parser_vars->m_ignore_lookups = true; - void *ret = ClangASTContext::CopyType (dest_context, - source_context, - clang_type); + lldb_private::ClangASTImporter *importer = m_parser_vars->GetASTImporter(dest_context); + + QualType ret_qual_type = importer->CopyType (source_context, + QualType::getFromOpaquePtr(clang_type)); + + void *ret = ret_qual_type.getAsOpaquePtr(); m_parser_vars->m_ignore_lookups = false; 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=133852&r1=133851&r2=133852&view=diff ============================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Fri Jun 24 19:44:06 2011 @@ -218,6 +218,7 @@ llvm::OwningPtr ast_source_ap ( new ClangExternalASTSourceCallbacks (SymbolFileDWARF::CompleteTagDecl, SymbolFileDWARF::CompleteObjCInterfaceDecl, + SymbolFileDWARF::FindExternalVisibleDeclsByName, this)); ast.SetExternalSource (ast_source_ap); @@ -2789,7 +2790,7 @@ Declaration decl; // TODO: fill in the decl object clang::NamespaceDecl *namespace_decl = GetClangASTContext().GetUniqueNamespaceDeclaration (namespace_name, decl, GetClangDeclContextForDIE (curr_cu, die->GetParent())); if (namespace_decl) - m_die_to_decl_ctx[die] = (clang::DeclContext*)namespace_decl; + LinkDeclContextToDIE((clang::DeclContext*)namespace_decl, die); return namespace_decl; } } @@ -2834,7 +2835,7 @@ if (namespace_decl) { //printf ("SymbolFileDWARF::GetClangDeclContextForDIE ( die = 0x%8.8x ) => 0x%8.8x\n", decl_die->GetOffset(), die->GetOffset()); - m_die_to_decl_ctx[die] = (clang::DeclContext*)namespace_decl; + LinkDeclContextToDIE((clang::DeclContext*)namespace_decl, die); } return namespace_decl; } @@ -3282,8 +3283,8 @@ // Store a forward declaration to this class type in case any // parameters in any class methods need it for the clang - // types for function prototypes. - m_die_to_decl_ctx[die] = ClangASTContext::GetDeclContextForType (clang_type); + // types for function prototypes. + LinkDeclContextToDIE(ClangASTContext::GetDeclContextForType(clang_type), die); type_sp.reset (new Type (die->GetOffset(), this, type_name_const_str, @@ -3396,7 +3397,8 @@ assert (enumerator_clang_type != NULL); } - m_die_to_decl_ctx[die] = ClangASTContext::GetDeclContextForType (clang_type); + LinkDeclContextToDIE(ClangASTContext::GetDeclContextForType(clang_type), die); + type_sp.reset( new Type (die->GetOffset(), this, type_name_const_str, @@ -3661,7 +3663,7 @@ // Add the decl to our DIE to decl context map assert (function_decl); - m_die_to_decl_ctx[die] = function_decl; + LinkDeclContextToDIE(function_decl, die); if (!function_param_decls.empty()) ast.SetFunctionParameters (function_decl, &function_param_decls.front(), @@ -4409,3 +4411,69 @@ symbol_file_dwarf->ResolveClangOpaqueTypeDefinition (clang_type); } +void +SymbolFileDWARF::SearchNamespace (const clang::NamespaceDecl *namespace_decl, + const char *name, + llvm::SmallVectorImpl *results) +{ + DeclContextToDIEMap::iterator iter = m_decl_ctx_to_die.find((const clang::DeclContext*)namespace_decl); + + if (iter == m_decl_ctx_to_die.end()) + return; + + const DWARFDebugInfoEntry *namespace_die = iter->second; + + if (!results) + return; + + DWARFDebugInfo* info = DebugInfo(); + + std::vector die_info_array; + + size_t num_matches = m_type_index.Find (name, die_info_array); + + if (num_matches) + { + for (int i = 0; + i < num_matches; + ++i) + { + DWARFCompileUnit* compile_unit = info->GetCompileUnitAtIndex(die_info_array[i].cu_idx); + compile_unit->ExtractDIEsIfNeeded (false); + const DWARFDebugInfoEntry *die = compile_unit->GetDIEAtIndexUnchecked(die_info_array[i].die_idx); + + if (die->GetParent() != namespace_die) + continue; + + Type *matching_type = ResolveType (compile_unit, die); + + lldb::clang_type_t type = matching_type->GetClangFullType(); + clang::QualType qual_type = clang::QualType::getFromOpaquePtr(type); + + + if (const clang::TagType *tag_type = dyn_cast(qual_type.getTypePtr())) + { + clang::TagDecl *tag_decl = tag_type->getDecl(); + results->push_back(tag_decl); + } + else if (const clang::TypedefType *typedef_type = dyn_cast(qual_type.getTypePtr())) + { + clang::TypedefNameDecl *typedef_decl = typedef_type->getDecl(); + results->push_back(typedef_decl); + } + } + } +} + +void +SymbolFileDWARF::FindExternalVisibleDeclsByName (void *baton, + const clang::DeclContext *DC, + clang::DeclarationName Name, + llvm::SmallVectorImpl *results) +{ + SymbolFileDWARF *symbol_file_dwarf = (SymbolFileDWARF *)baton; + + const clang::NamespaceDecl *DC_namespace = llvm::dyn_cast(DC); + + symbol_file_dwarf->SearchNamespace (DC_namespace, Name.getAsString().c_str(), results); +} Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h?rev=133852&r1=133851&r2=133852&view=diff ============================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Fri Jun 24 19:44:06 2011 @@ -18,6 +18,7 @@ #include // Other libraries and framework includes +#include "clang/AST/ExternalASTSource.h" #include "llvm/ADT/DenseMap.h" #include "lldb/Core/ClangForward.h" @@ -127,6 +128,12 @@ static void CompleteObjCInterfaceDecl (void *baton, clang::ObjCInterfaceDecl *); + + static void + FindExternalVisibleDeclsByName (void *baton, + const clang::DeclContext *DC, + clang::DeclarationName Name, + llvm::SmallVectorImpl *results); //------------------------------------------------------------------ // PluginInterface protocol @@ -180,6 +187,11 @@ clang::DeclContext * GetClangDeclContextForDIEOffset (dw_offset_t die_offset); + + void + SearchNamespace (const clang::NamespaceDecl *namespace_decl, + const char *name, + llvm::SmallVectorImpl *results); lldb_private::Flags& GetFlags () @@ -328,6 +340,13 @@ UniqueDWARFASTTypeMap & GetUniqueDWARFASTTypeMap (); + void LinkDeclContextToDIE (clang::DeclContext *decl_ctx, + const DWARFDebugInfoEntry *die) + { + m_die_to_decl_ctx[die] = decl_ctx; + m_decl_ctx_to_die[decl_ctx] = die; + } + SymbolFileDWARFDebugMap * m_debug_map_symfile; clang::TranslationUnitDecl * m_clang_tu_decl; lldb_private::Flags m_flags; @@ -360,11 +379,13 @@ std::auto_ptr m_ranges; UniqueDWARFASTTypeMap m_unique_ast_type_map; typedef llvm::DenseMap DIEToDeclContextMap; + typedef llvm::DenseMap DeclContextToDIEMap; typedef llvm::DenseMap DIEToTypePtr; typedef llvm::DenseMap DIEToVariableSP; typedef llvm::DenseMap DIEToClangType; typedef llvm::DenseMap ClangTypeToDIE; DIEToDeclContextMap m_die_to_decl_ctx; + DeclContextToDIEMap m_decl_ctx_to_die; DIEToTypePtr m_die_to_type; DIEToVariableSP m_die_to_variable_sp; DIEToClangType m_forward_decl_die_to_clang_type; Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=133852&r1=133851&r2=133852&view=diff ============================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Fri Jun 24 19:44:06 2011 @@ -81,6 +81,7 @@ llvm::OwningPtr ast_source_ap ( new ClangExternalASTSourceCallbacks (SymbolFileDWARFDebugMap::CompleteTagDecl, SymbolFileDWARFDebugMap::CompleteObjCInterfaceDecl, + NULL, this)); GetClangASTContext().SetExternalSource (ast_source_ap); Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=133852&r1=133851&r2=133852&view=diff ============================================================================== --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Fri Jun 24 19:44:06 2011 @@ -4644,3 +4644,45 @@ return ClangASTContext::GetCompleteType (getASTContext(), clang_type); } +bool +ClangASTContext::GetCompleteDecl (clang::ASTContext *ast, + clang::Decl *decl) +{ + if (!decl) + return false; + + ExternalASTSource *ast_source = ast->getExternalSource(); + + if (!ast_source) + return false; + + if (clang::TagDecl *tag_decl = llvm::dyn_cast(decl)) + { + if (tag_decl->getDefinition()) + return true; + + if (!tag_decl->hasExternalLexicalStorage()) + return false; + + ast_source->CompleteType(tag_decl); + + return !tag_decl->getTypeForDecl()->isIncompleteType(); + } + else if (clang::ObjCInterfaceDecl *objc_interface_decl = llvm::dyn_cast(decl)) + { + if (!objc_interface_decl->isForwardDecl()) + return true; + + if (!objc_interface_decl->hasExternalLexicalStorage()) + return false; + + ast_source->CompleteType(objc_interface_decl); + + return !objc_interface_decl->isForwardDecl(); + } + else + { + return false; + } +} + Added: lldb/trunk/source/Symbol/ClangASTImporter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTImporter.cpp?rev=133852&view=auto ============================================================================== --- lldb/trunk/source/Symbol/ClangASTImporter.cpp (added) +++ lldb/trunk/source/Symbol/ClangASTImporter.cpp Fri Jun 24 19:44:06 2011 @@ -0,0 +1,61 @@ +//===-- ClangASTImporter.cpp ------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "clang/AST/Decl.h" +#include "lldb/Symbol/ClangASTContext.h" +#include "lldb/Symbol/ClangASTImporter.h" + +using namespace lldb_private; +using namespace clang; + +clang::QualType +ClangASTImporter::CopyType (clang::ASTContext *src_ast, + clang::QualType type) +{ + MinionSP minion = GetMinion(src_ast, false); + + return minion->Import(type); +} + +clang::Decl * +ClangASTImporter::CopyDecl (clang::ASTContext *src_ast, + clang::Decl *decl) +{ + MinionSP minion; + + if (isa(decl)) + minion = GetMinion(src_ast, true); + else + minion = GetMinion(src_ast, false); + + return minion->Import(decl); +} + +const clang::DeclContext * +ClangASTImporter::CompleteDeclContext (const clang::DeclContext *decl_context) +{ + const Decl *context_decl = dyn_cast(decl_context); + + if (!context_decl) + return NULL; + + DeclOrigin context_decl_origin = GetDeclOrigin(context_decl); + + if (!context_decl_origin.Valid()) + return NULL; + + if (!ClangASTContext::GetCompleteDecl(context_decl_origin.ctx, context_decl_origin.decl)) + return NULL; + + MinionSP minion = GetMinion(context_decl_origin.ctx, false); + + minion->ImportDefinition(context_decl_origin.decl); + + return decl_context; +} Modified: lldb/trunk/source/Symbol/ClangExternalASTSourceCallbacks.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangExternalASTSourceCallbacks.cpp?rev=133852&r1=133851&r2=133852&view=diff ============================================================================== --- lldb/trunk/source/Symbol/ClangExternalASTSourceCallbacks.cpp (original) +++ lldb/trunk/source/Symbol/ClangExternalASTSourceCallbacks.cpp Fri Jun 24 19:44:06 2011 @@ -52,6 +52,17 @@ clang::DeclarationName clang_decl_name ) { + if (m_callback_find_by_name) + { + llvm::SmallVector results; + + m_callback_find_by_name (m_callback_baton, decl_ctx, clang_decl_name, &results); + + DeclContextLookupResult lookup_result (SetExternalVisibleDeclsForName(decl_ctx, clang_decl_name, results)); + + return lookup_result; + } + std::string decl_name (clang_decl_name.getAsString()); switch (clang_decl_name.getNameKind()) { From jmolenda at apple.com Fri Jun 24 20:55:21 2011 From: jmolenda at apple.com (Jason Molenda) Date: Sat, 25 Jun 2011 01:55:21 -0000 Subject: [Lldb-commits] [lldb] r133857 - in /lldb/trunk/tools/debugserver/source: RNBRemote.cpp RNBRemote.h Message-ID: <20110625015521.89F4F2A6C12C@llvm.org> Author: jmolenda Date: Fri Jun 24 20:55:21 2011 New Revision: 133857 URL: http://llvm.org/viewvc/llvm-project?rev=133857&view=rev Log: Add support for a QEnvironmentHexEncoded packet which takes its arguments in hex-encoded form instead of the old QEnvironment packet which takes them as plain-text strings. Environment variables containing remote protocol special chars like '#' would fail to set with QEnvironment. Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp lldb/trunk/tools/debugserver/source/RNBRemote.h Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=133857&r1=133856&r2=133857&view=diff ============================================================================== --- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original) +++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Fri Jun 24 20:55:21 2011 @@ -175,6 +175,7 @@ t.push_back (Packet (set_max_packet_size, &RNBRemote::HandlePacket_QSetMaxPacketSize , NULL, "QSetMaxPacketSize:", "Tell " DEBUGSERVER_PROGRAM_NAME " the max sized packet gdb can handle")); t.push_back (Packet (set_max_payload_size, &RNBRemote::HandlePacket_QSetMaxPayloadSize , NULL, "QSetMaxPayloadSize:", "Tell " DEBUGSERVER_PROGRAM_NAME " the max sized payload gdb can handle")); t.push_back (Packet (set_environment_variable, &RNBRemote::HandlePacket_QEnvironment , NULL, "QEnvironment:", "Add an environment variable to the inferior's environment")); + t.push_back (Packet (set_environment_variable_hex, &RNBRemote::HandlePacket_QEnvironmentHexEncoded , NULL, "QEnvironmentHexEncoded:", "Add an environment variable to the inferior's environment")); t.push_back (Packet (set_launch_arch, &RNBRemote::HandlePacket_QLaunchArch , NULL, "QLaunchArch:", "Set the architecture to use when launching a process for hosts that can run multiple architecture slices from universal files.")); t.push_back (Packet (set_disable_aslr, &RNBRemote::HandlePacket_QSetDisableASLR , NULL, "QSetDisableASLR:", "Set wether to disable ASLR when launching the process with the set argv ('A') packet")); t.push_back (Packet (set_stdin, &RNBRemote::HandlePacket_QSetSTDIO , NULL, "QSetSTDIN:", "Set the standard input for a process to be launched with the 'A' packet")); @@ -1909,6 +1910,53 @@ } rnb_err_t +RNBRemote::HandlePacket_QEnvironmentHexEncoded (const char *p) +{ + /* This sets the environment for the target program. The packet is of the form: + + QEnvironmentHexEncoded:VARIABLE=VALUE + + The VARIABLE=VALUE part is sent hex-encoded so chracters like '#' with special + meaning in the remote protocol won't break it. + */ + + DNBLogThreadedIf (LOG_RNB_REMOTE, "%8u RNBRemote::%s Handling QEnvironmentHexEncoded: \"%s\"", + (uint32_t)m_comm.Timer().ElapsedMicroSeconds(true), __FUNCTION__, p); + + p += sizeof ("QEnvironmentHexEncoded:") - 1; + + std::string arg; + const char *c; + c = p; + while (*c != '\0') + { + if (*(c + 1) == '\0') + { + return HandlePacket_ILLFORMED (__FILE__, __LINE__, p, "non-hex char in arg on 'QEnvironmentHexEncoded' pkt"); + } + char smallbuf[3]; + smallbuf[0] = *c; + smallbuf[1] = *(c + 1); + smallbuf[2] = '\0'; + errno = 0; + int ch = strtoul (smallbuf, NULL, 16); + if (errno != 0 && ch == 0) + { + return HandlePacket_ILLFORMED (__FILE__, __LINE__, p, "non-hex char in arg on 'QEnvironmentHexEncoded' pkt"); + } + arg.push_back(ch); + c += 2; + } + + RNBContext& ctx = Context(); + if (arg.length() > 0) + ctx.PushEnvironment (arg.c_str()); + + return SendPacket ("OK"); +} + + +rnb_err_t RNBRemote::HandlePacket_QLaunchArch (const char *p) { p += sizeof ("QLaunchArch:") - 1; Modified: lldb/trunk/tools/debugserver/source/RNBRemote.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.h?rev=133857&r1=133856&r2=133857&view=diff ============================================================================== --- lldb/trunk/tools/debugserver/source/RNBRemote.h (original) +++ lldb/trunk/tools/debugserver/source/RNBRemote.h Fri Jun 24 20:55:21 2011 @@ -98,6 +98,7 @@ set_max_packet_size, // 'QSetMaxPacketSize:' set_max_payload_size, // 'QSetMaxPayloadSize:' set_environment_variable, // 'QEnvironment:' + set_environment_variable_hex, // 'QEnvironmentHexEncoded:' set_launch_arch, // 'QLaunchArch:' set_disable_aslr, // 'QSetDisableASLR:' set_stdin, // 'QSetSTDIN:' @@ -171,6 +172,7 @@ rnb_err_t HandlePacket_QSetMaxPayloadSize (const char *p); rnb_err_t HandlePacket_QSetMaxPacketSize (const char *p); rnb_err_t HandlePacket_QEnvironment (const char *p); + rnb_err_t HandlePacket_QEnvironmentHexEncoded (const char *p); rnb_err_t HandlePacket_QLaunchArch (const char *p); rnb_err_t HandlePacket_QPrefixRegisterPacketsWithThreadID (const char *p); rnb_err_t HandlePacket_last_signal (const char *p); From gclayton at apple.com Fri Jun 24 23:35:01 2011 From: gclayton at apple.com (Greg Clayton) Date: Sat, 25 Jun 2011 04:35:01 -0000 Subject: [Lldb-commits] [lldb] r133865 - in /lldb/trunk: lldb.xcodeproj/project.pbxproj lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme resources/LLDB-Info.plist source/API/SBFrame.cpp tools/debugserver/debugserver.xcodeproj/project.pbxproj Message-ID: <20110625043501.45CC52A6C12C@llvm.org> Author: gclayton Date: Fri Jun 24 23:35:01 2011 New Revision: 133865 URL: http://llvm.org/viewvc/llvm-project?rev=133865&view=rev Log: Bumped Xcode project versions to lldb-65 and debugserver-140. Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme lldb/trunk/resources/LLDB-Info.plist lldb/trunk/source/API/SBFrame.cpp 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=133865&r1=133864&r2=133865&view=diff ============================================================================== --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri Jun 24 23:35:01 2011 @@ -3412,10 +3412,10 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 64; + CURRENT_PROJECT_VERSION = 65; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 64; + DYLIB_CURRENT_VERSION = 65; EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3464,11 +3464,11 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 64; + CURRENT_PROJECT_VERSION = 65; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 64; + DYLIB_CURRENT_VERSION = 65; EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3515,8 +3515,8 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 64; - DYLIB_CURRENT_VERSION = 64; + CURRENT_PROJECT_VERSION = 65; + DYLIB_CURRENT_VERSION = 65; EXECUTABLE_EXTENSION = a; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3554,9 +3554,9 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 64; + CURRENT_PROJECT_VERSION = 65; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DYLIB_CURRENT_VERSION = 64; + DYLIB_CURRENT_VERSION = 65; EXECUTABLE_EXTENSION = a; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3594,9 +3594,9 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 64; + CURRENT_PROJECT_VERSION = 65; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DYLIB_CURRENT_VERSION = 64; + DYLIB_CURRENT_VERSION = 65; EXECUTABLE_EXTENSION = a; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3664,7 +3664,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 64; + CURRENT_PROJECT_VERSION = 65; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3695,11 +3695,11 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 64; + CURRENT_PROJECT_VERSION = 65; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 64; + DYLIB_CURRENT_VERSION = 65; EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3824,7 +3824,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 64; + CURRENT_PROJECT_VERSION = 65; DEBUG_INFORMATION_FORMAT = dwarf; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3856,7 +3856,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 64; + CURRENT_PROJECT_VERSION = 65; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", Modified: lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme?rev=133865&r1=133864&r2=133865&view=diff ============================================================================== --- lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme (original) +++ lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme Fri Jun 24 23:35:01 2011 @@ -77,7 +77,7 @@ launchStyle = "0" useCustomWorkingDirectory = "NO" customWorkingDirectory = "/Volumes/work/gclayton/Documents/devb/attach" - buildConfiguration = "Debug" + buildConfiguration = "Release" ignoresPersistentStateOnLaunch = "YES" enablesOpenGLESFrameCapture = "YES"> Modified: lldb/trunk/resources/LLDB-Info.plist URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/resources/LLDB-Info.plist?rev=133865&r1=133864&r2=133865&view=diff ============================================================================== --- lldb/trunk/resources/LLDB-Info.plist (original) +++ lldb/trunk/resources/LLDB-Info.plist Fri Jun 24 23:35:01 2011 @@ -17,7 +17,7 @@ CFBundleSignature ???? CFBundleVersion - 64 + 65 CFBundleName ${EXECUTABLE_NAME} Modified: lldb/trunk/source/API/SBFrame.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFrame.cpp?rev=133865&r1=133864&r2=133865&view=diff ============================================================================== --- lldb/trunk/source/API/SBFrame.cpp (original) +++ lldb/trunk/source/API/SBFrame.cpp Fri Jun 24 23:35:01 2011 @@ -22,6 +22,7 @@ #include "lldb/Core/ValueObjectRegister.h" #include "lldb/Core/ValueObjectVariable.h" #include "lldb/Expression/ClangUserExpression.h" +#include "lldb/Host/Host.h" #include "lldb/Symbol/Block.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Symbol/VariableList.h" @@ -746,6 +747,13 @@ { Mutex::Locker api_locker (m_opaque_sp->GetThread().GetProcess().GetTarget().GetAPIMutex()); + + StreamString frame_description; + m_opaque_sp->DumpUsingSettingsFormat (&frame_description); + + Host::SetCrashDescriptionWithFormat ("SBFrame::EvaluateExpression (expr = \"%s\", fetch_dynamic_value = %u) %s", + expr, fetch_dynamic_value, frame_description.GetString().c_str()); + ExecutionResults exe_results; const bool unwind_on_error = true; const bool keep_in_memory = false; 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=133865&r1=133864&r2=133865&view=diff ============================================================================== --- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original) +++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Fri Jun 24 23:35:01 2011 @@ -467,7 +467,7 @@ i386, ); COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 139; + CURRENT_PROJECT_VERSION = 140; "GCC_VERSION[sdk=iphoneos*][arch=*]" = 4.2; "GCC_VERSION[sdk=macosx*][arch=*]" = ""; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -488,7 +488,7 @@ x86_64, i386, ); - CURRENT_PROJECT_VERSION = 139; + CURRENT_PROJECT_VERSION = 140; DEAD_CODE_STRIPPING = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; @@ -509,7 +509,7 @@ x86_64, i386, ); - CURRENT_PROJECT_VERSION = 139; + CURRENT_PROJECT_VERSION = 140; DEAD_CODE_STRIPPING = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; @@ -527,7 +527,7 @@ buildSettings = { "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 139; + CURRENT_PROJECT_VERSION = 140; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks; "FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = ( @@ -567,7 +567,7 @@ "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 139; + CURRENT_PROJECT_VERSION = 140; FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks; "FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = ( "$(SDKROOT)/System/Library/PrivateFrameworks", @@ -607,7 +607,7 @@ "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 139; + CURRENT_PROJECT_VERSION = 140; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks; "FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = ( From gclayton at apple.com Fri Jun 24 23:35:55 2011 From: gclayton at apple.com (Greg Clayton) Date: Sat, 25 Jun 2011 04:35:55 -0000 Subject: [Lldb-commits] [lldb] r133866 - /lldb/tags/lldb-65/ Message-ID: <20110625043555.CB1632A6C12C@llvm.org> Author: gclayton Date: Fri Jun 24 23:35:55 2011 New Revision: 133866 URL: http://llvm.org/viewvc/llvm-project?rev=133866&view=rev Log: lldb-65. Added: lldb/tags/lldb-65/ - copied from r133865, lldb/trunk/ From johnny.chen at apple.com Sat Jun 25 15:07:20 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Sat, 25 Jun 2011 20:07:20 -0000 Subject: [Lldb-commits] [lldb] r133876 - in /lldb/trunk/test: lang/ lang/objc/ lang/objc/sample/ lang/objc/sample/Makefile objc/ Message-ID: <20110625200720.657462A6C12C@llvm.org> Author: johnny Date: Sat Jun 25 15:07:20 2011 New Revision: 133876 URL: http://llvm.org/viewvc/llvm-project?rev=133876&view=rev Log: Start moving things around to have a more hierarchical directory structure. Added: lldb/trunk/test/lang/ lldb/trunk/test/lang/objc/ lldb/trunk/test/lang/objc/sample/ - copied from r133875, lldb/trunk/test/objc/ Removed: lldb/trunk/test/objc/ Modified: lldb/trunk/test/lang/objc/sample/Makefile Modified: lldb/trunk/test/lang/objc/sample/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/sample/Makefile?rev=133876&r1=133875&r2=133876&view=diff ============================================================================== --- lldb/trunk/test/lang/objc/sample/Makefile (original) +++ lldb/trunk/test/lang/objc/sample/Makefile Sat Jun 25 15:07:20 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make OBJC_SOURCES := main.m LDFLAGS = $(CFLAGS) -lobjc -framework Foundation From johnny.chen at apple.com Sat Jun 25 15:16:38 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Sat, 25 Jun 2011 20:16:38 -0000 Subject: [Lldb-commits] [lldb] r133877 - in /lldb/trunk/test: lang/objc/objc-dynamic-value/ lang/objc/objc-ivar-offsets/ lang/objc/objc-optimized/ lang/objc/objc-stepping/ objc-dynamic-value/ objc-ivar-offsets/ objc-optimized/ objc-stepping/ Message-ID: <20110625201638.98E0D2A6C12C@llvm.org> Author: johnny Date: Sat Jun 25 15:16:38 2011 New Revision: 133877 URL: http://llvm.org/viewvc/llvm-project?rev=133877&view=rev Log: Move objc-related test directories to now reside under lang/objc. Added: lldb/trunk/test/lang/objc/objc-dynamic-value/ - copied from r133875, lldb/trunk/test/objc-dynamic-value/ lldb/trunk/test/lang/objc/objc-ivar-offsets/ - copied from r133875, lldb/trunk/test/objc-ivar-offsets/ lldb/trunk/test/lang/objc/objc-optimized/ - copied from r133875, lldb/trunk/test/objc-optimized/ lldb/trunk/test/lang/objc/objc-stepping/ - copied from r133875, lldb/trunk/test/objc-stepping/ Removed: lldb/trunk/test/objc-dynamic-value/ lldb/trunk/test/objc-ivar-offsets/ lldb/trunk/test/objc-optimized/ lldb/trunk/test/objc-stepping/ Modified: lldb/trunk/test/lang/objc/objc-dynamic-value/Makefile lldb/trunk/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py lldb/trunk/test/lang/objc/objc-ivar-offsets/Makefile lldb/trunk/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py lldb/trunk/test/lang/objc/objc-optimized/Makefile lldb/trunk/test/lang/objc/objc-optimized/TestObjcOptimized.py lldb/trunk/test/lang/objc/objc-stepping/Makefile lldb/trunk/test/lang/objc/objc-stepping/TestObjCStepping.py Modified: lldb/trunk/test/lang/objc/objc-dynamic-value/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-dynamic-value/Makefile?rev=133877&r1=133875&r2=133877&view=diff ============================================================================== --- lldb/trunk/test/lang/objc/objc-dynamic-value/Makefile (original) +++ lldb/trunk/test/lang/objc/objc-dynamic-value/Makefile Sat Jun 25 15:16:38 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make OBJC_SOURCES := dynamic-value.m LDFLAGS = $(CFLAGS) -lobjc -framework Foundation Modified: lldb/trunk/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py?rev=133877&r1=133875&r2=133877&view=diff ============================================================================== --- lldb/trunk/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py (original) +++ lldb/trunk/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py Sat Jun 25 15:16:38 2011 @@ -10,7 +10,7 @@ class ObjCDynamicValueTestCase(TestBase): - mydir = "objc-dynamic-value" + mydir = os.path.join("lang", "objc", "objc-dynamic-value") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") @python_api_test Modified: lldb/trunk/test/lang/objc/objc-ivar-offsets/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-ivar-offsets/Makefile?rev=133877&r1=133875&r2=133877&view=diff ============================================================================== --- lldb/trunk/test/lang/objc/objc-ivar-offsets/Makefile (original) +++ lldb/trunk/test/lang/objc/objc-ivar-offsets/Makefile Sat Jun 25 15:16:38 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make OBJC_SOURCES := objc-ivar-offsets.m main.m LDFLAGS = $(CFLAGS) -lobjc -framework Foundation Modified: lldb/trunk/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py?rev=133877&r1=133875&r2=133877&view=diff ============================================================================== --- lldb/trunk/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py (original) +++ lldb/trunk/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py Sat Jun 25 15:16:38 2011 @@ -8,7 +8,7 @@ class TestObjCIvarOffsets(TestBase): - mydir = "objc-ivar-offsets" + mydir = os.path.join("lang", "objc", "objc-ivar-offsets") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") @python_api_test Modified: lldb/trunk/test/lang/objc/objc-optimized/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-optimized/Makefile?rev=133877&r1=133875&r2=133877&view=diff ============================================================================== --- lldb/trunk/test/lang/objc/objc-optimized/Makefile (original) +++ lldb/trunk/test/lang/objc/objc-optimized/Makefile Sat Jun 25 15:16:38 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make OBJC_SOURCES := main.m Modified: lldb/trunk/test/lang/objc/objc-optimized/TestObjcOptimized.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-optimized/TestObjcOptimized.py?rev=133877&r1=133875&r2=133877&view=diff ============================================================================== --- lldb/trunk/test/lang/objc/objc-optimized/TestObjcOptimized.py (original) +++ lldb/trunk/test/lang/objc/objc-optimized/TestObjcOptimized.py Sat Jun 25 15:16:38 2011 @@ -17,7 +17,7 @@ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") class ObjcOptimizedTestCase(TestBase): - mydir = "objc-optimized" + mydir = os.path.join("lang", "objc", "objc-optimized") myclass = "MyClass" mymethod = "description" method_spec = "-[%s %s]" % (myclass, mymethod) Modified: lldb/trunk/test/lang/objc/objc-stepping/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-stepping/Makefile?rev=133877&r1=133875&r2=133877&view=diff ============================================================================== --- lldb/trunk/test/lang/objc/objc-stepping/Makefile (original) +++ lldb/trunk/test/lang/objc/objc-stepping/Makefile Sat Jun 25 15:16:38 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make OBJC_SOURCES := stepping-tests.m LDFLAGS = $(CFLAGS) -lobjc -framework Foundation Modified: lldb/trunk/test/lang/objc/objc-stepping/TestObjCStepping.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-stepping/TestObjCStepping.py?rev=133877&r1=133875&r2=133877&view=diff ============================================================================== --- lldb/trunk/test/lang/objc/objc-stepping/TestObjCStepping.py (original) +++ lldb/trunk/test/lang/objc/objc-stepping/TestObjCStepping.py Sat Jun 25 15:16:38 2011 @@ -7,7 +7,7 @@ class TestObjCStepping(TestBase): - mydir = "objc-stepping" + mydir = os.path.join("lang", "objc", "objc-stepping") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") @python_api_test From johnny.chen at apple.com Sat Jun 25 15:19:47 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Sat, 25 Jun 2011 20:19:47 -0000 Subject: [Lldb-commits] [lldb] r133878 - in /lldb/trunk/test: cpp/ lang/cpp/ lang/cpp/dynamic-value/Makefile lang/cpp/dynamic-value/TestDynamicValue.py lang/cpp/virtual/Makefile lang/cpp/virtual/TestVirtual.py Message-ID: <20110625201947.482942A6C12C@llvm.org> Author: johnny Date: Sat Jun 25 15:19:47 2011 New Revision: 133878 URL: http://llvm.org/viewvc/llvm-project?rev=133878&view=rev Log: Move C++-related test directories to now reside under lang. Added: lldb/trunk/test/lang/cpp/ - copied from r133875, lldb/trunk/test/cpp/ Removed: lldb/trunk/test/cpp/ Modified: lldb/trunk/test/lang/cpp/dynamic-value/Makefile lldb/trunk/test/lang/cpp/dynamic-value/TestDynamicValue.py lldb/trunk/test/lang/cpp/virtual/Makefile lldb/trunk/test/lang/cpp/virtual/TestVirtual.py Modified: lldb/trunk/test/lang/cpp/dynamic-value/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/dynamic-value/Makefile?rev=133878&r1=133875&r2=133878&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/dynamic-value/Makefile (original) +++ lldb/trunk/test/lang/cpp/dynamic-value/Makefile Sat Jun 25 15:19:47 2011 @@ -1,4 +1,4 @@ -LEVEL = ../../make +LEVEL = ../../../make CXX_SOURCES := pass-to-base.cpp Modified: lldb/trunk/test/lang/cpp/dynamic-value/TestDynamicValue.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/dynamic-value/TestDynamicValue.py?rev=133878&r1=133875&r2=133878&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/dynamic-value/TestDynamicValue.py (original) +++ lldb/trunk/test/lang/cpp/dynamic-value/TestDynamicValue.py Sat Jun 25 15:19:47 2011 @@ -10,7 +10,7 @@ class DynamicValueTestCase(TestBase): - mydir = os.path.join("cpp", "dynamic-value") + mydir = os.path.join("lang", "cpp", "dynamic-value") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") @python_api_test Modified: lldb/trunk/test/lang/cpp/virtual/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/virtual/Makefile?rev=133878&r1=133875&r2=133878&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/virtual/Makefile (original) +++ lldb/trunk/test/lang/cpp/virtual/Makefile Sat Jun 25 15:19:47 2011 @@ -1,4 +1,4 @@ -LEVEL = ../../make +LEVEL = ../../../make CXX_SOURCES := main.cpp Modified: lldb/trunk/test/lang/cpp/virtual/TestVirtual.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/virtual/TestVirtual.py?rev=133878&r1=133875&r2=133878&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/virtual/TestVirtual.py (original) +++ lldb/trunk/test/lang/cpp/virtual/TestVirtual.py Sat Jun 25 15:19:47 2011 @@ -12,7 +12,7 @@ class CppVirtualMadness(TestBase): - mydir = os.path.join("cpp", "virtual") + mydir = os.path.join("lang", "cpp", "virtual") # This is the pattern by design to match the "my_expr = 'value'" output from # printf() stmts (see main.cpp). From johnny.chen at apple.com Sat Jun 25 15:21:10 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Sat, 25 Jun 2011 20:21:10 -0000 Subject: [Lldb-commits] [lldb] r133879 - in /lldb/trunk/test: lang/cpp/namespace/ lang/cpp/namespace/Makefile lang/cpp/namespace/TestNamespace.py namespace/ Message-ID: <20110625202110.6BABF2A6C12C@llvm.org> Author: johnny Date: Sat Jun 25 15:21:10 2011 New Revision: 133879 URL: http://llvm.org/viewvc/llvm-project?rev=133879&view=rev Log: Move namespace directory to now reside under lang/cpp. Added: lldb/trunk/test/lang/cpp/namespace/ - copied from r133875, lldb/trunk/test/namespace/ Removed: lldb/trunk/test/namespace/ Modified: lldb/trunk/test/lang/cpp/namespace/Makefile lldb/trunk/test/lang/cpp/namespace/TestNamespace.py Modified: lldb/trunk/test/lang/cpp/namespace/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/namespace/Makefile?rev=133879&r1=133875&r2=133879&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/namespace/Makefile (original) +++ lldb/trunk/test/lang/cpp/namespace/Makefile Sat Jun 25 15:21:10 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make CXX_SOURCES := main.cpp 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=133879&r1=133875&r2=133879&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/namespace/TestNamespace.py (original) +++ lldb/trunk/test/lang/cpp/namespace/TestNamespace.py Sat Jun 25 15:21:10 2011 @@ -9,7 +9,7 @@ class NamespaceTestCase(TestBase): - mydir = "namespace" + mydir = os.path.join("lang", "cpp", "namespace") # rdar://problem/8668674 @unittest2.expectedFailure From johnny.chen at apple.com Sat Jun 25 15:29:42 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Sat, 25 Jun 2011 20:29:42 -0000 Subject: [Lldb-commits] [lldb] r133880 - in /lldb/trunk/test: enum_types/ lang/c/ lang/c/enum_types/ lang/c/enum_types/Makefile lang/c/enum_types/TestEnumTypes.py Message-ID: <20110625202942.236542A6C12D@llvm.org> Author: johnny Date: Sat Jun 25 15:29:41 2011 New Revision: 133880 URL: http://llvm.org/viewvc/llvm-project?rev=133880&view=rev Log: Move enum_types to now reside under lang/c. Added: lldb/trunk/test/lang/c/ lldb/trunk/test/lang/c/enum_types/ - copied from r133875, lldb/trunk/test/enum_types/ Removed: lldb/trunk/test/enum_types/ Modified: lldb/trunk/test/lang/c/enum_types/Makefile lldb/trunk/test/lang/c/enum_types/TestEnumTypes.py Modified: lldb/trunk/test/lang/c/enum_types/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/enum_types/Makefile?rev=133880&r1=133875&r2=133880&view=diff ============================================================================== --- lldb/trunk/test/lang/c/enum_types/Makefile (original) +++ lldb/trunk/test/lang/c/enum_types/Makefile Sat Jun 25 15:29:41 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make C_SOURCES := main.c Modified: lldb/trunk/test/lang/c/enum_types/TestEnumTypes.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/enum_types/TestEnumTypes.py?rev=133880&r1=133875&r2=133880&view=diff ============================================================================== --- lldb/trunk/test/lang/c/enum_types/TestEnumTypes.py (original) +++ lldb/trunk/test/lang/c/enum_types/TestEnumTypes.py Sat Jun 25 15:29:41 2011 @@ -7,7 +7,7 @@ class EnumTypesTestCase(TestBase): - mydir = "enum_types" + mydir = os.path.join("lang", "c", "enum_types") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym(self): From johnny.chen at apple.com Sat Jun 25 15:43:58 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Sat, 25 Jun 2011 20:43:58 -0000 Subject: [Lldb-commits] [lldb] r133881 - in /lldb/trunk/test: array_types/ bitfields/ class_static/ class_types/ lang/c/array_types/ lang/c/bitfields/ lang/cpp/class_static/ lang/cpp/class_types/ lang/cpp/signed_types/ lang/cpp/unique-types/ lang/cpp/unsigned_types/ signed_types/ unique-types/ unsigned_types/ Message-ID: <20110625204358.487562A6C12C@llvm.org> Author: johnny Date: Sat Jun 25 15:43:57 2011 New Revision: 133881 URL: http://llvm.org/viewvc/llvm-project?rev=133881&view=rev Log: Move some directories to now reside under lang/c or lang/cpp. Added: lldb/trunk/test/lang/c/array_types/ - copied from r133875, lldb/trunk/test/array_types/ lldb/trunk/test/lang/c/bitfields/ - copied from r133875, lldb/trunk/test/bitfields/ lldb/trunk/test/lang/cpp/class_static/ - copied from r133875, lldb/trunk/test/class_static/ lldb/trunk/test/lang/cpp/class_types/ - copied from r133875, lldb/trunk/test/class_types/ lldb/trunk/test/lang/cpp/signed_types/ - copied from r133875, lldb/trunk/test/signed_types/ lldb/trunk/test/lang/cpp/unique-types/ - copied from r133875, lldb/trunk/test/unique-types/ lldb/trunk/test/lang/cpp/unsigned_types/ - copied from r133875, lldb/trunk/test/unsigned_types/ Removed: lldb/trunk/test/array_types/ lldb/trunk/test/bitfields/ lldb/trunk/test/class_static/ lldb/trunk/test/class_types/ lldb/trunk/test/signed_types/ lldb/trunk/test/unique-types/ lldb/trunk/test/unsigned_types/ Modified: lldb/trunk/test/lang/c/array_types/Makefile lldb/trunk/test/lang/c/array_types/TestArrayTypes.py lldb/trunk/test/lang/c/bitfields/Makefile lldb/trunk/test/lang/c/bitfields/TestBitfields.py lldb/trunk/test/lang/cpp/class_static/Makefile lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py lldb/trunk/test/lang/cpp/class_types/Makefile lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py lldb/trunk/test/lang/cpp/signed_types/Makefile lldb/trunk/test/lang/cpp/signed_types/TestSignedTypes.py lldb/trunk/test/lang/cpp/unique-types/Makefile lldb/trunk/test/lang/cpp/unique-types/TestUniqueTypes.py lldb/trunk/test/lang/cpp/unsigned_types/Makefile lldb/trunk/test/lang/cpp/unsigned_types/TestUnsignedTypes.py Modified: lldb/trunk/test/lang/c/array_types/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/array_types/Makefile?rev=133881&r1=133875&r2=133881&view=diff ============================================================================== --- lldb/trunk/test/lang/c/array_types/Makefile (original) +++ lldb/trunk/test/lang/c/array_types/Makefile Sat Jun 25 15:43:57 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make C_SOURCES := main.c Modified: lldb/trunk/test/lang/c/array_types/TestArrayTypes.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/array_types/TestArrayTypes.py?rev=133881&r1=133875&r2=133881&view=diff ============================================================================== --- lldb/trunk/test/lang/c/array_types/TestArrayTypes.py (original) +++ lldb/trunk/test/lang/c/array_types/TestArrayTypes.py Sat Jun 25 15:43:57 2011 @@ -7,7 +7,7 @@ class ArrayTypesTestCase(TestBase): - mydir = "array_types" + mydir = os.path.join("lang", "c", "array_types") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym_and_run_command(self): Modified: lldb/trunk/test/lang/c/bitfields/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/bitfields/Makefile?rev=133881&r1=133875&r2=133881&view=diff ============================================================================== --- lldb/trunk/test/lang/c/bitfields/Makefile (original) +++ lldb/trunk/test/lang/c/bitfields/Makefile Sat Jun 25 15:43:57 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make C_SOURCES := main.c Modified: lldb/trunk/test/lang/c/bitfields/TestBitfields.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/bitfields/TestBitfields.py?rev=133881&r1=133875&r2=133881&view=diff ============================================================================== --- lldb/trunk/test/lang/c/bitfields/TestBitfields.py (original) +++ lldb/trunk/test/lang/c/bitfields/TestBitfields.py Sat Jun 25 15:43:57 2011 @@ -7,7 +7,7 @@ class BitfieldsTestCase(TestBase): - mydir = "bitfields" + mydir = os.path.join("lang", "c", "bitfields") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym_and_run_command(self): Modified: lldb/trunk/test/lang/cpp/class_static/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/class_static/Makefile?rev=133881&r1=133875&r2=133881&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/class_static/Makefile (original) +++ lldb/trunk/test/lang/cpp/class_static/Makefile Sat Jun 25 15:43:57 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make CXX_SOURCES := main.cpp Modified: lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py?rev=133881&r1=133875&r2=133881&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py (original) +++ lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py Sat Jun 25 15:43:57 2011 @@ -9,7 +9,7 @@ class StaticVariableTestCase(TestBase): - mydir = "class_static" + mydir = os.path.join("lang", "cpp", "class_static") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym_and_run_command(self): Modified: lldb/trunk/test/lang/cpp/class_types/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/class_types/Makefile?rev=133881&r1=133875&r2=133881&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/class_types/Makefile (original) +++ lldb/trunk/test/lang/cpp/class_types/Makefile Sat Jun 25 15:43:57 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make CXX_SOURCES := main.cpp Modified: lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py?rev=133881&r1=133875&r2=133881&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py (original) +++ lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py Sat Jun 25 15:43:57 2011 @@ -8,7 +8,7 @@ class ClassTypesTestCase(TestBase): - mydir = "class_types" + mydir = os.path.join("lang", "cpp", "class_types") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym_and_run_command(self): Modified: lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py?rev=133881&r1=133875&r2=133881&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py (original) +++ lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py Sat Jun 25 15:43:57 2011 @@ -9,7 +9,7 @@ class IterateFrameAndDisassembleTestCase(TestBase): - mydir = "class_types" + mydir = os.path.join("lang", "cpp", "class_types") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym_and_run_command(self): Modified: lldb/trunk/test/lang/cpp/signed_types/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/signed_types/Makefile?rev=133881&r1=133875&r2=133881&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/signed_types/Makefile (original) +++ lldb/trunk/test/lang/cpp/signed_types/Makefile Sat Jun 25 15:43:57 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make CXX_SOURCES := main.cpp Modified: lldb/trunk/test/lang/cpp/signed_types/TestSignedTypes.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/signed_types/TestSignedTypes.py?rev=133881&r1=133875&r2=133881&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/signed_types/TestSignedTypes.py (original) +++ lldb/trunk/test/lang/cpp/signed_types/TestSignedTypes.py Sat Jun 25 15:43:57 2011 @@ -10,7 +10,7 @@ class UnsignedTypesTestCase(TestBase): - mydir = "signed_types" + mydir = os.path.join("lang", "cpp", "signed_types") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym(self): Modified: lldb/trunk/test/lang/cpp/unique-types/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/unique-types/Makefile?rev=133881&r1=133875&r2=133881&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/unique-types/Makefile (original) +++ lldb/trunk/test/lang/cpp/unique-types/Makefile Sat Jun 25 15:43:57 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make CXX_SOURCES := main.cpp Modified: lldb/trunk/test/lang/cpp/unique-types/TestUniqueTypes.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/unique-types/TestUniqueTypes.py?rev=133881&r1=133875&r2=133881&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/unique-types/TestUniqueTypes.py (original) +++ lldb/trunk/test/lang/cpp/unique-types/TestUniqueTypes.py Sat Jun 25 15:43:57 2011 @@ -9,7 +9,7 @@ class UniqueTypesTestCase(TestBase): - mydir = "unique-types" + mydir = os.path.join("lang", "cpp", "unique-types") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym(self): Modified: lldb/trunk/test/lang/cpp/unsigned_types/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/unsigned_types/Makefile?rev=133881&r1=133875&r2=133881&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/unsigned_types/Makefile (original) +++ lldb/trunk/test/lang/cpp/unsigned_types/Makefile Sat Jun 25 15:43:57 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make CXX_SOURCES := main.cpp Modified: lldb/trunk/test/lang/cpp/unsigned_types/TestUnsignedTypes.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/unsigned_types/TestUnsignedTypes.py?rev=133881&r1=133875&r2=133881&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/unsigned_types/TestUnsignedTypes.py (original) +++ lldb/trunk/test/lang/cpp/unsigned_types/TestUnsignedTypes.py Sat Jun 25 15:43:57 2011 @@ -10,7 +10,7 @@ class UnsignedTypesTestCase(TestBase): - mydir = "unsigned_types" + mydir = os.path.join("lang", "cpp", "unsigned_types") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym(self): From johnny.chen at apple.com Sat Jun 25 15:49:06 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Sat, 25 Jun 2011 20:49:06 -0000 Subject: [Lldb-commits] [lldb] r133882 - in /lldb/trunk/test: forward/ function_types/ lang/c/forward/ lang/c/forward/Makefile lang/c/forward/TestForwardDeclaration.py lang/c/function_types/ lang/c/function_types/Makefile lang/c/function_types/TestFunctionTypes.py Message-ID: <20110625204906.EA2B22A6C12C@llvm.org> Author: johnny Date: Sat Jun 25 15:49:06 2011 New Revision: 133882 URL: http://llvm.org/viewvc/llvm-project?rev=133882&view=rev Log: Move test dirs forward and function_types to now reside under lang/c. Added: lldb/trunk/test/lang/c/forward/ - copied from r133875, lldb/trunk/test/forward/ lldb/trunk/test/lang/c/function_types/ - copied from r133875, lldb/trunk/test/function_types/ Removed: lldb/trunk/test/forward/ lldb/trunk/test/function_types/ Modified: lldb/trunk/test/lang/c/forward/Makefile lldb/trunk/test/lang/c/forward/TestForwardDeclaration.py lldb/trunk/test/lang/c/function_types/Makefile lldb/trunk/test/lang/c/function_types/TestFunctionTypes.py Modified: lldb/trunk/test/lang/c/forward/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/forward/Makefile?rev=133882&r1=133875&r2=133882&view=diff ============================================================================== --- lldb/trunk/test/lang/c/forward/Makefile (original) +++ lldb/trunk/test/lang/c/forward/Makefile Sat Jun 25 15:49:06 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make C_SOURCES := main.c foo.c Modified: lldb/trunk/test/lang/c/forward/TestForwardDeclaration.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/forward/TestForwardDeclaration.py?rev=133882&r1=133875&r2=133882&view=diff ============================================================================== --- lldb/trunk/test/lang/c/forward/TestForwardDeclaration.py (original) +++ lldb/trunk/test/lang/c/forward/TestForwardDeclaration.py Sat Jun 25 15:49:06 2011 @@ -7,7 +7,7 @@ class ForwardDeclarationTestCase(TestBase): - mydir = "forward" + mydir = os.path.join("lang", "c", "forward") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym_and_run_command(self): Modified: lldb/trunk/test/lang/c/function_types/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/function_types/Makefile?rev=133882&r1=133875&r2=133882&view=diff ============================================================================== --- lldb/trunk/test/lang/c/function_types/Makefile (original) +++ lldb/trunk/test/lang/c/function_types/Makefile Sat Jun 25 15:49:06 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make C_SOURCES := main.c Modified: lldb/trunk/test/lang/c/function_types/TestFunctionTypes.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/function_types/TestFunctionTypes.py?rev=133882&r1=133875&r2=133882&view=diff ============================================================================== --- lldb/trunk/test/lang/c/function_types/TestFunctionTypes.py (original) +++ lldb/trunk/test/lang/c/function_types/TestFunctionTypes.py Sat Jun 25 15:49:06 2011 @@ -7,7 +7,7 @@ class FunctionTypesTestCase(TestBase): - mydir = "function_types" + mydir = os.path.join("lang", "c", "function_types") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym(self): From johnny.chen at apple.com Sat Jun 25 15:55:22 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Sat, 25 Jun 2011 20:55:22 -0000 Subject: [Lldb-commits] [lldb] r133883 - in /lldb/trunk/test: foundation/ global_variables/ lang/c/global_variables/ lang/c/global_variables/Makefile lang/c/global_variables/TestGlobalVariables.py lang/objc/foundation/ lang/objc/foundation/Makefile lang/objc/foundation/TestConstStrings.py lang/objc/foundation/TestFoundationDisassembly.py lang/objc/foundation/TestObjCMethods.py lang/objc/foundation/TestObjCMethods2.py lang/objc/foundation/TestSymbolTable.py Message-ID: <20110625205522.A7AEC2A6C12C@llvm.org> Author: johnny Date: Sat Jun 25 15:55:22 2011 New Revision: 133883 URL: http://llvm.org/viewvc/llvm-project?rev=133883&view=rev Log: Move global_variables dir to lang/c and foundation dir to lang/objc. Added: lldb/trunk/test/lang/c/global_variables/ - copied from r133875, lldb/trunk/test/global_variables/ lldb/trunk/test/lang/objc/foundation/ - copied from r133875, lldb/trunk/test/foundation/ Removed: lldb/trunk/test/foundation/ lldb/trunk/test/global_variables/ Modified: lldb/trunk/test/lang/c/global_variables/Makefile lldb/trunk/test/lang/c/global_variables/TestGlobalVariables.py lldb/trunk/test/lang/objc/foundation/Makefile lldb/trunk/test/lang/objc/foundation/TestConstStrings.py lldb/trunk/test/lang/objc/foundation/TestFoundationDisassembly.py lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py lldb/trunk/test/lang/objc/foundation/TestObjCMethods2.py lldb/trunk/test/lang/objc/foundation/TestSymbolTable.py Modified: lldb/trunk/test/lang/c/global_variables/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/global_variables/Makefile?rev=133883&r1=133875&r2=133883&view=diff ============================================================================== --- lldb/trunk/test/lang/c/global_variables/Makefile (original) +++ lldb/trunk/test/lang/c/global_variables/Makefile Sat Jun 25 15:55:22 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make C_SOURCES := main.c Modified: lldb/trunk/test/lang/c/global_variables/TestGlobalVariables.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/global_variables/TestGlobalVariables.py?rev=133883&r1=133875&r2=133883&view=diff ============================================================================== --- lldb/trunk/test/lang/c/global_variables/TestGlobalVariables.py (original) +++ lldb/trunk/test/lang/c/global_variables/TestGlobalVariables.py Sat Jun 25 15:55:22 2011 @@ -7,7 +7,7 @@ class GlobalVariablesTestCase(TestBase): - mydir = "global_variables" + mydir = os.path.join("lang", "c", "global_variables") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym(self): Modified: lldb/trunk/test/lang/objc/foundation/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/foundation/Makefile?rev=133883&r1=133875&r2=133883&view=diff ============================================================================== --- lldb/trunk/test/lang/objc/foundation/Makefile (original) +++ lldb/trunk/test/lang/objc/foundation/Makefile Sat Jun 25 15:55:22 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make OBJC_SOURCES := main.m my-base.m #OBJC_SOURCES := const-strings.m Modified: lldb/trunk/test/lang/objc/foundation/TestConstStrings.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/foundation/TestConstStrings.py?rev=133883&r1=133875&r2=133883&view=diff ============================================================================== --- lldb/trunk/test/lang/objc/foundation/TestConstStrings.py (original) +++ lldb/trunk/test/lang/objc/foundation/TestConstStrings.py Sat Jun 25 15:55:22 2011 @@ -11,7 +11,7 @@ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") class ConstStringTestCase(TestBase): - mydir = "foundation" + mydir = os.path.join("lang", "objc", "foundation") d = {'OBJC_SOURCES': 'const-strings.m'} def test_break_with_dsym(self): Modified: lldb/trunk/test/lang/objc/foundation/TestFoundationDisassembly.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/foundation/TestFoundationDisassembly.py?rev=133883&r1=133875&r2=133883&view=diff ============================================================================== --- lldb/trunk/test/lang/objc/foundation/TestFoundationDisassembly.py (original) +++ lldb/trunk/test/lang/objc/foundation/TestFoundationDisassembly.py Sat Jun 25 15:55:22 2011 @@ -10,7 +10,7 @@ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") class FoundationDisassembleTestCase(TestBase): - mydir = "foundation" + mydir = os.path.join("lang", "objc", "foundation") # rdar://problem/8504895 # Crash while doing 'disassemble -n "-[NSNumber descriptionWithLocale:]" Modified: lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py?rev=133883&r1=133875&r2=133883&view=diff ============================================================================== --- lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py (original) +++ lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py Sat Jun 25 15:55:22 2011 @@ -11,7 +11,7 @@ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") class FoundationTestCase(TestBase): - mydir = "foundation" + mydir = os.path.join("lang", "objc", "foundation") def test_break_with_dsym(self): """Test setting objc breakpoints using '_regexp-break' and 'breakpoint set'.""" Modified: lldb/trunk/test/lang/objc/foundation/TestObjCMethods2.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/foundation/TestObjCMethods2.py?rev=133883&r1=133875&r2=133883&view=diff ============================================================================== --- lldb/trunk/test/lang/objc/foundation/TestObjCMethods2.py (original) +++ lldb/trunk/test/lang/objc/foundation/TestObjCMethods2.py Sat Jun 25 15:55:22 2011 @@ -10,7 +10,7 @@ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") class FoundationTestCase2(TestBase): - mydir = "foundation" + mydir = os.path.join("lang", "objc", "foundation") def test_more_expr_commands_with_dsym(self): """More expression commands for objective-c.""" Modified: lldb/trunk/test/lang/objc/foundation/TestSymbolTable.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/foundation/TestSymbolTable.py?rev=133883&r1=133875&r2=133883&view=diff ============================================================================== --- lldb/trunk/test/lang/objc/foundation/TestSymbolTable.py (original) +++ lldb/trunk/test/lang/objc/foundation/TestSymbolTable.py Sat Jun 25 15:55:22 2011 @@ -10,7 +10,7 @@ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") class FoundationSymtabTestCase(TestBase): - mydir = "foundation" + mydir = os.path.join("lang", "objc", "foundation") symbols_list = ['-[MyString initWithNSString:]', '-[MyString dealloc]', From johnny.chen at apple.com Sat Jun 25 16:07:03 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Sat, 25 Jun 2011 21:07:03 -0000 Subject: [Lldb-commits] [lldb] r133884 - in /lldb/trunk/test: lang/c/set_values/ lang/c/set_values/Makefile lang/c/set_values/TestSetValues.py lang/c/stepping/ lang/c/stepping/Makefile lang/c/stepping/TestThreadStepping.py lang/c/struct_types/ lang/c/struct_types/Makefile lang/c/struct_types/TestStructTypes.py lang/cpp/stl/ lang/cpp/stl/Makefile lang/cpp/stl/TestSTL.py lang/cpp/stl/TestStdCXXDisassembly.py set_values/ stepping/ stl/ struct_types/ Message-ID: <20110625210703.5986E2A6C12C@llvm.org> Author: johnny Date: Sat Jun 25 16:07:03 2011 New Revision: 133884 URL: http://llvm.org/viewvc/llvm-project?rev=133884&view=rev Log: Move struct_types, stepping, and set_values dirs to now reside under lang/c. Move stl dir to now reside under lang/cpp. Added: lldb/trunk/test/lang/c/set_values/ - copied from r133875, lldb/trunk/test/set_values/ lldb/trunk/test/lang/c/stepping/ - copied from r133875, lldb/trunk/test/stepping/ lldb/trunk/test/lang/c/struct_types/ - copied from r133875, lldb/trunk/test/struct_types/ lldb/trunk/test/lang/cpp/stl/ - copied from r133875, lldb/trunk/test/stl/ Removed: lldb/trunk/test/set_values/ lldb/trunk/test/stepping/ lldb/trunk/test/stl/ lldb/trunk/test/struct_types/ Modified: lldb/trunk/test/lang/c/set_values/Makefile lldb/trunk/test/lang/c/set_values/TestSetValues.py lldb/trunk/test/lang/c/stepping/Makefile lldb/trunk/test/lang/c/stepping/TestThreadStepping.py lldb/trunk/test/lang/c/struct_types/Makefile lldb/trunk/test/lang/c/struct_types/TestStructTypes.py lldb/trunk/test/lang/cpp/stl/Makefile lldb/trunk/test/lang/cpp/stl/TestSTL.py lldb/trunk/test/lang/cpp/stl/TestStdCXXDisassembly.py Modified: lldb/trunk/test/lang/c/set_values/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/set_values/Makefile?rev=133884&r1=133875&r2=133884&view=diff ============================================================================== --- lldb/trunk/test/lang/c/set_values/Makefile (original) +++ lldb/trunk/test/lang/c/set_values/Makefile Sat Jun 25 16:07:03 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make C_SOURCES := main.c Modified: lldb/trunk/test/lang/c/set_values/TestSetValues.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/set_values/TestSetValues.py?rev=133884&r1=133875&r2=133884&view=diff ============================================================================== --- lldb/trunk/test/lang/c/set_values/TestSetValues.py (original) +++ lldb/trunk/test/lang/c/set_values/TestSetValues.py Sat Jun 25 16:07:03 2011 @@ -7,7 +7,7 @@ class SetValuesTestCase(TestBase): - mydir = "set_values" + mydir = os.path.join("lang", "c", "set_values") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym(self): Modified: lldb/trunk/test/lang/c/stepping/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/stepping/Makefile?rev=133884&r1=133875&r2=133884&view=diff ============================================================================== --- lldb/trunk/test/lang/c/stepping/Makefile (original) +++ lldb/trunk/test/lang/c/stepping/Makefile Sat Jun 25 16:07:03 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make C_SOURCES := main.c Modified: lldb/trunk/test/lang/c/stepping/TestThreadStepping.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/stepping/TestThreadStepping.py?rev=133884&r1=133875&r2=133884&view=diff ============================================================================== --- lldb/trunk/test/lang/c/stepping/TestThreadStepping.py (original) +++ lldb/trunk/test/lang/c/stepping/TestThreadStepping.py Sat Jun 25 16:07:03 2011 @@ -10,7 +10,7 @@ class ThreadSteppingTestCase(TestBase): - mydir = "stepping" + mydir = os.path.join("lang", "c", "stepping") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_step_out_with_dsym_and_run_command(self): Modified: lldb/trunk/test/lang/c/struct_types/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/struct_types/Makefile?rev=133884&r1=133875&r2=133884&view=diff ============================================================================== --- lldb/trunk/test/lang/c/struct_types/Makefile (original) +++ lldb/trunk/test/lang/c/struct_types/Makefile Sat Jun 25 16:07:03 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make C_SOURCES := main.c Modified: lldb/trunk/test/lang/c/struct_types/TestStructTypes.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/struct_types/TestStructTypes.py?rev=133884&r1=133875&r2=133884&view=diff ============================================================================== --- lldb/trunk/test/lang/c/struct_types/TestStructTypes.py (original) +++ lldb/trunk/test/lang/c/struct_types/TestStructTypes.py Sat Jun 25 16:07:03 2011 @@ -11,7 +11,7 @@ class StructTypesTestCase(TestBase): - mydir = "struct_types" + mydir = os.path.join("lang", "c", "struct_types") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym(self): Modified: lldb/trunk/test/lang/cpp/stl/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/stl/Makefile?rev=133884&r1=133875&r2=133884&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/stl/Makefile (original) +++ lldb/trunk/test/lang/cpp/stl/Makefile Sat Jun 25 16:07:03 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make CXX_SOURCES := main.cpp CFLAGS :=-arch x86_64 -gdwarf-2 -Os 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=133884&r1=133875&r2=133884&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/stl/TestSTL.py (original) +++ lldb/trunk/test/lang/cpp/stl/TestSTL.py Sat Jun 25 16:07:03 2011 @@ -9,7 +9,7 @@ class STLTestCase(TestBase): - mydir = "stl" + mydir = os.path.join("lang", "cpp", "stl") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym(self): Modified: lldb/trunk/test/lang/cpp/stl/TestStdCXXDisassembly.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/stl/TestStdCXXDisassembly.py?rev=133884&r1=133875&r2=133884&view=diff ============================================================================== --- lldb/trunk/test/lang/cpp/stl/TestStdCXXDisassembly.py (original) +++ lldb/trunk/test/lang/cpp/stl/TestStdCXXDisassembly.py Sat Jun 25 16:07:03 2011 @@ -9,7 +9,7 @@ class StdCXXDisassembleTestCase(TestBase): - mydir = "stl" + mydir = os.path.join("lang", "cpp", "stl") def setUp(self): # Call super's setUp(). From johnny.chen at apple.com Sun Jun 26 15:48:37 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Sun, 26 Jun 2011 20:48:37 -0000 Subject: [Lldb-commits] [lldb] r133889 - /lldb/trunk/test/hello_world/TestHelloWorld.py Message-ID: <20110626204837.7403F2A6C12C@llvm.org> Author: johnny Date: Sun Jun 26 15:48:37 2011 New Revision: 133889 URL: http://llvm.org/viewvc/llvm-project?rev=133889&view=rev Log: Simplified the test cases, before moving the file to reside under python_api dir. Modified: lldb/trunk/test/hello_world/TestHelloWorld.py Modified: lldb/trunk/test/hello_world/TestHelloWorld.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/hello_world/TestHelloWorld.py?rev=133889&r1=133888&r2=133889&view=diff ============================================================================== --- lldb/trunk/test/hello_world/TestHelloWorld.py (original) +++ lldb/trunk/test/hello_world/TestHelloWorld.py Sun Jun 26 15:48:37 2011 @@ -10,23 +10,6 @@ mydir = "hello_world" @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") - def test_with_dsym_and_run_command(self): - """Create target, breakpoint, launch a process, and then kill it. - - Use dsym info and lldb "run" command. - """ - self.buildDsym() - self.hello_world_python(useLaunchAPI = False) - - def test_with_dwarf_and_run_command(self): - """Create target, breakpoint, launch a process, and then kill it. - - Use dwarf debug map and lldb "run" command. - """ - self.buildDwarf() - self.hello_world_python(useLaunchAPI = False) - - @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") @python_api_test def test_with_dsym_and_process_launch_api(self): """Create target, breakpoint, launch a process, and then kill it. @@ -34,7 +17,7 @@ Use dsym info and process launch API. """ self.buildDsym() - self.hello_world_python(useLaunchAPI = True) + self.hello_world_python() @python_api_test def test_with_dwarf_and_process_launch_api(self): @@ -43,7 +26,7 @@ Use dwarf debug map and process launch API. """ self.buildDwarf() - self.hello_world_python(useLaunchAPI = True) + self.hello_world_python() @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") @python_api_test @@ -92,7 +75,7 @@ self.line1 = line_number('main.c', '// Set break point at this line.') self.line2 = line_number('main.c', '// Waiting to be attached...') - def hello_world_python(self, useLaunchAPI): + def hello_world_python(self): """Create target, breakpoint, launch a process, and then kill it.""" target = self.dbg.CreateTarget(self.exe) @@ -114,16 +97,12 @@ # rdar://problem/8364687 # SBTarget.Launch() issue (or is there some race condition)? - if useLaunchAPI: - process = target.LaunchSimple(None, None, os.getcwd()) - # The following isn't needed anymore, rdar://8364687 is fixed. - # - # Apply some dances after LaunchProcess() in order to break at "main". - # It only works sometimes. - #self.breakAfterLaunch(process, "main") - else: - # On the other hand, the following line of code are more reliable. - self.runCmd("run") + process = target.LaunchSimple(None, None, os.getcwd()) + # The following isn't needed anymore, rdar://8364687 is fixed. + # + # Apply some dances after LaunchProcess() in order to break at "main". + # It only works sometimes. + #self.breakAfterLaunch(process, "main") process = target.GetProcess() self.assertTrue(process, PROCESS_IS_VALID) From johnny.chen at apple.com Sun Jun 26 15:59:36 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Sun, 26 Jun 2011 20:59:36 -0000 Subject: [Lldb-commits] [lldb] r133890 - in /lldb/trunk/test: hello_world/ python_api/hello_world/ python_api/hello_world/Makefile python_api/hello_world/TestHelloWorld.py Message-ID: <20110626205936.B61DD2A6C12C@llvm.org> Author: johnny Date: Sun Jun 26 15:59:36 2011 New Revision: 133890 URL: http://llvm.org/viewvc/llvm-project?rev=133890&view=rev Log: Move hello_world to now reside under python_api dir. Added: lldb/trunk/test/python_api/hello_world/ - copied from r133875, lldb/trunk/test/hello_world/ lldb/trunk/test/python_api/hello_world/TestHelloWorld.py - copied, changed from r133889, lldb/trunk/test/hello_world/TestHelloWorld.py Removed: lldb/trunk/test/hello_world/ Modified: lldb/trunk/test/python_api/hello_world/Makefile Modified: lldb/trunk/test/python_api/hello_world/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/hello_world/Makefile?rev=133890&r1=133875&r2=133890&view=diff ============================================================================== --- lldb/trunk/test/python_api/hello_world/Makefile (original) +++ lldb/trunk/test/python_api/hello_world/Makefile Sun Jun 26 15:59:36 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../make C_SOURCES := main.c EXE := hello_world Copied: lldb/trunk/test/python_api/hello_world/TestHelloWorld.py (from r133889, lldb/trunk/test/hello_world/TestHelloWorld.py) URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/hello_world/TestHelloWorld.py?p2=lldb/trunk/test/python_api/hello_world/TestHelloWorld.py&p1=lldb/trunk/test/hello_world/TestHelloWorld.py&r1=133889&r2=133890&rev=133890&view=diff ============================================================================== --- lldb/trunk/test/hello_world/TestHelloWorld.py (original) +++ lldb/trunk/test/python_api/hello_world/TestHelloWorld.py Sun Jun 26 15:59:36 2011 @@ -7,7 +7,7 @@ class HelloWorldTestCase(TestBase): - mydir = "hello_world" + mydir = os.path.join("python_api", "hello_world") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") @python_api_test From johnny.chen at apple.com Sun Jun 26 16:11:46 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Sun, 26 Jun 2011 21:11:46 -0000 Subject: [Lldb-commits] [lldb] r133891 - /lldb/trunk/test/functionalities/ Message-ID: <20110626211146.C52052A6C12C@llvm.org> Author: johnny Date: Sun Jun 26 16:11:46 2011 New Revision: 133891 URL: http://llvm.org/viewvc/llvm-project?rev=133891&view=rev Log: Create new directory named 'functionalities' to house some existing top level directories. Added: lldb/trunk/test/functionalities/ From johnny.chen at apple.com Sun Jun 26 16:24:46 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Sun, 26 Jun 2011 21:24:46 -0000 Subject: [Lldb-commits] [lldb] r133892 - in /lldb/trunk/test: abbreviation_tests/ alias_tests/ breakpoint_command/ breakpoint_conditions/ breakpoint_ids/ breakpoint_ignore_count/ breakpoint_locations/ functionalities/abbreviation_tests/ functionalities/alias_tests/ functionalities/breakpoint/ functionalities/breakpoint/breakpoint_command/ functionalities/breakpoint/breakpoint_conditions/ functionalities/breakpoint/breakpoint_ids/ functionalities/breakpoint/breakpoint_ignore_count/ functionalities/breakpoint/breakpoint_locations/ Message-ID: <20110626212446.6F5742A6C12C@llvm.org> Author: johnny Date: Sun Jun 26 16:24:46 2011 New Revision: 133892 URL: http://llvm.org/viewvc/llvm-project?rev=133892&view=rev Log: Move some top level directories to reside under functionalities dir. Added: lldb/trunk/test/functionalities/abbreviation_tests/ - copied from r133889, lldb/trunk/test/abbreviation_tests/ lldb/trunk/test/functionalities/alias_tests/ - copied from r133889, lldb/trunk/test/alias_tests/ lldb/trunk/test/functionalities/breakpoint/ lldb/trunk/test/functionalities/breakpoint/breakpoint_command/ - copied from r133889, lldb/trunk/test/breakpoint_command/ lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/ - copied from r133889, lldb/trunk/test/breakpoint_conditions/ lldb/trunk/test/functionalities/breakpoint/breakpoint_ids/ - copied from r133889, lldb/trunk/test/breakpoint_ids/ lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/ - copied from r133889, lldb/trunk/test/breakpoint_ignore_count/ lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/ - copied from r133889, lldb/trunk/test/breakpoint_locations/ Removed: lldb/trunk/test/abbreviation_tests/ lldb/trunk/test/alias_tests/ lldb/trunk/test/breakpoint_command/ lldb/trunk/test/breakpoint_conditions/ lldb/trunk/test/breakpoint_ids/ lldb/trunk/test/breakpoint_ignore_count/ lldb/trunk/test/breakpoint_locations/ Modified: lldb/trunk/test/functionalities/abbreviation_tests/Makefile lldb/trunk/test/functionalities/abbreviation_tests/TestAbbreviations.py lldb/trunk/test/functionalities/alias_tests/Makefile lldb/trunk/test/functionalities/alias_tests/TestAliases.py lldb/trunk/test/functionalities/breakpoint/breakpoint_command/Makefile lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/Makefile lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py lldb/trunk/test/functionalities/breakpoint/breakpoint_ids/Makefile lldb/trunk/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/Makefile lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/Makefile lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py Modified: lldb/trunk/test/functionalities/abbreviation_tests/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/abbreviation_tests/Makefile?rev=133892&r1=133889&r2=133892&view=diff ============================================================================== --- lldb/trunk/test/functionalities/abbreviation_tests/Makefile (original) +++ lldb/trunk/test/functionalities/abbreviation_tests/Makefile Sun Jun 26 16:24:46 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../make CXX_SOURCES := main.cpp Modified: lldb/trunk/test/functionalities/abbreviation_tests/TestAbbreviations.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/abbreviation_tests/TestAbbreviations.py?rev=133892&r1=133889&r2=133892&view=diff ============================================================================== --- lldb/trunk/test/functionalities/abbreviation_tests/TestAbbreviations.py (original) +++ lldb/trunk/test/functionalities/abbreviation_tests/TestAbbreviations.py Sun Jun 26 16:24:46 2011 @@ -9,7 +9,7 @@ class AbbreviationsTestCase(TestBase): - mydir = "abbreviation_tests" + mydir = os.path.join("functionalities", "abbreviation_tests") def test_nonrunning_command_abbreviations (self): self.expect("ap script", Modified: lldb/trunk/test/functionalities/alias_tests/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/alias_tests/Makefile?rev=133892&r1=133889&r2=133892&view=diff ============================================================================== --- lldb/trunk/test/functionalities/alias_tests/Makefile (original) +++ lldb/trunk/test/functionalities/alias_tests/Makefile Sun Jun 26 16:24:46 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../make CXX_SOURCES := main.cpp Modified: lldb/trunk/test/functionalities/alias_tests/TestAliases.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/alias_tests/TestAliases.py?rev=133892&r1=133889&r2=133892&view=diff ============================================================================== --- lldb/trunk/test/functionalities/alias_tests/TestAliases.py (original) +++ lldb/trunk/test/functionalities/alias_tests/TestAliases.py Sun Jun 26 16:24:46 2011 @@ -9,7 +9,7 @@ class AliasTestCase(TestBase): - mydir = "alias_tests" + mydir = os.path.join("functionalities", "alias_tests") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym (self): Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_command/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_command/Makefile?rev=133892&r1=133889&r2=133892&view=diff ============================================================================== --- lldb/trunk/test/functionalities/breakpoint/breakpoint_command/Makefile (original) +++ lldb/trunk/test/functionalities/breakpoint/breakpoint_command/Makefile Sun Jun 26 16:24:46 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make C_SOURCES := main.c Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py?rev=133892&r1=133889&r2=133892&view=diff ============================================================================== --- lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py (original) +++ lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py Sun Jun 26 16:24:46 2011 @@ -9,7 +9,7 @@ class BreakpointCommandTestCase(TestBase): - mydir = "breakpoint_command" + mydir = os.path.join("functionalities", "breakpoint", "breakpoint_command") @classmethod def classCleanup(cls): Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/Makefile?rev=133892&r1=133889&r2=133892&view=diff ============================================================================== --- lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/Makefile (original) +++ lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/Makefile Sun Jun 26 16:24:46 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make C_SOURCES := main.c Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py?rev=133892&r1=133889&r2=133892&view=diff ============================================================================== --- lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py (original) +++ lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py Sun Jun 26 16:24:46 2011 @@ -10,7 +10,7 @@ class BreakpointConditionsTestCase(TestBase): - mydir = "breakpoint_conditions" + mydir = os.path.join("functionalities", "breakpoint", "breakpoint_conditions") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym_and_run_command(self): Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_ids/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_ids/Makefile?rev=133892&r1=133889&r2=133892&view=diff ============================================================================== --- lldb/trunk/test/functionalities/breakpoint/breakpoint_ids/Makefile (original) +++ lldb/trunk/test/functionalities/breakpoint/breakpoint_ids/Makefile Sun Jun 26 16:24:46 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make CXX_SOURCES := main.cpp Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py?rev=133892&r1=133889&r2=133892&view=diff ============================================================================== --- lldb/trunk/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py (original) +++ lldb/trunk/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py Sun Jun 26 16:24:46 2011 @@ -9,7 +9,7 @@ class BreakpointIDTestCase(TestBase): - mydir = "breakpoint_ids" + mydir = os.path.join("functionalities", "breakpoint", "breakpoint_ids") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym (self): Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/Makefile?rev=133892&r1=133889&r2=133892&view=diff ============================================================================== --- lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/Makefile (original) +++ lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/Makefile Sun Jun 26 16:24:46 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make C_SOURCES := main.c Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py?rev=133892&r1=133889&r2=133892&view=diff ============================================================================== --- lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py (original) +++ lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py Sun Jun 26 16:24:46 2011 @@ -10,7 +10,7 @@ class BreakpointIgnoreCountTestCase(TestBase): - mydir = "breakpoint_ignore_count" + mydir = os.path.join("functionalities", "breakpoint", "breakpoint_ignore_count") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym_and_run_command(self): Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/Makefile?rev=133892&r1=133889&r2=133892&view=diff ============================================================================== --- lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/Makefile (original) +++ lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/Makefile Sun Jun 26 16:24:46 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../../make C_SOURCES := main.c Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py?rev=133892&r1=133889&r2=133892&view=diff ============================================================================== --- lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py (original) +++ lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py Sun Jun 26 16:24:46 2011 @@ -9,7 +9,7 @@ class BreakpointLocationsTestCase(TestBase): - mydir = "breakpoint_locations" + mydir = os.path.join("functionalities", "breakpoint", "breakpoint_locations") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym(self): From johnny.chen at apple.com Sun Jun 26 16:27:27 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Sun, 26 Jun 2011 21:27:27 -0000 Subject: [Lldb-commits] [lldb] r133893 - in /lldb/trunk/test/functionalities: abbreviation/ abbreviation/TestAbbreviations.py abbreviation_tests/ alias/ alias/TestAliases.py alias_tests/ Message-ID: <20110626212727.51DB92A6C12C@llvm.org> Author: johnny Date: Sun Jun 26 16:27:27 2011 New Revision: 133893 URL: http://llvm.org/viewvc/llvm-project?rev=133893&view=rev Log: A couple of directory renamings; get rid of 'tests' from the directory names. Added: lldb/trunk/test/functionalities/abbreviation/ - copied from r133892, lldb/trunk/test/functionalities/abbreviation_tests/ lldb/trunk/test/functionalities/alias/ - copied from r133892, lldb/trunk/test/functionalities/alias_tests/ Removed: lldb/trunk/test/functionalities/abbreviation_tests/ lldb/trunk/test/functionalities/alias_tests/ Modified: lldb/trunk/test/functionalities/abbreviation/TestAbbreviations.py lldb/trunk/test/functionalities/alias/TestAliases.py Modified: lldb/trunk/test/functionalities/abbreviation/TestAbbreviations.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/abbreviation/TestAbbreviations.py?rev=133893&r1=133892&r2=133893&view=diff ============================================================================== --- lldb/trunk/test/functionalities/abbreviation/TestAbbreviations.py (original) +++ lldb/trunk/test/functionalities/abbreviation/TestAbbreviations.py Sun Jun 26 16:27:27 2011 @@ -9,7 +9,7 @@ class AbbreviationsTestCase(TestBase): - mydir = os.path.join("functionalities", "abbreviation_tests") + mydir = os.path.join("functionalities", "abbreviation") def test_nonrunning_command_abbreviations (self): self.expect("ap script", Modified: lldb/trunk/test/functionalities/alias/TestAliases.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/alias/TestAliases.py?rev=133893&r1=133892&r2=133893&view=diff ============================================================================== --- lldb/trunk/test/functionalities/alias/TestAliases.py (original) +++ lldb/trunk/test/functionalities/alias/TestAliases.py Sun Jun 26 16:27:27 2011 @@ -9,7 +9,7 @@ class AliasTestCase(TestBase): - mydir = os.path.join("functionalities", "alias_tests") + mydir = os.path.join("functionalities", "alias") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym (self): From johnny.chen at apple.com Sun Jun 26 16:36:28 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Sun, 26 Jun 2011 21:36:28 -0000 Subject: [Lldb-commits] [lldb] r133894 - in /lldb/trunk/test: command_regex/ command_source/ conditional_break/ connect_remote/ data-formatter/ dead-strip/ functionalities/command_regex/ functionalities/command_source/ functionalities/conditional_break/ functionalities/connect_remote/ functionalities/data-formatter/ functionalities/dead-strip/ Message-ID: <20110626213628.87A002A6C12C@llvm.org> Author: johnny Date: Sun Jun 26 16:36:28 2011 New Revision: 133894 URL: http://llvm.org/viewvc/llvm-project?rev=133894&view=rev Log: Move more top level test dirs to reside under functionalities dir. Added: lldb/trunk/test/functionalities/command_regex/ - copied from r133889, lldb/trunk/test/command_regex/ lldb/trunk/test/functionalities/command_source/ - copied from r133889, lldb/trunk/test/command_source/ lldb/trunk/test/functionalities/conditional_break/ - copied from r133889, lldb/trunk/test/conditional_break/ lldb/trunk/test/functionalities/connect_remote/ - copied from r133889, lldb/trunk/test/connect_remote/ lldb/trunk/test/functionalities/data-formatter/ - copied from r133889, lldb/trunk/test/data-formatter/ lldb/trunk/test/functionalities/dead-strip/ - copied from r133889, lldb/trunk/test/dead-strip/ Removed: lldb/trunk/test/command_regex/ lldb/trunk/test/command_source/ lldb/trunk/test/conditional_break/ lldb/trunk/test/connect_remote/ lldb/trunk/test/data-formatter/ lldb/trunk/test/dead-strip/ Modified: lldb/trunk/test/functionalities/command_regex/TestCommandRegex.py lldb/trunk/test/functionalities/command_source/TestCommandSource.py lldb/trunk/test/functionalities/conditional_break/Makefile lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py lldb/trunk/test/functionalities/connect_remote/TestConnectRemote.py lldb/trunk/test/functionalities/data-formatter/Makefile lldb/trunk/test/functionalities/data-formatter/TestDataFormatter.py lldb/trunk/test/functionalities/dead-strip/Makefile lldb/trunk/test/functionalities/dead-strip/TestDeadStrip.py 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=133894&r1=133889&r2=133894&view=diff ============================================================================== --- lldb/trunk/test/functionalities/command_regex/TestCommandRegex.py (original) +++ lldb/trunk/test/functionalities/command_regex/TestCommandRegex.py Sun Jun 26 16:36:28 2011 @@ -10,7 +10,7 @@ class CommandRegexTestCase(TestBase): - mydir = "command_regex" + mydir = os.path.join("functionalities", "command_regex") def test_command_regex(self): """Test a simple scenario of 'command regexp' invocation and subsequent use.""" Modified: lldb/trunk/test/functionalities/command_source/TestCommandSource.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/command_source/TestCommandSource.py?rev=133894&r1=133889&r2=133894&view=diff ============================================================================== --- lldb/trunk/test/functionalities/command_source/TestCommandSource.py (original) +++ lldb/trunk/test/functionalities/command_source/TestCommandSource.py Sun Jun 26 16:36:28 2011 @@ -11,7 +11,7 @@ class CommandSourceTestCase(TestBase): - mydir = "command_source" + mydir = os.path.join("functionalities", "command_source") def test_command_source(self): """Test that lldb command "command source" works correctly.""" Modified: lldb/trunk/test/functionalities/conditional_break/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/conditional_break/Makefile?rev=133894&r1=133889&r2=133894&view=diff ============================================================================== --- lldb/trunk/test/functionalities/conditional_break/Makefile (original) +++ lldb/trunk/test/functionalities/conditional_break/Makefile Sun Jun 26 16:36:28 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../make C_SOURCES := main.c Modified: lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py?rev=133894&r1=133889&r2=133894&view=diff ============================================================================== --- lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py (original) +++ lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py Sun Jun 26 16:36:28 2011 @@ -15,7 +15,7 @@ class ConditionalBreakTestCase(TestBase): - mydir = "conditional_break" + mydir = os.path.join("functionalities", "conditional_break") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") @python_api_test Modified: lldb/trunk/test/functionalities/connect_remote/TestConnectRemote.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/connect_remote/TestConnectRemote.py?rev=133894&r1=133889&r2=133894&view=diff ============================================================================== --- lldb/trunk/test/functionalities/connect_remote/TestConnectRemote.py (original) +++ lldb/trunk/test/functionalities/connect_remote/TestConnectRemote.py Sun Jun 26 16:36:28 2011 @@ -10,7 +10,7 @@ class ConnectRemoteTestCase(TestBase): - mydir = "connect_remote" + mydir = os.path.join("functionalities", "connect_remote") def test_connect_remote(self): """Test "process connect connect:://localhost:12345".""" Modified: lldb/trunk/test/functionalities/data-formatter/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/Makefile?rev=133894&r1=133889&r2=133894&view=diff ============================================================================== --- lldb/trunk/test/functionalities/data-formatter/Makefile (original) +++ lldb/trunk/test/functionalities/data-formatter/Makefile Sun Jun 26 16:36:28 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../make CXX_SOURCES := main.cpp Modified: lldb/trunk/test/functionalities/data-formatter/TestDataFormatter.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/TestDataFormatter.py?rev=133894&r1=133889&r2=133894&view=diff ============================================================================== --- lldb/trunk/test/functionalities/data-formatter/TestDataFormatter.py (original) +++ lldb/trunk/test/functionalities/data-formatter/TestDataFormatter.py Sun Jun 26 16:36:28 2011 @@ -9,7 +9,7 @@ class DataFormatterTestCase(TestBase): - mydir = "data-formatter" + mydir = os.path.join("functionalities", "data-formatter") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym_and_run_command(self): Modified: lldb/trunk/test/functionalities/dead-strip/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/dead-strip/Makefile?rev=133894&r1=133889&r2=133894&view=diff ============================================================================== --- lldb/trunk/test/functionalities/dead-strip/Makefile (original) +++ lldb/trunk/test/functionalities/dead-strip/Makefile Sun Jun 26 16:36:28 2011 @@ -1,4 +1,4 @@ -LEVEL = ../make +LEVEL = ../../make C_SOURCES := main.c LDFLAGS = $(CFLAGS) -Xlinker -dead_strip Modified: lldb/trunk/test/functionalities/dead-strip/TestDeadStrip.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/dead-strip/TestDeadStrip.py?rev=133894&r1=133889&r2=133894&view=diff ============================================================================== --- lldb/trunk/test/functionalities/dead-strip/TestDeadStrip.py (original) +++ lldb/trunk/test/functionalities/dead-strip/TestDeadStrip.py Sun Jun 26 16:36:28 2011 @@ -9,7 +9,7 @@ class DeadStripTestCase(TestBase): - mydir = "dead-strip" + mydir = os.path.join("functionalities", "dead-strip") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym(self):