[Lldb-commits] [PATCH] Remove dead code
Hi clayborg, zturner, This code is dead right now. If nobody else is planning to use it, I'd like to remove it. It can be reintroduced if people needs it again. REPOSITORY rL LLVM http://reviews.llvm.org/D8761 Files: ProcessPOSIX.cpp Index: ProcessPOSIX.cpp === --- ProcessPOSIX.cpp +++ ProcessPOSIX.cpp @@ -36,39 +36,6 @@ using namespace lldb_private; //-- -// Static functions. -#if 0 -Process* -ProcessPOSIX::CreateInstance(Target& target, Listener &listener) -{ -return new ProcessPOSIX(target, listener); -} - - -void -ProcessPOSIX::Initialize() -{ -static bool g_initialized = false; - -if (!g_initialized) -{ -g_initialized = true; -PluginManager::RegisterPlugin(GetPluginNameStatic(), - GetPluginDescriptionStatic(), - CreateInstance); - -Log::Callbacks log_callbacks = { -ProcessPOSIXLog::DisableLog, -ProcessPOSIXLog::EnableLog, -ProcessPOSIXLog::ListLogCategories -}; - -Log::RegisterLogChannel (ProcessPOSIX::GetPluginNameStatic(), log_callbacks); -} -} -#endif - -//-- // Constructors and destructors. ProcessPOSIX::ProcessPOSIX(Target& target, Listener &listener, UnixSignalsSP &unix_signals_sp) EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ Index: ProcessPOSIX.cpp === --- ProcessPOSIX.cpp +++ ProcessPOSIX.cpp @@ -36,39 +36,6 @@ using namespace lldb_private; //-- -// Static functions. -#if 0 -Process* -ProcessPOSIX::CreateInstance(Target& target, Listener &listener) -{ -return new ProcessPOSIX(target, listener); -} - - -void -ProcessPOSIX::Initialize() -{ -static bool g_initialized = false; - -if (!g_initialized) -{ -g_initialized = true; -PluginManager::RegisterPlugin(GetPluginNameStatic(), - GetPluginDescriptionStatic(), - CreateInstance); - -Log::Callbacks log_callbacks = { -ProcessPOSIXLog::DisableLog, -ProcessPOSIXLog::EnableLog, -ProcessPOSIXLog::ListLogCategories -}; - -Log::RegisterLogChannel (ProcessPOSIX::GetPluginNameStatic(), log_callbacks); -} -} -#endif - -//-- // Constructors and destructors. ProcessPOSIX::ProcessPOSIX(Target& target, Listener &listener, UnixSignalsSP &unix_signals_sp) ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] Use std::call_once for initialization
Hi zturner, clayborg, Previously discussed with zturner on IRC. REPOSITORY rL LLVM http://reviews.llvm.org/D8760 Files: source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp source/Plugins/Process/Linux/ProcessLinux.cpp source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp source/Plugins/Process/Windows/ProcessWindows.cpp source/Plugins/Process/elf-core/ProcessElfCore.cpp source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp source/Plugins/Process/mach-core/ProcessMachCore.cpp EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ Index: source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp === --- source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp +++ source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp @@ -56,16 +56,14 @@ void ProcessFreeBSD::Initialize() { -static bool g_initialized = false; +static std::once_flag g_once_flag; -if (!g_initialized) -{ +std::call_once(g_once_flag, []() { PluginManager::RegisterPlugin(GetPluginNameStatic(), GetPluginDescriptionStatic(), CreateInstance); ProcessPOSIXLog::Initialize(GetPluginNameStatic()); -g_initialized = true; -} +}); } lldb_private::ConstString Index: source/Plugins/Process/Linux/ProcessLinux.cpp === --- source/Plugins/Process/Linux/ProcessLinux.cpp +++ source/Plugins/Process/Linux/ProcessLinux.cpp @@ -53,16 +53,14 @@ void ProcessLinux::Initialize() { -static bool g_initialized = false; +static std::once_flag g_once_flag; -if (!g_initialized) -{ -g_initialized = true; +std::call_once(g_once_flag, []() { PluginManager::RegisterPlugin(GetPluginNameStatic(), GetPluginDescriptionStatic(), CreateInstance); ProcessPOSIXLog::Initialize(GetPluginNameStatic()); -} +}); } //-- Index: source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp === --- source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp +++ source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp @@ -835,24 +835,23 @@ void ProcessKDP::Initialize() { -static bool g_initialized = false; - -if (g_initialized == false) +static std::once_flag g_once_flag; + +std::call_once(g_once_flag, []() { -g_initialized = true; PluginManager::RegisterPlugin (GetPluginNameStatic(), GetPluginDescriptionStatic(), CreateInstance, - DebuggerInitialize); - + DebuggerInitialize);a + Log::Callbacks log_callbacks = { ProcessKDPLog::DisableLog, ProcessKDPLog::EnableLog, ProcessKDPLog::ListLogCategories }; - + Log::RegisterLogChannel (ProcessKDP::GetPluginNameStatic(), log_callbacks); -} +}); } void Index: source/Plugins/Process/Windows/ProcessWindows.cpp === --- source/Plugins/Process/Windows/ProcessWindows.cpp +++ source/Plugins/Process/Windows/ProcessWindows.cpp @@ -87,11 +87,10 @@ void ProcessWindows::Initialize() { -static bool g_initialized = false; +static std::once_flag g_once_flag; -if (!g_initialized) +std::call_once(g_once_flag, []() { -g_initialized = true; PluginManager::RegisterPlugin(GetPluginNameStatic(), GetPluginDescriptionStatic(), CreateInstance); Index: source/Plugins/Process/elf-core/ProcessElfCore.cpp === --- source/Plugins/Process/elf-core/ProcessElfCore.cpp +++ source/Plugins/Process/elf-core/ProcessElfCore.cpp @@ -374,13 +374,13 @@ void ProcessElfCore::Initialize() { -static bool g_initialized = false; +static std::once_flag g_once_flag; -if (g_initialized == false) +std::call_once(g_once_flag, []() { -g_initialized = true; -PluginManager::RegisterPlugin (GetPluginNameStatic(), GetPluginDescriptionStatic(), CreateInstance); -} +PluginManager::RegisterPlugin (GetPluginNameStatic(), + GetPluginDescriptionStatic(), CreateInstance); +}); } lldb::addr_t Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp === --- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -2958,16 +2958,15 @@ void ProcessGDBRemote::Init
[Lldb-commits] [lldb] r233780 - Fix ForwardPortWithAdb - update device_id variable if Android device has been found.
Author: ovyalov Date: Tue Mar 31 21:30:17 2015 New Revision: 233780 URL: http://llvm.org/viewvc/llvm-project?rev=233780&view=rev Log: Fix ForwardPortWithAdb - update device_id variable if Android device has been found. Modified: lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp Modified: lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp?rev=233780&r1=233779&r2=233780&view=diff == --- lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp (original) +++ lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp Tue Mar 31 21:30:17 2015 @@ -34,8 +34,9 @@ ForwardPortWithAdb (uint16_t port, std:: if (error.Fail ()) return error; +device_id = adb.GetDeviceID (); if (log) -log->Printf("Connected to Android device \"%s\"", adb.GetDeviceID ().c_str ()); +log->Printf("Connected to Android device \"%s\"", device_id.c_str ()); return adb.SetPortForwarding (port); } ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] Introduce a TypeSystem interface to support adding non-clang languages.
On Mon, Mar 30, 2015 at 4:05 PM, Greg Clayton wrote: > Overall a good start. I am confused as to why there were a lot of: > > clang_type.method(...) > > changed to > > type_system->method(clang_type, ...) > Well these are the methods which seemed too clang specific and I didn't want to add them to the TypeSystem interface. Do you think these methods are general to all type systems? Or do you think there's a better way to handle these language specific methods? I definitely agree it would be good to take the clang specific stuff out of TypeSystem so other languages don't have to implement them. I looked through all the TypeSystem methods: ~50 seem like they need to stay. ~20 are clang specific and probably would be better off in ClangASTContext. ~20 I'm not sure about You can see the list in this spreadsheet: https://docs.google.com/spreadsheets/d/1MAe6q5ZnHJ5kDTseq5GsG2dujigixaHiTTwReVOH0hs/edit?usp=sharing What do you think is the best way to implement the casting? I would probably just add a virtual AsXXX method to TypeSystem for each new implementation. That seems more straight forward than trying to support llvm::dyn_cast > Seems like we should keep the old API as the ClangASTType contains a > "TypeSystem*" and it would make the diffs a lot less noisy in > SymbolFileDWARF. These are all of the "Why is this no longer a method on > ..." inline code notations. > > It also seems like anything that is actually creating a ClangASTTypeSystem > specific type should have the creation functions only in ClangASTTypeSystem > and not make all of them pure virtual in the TypeSystem definition. Then > each language will have its own TypeSystem subclass. See inlined notes that > say "move to ClangASTTypeSystem.h?". If we do this, then each module needs > to be able to get one of the TypeSystem specific subclasses from the module: > > ClangASTTypeSystem * > Module::GetTypeSystemClang (); > > ClangASTTypeGo * > Module::GetTypeSystemGo (); > > ClangASTTypeSwift * > Module::GetTypeSystemSwift (); > > Then the DWARF parser would grab the right TypeSystem subclass from the > module in SymbolFileDWARF and use that to create types. Each TypeSystem > subclass can have its own way to create native types. All of which must > return ClangASTType (this really should be renamed CompilerType) types. > > So the changes I would like to see is: > 1 - Make ClangASTContext inherit from TypeSystem > 2 - Try and isolate all of the language specific type creation routines > into ClangASTContext (since it now inherits from TypeSystem) and let it > create native clang types. This way not all languages have to make hundreds > of pure virtual functions that they will never support. If any are generic > enough, we can include them, but it would be cleaner to allow each langue > to have its own language specific create/addField/addIVar, etc routines > 3 - Add get_as() to the TypeSystem and allow people to dyn_cast their > TypeSystem into more specific subclasses where needed and where the pure > virtual stuff falls down. > > > REPOSITORY > rL LLVM > > > Comment at: include/lldb/Symbol/ClangASTContext.h:39 > @@ -37,3 +38,3 @@ > > class ClangASTContext > { > > Shouldn't this inherit from TypeSystem? > > > Comment at: include/lldb/Symbol/ClangASTContext.h:58-59 > @@ -56,1 +57,4 @@ > + > +ClangASTTypeSystem* > +getTypeSystem(); > > > If ClangASTContext inherits from TypeSystem, this isn't needed. > > > Comment at: include/lldb/Symbol/ClangASTContext.h:509 > @@ -490,2 +508,3 @@ > std::unique_ptrm_builtins_ap; > +std::unique_ptr m_type_system_ap; > CompleteTagDeclCallback m_callback_tag_decl; > > Shouldn't ClangASTContext inherit from TypeSystem? If so, this isn't > needed. > > > Comment at: include/lldb/Symbol/ClangASTType.h:20 > @@ -19,1 +19,3 @@ > > +class TypeSystem; > + > > Put this in lldb-forward.h and remove any other forward references to > TypeSystem. > > > Comment at: include/lldb/Symbol/ClangASTType.h:38 > @@ -35,8 +37,3 @@ > > //-- > -ClangASTType (clang::ASTContext *ast_context, lldb::clang_type_t > type) : > -m_type (type), > -m_ast (ast_context) > -{ > -} > - > +ClangASTType (clang::ASTContext *ast_context, lldb::clang_type_t > type); > ClangASTType (clang::ASTContext *ast_context, clang::QualType > qual_type); > > This should be "TypeSystem* type_system, void *type". > > > Comment at: include/lldb/Symbol/ClangASTType.h:233-235 > @@ -235,2 +232,5 @@ > > +clang::ASTContext * > +GetASTContext() const; > + > ConstString > > We shouldn't need this we should just be able to use the GetTypeSystem() > above. We might need to implement llvm sty
Re: [Lldb-commits] [PATCH] Fix selecting the Platform in TargetList::CreateTargetInternal()
IIRC, the point of the previous patch was to make new targets use the currently selected platform, so that you can do: (lldb) platform select whatever (lldb) file some_file and some_file would use the platform you had specified. That seems a useful behavior. Can you fix this in a way that preserves that behavior? http://reviews.llvm.org/D8749 EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] Fix selecting the Platform in TargetList::CreateTargetInternal()
Hi clayborg, vharron, TargetList::CreateTargetInternal() will only select the current Platform. A previous patch always sets platform_sp to the current Platform, so a check later to see if platform_sp was not defined always failed, and the current Platform was used. This patch removes that check, so if the current Platform is not compatible with the target architecture, CreateTargetInternal() will call Platform::GetPlatformForArchitecture() to select a compatible Platform. Vince, remote linux tests (Ubuntu -> remote Ubuntu) pass the same with and without this patch. http://reviews.llvm.org/D8749 Files: source/Target/TargetList.cpp Index: source/Target/TargetList.cpp === --- source/Target/TargetList.cpp +++ source/Target/TargetList.cpp @@ -293,32 +293,27 @@ } } -if (!platform_sp) +// If we have a valid architecture, make sure the current platform is +// compatible with that architecture +if (!prefer_platform_arch && arch.IsValid()) { -// Get the current platform and make sure it is compatible with the -// current architecture if we have a valid architecture. -platform_sp = debugger.GetPlatformList().GetSelectedPlatform (); - -if (!prefer_platform_arch && arch.IsValid()) +if (!platform_sp->IsCompatibleArchitecture(arch, false, &platform_arch)) { -if (!platform_sp->IsCompatibleArchitecture(arch, false, &platform_arch)) -{ -platform_sp = Platform::GetPlatformForArchitecture(arch, &platform_arch); -if (platform_sp) - debugger.GetPlatformList().SetSelectedPlatform(platform_sp); -} +platform_sp = Platform::GetPlatformForArchitecture(arch, &platform_arch); +if (platform_sp) +debugger.GetPlatformList().SetSelectedPlatform(platform_sp); } -else if (platform_arch.IsValid()) +} +else if (platform_arch.IsValid()) +{ +// if "arch" isn't valid, yet "platform_arch" is, it means we have an executable file with +// a single architecture which should be used +ArchSpec fixed_platform_arch; +if (!platform_sp->IsCompatibleArchitecture(platform_arch, false, &fixed_platform_arch)) { -// if "arch" isn't valid, yet "platform_arch" is, it means we have an executable file with -// a single architecture which should be used -ArchSpec fixed_platform_arch; -if (!platform_sp->IsCompatibleArchitecture(platform_arch, false, &fixed_platform_arch)) -{ -platform_sp = Platform::GetPlatformForArchitecture(platform_arch, &fixed_platform_arch); -if (platform_sp) - debugger.GetPlatformList().SetSelectedPlatform(platform_sp); -} +platform_sp = Platform::GetPlatformForArchitecture(platform_arch, &fixed_platform_arch); +if (platform_sp) +debugger.GetPlatformList().SetSelectedPlatform(platform_sp); } } EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ Index: source/Target/TargetList.cpp === --- source/Target/TargetList.cpp +++ source/Target/TargetList.cpp @@ -293,32 +293,27 @@ } } -if (!platform_sp) +// If we have a valid architecture, make sure the current platform is +// compatible with that architecture +if (!prefer_platform_arch && arch.IsValid()) { -// Get the current platform and make sure it is compatible with the -// current architecture if we have a valid architecture. -platform_sp = debugger.GetPlatformList().GetSelectedPlatform (); - -if (!prefer_platform_arch && arch.IsValid()) +if (!platform_sp->IsCompatibleArchitecture(arch, false, &platform_arch)) { -if (!platform_sp->IsCompatibleArchitecture(arch, false, &platform_arch)) -{ -platform_sp = Platform::GetPlatformForArchitecture(arch, &platform_arch); -if (platform_sp) -debugger.GetPlatformList().SetSelectedPlatform(platform_sp); -} +platform_sp = Platform::GetPlatformForArchitecture(arch, &platform_arch); +if (platform_sp) +debugger.GetPlatformList().SetSelectedPlatform(platform_sp); } -else if (platform_arch.IsValid()) +} +else if (platform_arch.IsValid()) +{ +// if "arch" isn't valid, yet "platform_arch" is, it means we have an executable file with +// a single architecture which should be used +ArchSpec fixed_platform_arch; +if (!platform_sp->IsCompatibleArchitecture(platform_arch, false, &fixed_platform_arch)) { -// if "arch" isn't valid, yet "platfo
Re: [Lldb-commits] [PATCH] Update sys.platform switched behavior in tests to use self.getPlatform (remote target platform)
REPOSITORY rL LLVM http://reviews.llvm.org/D8747 EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r233757 - Make sure that "add-dsym" can't crash us when using it.
Author: gclayton Date: Tue Mar 31 16:01:48 2015 New Revision: 233757 URL: http://llvm.org/viewvc/llvm-project?rev=233757&view=rev Log: Make sure that "add-dsym" can't crash us when using it. I am fixing this by: 1 - make sure we aren't trying to set the symbol file for a module to the same thing it already has and leaving it alone if it is the same 2 - keep all old symbol files around in the module in case there are any outstanding type references Modified: lldb/trunk/include/lldb/Core/Module.h lldb/trunk/source/Core/Module.cpp Modified: lldb/trunk/include/lldb/Core/Module.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Module.h?rev=233757&r1=233756&r2=233757&view=diff == --- lldb/trunk/include/lldb/Core/Module.h (original) +++ lldb/trunk/include/lldb/Core/Module.h Tue Mar 31 16:01:48 2015 @@ -1108,6 +1108,8 @@ protected: TimeValue m_object_mod_time; lldb::ObjectFileSP m_objfile_sp; ///< A shared pointer to the object file parser for this module as it may or may not be shared with the SymbolFile lldb::SymbolVendorUPm_symfile_ap; ///< A pointer to the symbol vendor for this module. +std::vector m_old_symfiles; ///< If anyone calls Module::SetSymbolFileFileSpec() and changes the symbol file, + ///< we need to keep all old symbol files around in case anyone has type references to them lldb::ClangASTContextUP m_ast; ///< The AST context for this module. PathMappingList m_source_mappings; ///< Module specific source remappings for when you have debug info for a module that doesn't match where the sources currently are lldb::SectionListUP m_sections_ap; ///< Unified section list for module that is used by the ObjectFile and and ObjectFile instances for the debug info Modified: lldb/trunk/source/Core/Module.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=233757&r1=233756&r2=233757&view=diff == --- lldb/trunk/source/Core/Module.cpp (original) +++ lldb/trunk/source/Core/Module.cpp Tue Mar 31 16:01:48 2015 @@ -1469,9 +1469,11 @@ Module::FindSymbolsMatchingRegExAndType void Module::SetSymbolFileFileSpec (const FileSpec &file) { -// Remove any sections in the unified section list that come from the current symbol vendor. +if (!file.Exists()) +return; if (m_symfile_ap) { +// Remove any sections in the unified section list that come from the current symbol vendor. SectionList *section_list = GetSectionList(); SymbolFile *symbol_file = m_symfile_ap->GetSymbolFile(); if (section_list && symbol_file) @@ -1479,21 +1481,49 @@ Module::SetSymbolFileFileSpec (const Fil ObjectFile *obj_file = symbol_file->GetObjectFile(); // Make sure we have an object file and that the symbol vendor's objfile isn't // the same as the module's objfile before we remove any sections for it... -if (obj_file && obj_file != m_objfile_sp.get()) +if (obj_file) { -size_t num_sections = section_list->GetNumSections (0); -for (size_t idx = num_sections; idx > 0; --idx) +// Check to make sure we aren't trying to specify the file we already have +if (obj_file->GetFileSpec() == file) { -lldb::SectionSP section_sp (section_list->GetSectionAtIndex (idx - 1)); -if (section_sp->GetObjectFile() == obj_file) +// We are being told to add the exact same file that we already have +// we don't have to do anything. +return; +} + +// The symbol file might be a directory bundle ("/tmp/a.out.dSYM") instead +// of a full path to the symbol file within the bundle +// ("/tmp/a.out.dSYM/Contents/Resources/DWARF/a.out"). So we need to check this + +if (file.IsDirectory()) +{ +std::string new_path(file.GetPath()); +std::string old_path(obj_file->GetFileSpec().GetPath()); +if (old_path.find(new_path) == 0) +{ +// We specified the same bundle as the symbol file that we already have +return; +} +} + +if (obj_file != m_objfile_sp.get()) +{ +size_t num_sections = section_list->GetNumSections (0); +for (size_t idx = num_sections; idx > 0; --idx) { -section_list->DeleteSection (idx - 1); +
Re: [Lldb-commits] [PATCH] Remove Triple Vendor check when creating Linux Platform
This is good. Had some issues with this in the past. http://reviews.llvm.org/D8742 EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] Remove Triple Vendor check when creating Linux Platform
Looks good. http://reviews.llvm.org/D8742 EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r233717 - TestPrintStackTraces - made XFAIL more precise
Author: vharron Date: Tue Mar 31 12:45:54 2015 New Revision: 233717 URL: http://llvm.org/viewvc/llvm-project?rev=233717&view=rev Log: TestPrintStackTraces - made XFAIL more precise Works with x86_64 inferior, fails w/i386 inferior - updated test to reflect Modified: lldb/trunk/test/python_api/lldbutil/process/TestPrintStackTraces.py Modified: lldb/trunk/test/python_api/lldbutil/process/TestPrintStackTraces.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/lldbutil/process/TestPrintStackTraces.py?rev=233717&r1=233716&r2=233717&view=diff == --- lldb/trunk/test/python_api/lldbutil/process/TestPrintStackTraces.py (original) +++ lldb/trunk/test/python_api/lldbutil/process/TestPrintStackTraces.py Tue Mar 31 12:45:54 2015 @@ -18,7 +18,10 @@ class ThreadsStackTracesTestCase(TestBas # Find the line number to break inside main(). self.line = line_number('main.cpp', '// Set break point at this line.') -@expectedFailureLinux # llvm.org/pr15415 -- partial stack trace in thread 1 (while stopped inside a read() call) +# llvm.org/pr23043 - leaving the next two lines in so it's easy to find this +# test will appear when searching for expectedFailure(Linux|i386) +#@expectedFailureLinux +#@expectedFailurei386 @python_api_test def test_stack_traces(self): """Test SBprocess and SBThread APIs with printing of the stack traces.""" @@ -27,6 +30,9 @@ class ThreadsStackTracesTestCase(TestBas def break_and_print_stacktraces(self): """Break at main.cpp:68 and do a threads dump""" +if self.getArchitecture() in ['i386'] and "linux" in sys.platform: +self.skipTest("Skipping because this test is known to fail on i386 Linux") + exe = os.path.join(os.getcwd(), "a.out") target = self.dbg.CreateTarget(exe) ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] Enabled a bunch of tests on Linux
REPOSITORY rL LLVM http://reviews.llvm.org/D8676 Files: lldb/trunk/test/expression_command/formatters/TestFormatters.py lldb/trunk/test/functionalities/attach_resume/TestAttachResume.py lldb/trunk/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py lldb/trunk/test/functionalities/data-formatter/rdar-9974002/Test-rdar-9974002.py lldb/trunk/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py lldb/trunk/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py lldb/trunk/test/functionalities/inferior-assert/TestInferiorAssert.py lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py lldb/trunk/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py lldb/trunk/test/lang/cpp/dynamic-value/TestDynamicValue.py lldb/trunk/test/python_api/thread/TestThreadAPI.py lldb/trunk/test/python_api/value_var_update/TestValueVarUpdate.py EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ Index: lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py === --- lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py +++ lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py @@ -10,7 +10,6 @@ class ClassTypesTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) -failing_compilers = ['clang', 'gcc'] @skipUnlessDarwin @dsym_test @@ -74,7 +73,6 @@ # test/class_types test failures: runCmd: expr this->m_c_int @dwarf_test @expectedFailureFreeBSD('llvm.org/pr14540') -@expectedFailureLinux('llvm.org/pr14540', failing_compilers) @expectedFailureDarwin(16362674) def test_with_dwarf_and_constructor_name (self): """Test 'frame variable this' and 'expr this' when stopped inside a constructor.""" Index: lldb/trunk/test/lang/cpp/dynamic-value/TestDynamicValue.py === --- lldb/trunk/test/lang/cpp/dynamic-value/TestDynamicValue.py +++ lldb/trunk/test/lang/cpp/dynamic-value/TestDynamicValue.py @@ -21,7 +21,6 @@ self.do_get_dynamic_vals() @expectedFailureFreeBSD # FIXME: This needs to be root-caused. -@expectedFailureLinux # FIXME: This needs to be root-caused. It looks like the DWARF info is anticipating the derived class assignment. @python_api_test @dwarf_test def test_get_dynamic_vals_with_dwarf(self): Index: lldb/trunk/test/expression_command/formatters/TestFormatters.py === --- lldb/trunk/test/expression_command/formatters/TestFormatters.py +++ lldb/trunk/test/expression_command/formatters/TestFormatters.py @@ -26,7 +26,6 @@ self.do_my_test() @expectedFailureFreeBSD('llvm.org/pr19011') # Newer Clang omits C1 complete object constructor -@expectedFailureLinux('llvm.org/pr20230') @dwarf_test def test_with_dwarf(self): """Test expr + formatters for good interoperability.""" Index: lldb/trunk/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py === --- lldb/trunk/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py +++ lldb/trunk/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py @@ -20,10 +20,6 @@ self.data_formatter_commands() @skipIfFreeBSD # llvm.org/pr20545 bogus output confuses buildbot parser -@expectedFailureLinux # non-core functionality, need to reenable and fix - # later (DES 2014.11.07). Most likely failing because - # of mis-match is version of libstdc++ supported by - # the data-formatters. @dwarf_test def test_with_dwarf_and_run_command(self): """Test using Python synthetic children provider to provide a value.""" Index: lldb/trunk/test/functionalities/data-formatter/rdar-9974002/Test-rdar-9974002.py === --- lldb/trunk/test/functionalities/data-formatter/rdar-9974002/Test-rdar-9974002.py +++ lldb/trunk/test/functionalities/data-formatter/rdar-9974002/Test-rdar-9974002.py @@ -21,7 +21,6 @@ self.data_formatter_commands() @dwarf_test -@expectedFailureLinux("llvm.org/pr20232") def test_with_dwarf_and_run_command(self): """Test data formatter commands.""" self.buildDwarf() Index: lldb/trunk/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py === --- lldb/trunk/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py +++ lldb/trunk/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py @@ -24,7 +24,6 @@
Re: [Lldb-commits] [PATCH] Replace sys.platform skips in tests with @skip decorators which check against remote platform.
In http://reviews.llvm.org/D8665#149727, @emaste wrote: > This causes massive test run failures on FreeBSD because the triple OS > component is 'freebsd10.1' Fixed in http://reviews.llvm.org/rL233705 REPOSITORY rL LLVM http://reviews.llvm.org/D8665 EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r233714 - Fix DynamicLoaderMacOSXDYLD to deal with new shared cache changes.
Author: gclayton Date: Tue Mar 31 12:02:36 2015 New Revision: 233714 URL: http://llvm.org/viewvc/llvm-project?rev=233714&view=rev Log: Fix DynamicLoaderMacOSXDYLD to deal with new shared cache changes. Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp 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=233714&r1=233713&r2=233714&view=diff == --- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original) +++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Tue Mar 31 12:02:36 2015 @@ -1266,7 +1266,7 @@ DynamicLoaderMacOSXDYLD::ParseLoadComman // Iterate through the object file sections to find the // first section that starts of file offset zero and that // has bytes in the file... -if (dylib_info.segments[i].fileoff == 0 && dylib_info.segments[i].filesize > 0) +if ((dylib_info.segments[i].fileoff == 0 && dylib_info.segments[i].filesize > 0) || (dylib_info.segments[i].name == ConstString("__TEXT"))) { dylib_info.slide = dylib_info.address - dylib_info.segments[i].vmaddr; // We have found the slide amount, so we can exit ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] Replace sys.platform skips in tests with @skip decorators which check against remote platform.
In http://reviews.llvm.org/D8665#149727, @emaste wrote: > This causes massive test run failures on FreeBSD because the triple OS > component is 'freebsd10.1' I can update this to continue to do a prefix string check to ignore version number. Why do we have a version number in the OS component on freebsd but not the other platforms as far as I can tell? REPOSITORY rL LLVM http://reviews.llvm.org/D8665 EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] TestPrintStackTraces - made XFAIL more precise
Hi Greg, Do you want us to wait for review from you on changes that are fairly Linux specific? Comment at: test/python_api/lldbutil/process/TestPrintStackTraces.py:34 @@ +33,3 @@ +if self.getArchitecture() in ['i386'] and "linux" in sys.platform: +self.skipTest("Skipping because this test is known to fail on i386 Linux") + sivachandra wrote: > The test is already marked xfail for i386 and linux. Why have this? It was marked as expectedFailureLinux but seems to be passing on x86_64. http://reviews.llvm.org/D8677 EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r233705 - Fix FreeBSD test runs after r233311
Author: emaste Date: Tue Mar 31 11:37:10 2015 New Revision: 233705 URL: http://llvm.org/viewvc/llvm-project?rev=233705&view=rev Log: Fix FreeBSD test runs after r233311 On FreeBSD LLDB's triple ends up as e.g. "x86_64-unknown-freebsd10.1" but getPlatform() consumers expect just the name with no version number. 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=233705&r1=233704&r2=233705&view=diff == --- lldb/trunk/test/lldbtest.py (original) +++ lldb/trunk/test/lldbtest.py Tue Mar 31 11:37:10 2015 @@ -1389,7 +1389,10 @@ class Base(unittest2.TestCase): def getPlatform(self): """Returns the platform the test suite is running on.""" -return lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2] +platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2] +if platform.startswith('freebsd'): +platform = 'freebsd' +return platform def isIntelCompiler(self): """ Returns true if using an Intel (ICC) compiler, false otherwise. """ ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] Correctly detect sign-ness of wchar_t
Hi clayborg, Correctly detect sign-ness of wchar_t The underlying type of wchar_t is not defined by the standard. This CL add logic to correctly use the type specified for the current target based on TargetInfo. http://reviews.llvm.org/D8722 Files: source/Symbol/ClangASTContext.cpp Index: source/Symbol/ClangASTContext.cpp === --- source/Symbol/ClangASTContext.cpp +++ source/Symbol/ClangASTContext.cpp @@ -904,7 +904,8 @@ if (type_name) { if (streq(type_name, "wchar_t") && -QualTypeMatchesBitSize (bit_size, ast, ast->WCharTy)) +QualTypeMatchesBitSize (bit_size, ast, ast->WCharTy) && +TargetInfo::isTypeSigned (getTargetInfo()->getWCharType())) return ClangASTType (ast, ast->WCharTy.getAsOpaquePtr()); if (streq(type_name, "void") && QualTypeMatchesBitSize (bit_size, ast, ast->VoidTy)) @@ -961,6 +962,14 @@ case DW_ATE_unsigned: if (type_name) { +if (streq(type_name, "wchar_t")) +{ +if (QualTypeMatchesBitSize (bit_size, ast, ast->WCharTy)) +{ +if (!TargetInfo::isTypeSigned (getTargetInfo()->getWCharType())) +return ClangASTType (ast, ast->WCharTy.getAsOpaquePtr()); +} +} if (strstr(type_name, "long long")) { if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedLongLongTy)) EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ Index: source/Symbol/ClangASTContext.cpp === --- source/Symbol/ClangASTContext.cpp +++ source/Symbol/ClangASTContext.cpp @@ -904,7 +904,8 @@ if (type_name) { if (streq(type_name, "wchar_t") && -QualTypeMatchesBitSize (bit_size, ast, ast->WCharTy)) +QualTypeMatchesBitSize (bit_size, ast, ast->WCharTy) && +TargetInfo::isTypeSigned (getTargetInfo()->getWCharType())) return ClangASTType (ast, ast->WCharTy.getAsOpaquePtr()); if (streq(type_name, "void") && QualTypeMatchesBitSize (bit_size, ast, ast->VoidTy)) @@ -961,6 +962,14 @@ case DW_ATE_unsigned: if (type_name) { +if (streq(type_name, "wchar_t")) +{ +if (QualTypeMatchesBitSize (bit_size, ast, ast->WCharTy)) +{ +if (!TargetInfo::isTypeSigned (getTargetInfo()->getWCharType())) +return ClangASTType (ast, ast->WCharTy.getAsOpaquePtr()); +} +} if (strstr(type_name, "long long")) { if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedLongLongTy)) ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] LLDB ARM Register context support
Comment at: Host/posix/PipePosix.cpp:271 @@ -270,3 +270,3 @@ - std::this_thread::sleep_for(milliseconds(OPEN_WRITER_SLEEP_TIMEOUT_MSECS)); + //std::this_thread::sleep_for(milliseconds(OPEN_WRITER_SLEEP_TIMEOUT_MSECS)); } Extra changes included by accident, I presume Comment at: Plugins/Process/POSIX/POSIXThread.cpp:199-202 @@ -196,2 +198,6 @@ { +case llvm::Triple::arm: + assert(HostInfo::GetArchitecture().GetAddressByteSize() == 4); +reg_interface = static_cast(new RegisterContextLinux_arm(target_arch)); +break; case llvm::Triple::aarch64: suggest keeping in alphabetical order (here and several other places) Comment at: Plugins/Process/POSIX/ProcessPOSIX.cpp:678-679 @@ +677,4 @@ +// but the linux kernel does otherwise. +static const uint8_t g_arm_breakpoint_opcode[] = { 0xf0, 0x01, 0xf0, 0xe7 }; +static const uint8_t g_thumb_breakpoint_opcode[] = { 0x01, 0xde }; + ProcessPOSIX.cpp is used by Linux and FreeBSD so if Linux implements non-standard behaviour this will need to be changed Comment at: Plugins/Process/elf-core/ProcessElfCore.cpp:428 @@ -427,2 +427,3 @@ bool lp64 = (arch.GetMachine() == llvm::Triple::aarch64 || + arch.GetMachine() == llvm::Triple::arm || arch.GetMachine() == llvm::Triple::mips64 || 32-bit arm is not LP64 Comment at: Plugins/Process/elf-core/ThreadElfCore.cpp:135-137 @@ -132,2 +134,5 @@ break; +case llvm::Triple::arm: +reg_interface = new RegisterContextLinux_arm(arch); +break; default: alpha order Comment at: Plugins/Process/elf-core/ThreadElfCore.cpp:157-159 @@ -151,2 +156,5 @@ { +case llvm::Triple::arm: +m_thread_reg_ctx_sp.reset(new RegisterContextCorePOSIX_arm (*this, reg_interface, m_gpregset_data, m_fpregset_data)); +break; case llvm::Triple::aarch64: alpha order http://reviews.llvm.org/D8719 EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r233680 - Fix Windows build after r233679
Author: tberghammer Date: Tue Mar 31 05:11:04 2015 New Revision: 233680 URL: http://llvm.org/viewvc/llvm-project?rev=233680&view=rev Log: Fix Windows build after r233679 Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp?rev=233680&r1=233679&r2=233680&view=diff == --- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp (original) +++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp Tue Mar 31 05:11:04 2015 @@ -45,7 +45,6 @@ using namespace lldb; using namespace lldb_private; using namespace lldb_private::platform_linux; -using namespace lldb_private::process_linux; static uint32_t g_initialize_count = 0; @@ -882,7 +881,7 @@ PlatformLinux::LaunchNativeProcess (Proc return Error("exe_module_sp could not be resolved for %s", launch_info.GetExecutableFile ().GetPath ().c_str ()); // Launch it for debugging -error = NativeProcessLinux::LaunchProcess ( +error = process_linux::NativeProcessLinux::LaunchProcess ( exe_module_sp.get (), launch_info, native_delegate, @@ -904,6 +903,6 @@ PlatformLinux::AttachNativeProcess (lldb return Error("PlatformLinux::%s (): cannot attach to a debug process when not the host", __FUNCTION__); // Launch it for debugging -return NativeProcessLinux::AttachToProcess (pid, native_delegate, process_sp); +return process_linux::NativeProcessLinux::AttachToProcess (pid, native_delegate, process_sp); #endif } ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits