[Lldb-commits] [PATCH] D90857: [lldb] add a missing dependency on intrinsics_gen

2020-11-23 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90857/new/

https://reviews.llvm.org/D90857

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


[Lldb-commits] [PATCH] D91934: [lldb] [Process/FreeBSD] Add missing 'override' kws to POSIXStopInfo

2020-11-23 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.

I don't think you need to spin up reviews for trivial fixes such as this.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91934/new/

https://reviews.llvm.org/D91934

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


[Lldb-commits] [PATCH] D91922: [lldb] Fix qRegisterInfo to handle missing registers

2020-11-23 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Looks good. I'd rephrase the commit title to make it clearer this only changes 
the single test, and does not change behavior otherwise...




Comment at: lldb/test/API/tools/lldb-server/TestLldbGdbServer.py:588
 
+# Skip erraneous (unsupported) registers.
+if p_response.startswith("E") and len(p_response) == 3:

Maybe add a TODO to remove this once we're able to actually make registers 
disappear.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91922/new/

https://reviews.llvm.org/D91922

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


[Lldb-commits] [PATCH] D91923: [lldb] [Process/FreeBSDRemote] Fix regset names and related tests

2020-11-23 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Consistency is nice.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91923/new/

https://reviews.llvm.org/D91923

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


[Lldb-commits] [lldb] 7b7c372 - [lldb] [Process/FreeBSD] Add missing 'override' kws to POSIXStopInfo

2020-11-23 Thread Michał Górny via lldb-commits

Author: Michał Górny
Date: 2020-11-23T09:22:41+01:00
New Revision: 7b7c372e3fcadfd5ee6ab3fb68d9f0f1c25e0247

URL: 
https://github.com/llvm/llvm-project/commit/7b7c372e3fcadfd5ee6ab3fb68d9f0f1c25e0247
DIFF: 
https://github.com/llvm/llvm-project/commit/7b7c372e3fcadfd5ee6ab3fb68d9f0f1c25e0247.diff

LOG: [lldb] [Process/FreeBSD] Add missing 'override' kws to POSIXStopInfo

Differential Revision: https://reviews.llvm.org/D91934

Added: 


Modified: 
lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h

Removed: 




diff  --git a/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h 
b/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
index 88fb7f31fe06..5a022c485b68 100644
--- a/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
+++ b/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
@@ -34,13 +34,13 @@ class POSIXLimboStopInfo : public POSIXStopInfo {
 
   ~POSIXLimboStopInfo();
 
-  lldb::StopReason GetStopReason() const;
+  lldb::StopReason GetStopReason() const override;
 
-  const char *GetDescription();
+  const char *GetDescription() override;
 
-  bool ShouldStop(lldb_private::Event *event_ptr);
+  bool ShouldStop(lldb_private::Event *event_ptr) override;
 
-  bool ShouldNotify(lldb_private::Event *event_ptr);
+  bool ShouldNotify(lldb_private::Event *event_ptr) override;
 };
 
 
//===--===//
@@ -54,13 +54,13 @@ class POSIXNewThreadStopInfo : public POSIXStopInfo {
 
   ~POSIXNewThreadStopInfo();
 
-  lldb::StopReason GetStopReason() const;
+  lldb::StopReason GetStopReason() const override;
 
-  const char *GetDescription();
+  const char *GetDescription() override;
 
-  bool ShouldStop(lldb_private::Event *event_ptr);
+  bool ShouldStop(lldb_private::Event *event_ptr) override;
 
-  bool ShouldNotify(lldb_private::Event *event_ptr);
+  bool ShouldNotify(lldb_private::Event *event_ptr) override;
 };
 
 #endif



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


[Lldb-commits] [lldb] 8f2f9a8 - [lldb] [Process/Utility] Declare register overlaps between ST and MM

2020-11-23 Thread Michał Górny via lldb-commits

Author: Michał Górny
Date: 2020-11-23T09:23:14+01:00
New Revision: 8f2f9a82e2cc333d36ddd1b6bb0523623e065cdc

URL: 
https://github.com/llvm/llvm-project/commit/8f2f9a82e2cc333d36ddd1b6bb0523623e065cdc
DIFF: 
https://github.com/llvm/llvm-project/commit/8f2f9a82e2cc333d36ddd1b6bb0523623e065cdc.diff

LOG: [lldb] [Process/Utility] Declare register overlaps between ST and MM

Explicitly declare register overlaps/invalidation between ST(i) and MMi
registers.

Differential Revision: https://reviews.llvm.org/D91728

Added: 


Modified: 
lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h
lldb/source/Plugins/Process/Utility/RegisterInfos_i386.h
lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h

Removed: 




diff  --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp 
b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
index bf9282d8c0cc..2c7f63503d7c 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
@@ -286,6 +286,74 @@ uint32_t RegisterContextPOSIX_x86::g_invalidate_fip[] = {
 uint32_t RegisterContextPOSIX_x86::g_invalidate_fdp[] = {
 lldb_fdp_x86_64, lldb_fooff_x86_64, lldb_foseg_x86_64, 
LLDB_INVALID_REGNUM};
 
+uint32_t RegisterContextPOSIX_x86::g_contained_st0_32[] = {lldb_st0_i386,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st1_32[] = {lldb_st1_i386,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st2_32[] = {lldb_st2_i386,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st3_32[] = {lldb_st3_i386,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st4_32[] = {lldb_st4_i386,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st5_32[] = {lldb_st5_i386,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st6_32[] = {lldb_st6_i386,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st7_32[] = {lldb_st7_i386,
+   
LLDB_INVALID_REGNUM};
+
+uint32_t RegisterContextPOSIX_x86::g_invalidate_st0_32[] = {
+lldb_st0_i386, lldb_mm0_i386, LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_invalidate_st1_32[] = {
+lldb_st1_i386, lldb_mm1_i386, LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_invalidate_st2_32[] = {
+lldb_st2_i386, lldb_mm2_i386, LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_invalidate_st3_32[] = {
+lldb_st3_i386, lldb_mm3_i386, LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_invalidate_st4_32[] = {
+lldb_st4_i386, lldb_mm4_i386, LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_invalidate_st5_32[] = {
+lldb_st5_i386, lldb_mm5_i386, LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_invalidate_st6_32[] = {
+lldb_st6_i386, lldb_mm6_i386, LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_invalidate_st7_32[] = {
+lldb_st7_i386, lldb_mm7_i386, LLDB_INVALID_REGNUM};
+
+uint32_t RegisterContextPOSIX_x86::g_contained_st0_64[] = {lldb_st0_x86_64,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st1_64[] = {lldb_st1_x86_64,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st2_64[] = {lldb_st2_x86_64,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st3_64[] = {lldb_st3_x86_64,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st4_64[] = {lldb_st4_x86_64,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st5_64[] = {lldb_st5_x86_64,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st6_64[] = {lldb_st6_x86_64,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st7_64[] = {lldb_st7_x86_64,
+   
LLDB_INVALID_REGNUM};
+
+uint32_t RegisterContextPOSIX_x86::g_invalidat

[Lldb-commits] [PATCH] D91934: [lldb] [Process/FreeBSD] Add missing 'override' kws to POSIXStopInfo

2020-11-23 Thread Michał Górny via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7b7c372e3fca: [lldb] [Process/FreeBSD] Add missing 
'override' kws to POSIXStopInfo (authored by mgorny).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91934/new/

https://reviews.llvm.org/D91934

Files:
  lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h


Index: lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
===
--- lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
+++ lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
@@ -34,13 +34,13 @@
 
   ~POSIXLimboStopInfo();
 
-  lldb::StopReason GetStopReason() const;
+  lldb::StopReason GetStopReason() const override;
 
-  const char *GetDescription();
+  const char *GetDescription() override;
 
-  bool ShouldStop(lldb_private::Event *event_ptr);
+  bool ShouldStop(lldb_private::Event *event_ptr) override;
 
-  bool ShouldNotify(lldb_private::Event *event_ptr);
+  bool ShouldNotify(lldb_private::Event *event_ptr) override;
 };
 
 
//===--===//
@@ -54,13 +54,13 @@
 
   ~POSIXNewThreadStopInfo();
 
-  lldb::StopReason GetStopReason() const;
+  lldb::StopReason GetStopReason() const override;
 
-  const char *GetDescription();
+  const char *GetDescription() override;
 
-  bool ShouldStop(lldb_private::Event *event_ptr);
+  bool ShouldStop(lldb_private::Event *event_ptr) override;
 
-  bool ShouldNotify(lldb_private::Event *event_ptr);
+  bool ShouldNotify(lldb_private::Event *event_ptr) override;
 };
 
 #endif


Index: lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
===
--- lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
+++ lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
@@ -34,13 +34,13 @@
 
   ~POSIXLimboStopInfo();
 
-  lldb::StopReason GetStopReason() const;
+  lldb::StopReason GetStopReason() const override;
 
-  const char *GetDescription();
+  const char *GetDescription() override;
 
-  bool ShouldStop(lldb_private::Event *event_ptr);
+  bool ShouldStop(lldb_private::Event *event_ptr) override;
 
-  bool ShouldNotify(lldb_private::Event *event_ptr);
+  bool ShouldNotify(lldb_private::Event *event_ptr) override;
 };
 
 //===--===//
@@ -54,13 +54,13 @@
 
   ~POSIXNewThreadStopInfo();
 
-  lldb::StopReason GetStopReason() const;
+  lldb::StopReason GetStopReason() const override;
 
-  const char *GetDescription();
+  const char *GetDescription() override;
 
-  bool ShouldStop(lldb_private::Event *event_ptr);
+  bool ShouldStop(lldb_private::Event *event_ptr) override;
 
-  bool ShouldNotify(lldb_private::Event *event_ptr);
+  bool ShouldNotify(lldb_private::Event *event_ptr) override;
 };
 
 #endif
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D91728: [lldb] [Process/Utility] Declare register overlaps between ST and MM

2020-11-23 Thread Michał Górny via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8f2f9a82e2cc: [lldb] [Process/Utility] Declare register 
overlaps between ST and MM (authored by mgorny).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91728/new/

https://reviews.llvm.org/D91728

Files:
  lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
  lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h
  lldb/source/Plugins/Process/Utility/RegisterInfos_i386.h
  lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h

Index: lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
===
--- lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
+++ lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
@@ -88,15 +88,14 @@
  nullptr, nullptr, nullptr, 0  \
   }
 
-#define DEFINE_FP_MM(reg, i)   \
+#define DEFINE_FP_MM(reg, i, streg)\
   {\
-#reg #i, nullptr, sizeof(uint64_t),\
-  LLVM_EXTENSION FPR_OFFSET(   \
-  stmm[i]), eEncodingUint, eFormatHex, \
-  {dwarf_mm##i##_x86_64, dwarf_mm##i##_x86_64, \
-   LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,   \
-   lldb_mm##i##_x86_64 },  \
-   nullptr, nullptr, nullptr, 0\
+#reg #i, nullptr, sizeof(uint64_t), LLVM_EXTENSION FPR_OFFSET(stmm[i]),\
+eEncodingUint, eFormatHex, \
+{dwarf_mm##i##_x86_64, dwarf_mm##i##_x86_64, LLDB_INVALID_REGNUM,  \
+ LLDB_INVALID_REGNUM, lldb_mm##i##_x86_64 },   \
+RegisterContextPOSIX_x86::g_contained_##streg##_64,\
+RegisterContextPOSIX_x86::g_invalidate_##streg##_64, nullptr, 0\
   }
 
 #define DEFINE_XMM(reg, i) \
@@ -277,10 +276,12 @@
 // FP registers.
 DEFINE_FP_ST(st, 0), DEFINE_FP_ST(st, 1), DEFINE_FP_ST(st, 2),
 DEFINE_FP_ST(st, 3), DEFINE_FP_ST(st, 4), DEFINE_FP_ST(st, 5),
-DEFINE_FP_ST(st, 6), DEFINE_FP_ST(st, 7), DEFINE_FP_MM(mm, 0),
-DEFINE_FP_MM(mm, 1), DEFINE_FP_MM(mm, 2), DEFINE_FP_MM(mm, 3),
-DEFINE_FP_MM(mm, 4), DEFINE_FP_MM(mm, 5), DEFINE_FP_MM(mm, 6),
-DEFINE_FP_MM(mm, 7),
+DEFINE_FP_ST(st, 6), DEFINE_FP_ST(st, 7),
+
+DEFINE_FP_MM(mm, 0, st0), DEFINE_FP_MM(mm, 1, st1),
+DEFINE_FP_MM(mm, 2, st2), DEFINE_FP_MM(mm, 3, st3),
+DEFINE_FP_MM(mm, 4, st4), DEFINE_FP_MM(mm, 5, st5),
+DEFINE_FP_MM(mm, 6, st6), DEFINE_FP_MM(mm, 7, st7),
 
 // XMM registers
 DEFINE_XMM(xmm, 0), DEFINE_XMM(xmm, 1), DEFINE_XMM(xmm, 2),
Index: lldb/source/Plugins/Process/Utility/RegisterInfos_i386.h
===
--- lldb/source/Plugins/Process/Utility/RegisterInfos_i386.h
+++ lldb/source/Plugins/Process/Utility/RegisterInfos_i386.h
@@ -87,15 +87,14 @@
  nullptr, nullptr, nullptr, 0  \
   }
 
-#define DEFINE_FP_MM(reg, i)   \
+#define DEFINE_FP_MM(reg, i, streg)\
   {\
-#reg #i, nullptr, sizeof(uint64_t),\
-  LLVM_EXTENSION FPR_OFFSET(   \
-  stmm[i]), eEncodingUint, eFormatHex, \
-  {ehframe_mm##i##_i386, dwarf_mm##i##_i386,   \
-   LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,   \
-   lldb_mm##i##_i386 },\
-   nullptr, nullptr, nullptr, 0\
+#reg #i, nullptr, sizeof(uint64_t), LLVM_EXTENSION FPR_OFFSET(stmm[i]),\
+eEncodingUint, eFormatHex, \
+{dwarf_mm##i##_i386, dwarf_mm##i##_i386, LLDB_INVALID_REGNUM,  \
+ LLDB_INVALID_REGNUM, lldb_mm##i##_i386 }, \
+RegisterContextPOSIX_x86::g_contained_##streg##_32,\
+RegisterContextPOSIX_x86::g_invalidate_##streg##_32, nullptr, 0\
   }
 
 #define DEFINE_XMM(reg, i) \
@@ -251,10 +250,12 @@
 // FP registers.
 DEFINE_FP_ST

[Lldb-commits] [PATCH] D91922: [lldb] [test] Fix qRegisterInfo lldb-server test to handle missing registers

2020-11-23 Thread Michał Górny via Phabricator via lldb-commits
mgorny marked an inline comment as done.
mgorny added a comment.

Ok, will add the comment and push.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91922/new/

https://reviews.llvm.org/D91922

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


[Lldb-commits] [PATCH] D91923: [lldb] [Process/FreeBSDRemote] Fix regset names and related tests

2020-11-23 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment.

I'll also add a TODO here wrt unsupported registers.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91923/new/

https://reviews.llvm.org/D91923

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


[Lldb-commits] [lldb] 9367b57 - [lldb] [test] Fix qRegisterInfo lldb-server tests to handle missing registers

2020-11-23 Thread Michał Górny via lldb-commits

Author: Michał Górny
Date: 2020-11-23T09:26:23+01:00
New Revision: 9367b57dadb7a8515fa454cb4bb8e4cc45bf57d2

URL: 
https://github.com/llvm/llvm-project/commit/9367b57dadb7a8515fa454cb4bb8e4cc45bf57d2
DIFF: 
https://github.com/llvm/llvm-project/commit/9367b57dadb7a8515fa454cb4bb8e4cc45bf57d2.diff

LOG: [lldb] [test] Fix qRegisterInfo lldb-server tests to handle missing 
registers

Fix qRegisterInfo tests to handle Exx error response when querying
registers that are not supported on the platform in question.  This
is how FreeBSD and NetBSD platforms reporting missing registers right
now, and there certainly is value from verifying the remaining
registers.

This change fixes the test for FreeBSD but NetBSD has other regressions
that still need to be researched.

Differential Revision: https://reviews.llvm.org/D91922

Added: 


Modified: 
lldb/test/API/tools/lldb-server/TestLldbGdbServer.py

Removed: 




diff  --git a/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py 
b/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
index 13fe9c3c0398..9fb8cc1892ea 100644
--- a/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
+++ b/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
@@ -585,9 +585,15 @@ def 
p_returns_correct_data_size_for_each_qRegisterInfo(self):
 p_response = context.get("p_response")
 self.assertIsNotNone(p_response)
 
+# Skip erraneous (unsupported) registers.
+# TODO: remove this once we make unsupported registers disappear.
+if p_response.startswith("E") and len(p_response) == 3:
+continue
+
 if "dynamic_size_dwarf_expr_bytes" in reg_info:
 self.updateRegInfoBitsize(reg_info, byte_order)
-self.assertEqual(len(p_response), 2 * int(reg_info["bitsize"]) / 8)
+self.assertEqual(len(p_response), 2 * int(reg_info["bitsize"]) / 8,
+ reg_info)
 
 # Increment loop
 reg_index += 1
@@ -601,7 +607,7 @@ def 
test_p_returns_correct_data_size_for_each_qRegisterInfo_launch_debugserver(
 self.set_inferior_startup_launch()
 self.p_returns_correct_data_size_for_each_qRegisterInfo()
 
-@expectedFailureAll(oslist=["freebsd", "netbsd"])
+@expectedFailureAll(oslist=["netbsd"])
 @llgs_test
 def test_p_returns_correct_data_size_for_each_qRegisterInfo_launch_llgs(
 self):
@@ -619,7 +625,7 @@ def 
test_p_returns_correct_data_size_for_each_qRegisterInfo_attach_debugserver(
 self.set_inferior_startup_attach()
 self.p_returns_correct_data_size_for_each_qRegisterInfo()
 
-@expectedFailureAll(oslist=["freebsd", "netbsd"])
+@expectedFailureAll(oslist=["netbsd"])
 @llgs_test
 def test_p_returns_correct_data_size_for_each_qRegisterInfo_attach_llgs(
 self):



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


[Lldb-commits] [lldb] 8018e7b - [lldb] [Process/FreeBSDRemote] Fix regset names and related tests

2020-11-23 Thread Michał Górny via lldb-commits

Author: Michał Górny
Date: 2020-11-23T09:28:20+01:00
New Revision: 8018e7b447dacb37a520fe989ab42c0586730961

URL: 
https://github.com/llvm/llvm-project/commit/8018e7b447dacb37a520fe989ab42c0586730961
DIFF: 
https://github.com/llvm/llvm-project/commit/8018e7b447dacb37a520fe989ab42c0586730961.diff

LOG: [lldb] [Process/FreeBSDRemote] Fix regset names and related tests

Restore Linux-alike regset names for AVX/MPX registers
as TestLldbGdbServer seems to depend on them.  At the same time, fix
TestRegisters to be aware that they are not available on FreeBSD
and NetBSD, at least until we figure out a better way of reporting
unsupported register sets.

Differential Revision: https://reviews.llvm.org/D91923

Added: 


Modified: 

lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
lldb/test/API/commands/register/register/register_command/TestRegisters.py
lldb/test/API/tools/lldb-server/TestLldbGdbServer.py

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
index ea5400c55713..8f1ba2eb4137 100644
--- 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
+++ 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
@@ -215,9 +215,9 @@ static const RegisterSet 
g_reg_sets_i386[k_num_register_sets] = {
 {"Floating Point Registers", "fpu", k_num_fpr_registers_i386,
  g_fpu_regnums_i386},
 {"Debug Registers", "dbr", k_num_dbr_registers_i386, g_dbr_regnums_i386},
-{"Extended AVX registers", "avx", k_num_avx_registers_i386,
+{"Advanced Vector Extensions", "avx", k_num_avx_registers_i386,
  g_avx_regnums_i386},
-{"Extended MPX registers", "mpx", k_num_mpx_registers_i386,
+{"Memory Protection Extensions", "mpx", k_num_mpx_registers_i386,
  g_mpx_regnums_i386},
 };
 
@@ -229,9 +229,9 @@ static const RegisterSet 
g_reg_sets_x86_64[k_num_register_sets] = {
  g_fpu_regnums_x86_64},
 {"Debug Registers", "dbr", k_num_dbr_registers_x86_64,
  g_dbr_regnums_x86_64},
-{"Extended AVX registers", "avx", k_num_avx_registers_x86_64,
+{"Advanced Vector Extensions", "avx", k_num_avx_registers_x86_64,
  g_avx_regnums_x86_64},
-{"Extended MPX registers", "mpx", k_num_mpx_registers_x86_64,
+{"Memory Protection Extensions", "mpx", k_num_mpx_registers_x86_64,
  g_mpx_regnums_x86_64},
 };
 

diff  --git 
a/lldb/test/API/commands/register/register/register_command/TestRegisters.py 
b/lldb/test/API/commands/register/register/register_command/TestRegisters.py
index 98024a83bf42..5e26f3317b41 100644
--- a/lldb/test/API/commands/register/register/register_command/TestRegisters.py
+++ b/lldb/test/API/commands/register/register/register_command/TestRegisters.py
@@ -404,7 +404,12 @@ def fp_register_write(self):
 for registerSet in registerSets:
 if 'advanced vector extensions' in 
registerSet.GetName().lower():
 has_avx = True
-if 'memory protection extension' in 
registerSet.GetName().lower():
+# FreeBSD/NetBSD reports missing register sets 
diff erently
+# at the moment and triggers false positive here.
+# TODO: remove FreeBSD/NetBSD exception when we make 
unsupported
+# register groups correctly disappear.
+if ('memory protection extension' in 
registerSet.GetName().lower()
+and self.getPlatform() not in ["freebsd", "netbsd"]):
 has_mpx = True
 
 if has_avx:

diff  --git a/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py 
b/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
index 9fb8cc1892ea..609931e1f892 100644
--- a/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
+++ b/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
@@ -433,7 +433,7 @@ def qRegisterInfo_contains_avx_registers(self):
 "Advanced Vector Extensions" in register_sets)
 
 @expectedFailureAll(oslist=["windows"]) # no avx for now.
-@expectedFailureAll(oslist=["freebsd", "netbsd"])
+@expectedFailureAll(oslist=["netbsd"])
 @llgs_test
 def test_qRegisterInfo_contains_avx_registers_llgs(self):
 self.init_llgs_test()



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


[Lldb-commits] [PATCH] D91922: [lldb] [test] Fix qRegisterInfo lldb-server test to handle missing registers

2020-11-23 Thread Michał Górny via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9367b57dadb7: [lldb] [test] Fix qRegisterInfo lldb-server 
tests to handle missing registers (authored by mgorny).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D91922?vs=306871&id=306966#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91922/new/

https://reviews.llvm.org/D91922

Files:
  lldb/test/API/tools/lldb-server/TestLldbGdbServer.py


Index: lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
===
--- lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
+++ lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
@@ -585,9 +585,15 @@
 p_response = context.get("p_response")
 self.assertIsNotNone(p_response)
 
+# Skip erraneous (unsupported) registers.
+# TODO: remove this once we make unsupported registers disappear.
+if p_response.startswith("E") and len(p_response) == 3:
+continue
+
 if "dynamic_size_dwarf_expr_bytes" in reg_info:
 self.updateRegInfoBitsize(reg_info, byte_order)
-self.assertEqual(len(p_response), 2 * int(reg_info["bitsize"]) / 8)
+self.assertEqual(len(p_response), 2 * int(reg_info["bitsize"]) / 8,
+ reg_info)
 
 # Increment loop
 reg_index += 1
@@ -601,7 +607,7 @@
 self.set_inferior_startup_launch()
 self.p_returns_correct_data_size_for_each_qRegisterInfo()
 
-@expectedFailureAll(oslist=["freebsd", "netbsd"])
+@expectedFailureAll(oslist=["netbsd"])
 @llgs_test
 def test_p_returns_correct_data_size_for_each_qRegisterInfo_launch_llgs(
 self):
@@ -619,7 +625,7 @@
 self.set_inferior_startup_attach()
 self.p_returns_correct_data_size_for_each_qRegisterInfo()
 
-@expectedFailureAll(oslist=["freebsd", "netbsd"])
+@expectedFailureAll(oslist=["netbsd"])
 @llgs_test
 def test_p_returns_correct_data_size_for_each_qRegisterInfo_attach_llgs(
 self):


Index: lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
===
--- lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
+++ lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
@@ -585,9 +585,15 @@
 p_response = context.get("p_response")
 self.assertIsNotNone(p_response)
 
+# Skip erraneous (unsupported) registers.
+# TODO: remove this once we make unsupported registers disappear.
+if p_response.startswith("E") and len(p_response) == 3:
+continue
+
 if "dynamic_size_dwarf_expr_bytes" in reg_info:
 self.updateRegInfoBitsize(reg_info, byte_order)
-self.assertEqual(len(p_response), 2 * int(reg_info["bitsize"]) / 8)
+self.assertEqual(len(p_response), 2 * int(reg_info["bitsize"]) / 8,
+ reg_info)
 
 # Increment loop
 reg_index += 1
@@ -601,7 +607,7 @@
 self.set_inferior_startup_launch()
 self.p_returns_correct_data_size_for_each_qRegisterInfo()
 
-@expectedFailureAll(oslist=["freebsd", "netbsd"])
+@expectedFailureAll(oslist=["netbsd"])
 @llgs_test
 def test_p_returns_correct_data_size_for_each_qRegisterInfo_launch_llgs(
 self):
@@ -619,7 +625,7 @@
 self.set_inferior_startup_attach()
 self.p_returns_correct_data_size_for_each_qRegisterInfo()
 
-@expectedFailureAll(oslist=["freebsd", "netbsd"])
+@expectedFailureAll(oslist=["netbsd"])
 @llgs_test
 def test_p_returns_correct_data_size_for_each_qRegisterInfo_attach_llgs(
 self):
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D91923: [lldb] [Process/FreeBSDRemote] Fix regset names and related tests

2020-11-23 Thread Michał Górny via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8018e7b447da: [lldb] [Process/FreeBSDRemote] Fix regset 
names and related tests (authored by mgorny).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D91923?vs=306872&id=306967#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91923/new/

https://reviews.llvm.org/D91923

Files:
  
lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
  lldb/test/API/commands/register/register/register_command/TestRegisters.py
  lldb/test/API/tools/lldb-server/TestLldbGdbServer.py


Index: lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
===
--- lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
+++ lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
@@ -433,7 +433,7 @@
 "Advanced Vector Extensions" in register_sets)
 
 @expectedFailureAll(oslist=["windows"]) # no avx for now.
-@expectedFailureAll(oslist=["freebsd", "netbsd"])
+@expectedFailureAll(oslist=["netbsd"])
 @llgs_test
 def test_qRegisterInfo_contains_avx_registers_llgs(self):
 self.init_llgs_test()
Index: 
lldb/test/API/commands/register/register/register_command/TestRegisters.py
===
--- lldb/test/API/commands/register/register/register_command/TestRegisters.py
+++ lldb/test/API/commands/register/register/register_command/TestRegisters.py
@@ -404,7 +404,12 @@
 for registerSet in registerSets:
 if 'advanced vector extensions' in 
registerSet.GetName().lower():
 has_avx = True
-if 'memory protection extension' in 
registerSet.GetName().lower():
+# FreeBSD/NetBSD reports missing register sets differently
+# at the moment and triggers false positive here.
+# TODO: remove FreeBSD/NetBSD exception when we make 
unsupported
+# register groups correctly disappear.
+if ('memory protection extension' in 
registerSet.GetName().lower()
+and self.getPlatform() not in ["freebsd", "netbsd"]):
 has_mpx = True
 
 if has_avx:
Index: 
lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
===
--- 
lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
+++ 
lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
@@ -215,9 +215,9 @@
 {"Floating Point Registers", "fpu", k_num_fpr_registers_i386,
  g_fpu_regnums_i386},
 {"Debug Registers", "dbr", k_num_dbr_registers_i386, g_dbr_regnums_i386},
-{"Extended AVX registers", "avx", k_num_avx_registers_i386,
+{"Advanced Vector Extensions", "avx", k_num_avx_registers_i386,
  g_avx_regnums_i386},
-{"Extended MPX registers", "mpx", k_num_mpx_registers_i386,
+{"Memory Protection Extensions", "mpx", k_num_mpx_registers_i386,
  g_mpx_regnums_i386},
 };
 
@@ -229,9 +229,9 @@
  g_fpu_regnums_x86_64},
 {"Debug Registers", "dbr", k_num_dbr_registers_x86_64,
  g_dbr_regnums_x86_64},
-{"Extended AVX registers", "avx", k_num_avx_registers_x86_64,
+{"Advanced Vector Extensions", "avx", k_num_avx_registers_x86_64,
  g_avx_regnums_x86_64},
-{"Extended MPX registers", "mpx", k_num_mpx_registers_x86_64,
+{"Memory Protection Extensions", "mpx", k_num_mpx_registers_x86_64,
  g_mpx_regnums_x86_64},
 };
 


Index: lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
===
--- lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
+++ lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
@@ -433,7 +433,7 @@
 "Advanced Vector Extensions" in register_sets)
 
 @expectedFailureAll(oslist=["windows"]) # no avx for now.
-@expectedFailureAll(oslist=["freebsd", "netbsd"])
+@expectedFailureAll(oslist=["netbsd"])
 @llgs_test
 def test_qRegisterInfo_contains_avx_registers_llgs(self):
 self.init_llgs_test()
Index: lldb/test/API/commands/register/register/register_command/TestRegisters.py
===
--- lldb/test/API/commands/register/register/register_command/TestRegisters.py
+++ lldb/test/API/commands/register/register/register_command/TestRegisters.py
@@ -404,7 +404,12 @@
 for registerSet in registerSets:
 if 'advanced vector extensions' in registerSet.GetName().lower():
 has_avx = True
-if 'memory protection extension' in registerSet.GetName().lower():
+# FreeBSD/NetBSD reports missing register sets differently
+# at the moment and triggers false

[Lldb-commits] [PATCH] D91810: [lldb] Prevent 'process connect' from using local-only plugins

2020-11-23 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.

Seems ok. The code could really use a refactor though...




Comment at: lldb/test/Shell/Commands/command-process-connect.test:1
 # UNSUPPORTED: system-windows
 

I'm pretty sure windows suffered from the same problem.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91810/new/

https://reviews.llvm.org/D91810

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


[Lldb-commits] [PATCH] D91810: [lldb] Prevent 'process connect' from using local-only plugins

2020-11-23 Thread Michał Górny via Phabricator via lldb-commits
mgorny marked an inline comment as done.
mgorny added inline comments.



Comment at: lldb/test/Shell/Commands/command-process-connect.test:1
 # UNSUPPORTED: system-windows
 

labath wrote:
> I'm pretty sure windows suffered from the same problem.
Ok, I will remove this and see what buildbots say.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91810/new/

https://reviews.llvm.org/D91810

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


[Lldb-commits] [PATCH] D91847: [lldb] [debugserver] Add stN aliases for stmmN for compatibility

2020-11-23 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Still looks good to me. :) Jason, do you have any concerns?

Unfortunately, we still need a `@skipIfOutOfTreeDebugserver` equivalent


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91847/new/

https://reviews.llvm.org/D91847

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


[Lldb-commits] [lldb] 18e4272 - [lldb] Prevent 'process connect' from using local-only plugins

2020-11-23 Thread Michał Górny via lldb-commits

Author: Michał Górny
Date: 2020-11-23T09:48:55+01:00
New Revision: 18e4272a4fe4667a44f4d323140645a83ddfd864

URL: 
https://github.com/llvm/llvm-project/commit/18e4272a4fe4667a44f4d323140645a83ddfd864
DIFF: 
https://github.com/llvm/llvm-project/commit/18e4272a4fe4667a44f4d323140645a83ddfd864.diff

LOG: [lldb] Prevent 'process connect' from using local-only plugins

Add a 'can_connect' parameter to Process plugin initialization, and use
it to filter plugins to these capable of remote connections.  This is
used to prevent 'process connect' from picking up a plugin that can only
be used locally, e.g. the legacy FreeBSD plugin.

Differential Revision: https://reviews.llvm.org/D91810

Added: 


Modified: 
lldb/include/lldb/Target/Process.h
lldb/include/lldb/Target/ProcessTrace.h
lldb/include/lldb/Target/Target.h
lldb/include/lldb/lldb-private-interfaces.h
lldb/source/API/SBTarget.cpp
lldb/source/Commands/CommandObjectTarget.cpp
lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h
lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
lldb/source/Plugins/Process/elf-core/ProcessElfCore.h
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
lldb/source/Plugins/Process/mach-core/ProcessMachCore.h
lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
lldb/source/Plugins/Process/minidump/ProcessMinidump.h
lldb/source/Target/Platform.cpp
lldb/source/Target/Process.cpp
lldb/source/Target/ProcessTrace.cpp
lldb/source/Target/Target.cpp
lldb/source/Target/TraceSessionFileParser.cpp
lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
lldb/test/Shell/Commands/command-process-connect.test

Removed: 




diff  --git a/lldb/include/lldb/Target/Process.h 
b/lldb/include/lldb/Target/Process.h
index 7f1e1e8765568..744deab276c49 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -537,7 +537,8 @@ class Process : public 
std::enable_shared_from_this,
   static lldb::ProcessSP FindPlugin(lldb::TargetSP target_sp,
 llvm::StringRef plugin_name,
 lldb::ListenerSP listener_sp,
-const FileSpec *crash_file_path);
+const FileSpec *crash_file_path,
+bool can_connect);
 
   /// Static function that can be used with the \b host function
   /// Host::StartMonitoringChildProcess ().

diff  --git a/lldb/include/lldb/Target/ProcessTrace.h 
b/lldb/include/lldb/Target/ProcessTrace.h
index f947fbe8cdb42..53b3e704c17b0 100644
--- a/lldb/include/lldb/Target/ProcessTrace.h
+++ b/lldb/include/lldb/Target/ProcessTrace.h
@@ -77,7 +77,8 @@ class ProcessTrace : public PostMortemProcess {
 private:
   static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp,
 lldb::ListenerSP listener_sp,
-const FileSpec *crash_file_path);
+const FileSpec *crash_file_path,
+bool can_connect);
 };
 
 } // namespace lldb_private

diff  --git a/lldb/include/lldb/Target/Target.h 
b/lldb/include/lldb/Target/Target.h
index f77917a8812f7..47568c9e44299 100644
--- a/lldb/include/lldb/Target/Target.h
+++ b/lldb/include/lldb/Target/Target.h
@@ -573,7 +573,8 @@ class Target : public std::enable_shared_from_this,
   // used.
   const lldb::ProcessSP &CreateProcess(lldb::ListenerSP listener_sp,
llvm::StringRef plugin_name,
-   const FileSpec *crash_file);
+   const FileSpec *crash_file,
+   bool can_connect);
 
   const lldb::ProcessSP &GetProcessSP() const;
 

diff  --git a/lldb/include/lldb/lldb-private-interfaces.h 
b/lldb/include/lldb/lldb-private-interfaces.h
index 1a4eaba7cc5e7..df33f8af0e142 100644
--- a/lldb/include/lldb/lldb-private-interfaces.h
+++ b/lldb/include/lldb/lldb-private-interfaces.h
@@ -76,7 +76,7 @@ typedef lldb::PlatformSP (*PlatformCreateInstance)(bool force,
const ArchSpec *arch);
 t

[Lldb-commits] [PATCH] D91810: [lldb] Prevent 'process connect' from using local-only plugins

2020-11-23 Thread Michał Górny via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
mgorny marked an inline comment as done.
Closed by commit rG18e4272a4fe4: [lldb] Prevent 'process connect' 
from using local-only plugins (authored by mgorny).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D91810?vs=306699&id=306973#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91810/new/

https://reviews.llvm.org/D91810

Files:
  lldb/include/lldb/Target/Process.h
  lldb/include/lldb/Target/ProcessTrace.h
  lldb/include/lldb/Target/Target.h
  lldb/include/lldb/lldb-private-interfaces.h
  lldb/source/API/SBTarget.cpp
  lldb/source/Commands/CommandObjectTarget.cpp
  lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
  lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
  lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
  lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
  lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
  lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
  lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
  lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h
  lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
  lldb/source/Plugins/Process/elf-core/ProcessElfCore.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
  lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
  lldb/source/Plugins/Process/mach-core/ProcessMachCore.h
  lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
  lldb/source/Plugins/Process/minidump/ProcessMinidump.h
  lldb/source/Target/Platform.cpp
  lldb/source/Target/Process.cpp
  lldb/source/Target/ProcessTrace.cpp
  lldb/source/Target/Target.cpp
  lldb/source/Target/TraceSessionFileParser.cpp
  lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
  lldb/test/Shell/Commands/command-process-connect.test

Index: lldb/test/Shell/Commands/command-process-connect.test
===
--- lldb/test/Shell/Commands/command-process-connect.test
+++ lldb/test/Shell/Commands/command-process-connect.test
@@ -1,6 +1,3 @@
-# UNSUPPORTED: system-windows
-# XFAIL: system-freebsd
-
 # Synchronous
 # RUN: %lldb -o 'platform select remote-gdb-server' -o 'process connect connect://localhost:4321' 2>&1 | FileCheck %s
 
Index: lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
===
--- lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
+++ lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
@@ -11,7 +11,6 @@
 
 NO_DEBUG_INFO_TESTCASE = True
 
-@skipIfWindows
 def test_gdb_remote_sync(self):
 """Test the gdb-remote command in synchronous mode"""
 try:
@@ -21,7 +20,6 @@
 finally:
 self.dbg.GetSelectedPlatform().DisconnectRemote()
 
-@skipIfWindows
 @skipIfReproducer # Reproducer don't support async.
 def test_gdb_remote_async(self):
 """Test the gdb-remote command in asynchronous mode"""
@@ -35,8 +33,6 @@
 finally:
 self.dbg.GetSelectedPlatform().DisconnectRemote()
 
-@skipIfWindows
-@expectedFailureAll(oslist=["freebsd"])
 def test_process_connect_sync(self):
 """Test the gdb-remote command in synchronous mode"""
 try:
@@ -47,8 +43,6 @@
 finally:
 self.dbg.GetSelectedPlatform().DisconnectRemote()
 
-@skipIfWindows
-@expectedFailureAll(oslist=["freebsd"])
 @skipIfReproducer # Reproducer don't support async.
 def test_process_connect_async(self):
 """Test the gdb-remote command in asynchronous mode"""
Index: lldb/source/Target/TraceSessionFileParser.cpp
===
--- lldb/source/Target/TraceSessionFileParser.cpp
+++ lldb/source/Target/TraceSessionFileParser.cpp
@@ -127,7 +127,8 @@
 
   ProcessSP process_sp = target_sp->CreateProcess(
   /*listener*/ nullptr, "trace",
-  /*crash_file*/ nullptr);
+  /*crash_file*/ nullptr,
+  /*can_connect*/ false);
 
   process_sp->SetID(static_cast(process.pid));
 
Index: lldb/source/Target/Target.cpp
===
--- lldb/source/Target/Target.cpp
+++ lldb/source/Target/Target.cpp
@@ -199,12 +199,13 @@
 
 const lldb::ProcessSP &Target::CreateProcess(ListenerSP listener_sp,
  llvm::StringRef plugin_name,
- const FileSpec *crash_file) {
+ const FileSpec *crash_file,
+ bool can_connect) {
   if (!listener_sp)
 listener_sp = GetDebugger().GetListener();
   D

[Lldb-commits] [PATCH] D91847: [lldb] [debugserver] Add stN aliases for stmmN for compatibility

2020-11-23 Thread Michał Górny via Phabricator via lldb-commits
mgorny updated this revision to Diff 306986.
mgorny added a comment.

Rebase and fix TestRegisters.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91847/new/

https://reviews.llvm.org/D91847

Files:
  lldb/test/API/commands/register/register/register_command/TestRegisters.py
  lldb/test/Shell/Register/x86-multithread-write.test
  lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
  lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp

Index: lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
===
--- lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
+++ lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
@@ -1767,28 +1767,28 @@
  FPU_SIZE_UINT(mxcsrmask), FPU_OFFSET(mxcsrmask), -1U, -1U, -1U, -1U, NULL,
  NULL},
 
-{e_regSetFPU, fpu_stmm0, "stmm0", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm0, "stmm0", "st0", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm0), FPU_OFFSET(stmm0), ehframe_dwarf_stmm0,
  ehframe_dwarf_stmm0, -1U, debugserver_stmm0, NULL, NULL},
-{e_regSetFPU, fpu_stmm1, "stmm1", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm1, "stmm1", "st1", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm1), FPU_OFFSET(stmm1), ehframe_dwarf_stmm1,
  ehframe_dwarf_stmm1, -1U, debugserver_stmm1, NULL, NULL},
-{e_regSetFPU, fpu_stmm2, "stmm2", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm2, "stmm2", "st2", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm2), FPU_OFFSET(stmm2), ehframe_dwarf_stmm2,
  ehframe_dwarf_stmm2, -1U, debugserver_stmm2, NULL, NULL},
-{e_regSetFPU, fpu_stmm3, "stmm3", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm3, "stmm3", "st3", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm3), FPU_OFFSET(stmm3), ehframe_dwarf_stmm3,
  ehframe_dwarf_stmm3, -1U, debugserver_stmm3, NULL, NULL},
-{e_regSetFPU, fpu_stmm4, "stmm4", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm4, "stmm4", "st4", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm4), FPU_OFFSET(stmm4), ehframe_dwarf_stmm4,
  ehframe_dwarf_stmm4, -1U, debugserver_stmm4, NULL, NULL},
-{e_regSetFPU, fpu_stmm5, "stmm5", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm5, "stmm5", "st5", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm5), FPU_OFFSET(stmm5), ehframe_dwarf_stmm5,
  ehframe_dwarf_stmm5, -1U, debugserver_stmm5, NULL, NULL},
-{e_regSetFPU, fpu_stmm6, "stmm6", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm6, "stmm6", "st6", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm6), FPU_OFFSET(stmm6), ehframe_dwarf_stmm6,
  ehframe_dwarf_stmm6, -1U, debugserver_stmm6, NULL, NULL},
-{e_regSetFPU, fpu_stmm7, "stmm7", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm7, "stmm7", "st7", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm7), FPU_OFFSET(stmm7), ehframe_dwarf_stmm7,
  ehframe_dwarf_stmm7, -1U, debugserver_stmm7, NULL, NULL},
 
@@ -1882,28 +1882,28 @@
  FPU_SIZE_UINT(mxcsrmask), AVX_OFFSET(mxcsrmask), -1U, -1U, -1U, -1U, NULL,
  NULL},
 
-{e_regSetFPU, fpu_stmm0, "stmm0", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm0, "stmm0", "st0", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm0), AVX_OFFSET(stmm0), ehframe_dwarf_stmm0,
  ehframe_dwarf_stmm0, -1U, debugserver_stmm0, NULL, NULL},
-{e_regSetFPU, fpu_stmm1, "stmm1", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm1, "stmm1", "st1", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm1), AVX_OFFSET(stmm1), ehframe_dwarf_stmm1,
  ehframe_dwarf_stmm1, -1U, debugserver_stmm1, NULL, NULL},
-{e_regSetFPU, fpu_stmm2, "stmm2", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm2, "stmm2", "st2", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm2), AVX_OFFSET(stmm2), ehframe_dwarf_stmm2,
  ehframe_dwarf_stmm2, -1U, debugserver_stmm2, NULL, NULL},
-{e_regSetFPU, fpu_stmm3, "stmm3", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm3, "stmm3", "st3", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm3), AVX_OFFSET(stmm3), ehframe_dwarf_stmm3,
  ehframe_dwarf_stmm3, -1U, debugserver_stmm3, NULL, NULL},
-{e_regSetFPU, fpu_stmm4, "stmm4", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm4, "stmm4", "st4", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm4), AVX_OFFSET(stmm4), ehframe_dwarf_stmm4,
  ehframe_dwarf_stmm4, -1U, debugserver_stmm4, NULL, NULL},
-{e_regSetFPU, fpu_stmm5, "stmm5", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm5, "stmm5", "st5", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm5), AVX_OFFSET(stmm5), ehframe_dwarf_stmm5,
  ehframe_dwarf_stmm5, -1U, debugserver_stmm5, NULL, NULL},
-{e_regSetFPU, fpu_stmm6, "stmm6", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm6, "stmm6", "st6", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm6), AVX_OFFSET(stmm6), ehframe_dwarf_stmm6,
  ehframe_dwarf_stmm6, -1U, d

[Lldb-commits] [PATCH] D91847: [lldb] [debugserver] Add stN aliases for stmmN for compatibility

2020-11-23 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment.

In D91847#2410564 , @labath wrote:

> Still looks good to me. :) Jason, do you have any concerns?
>
> Unfortunately, we still need a `@skipIfOutOfTreeDebugserver` equivalent

Long term, probably yes. Short term, the tests are broken again because of 
`ftag` changes, so I think we can get away without it.

That said, I need to test this more. I'll also try running tests with 
out-of-tree debugserver to see if anything else fails.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91847/new/

https://reviews.llvm.org/D91847

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


[Lldb-commits] [PATCH] D91847: [lldb] [debugserver] Add stN aliases for stmmN for compatibility

2020-11-23 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added a comment.

I would mark stmmX as an alias to stX and keep stX as the default for all 
platforms. stmmX could be an alias for everybody for legacy reasons.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91847/new/

https://reviews.llvm.org/D91847

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


[Lldb-commits] [PATCH] D91847: [lldb] [debugserver] Add stN aliases for stmmN for compatibility

2020-11-23 Thread Michał Górny via Phabricator via lldb-commits
mgorny updated this revision to Diff 307021.
mgorny added a comment.

Added `system-debugserver` feature to skip tests.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91847/new/

https://reviews.llvm.org/D91847

Files:
  lldb/test/API/commands/register/register/register_command/TestRegisters.py
  lldb/test/CMakeLists.txt
  lldb/test/Shell/Register/x86-multithread-write.test
  lldb/test/Shell/lit.cfg.py
  lldb/test/Shell/lit.site.cfg.py.in
  lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
  lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp

Index: lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
===
--- lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
+++ lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
@@ -1767,28 +1767,28 @@
  FPU_SIZE_UINT(mxcsrmask), FPU_OFFSET(mxcsrmask), -1U, -1U, -1U, -1U, NULL,
  NULL},
 
-{e_regSetFPU, fpu_stmm0, "stmm0", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm0, "stmm0", "st0", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm0), FPU_OFFSET(stmm0), ehframe_dwarf_stmm0,
  ehframe_dwarf_stmm0, -1U, debugserver_stmm0, NULL, NULL},
-{e_regSetFPU, fpu_stmm1, "stmm1", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm1, "stmm1", "st1", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm1), FPU_OFFSET(stmm1), ehframe_dwarf_stmm1,
  ehframe_dwarf_stmm1, -1U, debugserver_stmm1, NULL, NULL},
-{e_regSetFPU, fpu_stmm2, "stmm2", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm2, "stmm2", "st2", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm2), FPU_OFFSET(stmm2), ehframe_dwarf_stmm2,
  ehframe_dwarf_stmm2, -1U, debugserver_stmm2, NULL, NULL},
-{e_regSetFPU, fpu_stmm3, "stmm3", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm3, "stmm3", "st3", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm3), FPU_OFFSET(stmm3), ehframe_dwarf_stmm3,
  ehframe_dwarf_stmm3, -1U, debugserver_stmm3, NULL, NULL},
-{e_regSetFPU, fpu_stmm4, "stmm4", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm4, "stmm4", "st4", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm4), FPU_OFFSET(stmm4), ehframe_dwarf_stmm4,
  ehframe_dwarf_stmm4, -1U, debugserver_stmm4, NULL, NULL},
-{e_regSetFPU, fpu_stmm5, "stmm5", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm5, "stmm5", "st5", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm5), FPU_OFFSET(stmm5), ehframe_dwarf_stmm5,
  ehframe_dwarf_stmm5, -1U, debugserver_stmm5, NULL, NULL},
-{e_regSetFPU, fpu_stmm6, "stmm6", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm6, "stmm6", "st6", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm6), FPU_OFFSET(stmm6), ehframe_dwarf_stmm6,
  ehframe_dwarf_stmm6, -1U, debugserver_stmm6, NULL, NULL},
-{e_regSetFPU, fpu_stmm7, "stmm7", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm7, "stmm7", "st7", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm7), FPU_OFFSET(stmm7), ehframe_dwarf_stmm7,
  ehframe_dwarf_stmm7, -1U, debugserver_stmm7, NULL, NULL},
 
@@ -1882,28 +1882,28 @@
  FPU_SIZE_UINT(mxcsrmask), AVX_OFFSET(mxcsrmask), -1U, -1U, -1U, -1U, NULL,
  NULL},
 
-{e_regSetFPU, fpu_stmm0, "stmm0", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm0, "stmm0", "st0", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm0), AVX_OFFSET(stmm0), ehframe_dwarf_stmm0,
  ehframe_dwarf_stmm0, -1U, debugserver_stmm0, NULL, NULL},
-{e_regSetFPU, fpu_stmm1, "stmm1", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm1, "stmm1", "st1", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm1), AVX_OFFSET(stmm1), ehframe_dwarf_stmm1,
  ehframe_dwarf_stmm1, -1U, debugserver_stmm1, NULL, NULL},
-{e_regSetFPU, fpu_stmm2, "stmm2", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm2, "stmm2", "st2", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm2), AVX_OFFSET(stmm2), ehframe_dwarf_stmm2,
  ehframe_dwarf_stmm2, -1U, debugserver_stmm2, NULL, NULL},
-{e_regSetFPU, fpu_stmm3, "stmm3", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm3, "stmm3", "st3", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm3), AVX_OFFSET(stmm3), ehframe_dwarf_stmm3,
  ehframe_dwarf_stmm3, -1U, debugserver_stmm3, NULL, NULL},
-{e_regSetFPU, fpu_stmm4, "stmm4", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm4, "stmm4", "st4", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm4), AVX_OFFSET(stmm4), ehframe_dwarf_stmm4,
  ehframe_dwarf_stmm4, -1U, debugserver_stmm4, NULL, NULL},
-{e_regSetFPU, fpu_stmm5, "stmm5", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm5, "stmm5", "st5", Vector, VectorOfUInt8,
  FPU_SIZE_MMST(stmm5), AVX_OFFSET(stmm5), ehframe_dwarf_stmm5,
  ehframe_dwarf_stmm5, -1U, debugserver_stmm5, NULL, NULL},
-{e_regSetFPU, fpu_stmm6, "stmm6", NULL, Vector, VectorOfUInt8,
+{e_regSetFPU, fpu_stmm6, "stmm6", "st6", Vector, Vec

Re: [Lldb-commits] [lldb] 6c0cd56 - [lldb] Make `process connect` behave the same in sync and async mode.

2020-11-23 Thread Pavel Labath via lldb-commits

On 14/11/2020 02:39, Jonas Devlieghere via lldb-commits wrote:

+# RUN: echo -e 'platform select remote-gdb-server\nprocess connect 
connect://localhost:4321' | %lldb 2>&1 | FileCheck %s
+
+# CHECK: Platform: remote-gdb-server
+# CHECK: Connected: no
+# CHECK: error: Failed to connect port


This is a bad test. You can't assume that the host machine will not have 
port 4321 open. If it does, for some reason, the test will fail. 
Moreover, if that port happens to belong to some other test (not likely, 
as we normally use higher port numbers, but possible), the spurious 
connection cause *that* test to fail as well...


(We've observed flakyness in this test internally. While I don't have 
conclusive proof that this is the cause, it's a pretty good bet that it is.)


The right way to handle this would be to first claim a port, and then 
have lldb server connect to that port. (most likely requires writing the 
test in python.)


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


[Lldb-commits] [lldb] a8f6f4e - [lldb] [test] Restore Windows-skip on 'process connect' tests

2020-11-23 Thread Michał Górny via lldb-commits

Author: Michał Górny
Date: 2020-11-23T14:27:32+01:00
New Revision: a8f6f4e8733cd601246ddc3e391cd82236231846

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

LOG: [lldb] [test] Restore Windows-skip on 'process connect' tests

Added: 


Modified: 
lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
lldb/test/Shell/Commands/command-process-connect.test

Removed: 




diff  --git 
a/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py 
b/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
index e9152f02a15e..c2d06ad5d67e 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
@@ -33,6 +33,7 @@ def test_gdb_remote_async(self):
 finally:
 self.dbg.GetSelectedPlatform().DisconnectRemote()
 
+@skipIfWindows
 def test_process_connect_sync(self):
 """Test the gdb-remote command in synchronous mode"""
 try:
@@ -43,6 +44,7 @@ def test_process_connect_sync(self):
 finally:
 self.dbg.GetSelectedPlatform().DisconnectRemote()
 
+@skipIfWindows
 @skipIfReproducer # Reproducer don't support async.
 def test_process_connect_async(self):
 """Test the gdb-remote command in asynchronous mode"""

diff  --git a/lldb/test/Shell/Commands/command-process-connect.test 
b/lldb/test/Shell/Commands/command-process-connect.test
index c4761360d541..30782243d4ed 100644
--- a/lldb/test/Shell/Commands/command-process-connect.test
+++ b/lldb/test/Shell/Commands/command-process-connect.test
@@ -1,3 +1,5 @@
+# UNSUPPORTED: system-windows
+
 # Synchronous
 # RUN: %lldb -o 'platform select remote-gdb-server' -o 'process connect 
connect://localhost:4321' 2>&1 | FileCheck %s
 



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


[Lldb-commits] [PATCH] D91963: [lldb] [test/Register] Initial tests for regsets in core dumps [WIP]

2020-11-23 Thread Michał Górny via Phabricator via lldb-commits
mgorny created this revision.
mgorny added reviewers: labath, krytarowski, emaste.
Herald added a subscriber: arichardson.
mgorny requested review of this revision.

Add initial tests for reading register sets from core dumps.  This
includes a C++ program to write registers and dump core, resulting core
dumps for Linux, FreeBSD and NetBSD, and the tests to verify them.

The tests are split into generic part, verifying user-specified register
values, and coredump-specific tests that verify memory addresses that
differ for every dump.

At this moment, all platforms support GPRs and FPRs up to XMM for amd64
target.  The i386 target does not work on NetBSD at all, and is missing
FPRs entirely on FreeBSD.

This is a work-in-progress PR.  TODO:

1. Verifying core dumps against 32-bit kernel (there are made with -m32 
currently).

2. Reduce the size of FreeBSD core dumps (can we use compression here?).


https://reviews.llvm.org/D91963

Files:
  lldb/test/Shell/Register/Core/Inputs/x86-32-freebsd.core
  lldb/test/Shell/Register/Core/Inputs/x86-32-gp.check
  lldb/test/Shell/Register/Core/Inputs/x86-32-linux.core
  lldb/test/Shell/Register/Core/Inputs/x86-32-netbsd.core
  lldb/test/Shell/Register/Core/Inputs/x86-64-freebsd.core
  lldb/test/Shell/Register/Core/Inputs/x86-64-gp-hixmm.check
  lldb/test/Shell/Register/Core/Inputs/x86-64-linux.core
  lldb/test/Shell/Register/Core/Inputs/x86-64-netbsd.core
  lldb/test/Shell/Register/Core/Inputs/x86-core-dump.cpp
  lldb/test/Shell/Register/Core/Inputs/x86-fp.check
  lldb/test/Shell/Register/Core/x86-32-freebsd-addr.test
  lldb/test/Shell/Register/Core/x86-32-freebsd-gp.test
  lldb/test/Shell/Register/Core/x86-32-linux-addr.test
  lldb/test/Shell/Register/Core/x86-32-linux-fp.test
  lldb/test/Shell/Register/Core/x86-32-linux-gp.test
  lldb/test/Shell/Register/Core/x86-64-freebsd-addr.test
  lldb/test/Shell/Register/Core/x86-64-freebsd-fp.test
  lldb/test/Shell/Register/Core/x86-64-freebsd-gp.test
  lldb/test/Shell/Register/Core/x86-64-linux-addr.test
  lldb/test/Shell/Register/Core/x86-64-linux-fp.test
  lldb/test/Shell/Register/Core/x86-64-linux-gp.test
  lldb/test/Shell/Register/Core/x86-64-netbsd-addr.test
  lldb/test/Shell/Register/Core/x86-64-netbsd-fp.test
  lldb/test/Shell/Register/Core/x86-64-netbsd-gp.test

Index: lldb/test/Shell/Register/Core/x86-64-netbsd-gp.test
===
--- /dev/null
+++ lldb/test/Shell/Register/Core/x86-64-netbsd-gp.test
@@ -0,0 +1,3 @@
+# RUN: %lldb -b -s %s -c %p/Inputs/x86-64-netbsd.core | FileCheck %p/Inputs/x86-64-gp-hixmm.check
+
+register read --all
Index: lldb/test/Shell/Register/Core/x86-64-netbsd-fp.test
===
--- /dev/null
+++ lldb/test/Shell/Register/Core/x86-64-netbsd-fp.test
@@ -0,0 +1,3 @@
+# RUN: %lldb -b -s %s -c %p/Inputs/x86-64-netbsd.core | FileCheck %p/Inputs/x86-fp.check
+
+register read --all
Index: lldb/test/Shell/Register/Core/x86-64-netbsd-addr.test
===
--- /dev/null
+++ lldb/test/Shell/Register/Core/x86-64-netbsd-addr.test
@@ -0,0 +1,18 @@
+# RUN: %lldb -b -s %s -c %p/Inputs/x86-64-netbsd.core | FileCheck %s
+
+register read --all
+# CHECK-DAG: rip = 0x00400c47
+# CHECK-DAG: rflags = 0x00010212
+# CHECK-DAG: cs = 0x0047
+# CHECK-DAG: fs = 0x
+# CHECK-DAG: gs = 0x
+# CHECK-DAG: ss = 0x003f
+# CHECK-DAG: ds = 0x0023
+# CHECK-DAG: es = 0x0023
+
+# CHECK-DAG: fiseg = 0x
+# CHECK-DAG: fioff = 0x00400c06
+# CHECK-DAG: fip = 0x00400c06
+# CHECK-DAG: foseg = 0x
+# CHECK-DAG: fooff = 0xfff93078
+# CHECK-DAG: fdp = 0xfff93078
Index: lldb/test/Shell/Register/Core/x86-64-linux-gp.test
===
--- /dev/null
+++ lldb/test/Shell/Register/Core/x86-64-linux-gp.test
@@ -0,0 +1,3 @@
+# RUN: %lldb -b -s %s -c %p/Inputs/x86-64-linux.core | FileCheck %p/Inputs/x86-64-gp-hixmm.check
+
+register read --all
Index: lldb/test/Shell/Register/Core/x86-64-linux-fp.test
===
--- /dev/null
+++ lldb/test/Shell/Register/Core/x86-64-linux-fp.test
@@ -0,0 +1,3 @@
+# RUN: %lldb -b -s %s -c %p/Inputs/x86-64-linux.core | FileCheck %p/Inputs/x86-fp.check
+
+register read --all
Index: lldb/test/Shell/Register/Core/x86-64-linux-addr.test
===
--- /dev/null
+++ lldb/test/Shell/Register/Core/x86-64-linux-addr.test
@@ -0,0 +1,18 @@
+# RUN: %lldb -b -s %s -c %p/Inputs/x86-64-linux.core | FileCheck %s
+
+register read --all
+# CHECK-DAG: rip = 0x004012db
+# CHECK-DAG: rflags = 0x00010246
+# CHECK-DAG: cs = 0x0033
+# CHECK-DAG: fs = 0x
+# CHECK-DAG: gs = 0x
+# CHECK-DAG: ss = 0x002b
+# CHECK-DAG: ds = 0

Re: [Lldb-commits] [lldb] 6c0cd56 - [lldb] Make `process connect` behave the same in sync and async mode.

2020-11-23 Thread Jonas Devlieghere via lldb-commits
I'm OOO this week but I've deleted the test until I can write a better one
next week.

On Mon, Nov 23, 2020 at 5:21 AM Pavel Labath  wrote:

> On 14/11/2020 02:39, Jonas Devlieghere via lldb-commits wrote:
> > +# RUN: echo -e 'platform select remote-gdb-server\nprocess connect
> connect://localhost:4321' | %lldb 2>&1 | FileCheck %s
> > +
> > +# CHECK: Platform: remote-gdb-server
> > +# CHECK: Connected: no
> > +# CHECK: error: Failed to connect port
>
> This is a bad test. You can't assume that the host machine will not have
> port 4321 open. If it does, for some reason, the test will fail.
> Moreover, if that port happens to belong to some other test (not likely,
> as we normally use higher port numbers, but possible), the spurious
> connection cause *that* test to fail as well...
>
> (We've observed flakyness in this test internally. While I don't have
> conclusive proof that this is the cause, it's a pretty good bet that it
> is.)
>
> The right way to handle this would be to first claim a port, and then
> have lldb server connect to that port. (most likely requires writing the
> test in python.)
>
> pl
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 5b8e4a1 - [lldb/test] Remove flaky `process connect` test.

2020-11-23 Thread Jordan Rupprecht via lldb-commits

Author: Jordan Rupprecht
Date: 2020-11-23T12:49:50-08:00
New Revision: 5b8e4a11029ff169fdac7caa3c7aa211f318adf6

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

LOG: [lldb/test] Remove flaky `process connect` test.

This test is flaky because it assumes port 4321 is not already open on a 
machine.

Added: 


Modified: 


Removed: 
lldb/test/Shell/Commands/command-process-connect.test



diff  --git a/lldb/test/Shell/Commands/command-process-connect.test 
b/lldb/test/Shell/Commands/command-process-connect.test
deleted file mode 100644
index 30782243d4ed..
--- a/lldb/test/Shell/Commands/command-process-connect.test
+++ /dev/null
@@ -1,11 +0,0 @@
-# UNSUPPORTED: system-windows
-
-# Synchronous
-# RUN: %lldb -o 'platform select remote-gdb-server' -o 'process connect 
connect://localhost:4321' 2>&1 | FileCheck %s
-
-# Asynchronous
-# RUN: echo -e 'platform select remote-gdb-server\nprocess connect 
connect://localhost:4321' | %lldb 2>&1 | FileCheck %s
-
-# CHECK: Platform: remote-gdb-server
-# CHECK: Connected: no
-# CHECK: error: Failed to connect port



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


Re: [Lldb-commits] [lldb] 6c0cd56 - [lldb] Make `process connect` behave the same in sync and async mode.

2020-11-23 Thread Jordan Rupprecht via lldb-commits
I didn't see the test deleted upstream (perhaps you forgot to run `git
push`?) so I removed it in 5b8e4a11029ff169fdac7caa3c7aa211f318adf6.

On Mon, Nov 23, 2020 at 10:51 AM Jonas Devlieghere 
wrote:

> I'm OOO this week but I've deleted the test until I can write a better one
> next week.
>
> On Mon, Nov 23, 2020 at 5:21 AM Pavel Labath  wrote:
>
>> On 14/11/2020 02:39, Jonas Devlieghere via lldb-commits wrote:
>> > +# RUN: echo -e 'platform select remote-gdb-server\nprocess connect
>> connect://localhost:4321' | %lldb 2>&1 | FileCheck %s
>> > +
>> > +# CHECK: Platform: remote-gdb-server
>> > +# CHECK: Connected: no
>> > +# CHECK: error: Failed to connect port
>>
>> This is a bad test. You can't assume that the host machine will not have
>> port 4321 open. If it does, for some reason, the test will fail.
>> Moreover, if that port happens to belong to some other test (not likely,
>> as we normally use higher port numbers, but possible), the spurious
>> connection cause *that* test to fail as well...
>>
>> (We've observed flakyness in this test internally. While I don't have
>> conclusive proof that this is the cause, it's a pretty good bet that it
>> is.)
>>
>> The right way to handle this would be to first claim a port, and then
>> have lldb server connect to that port. (most likely requires writing the
>> test in python.)
>>
>> pl
>>
>


smime.p7s
Description: S/MIME Cryptographic Signature
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D91508: [LLDB/Lua] add support for one-liner breakpoint callback

2020-11-23 Thread Pedro Tammela via Phabricator via lldb-commits
tammela updated this revision to Diff 307202.
tammela added a comment.

Redesign of the API


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91508/new/

https://reviews.llvm.org/D91508

Files:
  lldb/bindings/lua/lua-swigsafecast.swig
  lldb/bindings/lua/lua-wrapper.swig
  lldb/bindings/lua/lua.swig
  lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp
  lldb/source/Plugins/ScriptInterpreter/Lua/Lua.h
  lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
  lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
  lldb/test/Shell/ScriptInterpreter/Lua/breakpoint_oneline_callback.test
  lldb/unittests/ScriptInterpreter/Lua/LuaTests.cpp

Index: lldb/unittests/ScriptInterpreter/Lua/LuaTests.cpp
===
--- lldb/unittests/ScriptInterpreter/Lua/LuaTests.cpp
+++ lldb/unittests/ScriptInterpreter/Lua/LuaTests.cpp
@@ -13,6 +13,30 @@
 
 extern "C" int luaopen_lldb(lua_State *L) { return 0; }
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
+
+// Disable warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has
+// C-linkage specified, but returns UDT 'llvm::Expected' which is
+// incompatible with C
+#if _MSC_VER
+#pragma warning (push)
+#pragma warning (disable : 4190)
+#endif
+
+extern "C" llvm::Expected
+LLDBSwigLuaBreakpointCallbackFunction(lua_State *L, void *baton,
+  lldb::StackFrameSP &stop_frame_sp,
+  lldb::BreakpointLocationSP &bp_loc_sp) {
+  return false;
+}
+
+#if _MSC_VER
+#pragma warning (pop)
+#endif
+
+#pragma clang diagnostic pop
+
 TEST(LuaTest, RunValid) {
   Lua lua;
   llvm::Error error = lua.Run("foo = 1");
Index: lldb/test/Shell/ScriptInterpreter/Lua/breakpoint_oneline_callback.test
===
--- /dev/null
+++ lldb/test/Shell/ScriptInterpreter/Lua/breakpoint_oneline_callback.test
@@ -0,0 +1,7 @@
+# REQUIRES: lua
+# RUN: echo "int main() { return 0; }" | %clang_host -x c - -o %t
+# RUN: %lldb -s %s --script-language lua %t 2>&1 | FileCheck %s
+b main
+breakpoint command add -s lua -o 'print(frame)'
+run
+# CHECK: frame #0
Index: lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
===
--- lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
+++ lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
@@ -10,11 +10,20 @@
 #define liblldb_ScriptInterpreterLua_h_
 
 #include "lldb/Interpreter/ScriptInterpreter.h"
+#include "lldb/Utility/Status.h"
+#include "lldb/lldb-enumerations.h"
 
 namespace lldb_private {
 class Lua;
 class ScriptInterpreterLua : public ScriptInterpreter {
 public:
+  class CommandDataLua : public BreakpointOptions::CommandData {
+  public:
+CommandDataLua() : BreakpointOptions::CommandData() {
+  interpreter = lldb::eScriptLanguageLua;
+}
+  };
+
   ScriptInterpreterLua(Debugger &debugger);
 
   ~ScriptInterpreterLua() override;
@@ -41,6 +50,11 @@
 
   static const char *GetPluginDescriptionStatic();
 
+  static bool BreakpointCallbackFunction(void *baton,
+ StoppointCallbackContext *context,
+ lldb::user_id_t break_id,
+ lldb::user_id_t break_loc_id);
+
   // PluginInterface protocol
   lldb_private::ConstString GetPluginName() override;
 
@@ -51,6 +65,9 @@
   llvm::Error EnterSession(lldb::user_id_t debugger_id);
   llvm::Error LeaveSession();
 
+  Status SetBreakpointCommandCallback(BreakpointOptions *bp_options,
+  const char *command_body_text) override;
+
 private:
   std::unique_ptr m_lua;
   bool m_session_is_active = false;
Index: lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
===
--- lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
+++ lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
@@ -8,14 +8,17 @@
 
 #include "ScriptInterpreterLua.h"
 #include "Lua.h"
+#include "lldb/Breakpoint/StoppointCallbackContext.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/StreamFile.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Target/ExecutionContext.h"
 #include "lldb/Utility/Stream.h"
 #include "lldb/Utility/StringList.h"
 #include "lldb/Utility/Timer.h"
 #include "llvm/Support/FormatAdapters.h"
+#include 
 
 using namespace lldb;
 using namespace lldb_private;
@@ -174,6 +177,49 @@
   return m_lua->Run(str);
 }
 
+bool ScriptInterpreterLua::BreakpointCallbackFunction(
+void *baton, StoppointCallbackContext *context, user_id_t break_id,
+user_id_t break_loc_id) {
+  assert(context);
+
+  ExecutionContext exe_ctx(context->exe_c

[Lldb-commits] [PATCH] D91508: [LLDB/Lua] add support for one-liner breakpoint callback

2020-11-23 Thread Pedro Tammela via Phabricator via lldb-commits
tammela added a comment.

> I'm not sure what you mean by that. Can you elaborate?

Sure, it's was just a nod to your previous comment about that running callbacks 
(C++ lambdas) inside a `pcall` is a dangerous API. Although possible, it 
requires that the developer be very cautious about implicit throws.

> The way I see it, the problem is not about which environment is the c++ code 
> running in, as it can't throw an exception (in llvm). The problem is what 
> happens when we call lua from c++, and the lua code throws. And this is a 
> problem regardless of the environment the C(++) code is in -- the difference 
> is "only" in whether lua will panic or jump over the C code, but something 
> bad will happen anyway.

I agree 100% with your analysis of the problem.

> I think that could be solved by ensuring we always call lua in a protected 
> environment. That way lua will never unwind through the C code (regardless of 
> what environment it is in) because it would always stop right at the boundary.
>
> That would essentially mean, lua_call is banned (except maybe as an 
> optimization, if you can be sure that the code you're about to call will not 
> throw), and all C->lua transitions should go through lua_pcall. And we can 
> provide a wrapper that handles catches those errors and converts them to 
> llvm::Error/Expected, similar to how the python things do it.

I have posted a redesign based on your comments. The `lua_push*` functions are 
all safe-ish. The Lua implementation guarantees at least 20 stack slots when 
the `lua_State` is created so I've added the stack checks for sanity rather 
than necessity.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91508/new/

https://reviews.llvm.org/D91508

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


[Lldb-commits] [lldb] b20f3cc - [lldb] Add platform select to TestProcessConnect.py

2020-11-23 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-11-23T18:02:00-08:00
New Revision: b20f3cc5b560ae15a8f9018eb96d65e6f5e125d1

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

LOG: [lldb] Add platform select to TestProcessConnect.py

Extend TestProcessConnect to cover the scenario fixed by
6c0cd5676e0a0feaf836e0399023a6e21224467b. This replaces
command-process-connect.test which would fail if port 4321
was open.

Added: 


Modified: 
lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py

Removed: 




diff  --git 
a/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py 
b/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
index c2d06ad5d67e..80b83fbe2919 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
@@ -38,6 +38,8 @@ def test_process_connect_sync(self):
 """Test the gdb-remote command in synchronous mode"""
 try:
 self.dbg.SetAsync(False)
+self.expect("platform select remote-gdb-server",
+substrs=['Platform: remote-gdb-server', 'Connected: 
no'])
 self.expect("process connect connect://" +
 self.server.get_connect_address(),
 substrs=['Process', 'stopped'])
@@ -50,6 +52,8 @@ def test_process_connect_async(self):
 """Test the gdb-remote command in asynchronous mode"""
 try:
 self.dbg.SetAsync(True)
+self.expect("platform select remote-gdb-server",
+substrs=['Platform: remote-gdb-server', 'Connected: 
no'])
 self.expect("process connect connect://" +
 self.server.get_connect_address(),
 matching=False,



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


[Lldb-commits] [lldb] 2bd4540 - [LLDB] Fix typo in RegisterContextPOSIXProcessMonitor_arm64

2020-11-23 Thread Muhammad Omair Javaid via lldb-commits

Author: Muhammad Omair Javaid
Date: 2020-11-24T07:09:00+05:00
New Revision: 2bd4540f3816bb7acda31cba5351d02192d63f81

URL: 
https://github.com/llvm/llvm-project/commit/2bd4540f3816bb7acda31cba5351d02192d63f81
DIFF: 
https://github.com/llvm/llvm-project/commit/2bd4540f3816bb7acda31cba5351d02192d63f81.diff

LOG: [LLDB] Fix typo in RegisterContextPOSIXProcessMonitor_arm64

This patch fixes a minor typo in RegisterContextPOSIXProcessMonitor_arm64
constructor where memset target was wrongly specified as m_fpr instead of
m_gpr_arm64.

Added: 


Modified: 

lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp
 
b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp
index 035bf59cc9c9..39ae0b9b9e7f 100644
--- 
a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp
+++ 
b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp
@@ -25,7 +25,7 @@ RegisterContextPOSIXProcessMonitor_arm64::
 lldb_private::Thread &thread,
 std::unique_ptr register_info)
 : RegisterContextPOSIX_arm64(thread, std::move(register_info)) {
-  ::memset(&m_fpr, 0, sizeof m_gpr_arm64);
+  ::memset(&m_gpr_arm64, 0, sizeof m_gpr_arm64);
   ::memset(&m_fpr, 0, sizeof m_fpr);
 }
 



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