[Lldb-commits] [PATCH] D88769: [trace] Scaffold "thread trace dump instructions"

2020-10-03 Thread Greg Clayton via Phabricator via lldb-commits
clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

See inline comments about "thread trace dump instructions" as I am not quite 
sure what --offset means.

After we load a trace file, what is the default "offset" value? Is there a kind 
of "trace data position" that can be moved around? Does the offset default to 
the start of all trace instructions for a thread? The end of the trace data?




Comment at: lldb/include/lldb/Target/Target.h:1122-1137
+  /// Dump the instructions of the given thread's \a Trace.
+  ///
+  /// \param[in] s
+  ///   The stream object where the instructions are printed.
+  ///
+  /// \param[in] tid
+  ///The thread to print the instruction of.

This should probably go on the lldb_private::Thread now if we are only going to 
ever dump information for a thread at a time.



Comment at: lldb/source/Commands/Options.td:1011
+Arg<"Count">,
+Desc<"The number of total instructions to display.">;
+  def thread_trace_dump_instructions_offset: Option<"offset", "o">, Group<1>,

This option text might need to be a bit more descriptive. What if the user 
types:
```
(lldb) thread trace dump --count 22
```
What would that display? 22 instructions forward from the current point we are 
at? If we  load a trace file, will the position be at the end by default or at 
the beginning? I would think we would selec the end. Would this go 22 
instructions back? That doesn't make much sense if we use in conjunction with 
the --offset. 



Comment at: lldb/source/Commands/Options.td:1014-1015
+Arg<"Offset">,
+Desc<"Offset from the last instruction of the trace to start displaying "
+"instructions from. Defaults to 0.">;
+}

So what happens if the user just types:
```
(lldb) thread trace dump
```
If the trace position offset defaults to zero, and the current position is the 
end of the data by default, would this display nothing? Everything? Or would it 
display the stats for this thread? like:
```
(lldb) thread trace dump
thread #1: tid = 1234, 4096 trace branches available, position = end
thread #2: tid = 2345, 2345 trace branches available, position = end
```




Comment at: lldb/source/Plugins/Process/Trace/ProcessTrace.cpp:40-43
+bool ProcessTrace::CanDebug(lldb::TargetSP target_sp,
+bool plugin_specified_by_name) {
+  return true;
+}

You must return "plugin_specified_by_name" here so that this plug-in only gets 
selected if it was specified by name. We don't want to have this ProcessTrace 
plug-in get selected by any real debug sessions. So this should be:

```
bool ProcessTrace::CanDebug(lldb::TargetSP target_sp,
bool plugin_specified_by_name) {
  return plugin_specified_by_name;
}
```
That way we can request this process plug-in by name. 

If this is set to true, then when a target is shopping for a process plug-in by 
iterating through all installed Process plug-ins, if this function gets called 
before the ProcessGDBRemote or ProcessWindows it will take precedence over 
these other plug-ins. Typically a process plug-in will look at the target 
triple and look for an architecture, os, or vendor that matches and also look 
at the target's platform ("windows" for ProcessWindows) to determine if it can 
be used for debugging. In our case we should only be able to get a ProcessTrace 
instance back if we ask for it by name, it won't care about the target's 
triple, platform or anything else as it could be anything.




Comment at: lldb/source/Plugins/Process/Trace/ProcessTrace.cpp:62-65
+Status ProcessTrace::DoLoadCore() {
+  SetCanJIT(false);
+  return Status();
+}

Probably shouldn't use the LoadCore functionality, see inline comments.



Comment at: lldb/source/Plugins/Process/Trace/ProcessTrace.h:39
+
+  lldb_private::Status DoLoadCore() override;
+

Seems weird to use LoadCore, see other inline comments.



Comment at: lldb/source/Target/Target.cpp:2972-2981
+void Target::DumpTraceInstructions(Stream &s, lldb::tid_t tid, size_t count,
+   size_t offset) const {
+  if (!m_trace_sp) {
+s << "error: no trace in this target";
+return;
+  }
+  s.Printf("placeholder trace of tid %" PRIu64 ", count = %zu, offset = %zu\n",

move to lldb_private::Thread?



Comment at: lldb/source/Target/TraceSettingsParser.cpp:68-73
+  // For now we are setting an invalid PC. Eventually we should be able to
+  // lazyly reconstruct this callstack after decoding the trace.
+  ThreadSP thread_sp(new HistoryThread(*process_sp, tid,
+   /*callstack*/ {LLDB_INVALID_ADDRESS},
+   /*pcs_are_call_addresses*/ false,
+   

[Lldb-commits] [PATCH] D88583: [lldb] [test/Register] Add read/write tests for x87 regs

2020-10-03 Thread Michał Górny via Phabricator via lldb-commits
mgorny updated this revision to Diff 295980.
mgorny added a comment.

Added missing `-g` to x86-fp-read.cpp build, as necessary to get address of 
`zero`.


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

https://reviews.llvm.org/D88583

Files:
  lldb/test/Shell/Register/Inputs/x86-fp-read.cpp
  lldb/test/Shell/Register/Inputs/x86-fp-write.cpp
  lldb/test/Shell/Register/x86-64-fp-write.test
  lldb/test/Shell/Register/x86-fp-read.test
  lldb/test/Shell/Register/x86-fp-write.test

Index: lldb/test/Shell/Register/x86-fp-write.test
===
--- /dev/null
+++ lldb/test/Shell/Register/x86-fp-write.test
@@ -0,0 +1,45 @@
+# REQUIRES: native && target-x86
+# RUN: %clangxx_host %p/Inputs/x86-fp-write.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write fctrl 0x037b
+register write fstat 0x8884
+# note: this needs to enable all registers for writes to be effective
+# TODO: fix it to use proper ftag values instead of 'abridged'
+register write ftag 0x00ff
+register write fop 0x0033
+# the exact addresses do not matter, we want just to verify FXSAVE
+# note: segment registers are not supported on all CPUs
+register write fioff 0x89abcdef
+register write fooff 0x76543210
+
+register write st0 "{0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00 0x40}"
+register write st1 "{0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x3f 0x00 0x00}"
+register write st2 "{0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}"
+register write st3 "{0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80}"
+register write st4 "{0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0x7f}"
+register write st5 "{0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0xff}"
+register write st6 "{0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xc0 0xff 0xff}"
+register write st7 "{0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}"
+
+process continue
+
+# CHECK: process continue
+# CHECK-DAG: fctrl = 0x037b
+# CHECK-DAG: fstat = 0x8884
+# CHECK-DAG: ftag = 0xa961
+# CHECK-DAG: fop = 0x0033
+# CHECK-DAG: fip = 0x89abcdef
+# CHECK-DAG: fdp = 0x76543210
+
+# CHECK-DAG: st0 = { 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00 0x40 }
+# CHECK-DAG: st1 = { 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x3f 0x00 0x00 }
+# CHECK-DAG: st2 = { 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 }
+# CHECK-DAG: st3 = { 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 }
+# CHECK-DAG: st4 = { 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0x7f }
+# CHECK-DAG: st5 = { 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0xff }
+# CHECK-DAG: st6 = { 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xc0 0xff 0xff }
+# CHECK-DAG: st7 = { 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 }
+
+# CHECK: Process {{[0-9]+}} exited with status = 0
Index: lldb/test/Shell/Register/x86-fp-read.test
===
--- /dev/null
+++ lldb/test/Shell/Register/x86-fp-read.test
@@ -0,0 +1,36 @@
+# REQUIRES: native && (target-x86 || target-x86_64)
+# RUN: %clangxx_host -g %p/Inputs/x86-fp-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+# CHECK: Process {{.*}} stopped
+
+register read --all
+# CHECK-DAG: fctrl = 0x037b
+# CHECK-DAG: fstat = 0x8884
+# TODO: the following value is incorrect, it's a bug in the way
+# FXSAVE/XSAVE is interpreted; it should be 0xa963 once fixed
+# CHECK-DAG: ftag = 0x00fe
+# CHECK-DAG: fop = 0x0033
+
+# CHECK-DAG: st0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00 0x40}
+# CHECK-DAG: st1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x3f 0x00 0x00}
+# CHECK-DAG: st2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: st3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80}
+# CHECK-DAG: st4 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0x7f}
+# CHECK-DAG: st5 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0xff}
+# CHECK-DAG: st6 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xc0 0xff 0xff}
+# CHECK-DAG: st7 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+
+# fdiv (%rbx) gets encoded into 2 bytes, int3 into 1 byte
+print (void*)($pc-3)
+# CHECK: (void *) $0 = [[FDIV:0x[0-9a-f]*]]
+# TODO: we probably should not split it like this
+print (void*)($fiseg*0x1 + $fioff)
+# CHECK: (void *) $1 = [[FDIV]]
+print &zero
+# CHECK: (uint32_t *) $2 = [[ZERO:0x[0-9a-f]*]]
+print (uint32_t*)($foseg * 0x1 + $fooff)
+# CHECK: (uint32_t *) $3 = [[ZERO]]
+
+process continue
+# CHECK: Process {{[0-9]+}} exited with status = 0
Index: lldb/test/Shell/Register/x86-64-fp-write.test
===
--- /dev/null
+++ lldb/test/Shell/Register/x86-64-fp-write.test
@@ -0,0 +1,48 @@
+# REQUIRES: native && target-x86_64
+# RUN: %clangxx_host %p/Inputs/x86-fp-write.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write fctrl 0x037b
+register write fstat 0x8884
+# note: this needs to enable all registers for writes to be effective
+# TODO: fix it to use proper ftag values instead of 

[Lldb-commits] [lldb] 80b108f - [lldb] [Process/NetBSD] Fix reading FIP/FDP registers

2020-10-03 Thread Michał Górny via lldb-commits

Author: Michał Górny
Date: 2020-10-03T19:54:38+02:00
New Revision: 80b108f404fc9e9df7247f6ae9697083cbda

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

LOG: [lldb] [Process/NetBSD] Fix reading FIP/FDP registers

Fix reading FIP/FDP registers to correctly return segment and offset
parts.  On amd64, this roughly matches the Linux behavior of splitting
the 64-bit FIP/FDP into two halves, and putting the higher 32 bits
into f*seg and lower into f*off.  Well, actually we use only 16 bits
of higher half but the CPUs do not seem to handle more than that anyway.

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

Added: 


Modified: 
lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp 
b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
index af8b2a2ba794..089ae42f 100644
--- a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
+++ b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
@@ -657,13 +657,13 @@ NativeRegisterContextNetBSD_x86_64::ReadRegister(const 
RegisterInfo *reg_info,
 reg_value = (uint64_t)m_fpr.fxstate.fx_opcode;
 break;
   case lldb_fiseg_x86_64:
-reg_value = (uint64_t)m_fpr.fxstate.fx_ip.fa_64;
+reg_value = (uint32_t)m_fpr.fxstate.fx_ip.fa_32.fa_seg;
 break;
   case lldb_fioff_x86_64:
 reg_value = (uint32_t)m_fpr.fxstate.fx_ip.fa_32.fa_off;
 break;
   case lldb_foseg_x86_64:
-reg_value = (uint64_t)m_fpr.fxstate.fx_dp.fa_64;
+reg_value = (uint32_t)m_fpr.fxstate.fx_dp.fa_32.fa_seg;
 break;
   case lldb_fooff_x86_64:
 reg_value = (uint32_t)m_fpr.fxstate.fx_dp.fa_32.fa_off;
@@ -945,13 +945,13 @@ Status NativeRegisterContextNetBSD_x86_64::WriteRegister(
 m_fpr.fxstate.fx_opcode = reg_value.GetAsUInt16();
 break;
   case lldb_fiseg_x86_64:
-m_fpr.fxstate.fx_ip.fa_64 = reg_value.GetAsUInt64();
+m_fpr.fxstate.fx_ip.fa_32.fa_seg = reg_value.GetAsUInt32();
 break;
   case lldb_fioff_x86_64:
 m_fpr.fxstate.fx_ip.fa_32.fa_off = reg_value.GetAsUInt32();
 break;
   case lldb_foseg_x86_64:
-m_fpr.fxstate.fx_dp.fa_64 = reg_value.GetAsUInt64();
+m_fpr.fxstate.fx_dp.fa_32.fa_seg = reg_value.GetAsUInt32();
 break;
   case lldb_fooff_x86_64:
 m_fpr.fxstate.fx_dp.fa_32.fa_off = reg_value.GetAsUInt32();



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


[Lldb-commits] [lldb] 381bdc7 - [lldb] [test/Register] Add read/write tests for x87 regs

2020-10-03 Thread Michał Górny via lldb-commits

Author: Michał Górny
Date: 2020-10-03T19:54:38+02:00
New Revision: 381bdc75ee2ca2fb9784ffb2f6b90accd8eab3b6

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

LOG: [lldb] [test/Register] Add read/write tests for x87 regs

Add a partial read/write tests for x87 FPU registers.  This includes
reading and writing ST registers, control registers and floating-point
exception data registers (fop, fip, fdp).

The tests assume the current (roughly incorrect) behavior of reporting
the 'abridged' 8-bit ftag state as 16-bit ftag.  They also assume Linux
plugin behavior of reporting fip/fdp split into halves as (fiseg, fioff)
and (foseg, fooff).

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

Added: 
lldb/test/Shell/Register/Inputs/x86-fp-read.cpp
lldb/test/Shell/Register/Inputs/x86-fp-write.cpp
lldb/test/Shell/Register/x86-64-fp-write.test
lldb/test/Shell/Register/x86-fp-read.test
lldb/test/Shell/Register/x86-fp-write.test

Modified: 


Removed: 




diff  --git a/lldb/test/Shell/Register/Inputs/x86-fp-read.cpp 
b/lldb/test/Shell/Register/Inputs/x86-fp-read.cpp
new file mode 100644
index ..1bd2d60affa2
--- /dev/null
+++ b/lldb/test/Shell/Register/Inputs/x86-fp-read.cpp
@@ -0,0 +1,45 @@
+#include 
+
+struct alignas(16) float80_raw {
+  uint64_t mantissa;
+  uint16_t sign_exp;
+};
+
+int main() {
+  float80_raw st[] = {
+{0x8000, 0x4000},  // +2.0
+{0x3f00, 0x},  // 1.654785e-4932 (denormal)
+{0x, 0x},  // +0
+{0x, 0x8000},  // -0
+{0x8000, 0x7fff},  // +inf
+{0x8000, 0x},  // -inf
+{0xc000, 0x},  // nan
+// leave st7 empty to test tag word better
+  };
+
+  // unmask divide-by-zero exception
+  uint16_t cw = 0x037b;
+  // used as single-precision float
+  uint32_t zero = 0;
+
+  asm volatile(
+"finit\n\t"
+"fldcw %1\n\t"
+// load on stack in reverse order to make the result easier to read
+"fldt 0x60(%0)\n\t"
+"fldt 0x50(%0)\n\t"
+"fldt 0x40(%0)\n\t"
+"fldt 0x30(%0)\n\t"
+"fldt 0x20(%0)\n\t"
+"fldt 0x10(%0)\n\t"
+"fldt 0x00(%0)\n\t"
+// this should trigger a divide-by-zero
+"fdivs (%2)\n\t"
+"int3\n\t"
+:
+: "a"(st), "m"(cw), "b"(&zero)
+: "st"
+  );
+
+  return 0;
+}

diff  --git a/lldb/test/Shell/Register/Inputs/x86-fp-write.cpp 
b/lldb/test/Shell/Register/Inputs/x86-fp-write.cpp
new file mode 100644
index ..63791a8eff2e
--- /dev/null
+++ b/lldb/test/Shell/Register/Inputs/x86-fp-write.cpp
@@ -0,0 +1,69 @@
+#include 
+#include 
+#include 
+#include 
+
+struct alignas(16) float80_raw {
+  uint8_t data[10];
+};
+
+int main() {
+  float80_raw st[8];
+  uint16_t env[14];
+  union alignas(16) {
+uint16_t i16[256];
+uint32_t i32[128];
+uint64_t i64[64];
+  } fxsave;
+
+  asm volatile(
+"finit\n\t"
+"int3\n\t"
+#if defined(__x86_64__)
+"fxsave64 %2\n\t"
+#else
+"fxsave %2\n\t"
+#endif
+"fnstenv %1\n\t"
+"fnclex\n\t"
+"fstpt 0x00(%0)\n\t"
+"fstpt 0x10(%0)\n\t"
+"fstpt 0x20(%0)\n\t"
+"fstpt 0x30(%0)\n\t"
+"fstpt 0x40(%0)\n\t"
+"fstpt 0x50(%0)\n\t"
+"fstpt 0x60(%0)\n\t"
+"fstpt 0x70(%0)\n\t"
+:
+: "a"(st), "m"(env), "m"(fxsave)
+: "st"
+  );
+
+  assert(env[0] == fxsave.i16[0]);
+  assert(env[2] == fxsave.i16[1]);
+
+  printf("fctrl = 0x%04" PRIx16 "\n", env[0]);
+  printf("fstat = 0x%04" PRIx16 "\n", env[2]);
+  printf("ftag = 0x%04" PRIx16 "\n", env[4]);
+  printf("fop = 0x%04" PRIx16 "\n", fxsave.i16[3]);
+#if defined(__x86_64__)
+  printf("fip = 0x%016" PRIx64 "\n", fxsave.i64[1]);
+  printf("fdp = 0x%016" PRIx64 "\n", fxsave.i64[2]);
+#else
+  printf("fip = 0x%08" PRIx32 "\n", fxsave.i32[2]);
+  printf("fcs = 0x%04" PRIx16 "\n", fxsave.i16[6]);
+  printf("fdp = 0x%08" PRIx32 "\n", fxsave.i32[4]);
+  printf("fds = 0x%04" PRIx16 "\n", fxsave.i16[10]);
+#endif
+  printf("mxcsr = 0x%08" PRIx32 "\n", fxsave.i32[6]);
+  printf("mxcsr_mask = 0x%08" PRIx32 "\n", fxsave.i32[7]);
+
+  for (int i = 0; i < 8; ++i) {
+printf("st%d = { ", i);
+for (int j = 0; j < sizeof(st->data); ++j)
+  printf("0x%02" PRIx8 " ", st[i].data[j]);
+printf("}\n");
+  }
+
+  return 0;
+}

diff  --git a/lldb/test/Shell/Register/x86-64-fp-write.test 
b/lldb/test/Shell/Register/x86-64-fp-write.test
new file mode 100644
index ..b2e8c271b51b
--- /dev/null
+++ b/lldb/test/Shell/Register/x86-64-fp-write.test
@@ -0,0 +1,48 @@
+# REQUIRES: native && target-x86_64
+# RUN: %clangxx_host %p/Inputs/x86-fp-write.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write fctrl 0x037b
+register write fstat 0x8884
+# note: this needs to enable all registers for writ

[Lldb-commits] [lldb] 9821632 - [lldb] [Process/NetBSD] Fix crash on unsupported i386 regs

2020-10-03 Thread Michał Górny via lldb-commits

Author: Michał Górny
Date: 2020-10-03T19:54:38+02:00
New Revision: 9821632056dce9e2150bab9c0fbd9b2c7da64258

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

LOG: [lldb] [Process/NetBSD] Fix crash on unsupported i386 regs

Multiple fixes related to bugs discovered while debugging a crash
when reading all registers on i386.

The underlying problem was that GetSetForNativeRegNum() did not account
for MPX registers on i386, and since it only compared against upper
bounds of each known register set, the MPX registers were classified
into the wrong set and therefore considered supported.  However, they
were not expected in RegNumX86ToX86_64() and caused the assertion
to fail.

This includes:

- adding (unused) i386 → x86_64 translations for MPX registers
- fixing GetSetForNativeRegNum() to check both lower and upper bound
  for register sets, to avoid wrongly classifying unhandled register
  sets
- adding missing range check for MPX registers on i386
- renaming k_last_mpxr to k_last_mpxr_i386 for consistency
- replacing return-assertions with llvm_unreachable() and adding more
  checks for unexpected parameters

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

Added: 


Modified: 
lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp 
b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
index 089ae42f..cb1e883258b5 100644
--- a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
+++ b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
@@ -278,11 +278,8 @@ 
NativeRegisterContextNetBSD_x86_64::GetRegisterSet(uint32_t set_index) const {
   case llvm::Triple::x86_64:
 return &g_reg_sets_x86_64[set_index];
   default:
-assert(false && "Unhandled target architecture.");
-return nullptr;
+llvm_unreachable("Unhandled target architecture.");
   }
-
-  return nullptr;
 }
 
 static constexpr int RegNumX86ToX86_64(int regnum) {
@@ -375,6 +372,15 @@ static constexpr int RegNumX86ToX86_64(int regnum) {
   case lldb_ymm6_i386:
   case lldb_ymm7_i386:
 return lldb_ymm0_x86_64 + regnum - lldb_ymm0_i386;
+  case lldb_bnd0_i386:
+  case lldb_bnd1_i386:
+  case lldb_bnd2_i386:
+  case lldb_bnd3_i386:
+return lldb_bnd0_x86_64 + regnum - lldb_bnd0_i386;
+  case lldb_bndcfgu_i386:
+return lldb_bndcfgu_x86_64;
+  case lldb_bndstatus_i386:
+return lldb_bndstatus_x86_64;
   case lldb_dr0_i386:
   case lldb_dr1_i386:
   case lldb_dr2_i386:
@@ -385,8 +391,7 @@ static constexpr int RegNumX86ToX86_64(int regnum) {
   case lldb_dr7_i386:
 return lldb_dr0_x86_64 + regnum - lldb_dr0_i386;
   default:
-assert(false && "Unhandled i386 register.");
-return 0;
+llvm_unreachable("Unhandled i386 register.");
   }
 }
 
@@ -394,35 +399,38 @@ int 
NativeRegisterContextNetBSD_x86_64::GetSetForNativeRegNum(
 int reg_num) const {
   switch (GetRegisterInfoInterface().GetTargetArchitecture().GetMachine()) {
   case llvm::Triple::x86:
-if (reg_num <= k_last_gpr_i386)
+if (reg_num >= k_first_gpr_i386 && reg_num <= k_last_gpr_i386)
   return GPRegSet;
-else if (reg_num <= k_last_fpr_i386)
+if (reg_num >= k_first_fpr_i386 && reg_num <= k_last_fpr_i386)
   return FPRegSet;
-else if (reg_num <= k_last_avx_i386)
+if (reg_num >= k_first_avx_i386 && reg_num <= k_last_avx_i386)
   return XStateRegSet; // AVX
-else if (reg_num <= lldb_dr7_i386)
+if (reg_num >= k_first_mpxr_i386 && reg_num <= k_last_mpxr_i386)
+  return -1; // MPXR
+if (reg_num >= k_first_mpxc_i386 && reg_num <= k_last_mpxc_i386)
+  return -1; // MPXC
+if (reg_num >= k_first_dbr_i386 && reg_num <= k_last_dbr_i386)
   return DBRegSet; // DBR
-else
-  return -1;
+break;
   case llvm::Triple::x86_64:
-if (reg_num <= k_last_gpr_x86_64)
+if (reg_num >= k_first_gpr_x86_64 && reg_num <= k_last_gpr_x86_64)
   return GPRegSet;
-else if (reg_num <= k_last_fpr_x86_64)
+if (reg_num >= k_first_fpr_x86_64 && reg_num <= k_last_fpr_x86_64)
   return FPRegSet;
-else if (reg_num <= k_last_avx_x86_64)
+if (reg_num >= k_first_avx_x86_64 && reg_num <= k_last_avx_x86_64)
   return XStateRegSet; // AVX
-else if (reg_num <= k_last_mpxr_x86_64)
+if (reg_num >= k_first_mpxr_x86_64 && reg_num <= k_last_mpxr_x86_64)
   return -1; // MPXR
-else if (reg_num <= k_last_mpxc_x86_64)
+if (reg_num >= k_first_mpxc_x86_64 && reg_num <= k_last_mpxc_x86_64)
   return -1; // MPXC
-else if (reg_num <= lldb_dr7_x86_64)
+if (reg_num >= k_first_dbr_x86_64 && r

[Lldb-commits] [PATCH] D88681: [lldb] [Process/NetBSD] Fix reading FIP/FDP registers

2020-10-03 Thread Michał Górny via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG80b108f404fc: [lldb] [Process/NetBSD] Fix reading FIP/FDP 
registers (authored by mgorny).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88681

Files:
  lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp


Index: lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
===
--- lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
+++ lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
@@ -657,13 +657,13 @@
 reg_value = (uint64_t)m_fpr.fxstate.fx_opcode;
 break;
   case lldb_fiseg_x86_64:
-reg_value = (uint64_t)m_fpr.fxstate.fx_ip.fa_64;
+reg_value = (uint32_t)m_fpr.fxstate.fx_ip.fa_32.fa_seg;
 break;
   case lldb_fioff_x86_64:
 reg_value = (uint32_t)m_fpr.fxstate.fx_ip.fa_32.fa_off;
 break;
   case lldb_foseg_x86_64:
-reg_value = (uint64_t)m_fpr.fxstate.fx_dp.fa_64;
+reg_value = (uint32_t)m_fpr.fxstate.fx_dp.fa_32.fa_seg;
 break;
   case lldb_fooff_x86_64:
 reg_value = (uint32_t)m_fpr.fxstate.fx_dp.fa_32.fa_off;
@@ -945,13 +945,13 @@
 m_fpr.fxstate.fx_opcode = reg_value.GetAsUInt16();
 break;
   case lldb_fiseg_x86_64:
-m_fpr.fxstate.fx_ip.fa_64 = reg_value.GetAsUInt64();
+m_fpr.fxstate.fx_ip.fa_32.fa_seg = reg_value.GetAsUInt32();
 break;
   case lldb_fioff_x86_64:
 m_fpr.fxstate.fx_ip.fa_32.fa_off = reg_value.GetAsUInt32();
 break;
   case lldb_foseg_x86_64:
-m_fpr.fxstate.fx_dp.fa_64 = reg_value.GetAsUInt64();
+m_fpr.fxstate.fx_dp.fa_32.fa_seg = reg_value.GetAsUInt32();
 break;
   case lldb_fooff_x86_64:
 m_fpr.fxstate.fx_dp.fa_32.fa_off = reg_value.GetAsUInt32();


Index: lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
===
--- lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
+++ lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
@@ -657,13 +657,13 @@
 reg_value = (uint64_t)m_fpr.fxstate.fx_opcode;
 break;
   case lldb_fiseg_x86_64:
-reg_value = (uint64_t)m_fpr.fxstate.fx_ip.fa_64;
+reg_value = (uint32_t)m_fpr.fxstate.fx_ip.fa_32.fa_seg;
 break;
   case lldb_fioff_x86_64:
 reg_value = (uint32_t)m_fpr.fxstate.fx_ip.fa_32.fa_off;
 break;
   case lldb_foseg_x86_64:
-reg_value = (uint64_t)m_fpr.fxstate.fx_dp.fa_64;
+reg_value = (uint32_t)m_fpr.fxstate.fx_dp.fa_32.fa_seg;
 break;
   case lldb_fooff_x86_64:
 reg_value = (uint32_t)m_fpr.fxstate.fx_dp.fa_32.fa_off;
@@ -945,13 +945,13 @@
 m_fpr.fxstate.fx_opcode = reg_value.GetAsUInt16();
 break;
   case lldb_fiseg_x86_64:
-m_fpr.fxstate.fx_ip.fa_64 = reg_value.GetAsUInt64();
+m_fpr.fxstate.fx_ip.fa_32.fa_seg = reg_value.GetAsUInt32();
 break;
   case lldb_fioff_x86_64:
 m_fpr.fxstate.fx_ip.fa_32.fa_off = reg_value.GetAsUInt32();
 break;
   case lldb_foseg_x86_64:
-m_fpr.fxstate.fx_dp.fa_64 = reg_value.GetAsUInt64();
+m_fpr.fxstate.fx_dp.fa_32.fa_seg = reg_value.GetAsUInt32();
 break;
   case lldb_fooff_x86_64:
 m_fpr.fxstate.fx_dp.fa_32.fa_off = reg_value.GetAsUInt32();
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D88583: [lldb] [test/Register] Add read/write tests for x87 regs

2020-10-03 Thread Michał Górny via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG381bdc75ee2c: [lldb] [test/Register] Add read/write tests 
for x87 regs (authored by mgorny).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88583

Files:
  lldb/test/Shell/Register/Inputs/x86-fp-read.cpp
  lldb/test/Shell/Register/Inputs/x86-fp-write.cpp
  lldb/test/Shell/Register/x86-64-fp-write.test
  lldb/test/Shell/Register/x86-fp-read.test
  lldb/test/Shell/Register/x86-fp-write.test

Index: lldb/test/Shell/Register/x86-fp-write.test
===
--- /dev/null
+++ lldb/test/Shell/Register/x86-fp-write.test
@@ -0,0 +1,45 @@
+# REQUIRES: native && target-x86
+# RUN: %clangxx_host %p/Inputs/x86-fp-write.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write fctrl 0x037b
+register write fstat 0x8884
+# note: this needs to enable all registers for writes to be effective
+# TODO: fix it to use proper ftag values instead of 'abridged'
+register write ftag 0x00ff
+register write fop 0x0033
+# the exact addresses do not matter, we want just to verify FXSAVE
+# note: segment registers are not supported on all CPUs
+register write fioff 0x89abcdef
+register write fooff 0x76543210
+
+register write st0 "{0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00 0x40}"
+register write st1 "{0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x3f 0x00 0x00}"
+register write st2 "{0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}"
+register write st3 "{0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80}"
+register write st4 "{0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0x7f}"
+register write st5 "{0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0xff}"
+register write st6 "{0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xc0 0xff 0xff}"
+register write st7 "{0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}"
+
+process continue
+
+# CHECK: process continue
+# CHECK-DAG: fctrl = 0x037b
+# CHECK-DAG: fstat = 0x8884
+# CHECK-DAG: ftag = 0xa961
+# CHECK-DAG: fop = 0x0033
+# CHECK-DAG: fip = 0x89abcdef
+# CHECK-DAG: fdp = 0x76543210
+
+# CHECK-DAG: st0 = { 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00 0x40 }
+# CHECK-DAG: st1 = { 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x3f 0x00 0x00 }
+# CHECK-DAG: st2 = { 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 }
+# CHECK-DAG: st3 = { 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 }
+# CHECK-DAG: st4 = { 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0x7f }
+# CHECK-DAG: st5 = { 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0xff }
+# CHECK-DAG: st6 = { 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xc0 0xff 0xff }
+# CHECK-DAG: st7 = { 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 }
+
+# CHECK: Process {{[0-9]+}} exited with status = 0
Index: lldb/test/Shell/Register/x86-fp-read.test
===
--- /dev/null
+++ lldb/test/Shell/Register/x86-fp-read.test
@@ -0,0 +1,36 @@
+# REQUIRES: native && (target-x86 || target-x86_64)
+# RUN: %clangxx_host -g %p/Inputs/x86-fp-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+# CHECK: Process {{.*}} stopped
+
+register read --all
+# CHECK-DAG: fctrl = 0x037b
+# CHECK-DAG: fstat = 0x8884
+# TODO: the following value is incorrect, it's a bug in the way
+# FXSAVE/XSAVE is interpreted; it should be 0xa963 once fixed
+# CHECK-DAG: ftag = 0x00fe
+# CHECK-DAG: fop = 0x0033
+
+# CHECK-DAG: st0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00 0x40}
+# CHECK-DAG: st1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x3f 0x00 0x00}
+# CHECK-DAG: st2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: st3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80}
+# CHECK-DAG: st4 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0x7f}
+# CHECK-DAG: st5 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0xff}
+# CHECK-DAG: st6 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xc0 0xff 0xff}
+# CHECK-DAG: st7 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+
+# fdiv (%rbx) gets encoded into 2 bytes, int3 into 1 byte
+print (void*)($pc-3)
+# CHECK: (void *) $0 = [[FDIV:0x[0-9a-f]*]]
+# TODO: we probably should not split it like this
+print (void*)($fiseg*0x1 + $fioff)
+# CHECK: (void *) $1 = [[FDIV]]
+print &zero
+# CHECK: (uint32_t *) $2 = [[ZERO:0x[0-9a-f]*]]
+print (uint32_t*)($foseg * 0x1 + $fooff)
+# CHECK: (uint32_t *) $3 = [[ZERO]]
+
+process continue
+# CHECK: Process {{[0-9]+}} exited with status = 0
Index: lldb/test/Shell/Register/x86-64-fp-write.test
===
--- /dev/null
+++ lldb/test/Shell/Register/x86-64-fp-write.test
@@ -0,0 +1,48 @@
+# REQUIRES: native && target-x86_64
+# RUN: %clangxx_host %p/Inputs/x86-fp-write.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write fctrl 0x037b
+register write fstat 0x8884
+# note: this needs to enable all registers for writes

[Lldb-commits] [PATCH] D88682: [lldb] [Process/NetBSD] Fix crash on unsupported i386 regs

2020-10-03 Thread Michał Górny via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9821632056dc: [lldb] [Process/NetBSD] Fix crash on 
unsupported i386 regs (authored by mgorny).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88682

Files:
  lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
  lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h

Index: lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h
===
--- lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h
+++ lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h
@@ -106,7 +106,7 @@
   lldb_bnd1_i386,
   lldb_bnd2_i386,
   lldb_bnd3_i386,
-  k_last_mpxr = lldb_bnd3_i386,
+  k_last_mpxr_i386 = lldb_bnd3_i386,
 
   k_first_mpxc_i386,
   lldb_bndcfgu_i386 = k_first_mpxc_i386,
Index: lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
===
--- lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
+++ lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
@@ -278,11 +278,8 @@
   case llvm::Triple::x86_64:
 return &g_reg_sets_x86_64[set_index];
   default:
-assert(false && "Unhandled target architecture.");
-return nullptr;
+llvm_unreachable("Unhandled target architecture.");
   }
-
-  return nullptr;
 }
 
 static constexpr int RegNumX86ToX86_64(int regnum) {
@@ -375,6 +372,15 @@
   case lldb_ymm6_i386:
   case lldb_ymm7_i386:
 return lldb_ymm0_x86_64 + regnum - lldb_ymm0_i386;
+  case lldb_bnd0_i386:
+  case lldb_bnd1_i386:
+  case lldb_bnd2_i386:
+  case lldb_bnd3_i386:
+return lldb_bnd0_x86_64 + regnum - lldb_bnd0_i386;
+  case lldb_bndcfgu_i386:
+return lldb_bndcfgu_x86_64;
+  case lldb_bndstatus_i386:
+return lldb_bndstatus_x86_64;
   case lldb_dr0_i386:
   case lldb_dr1_i386:
   case lldb_dr2_i386:
@@ -385,8 +391,7 @@
   case lldb_dr7_i386:
 return lldb_dr0_x86_64 + regnum - lldb_dr0_i386;
   default:
-assert(false && "Unhandled i386 register.");
-return 0;
+llvm_unreachable("Unhandled i386 register.");
   }
 }
 
@@ -394,35 +399,38 @@
 int reg_num) const {
   switch (GetRegisterInfoInterface().GetTargetArchitecture().GetMachine()) {
   case llvm::Triple::x86:
-if (reg_num <= k_last_gpr_i386)
+if (reg_num >= k_first_gpr_i386 && reg_num <= k_last_gpr_i386)
   return GPRegSet;
-else if (reg_num <= k_last_fpr_i386)
+if (reg_num >= k_first_fpr_i386 && reg_num <= k_last_fpr_i386)
   return FPRegSet;
-else if (reg_num <= k_last_avx_i386)
+if (reg_num >= k_first_avx_i386 && reg_num <= k_last_avx_i386)
   return XStateRegSet; // AVX
-else if (reg_num <= lldb_dr7_i386)
+if (reg_num >= k_first_mpxr_i386 && reg_num <= k_last_mpxr_i386)
+  return -1; // MPXR
+if (reg_num >= k_first_mpxc_i386 && reg_num <= k_last_mpxc_i386)
+  return -1; // MPXC
+if (reg_num >= k_first_dbr_i386 && reg_num <= k_last_dbr_i386)
   return DBRegSet; // DBR
-else
-  return -1;
+break;
   case llvm::Triple::x86_64:
-if (reg_num <= k_last_gpr_x86_64)
+if (reg_num >= k_first_gpr_x86_64 && reg_num <= k_last_gpr_x86_64)
   return GPRegSet;
-else if (reg_num <= k_last_fpr_x86_64)
+if (reg_num >= k_first_fpr_x86_64 && reg_num <= k_last_fpr_x86_64)
   return FPRegSet;
-else if (reg_num <= k_last_avx_x86_64)
+if (reg_num >= k_first_avx_x86_64 && reg_num <= k_last_avx_x86_64)
   return XStateRegSet; // AVX
-else if (reg_num <= k_last_mpxr_x86_64)
+if (reg_num >= k_first_mpxr_x86_64 && reg_num <= k_last_mpxr_x86_64)
   return -1; // MPXR
-else if (reg_num <= k_last_mpxc_x86_64)
+if (reg_num >= k_first_mpxc_x86_64 && reg_num <= k_last_mpxc_x86_64)
   return -1; // MPXC
-else if (reg_num <= lldb_dr7_x86_64)
+if (reg_num >= k_first_dbr_x86_64 && reg_num <= k_last_dbr_x86_64)
   return DBRegSet; // DBR
-else
-  return -1;
+break;
   default:
-assert(false && "Unhandled target architecture.");
-return -1;
+llvm_unreachable("Unhandled target architecture.");
   }
+
+  llvm_unreachable("Register does not belong to any register set");
 }
 
 Status NativeRegisterContextNetBSD_x86_64::ReadRegisterSet(uint32_t set) {
@@ -511,9 +519,7 @@
 reg = RegNumX86ToX86_64(reg);
 break;
   default:
-assert(false && "Unhandled target architecture.");
-error.SetErrorString("Unhandled target architecture.");
-return error;
+llvm_unreachable("Unhandled target architecture.");
   }
 
   error = ReadRegisterSet(set);
@@ -758,6 +764,8 @@
   case lldb_dr7_x86_64:
 reg_value = (uint64_t)m_dbr.dr[reg - lldb_dr0_x86_64];
 break;
+  default:
+llvm_unreachable("Reading unknown/unsupported register");
   }
 
   

[Lldb-commits] [lldb] 508ac0e - [lldb] [test/Register] Mark new FP reg tests XFAIL on Windows

2020-10-03 Thread Michał Górny via lldb-commits

Author: Michał Górny
Date: 2020-10-03T22:16:29+02:00
New Revision: 508ac0ec13c1c56029fd2390a2e14c1b2ea84b73

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

LOG: [lldb] [test/Register] Mark new FP reg tests XFAIL on Windows

Added: 


Modified: 
lldb/test/Shell/Register/x86-64-fp-write.test
lldb/test/Shell/Register/x86-fp-read.test
lldb/test/Shell/Register/x86-fp-write.test

Removed: 




diff  --git a/lldb/test/Shell/Register/x86-64-fp-write.test 
b/lldb/test/Shell/Register/x86-64-fp-write.test
index b2e8c271b51b..38c894209118 100644
--- a/lldb/test/Shell/Register/x86-64-fp-write.test
+++ b/lldb/test/Shell/Register/x86-64-fp-write.test
@@ -1,3 +1,4 @@
+# XFAIL: system-windows
 # REQUIRES: native && target-x86_64
 # RUN: %clangxx_host %p/Inputs/x86-fp-write.cpp -o %t
 # RUN: %lldb -b -s %s %t | FileCheck %s

diff  --git a/lldb/test/Shell/Register/x86-fp-read.test 
b/lldb/test/Shell/Register/x86-fp-read.test
index 9ecc5634e729..42c85baa2295 100644
--- a/lldb/test/Shell/Register/x86-fp-read.test
+++ b/lldb/test/Shell/Register/x86-fp-read.test
@@ -1,3 +1,4 @@
+# XFAIL: system-windows
 # REQUIRES: native && (target-x86 || target-x86_64)
 # RUN: %clangxx_host -g %p/Inputs/x86-fp-read.cpp -o %t
 # RUN: %lldb -b -s %s %t | FileCheck %s

diff  --git a/lldb/test/Shell/Register/x86-fp-write.test 
b/lldb/test/Shell/Register/x86-fp-write.test
index 81f542c419af..a88bbfd8ce00 100644
--- a/lldb/test/Shell/Register/x86-fp-write.test
+++ b/lldb/test/Shell/Register/x86-fp-write.test
@@ -1,3 +1,4 @@
+# XFAIL: system-windows
 # REQUIRES: native && target-x86
 # RUN: %clangxx_host %p/Inputs/x86-fp-write.cpp -o %t
 # RUN: %lldb -b -s %s %t | FileCheck %s



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


[Lldb-commits] [PATCH] D88199: Introduce and use a new section type for the bb_addr_map section.

2020-10-03 Thread Rahman Lavaee via Phabricator via lldb-commits
rahmanl updated this revision to Diff 295666.
rahmanl added a comment.
Herald added subscribers: libcxx-commits, openmp-commits, lldb-commits, 
Sanitizers, cfe-commits, tatianashp, wenlei, ThomasRaoux, AlexeySotkin, 
msifontes, sstefan1, jurahul, Kayjukh, grosul1, Joonsoo, stephenneuendorffer, 
kerbowa, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, csigg, 
nicolasvasilache, antiagainst, shauheen, rriddle, mehdi_amini, usaxena95, 
s.egerton, dmgreen, Jim, ormris, mstorsjo, kadircet, jfb, arphaman, dexonsmith, 
steven_wu, atanasyan, mgrang, jrtc27, gbedwell, delcypher, simoncook, kbarton, 
aheejin, fedor.sergeev, jgravelle-google, arichardson, sbc100, mgorny, 
nhaehnle, jvesely, nemanjai, emaste, dylanmckay, dschuff, arsenm.
Herald added a reviewer: espindola.
Herald added a reviewer: andreadb.
Herald added a reviewer: alexshap.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: mravishankar.
Herald added a reviewer: antiagainst.
Herald added a reviewer: nicolasvasilache.
Herald added a reviewer: herhut.
Herald added a reviewer: rriddle.
Herald added a reviewer: aartbik.
Herald added a reviewer: ftynse.
Herald added a reviewer: silvas.
Herald added a reviewer: JDevlieghere.
Herald added projects: clang, Sanitizers, LLDB, libc++, OpenMP, libc++abi, MLIR.
Herald added a reviewer: libc++.
Herald added a reviewer: libc++abi.

- Rename section to __llvm_bb_addr_map.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88199

Files:
  clang-tools-extra/clang-tidy/android/ComparisonInTempFailureRetryCheck.cpp
  clang-tools-extra/clang-tidy/android/ComparisonInTempFailureRetryCheck.h
  clang-tools-extra/clangd/URI.cpp
  clang-tools-extra/clangd/quality/CompletionModelCodegen.py
  clang-tools-extra/clangd/test/check-fail.test
  clang-tools-extra/clangd/test/check.test
  clang-tools-extra/clangd/tool/CMakeLists.txt
  clang-tools-extra/clangd/tool/Check.cpp
  clang-tools-extra/clangd/tool/ClangdMain.cpp
  
clang-tools-extra/docs/clang-tidy/checks/android-comparison-in-temp-failure-retry.rst
  
clang-tools-extra/test/clang-tidy/checkers/android-comparison-in-temp-failure-retry-custom-macro.c
  clang/cmake/caches/Fuchsia-stage2.cmake
  clang/include/clang/Tooling/Syntax/Nodes.h
  clang/lib/AST/Decl.cpp
  clang/lib/AST/ExprConstant.cpp
  clang/lib/Basic/Targets/OSTargets.h
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/CodeGen/CGCall.cpp
  clang/lib/Driver/ToolChains/AIX.cpp
  clang/lib/Sema/SemaDeclCXX.cpp
  clang/lib/Tooling/Inclusions/HeaderIncludes.cpp
  clang/lib/Tooling/Syntax/BuildTree.cpp
  clang/lib/Tooling/Syntax/Nodes.cpp
  clang/lib/Tooling/Syntax/Synthesis.cpp
  clang/test/CodeGen/builtin-nan-exception.c
  clang/test/CodeGen/builtin-nan-legacy.c
  clang/test/CodeGen/mips-unsupported-nan.c
  clang/test/CodeGenOpenCL/amdgpu-attrs.cl
  clang/test/CodeGenOpenCL/fpmath.cl
  clang/test/Driver/aix-ld.c
  clang/test/Headers/arm-neon-header.c
  clang/test/SemaCXX/cxx20-constinit.cpp
  clang/test/SemaCXX/warn-overaligned-type-thrown.cpp
  clang/unittests/Format/SortIncludesTest.cpp
  clang/unittests/Tooling/Syntax/BuildTreeTest.cpp
  clang/unittests/Tooling/Syntax/SynthesisTest.cpp
  compiler-rt/cmake/base-config-ix.cmake
  compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
  compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
  compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cpp
  compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
  compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cpp
  compiler-rt/test/asan/TestCases/Posix/no_asan_gen_globals.c
  compiler-rt/test/sanitizer_common/TestCases/Linux/ptsname.c
  debuginfo-tests/CMakeLists.txt
  debuginfo-tests/lit.cfg.py
  debuginfo-tests/lit.site.cfg.py.in
  debuginfo-tests/llvm-prettyprinters/gdb/lit.local.cfg
  debuginfo-tests/llvm-prettyprinters/gdb/llvm-support.cpp
  debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.cpp
  debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.gdb
  flang/include/flang/Evaluate/characteristics.h
  flang/include/flang/Evaluate/type.h
  flang/include/flang/Lower/PFTBuilder.h
  flang/include/flang/Semantics/symbol.h
  flang/include/flang/Semantics/tools.h
  flang/lib/Evaluate/characteristics.cpp
  flang/lib/Evaluate/fold-implementation.h
  flang/lib/Evaluate/tools.cpp
  flang/lib/Evaluate/type.cpp
  flang/lib/Lower/CMakeLists.txt
  flang/lib/Lower/PFTBuilder.cpp
  flang/lib/Parser/unparse.cpp
  flang/lib/Semantics/check-call.cpp
  flang/lib/Semantics/check-declarations.cpp
  flang/lib/Semantics/mod-file.cpp
  flang/lib/Semantics/mod-file.h
  flang/lib/Semantics/pointer-assignment.cpp
  flang/lib/Semantics/resolve-names.cpp
  flang/lib/Semantics/symbol.cpp
  flang/lib/Semantics/tools.cpp
  flang/runtime/descriptor-io.h
  flang/runtime/edit-output.cpp
  flang/runtime/format-implementation.h
  flang/runtime/io-api.cpp
  flang/runtime/io-api.h
  flang/runtime/io-stmt.cpp
  flang/runtime/io-

[Lldb-commits] [PATCH] D88199: Introduce and use a new section type for the bb_addr_map section.

2020-10-03 Thread Rahman Lavaee via Phabricator via lldb-commits
rahmanl updated this revision to Diff 295668.
rahmanl added a comment.

Diff reupload.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88199

Files:
  llvm/include/llvm/BinaryFormat/ELF.h
  llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  llvm/lib/CodeGen/BasicBlockSections.cpp
  llvm/lib/MC/MCObjectFileInfo.cpp
  llvm/lib/MC/MCParser/ELFAsmParser.cpp
  llvm/lib/MC/MCSectionELF.cpp
  llvm/lib/Object/ELF.cpp
  llvm/test/CodeGen/X86/basic-block-sections-labels-functions-sections.ll
  llvm/test/CodeGen/X86/basic-block-sections-labels.ll
  llvm/test/MC/AsmParser/llvm_section_types.s

Index: llvm/test/MC/AsmParser/llvm_section_types.s
===
--- /dev/null
+++ llvm/test/MC/AsmParser/llvm_section_types.s
@@ -0,0 +1,27 @@
+## Verify that LLVM-specific section types are correctly inferred from assembly input.
+# RUN: llvm-mc -triple i386-pc-linux-gnu -filetype=obj -o %t %s
+# RUN: llvm-readobj -S - < %t | FileCheck %s
+.section.section1,"",@llvm_bb_addr_map
+.byte 1
+.section.section2,"",@llvm_call_graph_profile
+.byte 1
+.section.section3,"",@llvm_odrtab
+.byte 1
+.section.section4,"",@llvm_linker_options
+.byte 1
+.section.section5,"",@llvm_sympart
+.byte 1
+.section.section6,"",@llvm_dependent_libraries
+.byte 1
+# CHECK:Name: .section1
+# CHECK-NEXT:   Type: SHT_LLVM_BB_ADDR_MAP
+# CHECK:Name: .section2
+# CHECK-NEXT:   Type: SHT_LLVM_CALL_GRAPH_PROFILE
+# CHECK:Name: .section3
+# CHECK-NEXT:   Type: SHT_LLVM_ODRTAB
+# CHECK:Name: .section4
+# CHECK-NEXT:   Type: SHT_LLVM_LINKER_OPTIONS
+# CHECK:Name: .section5
+# CHECK-NEXT:   Type: SHT_LLVM_SYMPART
+# CHECK:Name: .section6
+# CHECK-NEXT:   Type: SHT_LLVM_DEPENDENT_LIBRARIES
Index: llvm/test/CodeGen/X86/basic-block-sections-labels.ll
===
--- llvm/test/CodeGen/X86/basic-block-sections-labels.ll
+++ llvm/test/CodeGen/X86/basic-block-sections-labels.ll
@@ -39,7 +39,7 @@
 ; CHECK-LABEL:	.LBB_END0_3:
 ; CHECK-LABEL:	.Lfunc_end0:
 
-; CHECK:	.section	.bb_addr_map,"o",@progbits,.text
+; CHECK:	.section	__llvm_bb_addr_map,"o",@llvm_bb_addr_map,.text
 ; CHECK-NEXT:	.quad	.Lfunc_begin0
 ; CHECK-NEXT:	.byte	4
 ; CHECK-NEXT:	.uleb128 .Lfunc_begin0-.Lfunc_begin0
Index: llvm/test/CodeGen/X86/basic-block-sections-labels-functions-sections.ll
===
--- llvm/test/CodeGen/X86/basic-block-sections-labels-functions-sections.ll
+++ llvm/test/CodeGen/X86/basic-block-sections-labels-functions-sections.ll
@@ -5,11 +5,11 @@
 define dso_local i32 @_Z3barv() {
   ret i32 0
 }
-;; Check we add SHF_LINK_ORDER for .bb_addr_map and link it with the corresponding .text sections.
+;; Check we add SHF_LINK_ORDER for __llvm_bb_addr_map and link it with the corresponding .text sections.
 ; CHECK:		.section .text._Z3barv,"ax",@progbits
 ; CHECK-LABEL:	_Z3barv:
 ; CHECK-NEXT:	[[BAR_BEGIN:.Lfunc_begin[0-9]+]]:
-; CHECK:		.section .bb_addr_map,"o",@progbits,.text._Z3barv{{$}}
+; CHECK:		.section __llvm_bb_addr_map,"o",@llvm_bb_addr_map,.text._Z3barv{{$}}
 ; CHECK-NEXT:		.quad [[BAR_BEGIN]]
 
 
@@ -20,16 +20,16 @@
 ; CHECK:		.section .text._Z3foov,"ax",@progbits
 ; CHECK-LABEL:	_Z3foov:
 ; CHECK-NEXT:	[[FOO_BEGIN:.Lfunc_begin[0-9]+]]:
-; CHECK:		.section  .bb_addr_map,"o",@progbits,.text._Z3foov{{$}}
+; CHECK:		.section  __llvm_bb_addr_map,"o",@llvm_bb_addr_map,.text._Z3foov{{$}}
 ; CHECK-NEXT:		.quad [[FOO_BEGIN]]
 
 
 define linkonce_odr dso_local i32 @_Z4fooTIiET_v() comdat {
   ret i32 0
 }
-;; Check we add .bb_addr_map section to a COMDAT group with the corresponding .text section if such a COMDAT exists.
+;; Check we add __llvm_bb_addr_map section to a COMDAT group with the corresponding .text section if such a COMDAT exists.
 ; CHECK:		.section .text._Z4fooTIiET_v,"axG",@progbits,_Z4fooTIiET_v,comdat
 ; CHECK-LABEL:	_Z4fooTIiET_v:
 ; CHECK-NEXT:	[[FOOCOMDAT_BEGIN:.Lfunc_begin[0-9]+]]:
-; CHECK:		.section .bb_addr_map,"Go",@progbits,_Z4fooTIiET_v,comdat,.text._Z4fooTIiET_v{{$}}
+; CHECK:		.section __llvm_bb_addr_map,"Go",@llvm_bb_addr_map,_Z4fooTIiET_v,comdat,.text._Z4fooTIiET_v{{$}}
 ; CHECK-NEXT:		.quad [[FOOCOMDAT_BEGIN]]
Index: llvm/lib/Object/ELF.cpp
===
--- llvm/lib/Object/ELF.cpp
+++ llvm/lib/Object/ELF.cpp
@@ -276,6 +276,7 @@
 STRINGIFY_ENUM_CASE(ELF, SHT_LLVM_SYMPART);
 STRINGIFY_ENUM_CASE(ELF, SHT_LLVM_PART_EHDR);
 STRINGIFY_ENUM_CASE(ELF, SHT_LLVM_PART_PHDR);
+STRINGIFY_ENUM_CASE(ELF, SHT_LLVM_BB_ADDR_MAP);
 STRINGIFY_ENUM_CASE(ELF, SHT_GNU_ATTRIBUTES);
 STRINGIFY_ENUM_CASE(ELF, SHT_GNU_HASH);
 STRINGIFY_ENUM_CASE(ELF, SHT_GNU_verdef);
Index: llvm/lib/MC/MCSectionELF.cpp
===
--- llvm/lib/MC/MCSect

[Lldb-commits] [PATCH] D62732: [RISCV] Add SystemV ABI

2020-10-03 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

ABI plugins are one of the hardest things to test in lldb, particularly without 
actual hardware. That's why we've let them be added in the past without any 
accompanying tests. The situation is not ideal though, because we've 
accumulated various ABI plugins which are hard to change without breaking (or 
even to know if they work) because they only work with third-party (possibly 
proprietary) stubs.

I'm not sure what's the state of risc-v hardware these days and how much 
resources do you have available, but if it's at all possible, I'd definitely 
recommend adding the lldb-server bits for risc-v and adding a builtbot for 
testing this configuration.

Even if there's no hardware which could run the lldb test suite in a reasonable 
amount of time, the availability of an lldb-server implementation would enable 
anyone to test this via qemu -- that's the strategy we're pursuing for the ARM 
SVE stuff, and we're about to add instructions on how to run lldb+sve+qemu 
here: D82064 .




Comment at: lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp:37-276
+enum riscv_dwarf_regnums {
+  dwarf_x0 = 0,
+  dwarf_x1,
+  dwarf_x2,
+  dwarf_x3,
+  dwarf_x4,
+  dwarf_x5,

It would be good to make this an MCBasedABI (that's a new concept, introduced 
after the inception of this patch). That should make all of this goo disappear.



Comment at: lldb/source/Utility/ArchSpec.cpp:460-463
+{ArchSpec::eCore_riscv32, llvm::ELF::EM_RISCV, LLDB_INVALID_CPUTYPE,
+ 0xu, 0xu}, // riscv32
+{ArchSpec::eCore_riscv64, llvm::ELF::EM_RISCV, LLDB_INVALID_CPUTYPE,
+ 0xu, 0xu}, // riscv64

These bits should go in as a part of D86292.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62732

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


[Lldb-commits] [PATCH] D88613: [flang] Semantic analysis for FINAL subroutines

2020-10-03 Thread Peter Klausler via Phabricator via lldb-commits
klausler updated this revision to Diff 295423.
klausler added a comment.

Previous update to this review had inadvertent changes to other files because I 
neglected to rebase after updating master; now fixed.  Sorry for the scare!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88613

Files:
  flang/include/flang/Evaluate/characteristics.h
  flang/include/flang/Evaluate/type.h
  flang/include/flang/Semantics/symbol.h
  flang/include/flang/Semantics/tools.h
  flang/lib/Evaluate/characteristics.cpp
  flang/lib/Evaluate/tools.cpp
  flang/lib/Evaluate/type.cpp
  flang/lib/Semantics/check-call.cpp
  flang/lib/Semantics/check-declarations.cpp
  flang/lib/Semantics/mod-file.cpp
  flang/lib/Semantics/mod-file.h
  flang/lib/Semantics/pointer-assignment.cpp
  flang/lib/Semantics/resolve-names.cpp
  flang/lib/Semantics/symbol.cpp
  flang/lib/Semantics/tools.cpp
  flang/test/Semantics/call03.f90
  flang/test/Semantics/call05.f90
  flang/test/Semantics/final01.f90
  flang/test/Semantics/modfile10.f90
  flang/test/Semantics/resolve32.f90
  flang/test/Semantics/resolve55.f90

Index: flang/test/Semantics/resolve55.f90
===
--- flang/test/Semantics/resolve55.f90
+++ flang/test/Semantics/resolve55.f90
@@ -36,25 +36,24 @@
   end do
 end subroutine s4
 
-subroutine s5()
+module m
 ! Cannot have a variable of a finalizable type in a locality spec
   type t1
 integer :: i
   contains
 final :: f
   end type t1
-
-  type(t1) :: var
-
-!ERROR: Finalizable variable 'var' not allowed in a locality-spec
-  do concurrent(i=1:5) local(var)
-  end do
-
-contains
+ contains
+  subroutine s5()
+type(t1) :: var
+!ERROR: Finalizable variable 'var' not allowed in a locality-spec
+do concurrent(i=1:5) local(var)
+end do
+  end subroutine s5
   subroutine f(x)
 type(t1) :: x
   end subroutine f
-end subroutine s5
+end module m
 
 subroutine s6
 ! Cannot have a nonpointer polymorphic dummy argument in a locality spec
Index: flang/test/Semantics/resolve32.f90
===
--- flang/test/Semantics/resolve32.f90
+++ flang/test/Semantics/resolve32.f90
@@ -57,7 +57,7 @@
   contains
 procedure, nopass :: b => s
 final :: f
-!ERROR: Type parameter, component, or procedure binding 'i' already defined in this type
+!ERROR: FINAL subroutine 'i' of derived type 't2' must be a module procedure
 final :: i
   end type
   type t3
Index: flang/test/Semantics/modfile10.f90
===
--- flang/test/Semantics/modfile10.f90
+++ flang/test/Semantics/modfile10.f90
@@ -64,8 +64,8 @@
 !  type::t2
 !integer(4)::x
 !  contains
-!final::c
 !procedure,non_overridable,private::d
+!final::c
 !  end type
 !  type,abstract::t2a
 !  contains
Index: flang/test/Semantics/final01.f90
===
--- /dev/null
+++ flang/test/Semantics/final01.f90
@@ -0,0 +1,119 @@
+! RUN: %S/test_errors.sh %s %t %f18
+! Test FINAL subroutine constraints C786-C789
+module m1
+  external :: external
+  intrinsic :: sin
+  real :: object
+  procedure(valid), pointer :: pointer
+  type :: parent(kind1, len1)
+integer, kind :: kind1 = 1
+integer, len :: len1 = 1
+  end type
+  type, extends(parent) :: child(kind2, len2)
+integer, kind :: kind2 = 2
+integer, len :: len2 = 2
+   contains
+final :: valid
+!ERROR: FINAL subroutine 'external' of derived type 'child' must be a module procedure
+!ERROR: FINAL subroutine 'sin' of derived type 'child' must be a module procedure
+!ERROR: FINAL subroutine 'object' of derived type 'child' must be a module procedure
+!ERROR: FINAL subroutine 'pointer' of derived type 'child' must be a module procedure
+!ERROR: FINAL subroutine 'func' of derived type 'child' must be a subroutine
+final :: external, sin, object, pointer, func
+!ERROR: FINAL subroutine 's01' of derived type 'child' must have a single dummy argument that is a data object
+!ERROR: FINAL subroutine 's02' of derived type 'child' must have a single dummy argument that is a data object
+!ERROR: FINAL subroutine 's03' of derived type 'child' must not have a dummy argument with INTENT(OUT)
+!ERROR: FINAL subroutine 's04' of derived type 'child' must not have a dummy argument with the VALUE attribute
+!ERROR: FINAL subroutine 's05' of derived type 'child' must not have a POINTER dummy argument
+!ERROR: FINAL subroutine 's06' of derived type 'child' must not have an ALLOCATABLE dummy argument
+!ERROR: FINAL subroutine 's07' of derived type 'child' must not have a coarray dummy argument
+!ERROR: FINAL subroutine 's08' of derived type 'child' must not have a polymorphic dummy argument
+!ERROR: FINAL subroutine 's09' of derived type 'child' must not have a polymorphic dummy argument
+!ERROR: FINAL subroutine 's10' 

Re: [Lldb-commits] [lldb] 92e1ebe - [trace] Fix destructor declaration

2020-10-03 Thread Walter Erquinigo via lldb-commits
But what about the case Vedant mentioned?

>Otherwise, when a std::shared_ptr is destroyed, the destructor for 
> the derived TraceIntelPT instance won't run.

Or is C++ smart enough to pick the destructor from TraceIntelPT class in this 
case? 

On 9/30/20, 5:56 AM, "Pavel Labath"  wrote:

On 29/09/2020 22:09, Walter Erquinigo via lldb-commits wrote:
> The destructor must be defined in the implementation class so that it
> can be called

That doesn't sound right. Each class automatically gets a destructor if
it does not declare one itself. "~Foo() override = default" is
completely equivalent to omitting the destructor completely, if the base
destructor is virtual (which is true in this case, because the classes
inherit from PluginInterface).

pl

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


[Lldb-commits] [lldb] 0f08a1a - [lldb] [test/Register] Mark new FP reg tests XFAIL on Darwin

2020-10-03 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-10-03T22:36:28-07:00
New Revision: 0f08a1a5b162dcd2caf1b76827b917ca69e3e48d

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

LOG: [lldb] [test/Register] Mark new FP reg tests XFAIL on Darwin

This is failing on GreenDragon:
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/24066/

Added: 


Modified: 
lldb/test/Shell/Register/x86-64-fp-write.test
lldb/test/Shell/Register/x86-fp-read.test

Removed: 




diff  --git a/lldb/test/Shell/Register/x86-64-fp-write.test 
b/lldb/test/Shell/Register/x86-64-fp-write.test
index 38c894209118..6f8047f94360 100644
--- a/lldb/test/Shell/Register/x86-64-fp-write.test
+++ b/lldb/test/Shell/Register/x86-64-fp-write.test
@@ -1,4 +1,5 @@
 # XFAIL: system-windows
+# XFAIL: system-darwin
 # REQUIRES: native && target-x86_64
 # RUN: %clangxx_host %p/Inputs/x86-fp-write.cpp -o %t
 # RUN: %lldb -b -s %s %t | FileCheck %s

diff  --git a/lldb/test/Shell/Register/x86-fp-read.test 
b/lldb/test/Shell/Register/x86-fp-read.test
index 42c85baa2295..eac942f5989c 100644
--- a/lldb/test/Shell/Register/x86-fp-read.test
+++ b/lldb/test/Shell/Register/x86-fp-read.test
@@ -1,4 +1,5 @@
 # XFAIL: system-windows
+# XFAIL: system-darwin
 # REQUIRES: native && (target-x86 || target-x86_64)
 # RUN: %clangxx_host -g %p/Inputs/x86-fp-read.cpp -o %t
 # RUN: %lldb -b -s %s %t | FileCheck %s



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


[Lldb-commits] [PATCH] D88583: [lldb] [test/Register] Add read/write tests for x87 regs

2020-10-03 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

This is failing on GreenDragon so I've XFAILed the tests (temporarily). Can you 
take a look and see if they can be fixed and re-enabled?

  commit 0f08a1a5b162dcd2caf1b76827b917ca69e3e48d (HEAD -> master, 
origin/master, origin/HEAD)
  Author: Jonas Devlieghere 
  Date:   Sat Oct 3 22:36:28 2020 -0700
  
  [lldb] [test/Register] Mark new FP reg tests XFAIL on Darwin
  
  This is failing on GreenDragon:
  http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/24066/


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88583

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


[Lldb-commits] [PATCH] D86670: [intel-pt] Add a basic implementation of the dump command

2020-10-03 Thread walter erquinigo via Phabricator via lldb-commits
wallace abandoned this revision.
wallace added a comment.

I'm redoing this in https://reviews.llvm.org/D88769


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86670

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


[Lldb-commits] [PATCH] D88792: [lldb/test] Catch invalid calls to expect()

2020-10-03 Thread Dave Lee via Phabricator via lldb-commits
kastiglione created this revision.
kastiglione added reviewers: aprantl, JDevlieghere, teemperor.
Herald added subscribers: lldb-commits, kbarton, nemanjai.
Herald added a project: LLDB.
kastiglione requested review of this revision.

Add preconditions to `TestBase.expect()` that catch semantically invalid calls
that happen to succeed anyway. This also fixes the broken callsites caught by
these checks.

This prevents the following incorrect calls:

1. `self.expect("lldb command", "some substr")`
2. `self.expect("lldb command", "assert message", "some substr")`


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88792

Files:
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/test/API/commands/frame/diagnose/bad-reference/TestBadReference.py
  
lldb/test/API/commands/frame/diagnose/complicated-expression/TestComplicatedExpression.py
  
lldb/test/API/commands/frame/diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py
  
lldb/test/API/commands/frame/diagnose/dereference-this/TestDiagnoseDereferenceThis.py
  lldb/test/API/commands/frame/diagnose/inheritance/TestDiagnoseInheritance.py
  lldb/test/API/commands/frame/diagnose/local-variable/TestLocalVariable.py
  
lldb/test/API/commands/frame/diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py
  lldb/test/API/commands/settings/TestSettings.py
  lldb/test/API/driver/batch_mode/TestBatchMode.py
  
lldb/test/API/functionalities/breakpoint/breakpoint_by_line_and_column/TestBreakpointByLineAndColumn.py
  
lldb/test/API/functionalities/data-formatter/data-formatter-objc/cmtime/TestDataFormatterCMTime.py
  lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
  lldb/test/API/macosx/macCatalyst/TestMacCatalyst.py
  lldb/test/API/types/TestRecursiveTypes.py

Index: lldb/test/API/types/TestRecursiveTypes.py
===
--- lldb/test/API/types/TestRecursiveTypes.py
+++ lldb/test/API/types/TestRecursiveTypes.py
@@ -50,5 +50,5 @@
 
 self.runCmd("run", RUN_SUCCEEDED)
 
-self.expect("print tpi", RUN_SUCCEEDED)
-self.expect("print *tpi", RUN_SUCCEEDED)
+self.expect("print tpi")
+self.expect("print *tpi")
Index: lldb/test/API/macosx/macCatalyst/TestMacCatalyst.py
===
--- lldb/test/API/macosx/macCatalyst/TestMacCatalyst.py
+++ lldb/test/API/macosx/macCatalyst/TestMacCatalyst.py
@@ -24,8 +24,8 @@
 self.expect("image list -t -b",
 patterns=[self.getArchitecture() +
   r'.*-apple-ios.*-macabi a\.out'])
-self.expect("fr v s", "Hello macCatalyst")
-self.expect("p s", "Hello macCatalyst")
+self.expect("fr v s", substrs=["Hello macCatalyst"])
+self.expect("p s", substrs=["Hello macCatalyst"])
 self.check_debugserver(log)
 
 def check_debugserver(self, log):
Index: lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
===
--- lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
+++ lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
@@ -19,7 +19,7 @@
 self.expect_expr("ClassWithDeletedDefaultCtor(7).value", result_type="int", result_value="7")
 
 # FIXME: It seems we try to call the non-existent default constructor here which is wrong.
-self.expect("expr ClassWithDefaultedCtor().foo()", error=True, substrs="Couldn't lookup symbols:")
+self.expect("expr ClassWithDefaultedCtor().foo()", error=True, substrs=["Couldn't lookup symbols:"])
 
 # FIXME: Calling deleted constructors should fail before linking.
 self.expect("expr ClassWithDeletedCtor(1).value", error=True, substrs=["Couldn't lookup symbols:"])
Index: lldb/test/API/functionalities/data-formatter/data-formatter-objc/cmtime/TestDataFormatterCMTime.py
===
--- lldb/test/API/functionalities/data-formatter/data-formatter-objc/cmtime/TestDataFormatterCMTime.py
+++ lldb/test/API/functionalities/data-formatter/data-formatter-objc/cmtime/TestDataFormatterCMTime.py
@@ -48,6 +48,6 @@
 self.expect(
 'frame variable t4',
 substrs=['10 seconds', 'value = 10', 'timescale = 1', 'epoch = 0'])
-self.expect('frame variable t5', '-oo')
-self.expect('frame variable t6', '+oo')
-self.expect('frame variable t7', 'indefinite')
+self.expect('frame variable t5', substrs=['+oo'])
+self.expect('frame variable t6', substrs=['-oo'])
+self.expect('frame variable t7', substrs=['indefinite'])
Index: lldb/test/API/functionalities/breakpoint/breakpoint_by_line_and_column/TestBreakpointByLineAndColumn.py
===
--- lldb/test/API/functionalities/breakpoint/breakpoint_by_line_and_column/TestBreakpointByLineAndColumn.py
+++ lldb/t

[Lldb-commits] [PATCH] D88583: [lldb] [test/Register] Add read/write tests for x87 regs

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

In D88583#2310538 , @JDevlieghere 
wrote:

> This is failing on GreenDragon so I've XFAILed the tests (temporarily). Can 
> you take a look and see if they can be fixed and re-enabled?

I'm afraid I don't have enough context. Would you be able to rerun them for me 
with `FILECHECK_DUMP_INPUT_ON_FAILURE=1` envvar? Also, I'd suggest adding this 
to buildbot — it's really helpful if something starts failing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88583

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


[Lldb-commits] [PATCH] D88583: [lldb] [test/Register] Add read/write tests for x87 regs

2020-10-03 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D88583#2310556 , @mgorny wrote:

> In D88583#2310538 , @JDevlieghere 
> wrote:
>
>> This is failing on GreenDragon so I've XFAILed the tests (temporarily). Can 
>> you take a look and see if they can be fixed and re-enabled?
>
> I'm afraid I don't have enough context. Would you be able to rerun them for 
> me with `FILECHECK_DUMP_INPUT_ON_FAILURE=1` envvar? Also, I'd suggest adding 
> this to buildbot — it's really helpful if something starts failing.

I think it recently became the default? Either way the bot has the input:

http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/24066/testReport/junit/lldb-shell/Register/x86_64_fp_write_test/
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/24066/testReport/junit/lldb-shell/Register/x86_fp_read_test/


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88583

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


[Lldb-commits] [PATCH] D88583: [lldb] [test/Register] Add read/write tests for x87 regs

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

Well, it's not full input but sure, it's good enough. So I suppose the problem 
is that the register is named stmm instead of st. I suppose we can use a regex 
to fix read test, and maybe teach lldb stX alias for write test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88583

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