Re: [Lldb-commits] [lldb] r324792 - Add test case for x86_64 architecture recognition in the

2018-02-15 Thread Pavel Labath via lldb-commits
This test was failing when run against a "remote" target (at least
android, but possibly others). I've skipped it because it's not really
applicable to the remote test suite, but I did notice something you
may want to know about while investigating:

The test verifies that the target triple is deduced as "x86_64--",
which is true when we run it with the "host" as the currently selected
platform. However, if the currently selected platform is
"remote-android", then something interesting happens: The platform of
the newly created target is set to "host" (which I presume is correct,
as that's the platform which is selected in the non-remote case as
well), however, the *triple* is deduced as "x86_64-apple-macosx"
(which seems a bit odd).

I don't really know what this means, but I'm writing it here in case
that's something you want to know about.

On 10 February 2018 at 01:13, Jason Molenda via lldb-commits
 wrote:
> Author: jmolenda
> Date: Fri Feb  9 17:13:34 2018
> New Revision: 324792
>
> URL: http://llvm.org/viewvc/llvm-project?rev=324792=rev
> Log:
> Add test case for x86_64 architecture recognition in the
> target.xml packet if it is included.
>
> Added:
> 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py
> Modified:
> 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
>
> Added: 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py?rev=324792=auto
> ==
> --- 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py
>  (added)
> +++ 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py
>  Fri Feb  9 17:13:34 2018
> @@ -0,0 +1,121 @@
> +from __future__ import print_function
> +import lldb
> +from lldbsuite.test.lldbtest import *
> +from lldbsuite.test.decorators import *
> +from gdbclientutils import *
> +
> +class TestTargetXMLArch(GDBRemoteTestBase):
> +
> +def test(self):
> +"""
> +Test lldb's parsing of the  tag in the target.xml 
> register
> +description packet.
> +"""
> +class MyResponder(MockGDBServerResponder):
> +
> +def qXferRead(self, obj, annex, offset, length):
> +if annex == "target.xml":
> +return """
> +
> +  i386:x86-64
> +  
> +
> + 
> + 
> + 
> + 
> + 
> + 
> + 
> + 
> + 
> + 
> + 
> + 
> + 
> + 
> + 
> + 
> + 
> + 
> + 
> +
> + type="int" group="general"/>
> + type="int" group="general"/>
> + type="int" group="general"/>
> + type="int" group="general"/>
> + type="int" group="general"/>
> + type="int" group="general"/>
> + type="data_ptr" group="general"/>
> + type="data_ptr" group="general"/>
> + type="int" group="general"/>
> + type="int" group="general"/>
> + type="int" group="general"/>
> + type="int" group="general"/>
> + type="int" group="general"/>
> + type="int" group="general"/>
> + type="int" group="general"/>
> + type="int" group="general"/>
> + type="code_ptr" group="general"/>
> + type="i386_eflags" group="general"/>
> +
> + type="int" group="general"/>
> + type="int" group="general"/>
> + type="int" group="general"/>
> + type="int" group="general"/>
> + type="int" group="general"/>
> + type="int" group="general"/>
> +
> + type="i387_ext" group="float"/>
> + type="i387_ext" group="float"/>
> + type="i387_ext" group="float"/>
> +  

[Lldb-commits] [lldb] r324792 - Add test case for x86_64 architecture recognition in the

2018-02-09 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Fri Feb  9 17:13:34 2018
New Revision: 324792

URL: http://llvm.org/viewvc/llvm-project?rev=324792=rev
Log:
Add test case for x86_64 architecture recognition in the
target.xml packet if it is included.

Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py
Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py?rev=324792=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py
 Fri Feb  9 17:13:34 2018
@@ -0,0 +1,121 @@
+from __future__ import print_function
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+from gdbclientutils import *
+
+class TestTargetXMLArch(GDBRemoteTestBase):
+
+def test(self):
+"""
+Test lldb's parsing of the  tag in the target.xml 
register
+description packet.
+"""
+class MyResponder(MockGDBServerResponder):
+
+def qXferRead(self, obj, annex, offset, length):
+if annex == "target.xml":
+return """
+
+  i386:x86-64
+  
+
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+""", False
+else:
+return None, False
+
+def qC(self):
+return "QC1"
+
+def haltReason(self):
+return 
"T05thread:0001;06:9038d60f0070;07:98b4062680ff;10:c0d7bf1b80ff;"
+
+def readRegister(self, register):
+regs = {0x0: "00b00661", 
+0xa: "68fe471c80ff", 
+0xc: "60574a1c80ff", 
+0xd: "18f3042680ff", 
+0xe: "be8a4d714200", 
+0xf: "50df471c80ff", 
+0x10: "c0d7bf1b80ff" }
+if register in regs:
+return regs[register]
+else:
+return ""
+
+self.server.responder = MyResponder()
+interp = self.dbg.GetCommandInterpreter()
+result = lldb.SBCommandReturnObject()
+if self.TraceOn():
+interp.HandleCommand("log enable gdb-remote packets", result)
+target = self.dbg.CreateTarget('')
+self.assertEqual('', target.GetTriple())
+process = self.connect(target)
+if self.TraceOn():
+interp.HandleCommand("target list", result)
+print(result.GetOutput())
+self.assertEqual('x86_64--', target.GetTriple())

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
URL: