[Lldb-commits] [lldb] 79bf032 - [lldb testing] Avoid subtle terminfo behavioral differences

2021-10-05 Thread David Zarzycki via lldb-commits

Author: David Zarzycki
Date: 2021-10-05T10:28:02-04:00
New Revision: 79bf032fe10546fd1d6e14c5ac8905f25c2b

URL: 
https://github.com/llvm/llvm-project/commit/79bf032fe10546fd1d6e14c5ac8905f25c2b
DIFF: 
https://github.com/llvm/llvm-project/commit/79bf032fe10546fd1d6e14c5ac8905f25c2b.diff

LOG: [lldb testing] Avoid subtle terminfo behavioral differences

The original "arbitrary" changes were causing EINVAL on a Fedora 34 box.

Added: 


Modified: 
lldb/unittests/Host/posix/TerminalTest.cpp

Removed: 




diff  --git a/lldb/unittests/Host/posix/TerminalTest.cpp 
b/lldb/unittests/Host/posix/TerminalTest.cpp
index ecdb548021643..37b6b3cf60bff 100644
--- a/lldb/unittests/Host/posix/TerminalTest.cpp
+++ b/lldb/unittests/Host/posix/TerminalTest.cpp
@@ -79,15 +79,9 @@ TEST_F(TerminalTest, SaveRestoreRAII) {
 TerminalState term_state{term};
 terminfo = orig_terminfo;
 
-// make some arbitrary changes
-terminfo.c_iflag ^= IGNPAR | INLCR;
-terminfo.c_oflag ^= OPOST | OCRNL;
-terminfo.c_cflag ^= PARENB | PARODD;
-terminfo.c_lflag ^= ICANON | ECHO;
-terminfo.c_cc[VEOF] ^= 8;
-terminfo.c_cc[VEOL] ^= 4;
-cfsetispeed(&terminfo, B9600);
-cfsetospeed(&terminfo, B9600);
+// make an arbitrary change
+cfsetispeed(&terminfo,cfgetispeed(&orig_terminfo) == B9600 ? B4800 : 
B9600);
+cfsetospeed(&terminfo,cfgetospeed(&orig_terminfo) == B9600 ? B4800 : 
B9600);
 
 ASSERT_EQ(tcsetattr(m_pty.GetPrimaryFileDescriptor(), TCSANOW, &terminfo),
   0);
@@ -108,15 +102,9 @@ TEST_F(TerminalTest, SaveRestore) {
   term_state.Save(term, false);
   terminfo = orig_terminfo;
 
-  // make some arbitrary changes
-  terminfo.c_iflag ^= IGNPAR | INLCR;
-  terminfo.c_oflag ^= OPOST | OCRNL;
-  terminfo.c_cflag ^= PARENB | PARODD;
-  terminfo.c_lflag ^= ICANON | ECHO;
-  terminfo.c_cc[VEOF] ^= 8;
-  terminfo.c_cc[VEOL] ^= 4;
-  cfsetispeed(&terminfo, B9600);
-  cfsetospeed(&terminfo, B9600);
+  // make an arbitrary change
+  cfsetispeed(&terminfo, cfgetispeed(&orig_terminfo) == B9600 ? B4800 : B9600);
+  cfsetospeed(&terminfo, cfgetospeed(&orig_terminfo) == B9600 ? B4800 : B9600);
 
   ASSERT_EQ(tcsetattr(m_pty.GetPrimaryFileDescriptor(), TCSANOW, &terminfo), 
0);
 



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 5bc32ad - [lldb testing] NFC: run through clang-format

2021-10-05 Thread David Zarzycki via lldb-commits

Author: David Zarzycki
Date: 2021-10-05T13:40:27-04:00
New Revision: 5bc32ad08d9a25b1a4fc4fe7daa4056d1d1ef67f

URL: 
https://github.com/llvm/llvm-project/commit/5bc32ad08d9a25b1a4fc4fe7daa4056d1d1ef67f
DIFF: 
https://github.com/llvm/llvm-project/commit/5bc32ad08d9a25b1a4fc4fe7daa4056d1d1ef67f.diff

LOG: [lldb testing] NFC: run through clang-format

Added: 


Modified: 
lldb/unittests/Host/posix/TerminalTest.cpp

Removed: 




diff  --git a/lldb/unittests/Host/posix/TerminalTest.cpp 
b/lldb/unittests/Host/posix/TerminalTest.cpp
index 37b6b3cf60bf..788c2a6ea579 100644
--- a/lldb/unittests/Host/posix/TerminalTest.cpp
+++ b/lldb/unittests/Host/posix/TerminalTest.cpp
@@ -80,8 +80,10 @@ TEST_F(TerminalTest, SaveRestoreRAII) {
 terminfo = orig_terminfo;
 
 // make an arbitrary change
-cfsetispeed(&terminfo,cfgetispeed(&orig_terminfo) == B9600 ? B4800 : 
B9600);
-cfsetospeed(&terminfo,cfgetospeed(&orig_terminfo) == B9600 ? B4800 : 
B9600);
+cfsetispeed(&terminfo,
+cfgetispeed(&orig_terminfo) == B9600 ? B4800 : B9600);
+cfsetospeed(&terminfo,
+cfgetospeed(&orig_terminfo) == B9600 ? B4800 : B9600);
 
 ASSERT_EQ(tcsetattr(m_pty.GetPrimaryFileDescriptor(), TCSANOW, &terminfo),
   0);



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 952bc6c - Revert "[lldb/Plugins] Add ScriptedProcess Process Plugin"

2021-03-24 Thread David Zarzycki via lldb-commits

Author: David Zarzycki
Date: 2021-03-24T07:07:22-04:00
New Revision: 952bc6c92e21414bcafa6bd85bce0e7f79ddc856

URL: 
https://github.com/llvm/llvm-project/commit/952bc6c92e21414bcafa6bd85bce0e7f79ddc856
DIFF: 
https://github.com/llvm/llvm-project/commit/952bc6c92e21414bcafa6bd85bce0e7f79ddc856.diff

LOG: Revert "[lldb/Plugins] Add ScriptedProcess Process Plugin"

This reverts commit dd391e1ef762d79f86112dc2480a89c9be066ce1.

This patch causes 17 LLDB test regressions on Fedora 33 (x86-64).

Added: 


Modified: 
lldb/bindings/python/CMakeLists.txt
lldb/include/lldb/Target/Process.h
lldb/source/Plugins/Process/CMakeLists.txt
lldb/source/Target/Target.cpp
lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py

Removed: 
lldb/source/Plugins/Process/scripted/CMakeLists.txt
lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
lldb/source/Plugins/Process/scripted/ScriptedProcess.h



diff  --git a/lldb/bindings/python/CMakeLists.txt 
b/lldb/bindings/python/CMakeLists.txt
index b5c75f5ab650..9422ee00cb5f 100644
--- a/lldb/bindings/python/CMakeLists.txt
+++ b/lldb/bindings/python/CMakeLists.txt
@@ -111,13 +111,6 @@ function(finish_swig_python swig_target 
lldb_python_bindings_dir lldb_python_tar
 FILES
 "${LLDB_SOURCE_DIR}/examples/python/scripted_process/scripted_process.py")
 
-  create_python_package(
-${swig_target}
-${lldb_python_target_dir}
-"plugins"
-FILES
-"${LLDB_SOURCE_DIR}/examples/python/scripted_process/scripted_process.py")
-
   if(APPLE)
 create_python_package(
   ${swig_target}

diff  --git a/lldb/include/lldb/Target/Process.h 
b/lldb/include/lldb/Target/Process.h
index 127f03f3619c..fbdb5069b39f 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -2561,6 +2561,8 @@ void PruneThreadPlans();
   virtual size_t DoReadMemory(lldb::addr_t vm_addr, void *buf, size_t size,
   Status &error) = 0;
 
+  void SetState(lldb::EventSP &event_sp);
+
   lldb::StateType GetPrivateState();
 
   /// The "private" side of resuming a process.  This doesn't alter the state

diff  --git a/lldb/source/Plugins/Process/CMakeLists.txt 
b/lldb/source/Plugins/Process/CMakeLists.txt
index bea5bac9eb21..fdeb211fe7a2 100644
--- a/lldb/source/Plugins/Process/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/CMakeLists.txt
@@ -12,7 +12,6 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
 elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   add_subdirectory(MacOSX-Kernel)
 endif()
-add_subdirectory(scripted)
 add_subdirectory(gdb-remote)
 add_subdirectory(Utility)
 add_subdirectory(elf-core)

diff  --git a/lldb/source/Plugins/Process/scripted/CMakeLists.txt 
b/lldb/source/Plugins/Process/scripted/CMakeLists.txt
deleted file mode 100644
index e2cfd058e278..
--- a/lldb/source/Plugins/Process/scripted/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-add_lldb_library(lldbPluginScriptedProcess PLUGIN
-  ScriptedProcess.cpp
-
-  LINK_LIBS
-lldbCore
-lldbTarget
-lldbUtility
-lldbPluginProcessUtility
-  LINK_COMPONENTS
-BinaryFormat
-Object
-Support
-  )

diff  --git a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp 
b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
deleted file mode 100644
index b4ec4c7124d2..
--- a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
+++ /dev/null
@@ -1,245 +0,0 @@
-//===-- ScriptedProcess.cpp 
---===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===--===//
-
-#include "ScriptedProcess.h"
-
-#include "lldb/Core/Debugger.h"
-#include "lldb/Core/Module.h"
-#include "lldb/Core/PluginManager.h"
-
-#include "lldb/Host/OptionParser.h"
-
-#include "lldb/Interpreter/OptionArgParser.h"
-#include "lldb/Interpreter/OptionGroupBoolean.h"
-#include "lldb/Interpreter/ScriptInterpreter.h"
-#include "lldb/Target/MemoryRegionInfo.h"
-
-LLDB_PLUGIN_DEFINE(ScriptedProcess)
-
-using namespace lldb;
-using namespace lldb_private;
-
-ConstString ScriptedProcess::GetPluginNameStatic() {
-  static ConstString g_name("ScriptedProcess");
-  return g_name;
-}
-
-const char *ScriptedProcess::GetPluginDescriptionStatic() {
-  return "Scripted Process plug-in.";
-}
-
-lldb::ProcessSP ScriptedProcess::CreateInstance(lldb::TargetSP target_sp,
-lldb::ListenerSP listener_sp,
-const FileSpec *file,
-bool can_connect) {
-  ScriptedProcess::LaunchInfo launch_info(target_sp->GetProcessLaunchInfo());
-
-  auto process_sp =
-   

[Lldb-commits] [lldb] r357336 - [CMake] Add missing test dep

2019-10-04 Thread David Zarzycki via lldb-commits
Author: davezarzycki
Date: Fri Mar 29 17:00:19 2019
New Revision: 357336

URL: http://llvm.org/viewvc/llvm-project?rev=357336&view=rev
Log:
[CMake] Add missing test dep

lit/SymbolFile/NativePDB/globals-bss.cpp needs llvm-readobj

Modified:
lldb/trunk/lit/CMakeLists.txt

Modified: lldb/trunk/lit/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/CMakeLists.txt?rev=357336&r1=357335&r2=357336&view=diff
==
--- lldb/trunk/lit/CMakeLists.txt (original)
+++ lldb/trunk/lit/CMakeLists.txt Fri Mar 29 17:00:19 2019
@@ -26,6 +26,7 @@ list(APPEND LLDB_TEST_DEPS
   llvm-config
   llvm-mc
   llvm-objcopy
+  llvm-readobj
   )
 
 if(TARGET lld)


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r371596 - [LLDB] Do not try to canonicalize gethostname() result

2019-09-11 Thread David Zarzycki via lldb-commits
Author: davezarzycki
Date: Wed Sep 11 01:32:37 2019
New Revision: 371596

URL: http://llvm.org/viewvc/llvm-project?rev=371596&view=rev
Log:
[LLDB] Do not try to canonicalize gethostname() result

This code is trying too hard and failing. Either the result of
gethostname() is canonical or it is not. If it is not, then trying to
canonicalize it is – for various reasons – a lost cause. For example, a
given machine might have multiple network interfaces with multiple
addresses per interface, each with a different canonical name.
Separably, the result of HostInfoPosix::GetHostname() and latency
thereof shouldn't depend on whether networking is up or down or what
network the machine happened to be attached to at any given moment (like
a laptop that travels between work and home).

https://reviews.llvm.org/D67230

Modified:
lldb/trunk/source/Host/posix/HostInfoPosix.cpp

Modified: lldb/trunk/source/Host/posix/HostInfoPosix.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/posix/HostInfoPosix.cpp?rev=371596&r1=371595&r2=371596&view=diff
==
--- lldb/trunk/source/Host/posix/HostInfoPosix.cpp (original)
+++ lldb/trunk/source/Host/posix/HostInfoPosix.cpp Wed Sep 11 01:32:37 2019
@@ -18,7 +18,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -32,17 +31,7 @@ bool HostInfoPosix::GetHostname(std::str
   char hostname[PATH_MAX];
   hostname[sizeof(hostname) - 1] = '\0';
   if (::gethostname(hostname, sizeof(hostname) - 1) == 0) {
-struct addrinfo hints;
-struct addrinfo *res = nullptr;
-std::memset(&hints, 0, sizeof(hints));
-hints.ai_flags = AI_CANONNAME;
-int err = ::getaddrinfo(hostname, nullptr, &hints, &res);
-if (err == 0) {
-  assert(res->ai_canonname && "getaddrinfo found a canonical name");
-  s.assign(res->ai_canonname);
-  freeaddrinfo(res);
-} else
-  s.assign(hostname);
+s.assign(hostname);
 return true;
   }
   return false;


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 075f661 - [lldb] Unbreak the build after a recent PowerPC change

2020-10-29 Thread David Zarzycki via lldb-commits

Author: David Zarzycki
Date: 2020-10-29T05:56:38-04:00
New Revision: 075f661d01f856192c236b6256f18bc697e28e1b

URL: 
https://github.com/llvm/llvm-project/commit/075f661d01f856192c236b6256f18bc697e28e1b
DIFF: 
https://github.com/llvm/llvm-project/commit/075f661d01f856192c236b6256f18bc697e28e1b.diff

LOG: [lldb] Unbreak the build after a recent PowerPC change

40dd4d5233d9f81705a24d91b48d2620e487b89d introduced two new types.

Added: 


Modified: 
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Removed: 




diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 3f6da8ef49d6..6a5c5cb69ac6 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -4819,6 +4819,12 @@ lldb::Encoding 
TypeSystemClang::GetEncoding(lldb::opaque_compiler_type_t type,
 case clang::BuiltinType::OCLIntelSubgroupAVCImeDualRefStreamin:
   break;
 
+// PowerPC -- Matrix Multiply Assist
+case clang::BuiltinType::VectorPair:
+case clang::BuiltinType::VectorQuad:
+  break;
+
+// ARM -- Scalable Vector Extension
 case clang::BuiltinType::SveBool:
 case clang::BuiltinType::SveInt8:
 case clang::BuiltinType::SveInt8x2:



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 430d5d8 - [LLDB] Unbreak the build after recent clang changes

2020-12-18 Thread David Zarzycki via lldb-commits

Author: David Zarzycki
Date: 2020-12-18T07:54:36-05:00
New Revision: 430d5d8429473c2b10b109991d7577a3cea41140

URL: 
https://github.com/llvm/llvm-project/commit/430d5d8429473c2b10b109991d7577a3cea41140
DIFF: 
https://github.com/llvm/llvm-project/commit/430d5d8429473c2b10b109991d7577a3cea41140.diff

LOG: [LLDB] Unbreak the build after recent clang changes

9e08e51a20d0d2b1c5724bb17e969d036fced4cd introduced a new enum case.

Added: 


Modified: 
lldb/include/lldb/lldb-enumerations.h
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Removed: 




diff  --git a/lldb/include/lldb/lldb-enumerations.h 
b/lldb/include/lldb/lldb-enumerations.h
index 2679ee52136d..ff4e15e7e070 100644
--- a/lldb/include/lldb/lldb-enumerations.h
+++ b/lldb/include/lldb/lldb-enumerations.h
@@ -816,6 +816,7 @@ enum TemplateArgumentKind {
   eTemplateArgumentKindExpression,
   eTemplateArgumentKindPack,
   eTemplateArgumentKindNullPtr,
+  eTemplateArgumentKindUncommonValue,
 };
 
 /// Options that can be set for a formatter to alter its behavior. Not

diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 643ea7e02206..894faa847450 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -6981,6 +6981,9 @@ 
TypeSystemClang::GetTemplateArgumentKind(lldb::opaque_compiler_type_t type,
 
   case clang::TemplateArgument::Pack:
 return eTemplateArgumentKindPack;
+
+  case clang::TemplateArgument::UncommonValue:
+return eTemplateArgumentKindUncommonValue;
   }
   llvm_unreachable("Unhandled clang::TemplateArgument::ArgKind");
 }



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits