aboutsummaryrefslogtreecommitdiff
path: root/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py')
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py42
1 files changed, 29 insertions, 13 deletions
diff --git a/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py b/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py
index e70ad5f570a7..ffabefc70f8d 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py
@@ -1,12 +1,12 @@
from __future__ import print_function
-
import gdbremote_testcase
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class TestGdbRemoteAuxvSupport(gdbremote_testcase.GdbRemoteTestCaseBase):
mydir = TestBase.compute_mydir(__file__)
@@ -15,7 +15,8 @@ class TestGdbRemoteAuxvSupport(gdbremote_testcase.GdbRemoteTestCaseBase):
def has_auxv_support(self):
inferior_args = ["message:main entered", "sleep:5"]
- procs = self.prep_debug_monitor_and_inferior(inferior_args=inferior_args)
+ procs = self.prep_debug_monitor_and_inferior(
+ inferior_args=inferior_args)
# Don't do anything until we match the launched inferior main entry output.
# Then immediately interrupt the process.
@@ -25,8 +26,9 @@ class TestGdbRemoteAuxvSupport(gdbremote_testcase.GdbRemoteTestCaseBase):
# Start the inferior...
"read packet: $c#63",
# ... match output....
- { "type":"output_match", "regex":self.maybe_strict_output_regex(r"message:main entered\r\n") },
- ], True)
+ {"type": "output_match", "regex": self.maybe_strict_output_regex(
+ r"message:main entered\r\n")},
+ ], True)
# ... then interrupt.
self.add_interrupt_packets()
self.add_qSupported_packets()
@@ -35,7 +37,8 @@ class TestGdbRemoteAuxvSupport(gdbremote_testcase.GdbRemoteTestCaseBase):
self.assertIsNotNone(context)
features = self.parse_qSupported_response(context)
- return self.AUXV_SUPPORT_FEATURE_NAME in features and features[self.AUXV_SUPPORT_FEATURE_NAME] == "+"
+ return self.AUXV_SUPPORT_FEATURE_NAME in features and features[
+ self.AUXV_SUPPORT_FEATURE_NAME] == "+"
def get_raw_auxv_data(self):
# Start up llgs and inferior, and check for auxv support.
@@ -60,10 +63,20 @@ class TestGdbRemoteAuxvSupport(gdbremote_testcase.GdbRemoteTestCaseBase):
# Grab the auxv data.
self.reset_test_sequence()
- self.test_sequence.add_log_lines([
- "read packet: $qXfer:auxv:read::{:x},{:x}:#00".format(OFFSET, LENGTH),
- {"direction":"send", "regex":re.compile(r"^\$([^E])(.*)#[0-9a-fA-F]{2}$", re.MULTILINE|re.DOTALL), "capture":{1:"response_type", 2:"content_raw"} }
- ], True)
+ self.test_sequence.add_log_lines(
+ [
+ "read packet: $qXfer:auxv:read::{:x},{:x}:#00".format(
+ OFFSET,
+ LENGTH),
+ {
+ "direction": "send",
+ "regex": re.compile(
+ r"^\$([^E])(.*)#[0-9a-fA-F]{2}$",
+ re.MULTILINE | re.DOTALL),
+ "capture": {
+ 1: "response_type",
+ 2: "content_raw"}}],
+ True)
context = self.expect_gdbremote_sequence()
self.assertIsNotNone(context)
@@ -101,8 +114,9 @@ class TestGdbRemoteAuxvSupport(gdbremote_testcase.GdbRemoteTestCaseBase):
(word_size, auxv_data) = self.get_raw_auxv_data()
self.assertIsNotNone(auxv_data)
- # Ensure auxv data is a multiple of 2*word_size (there should be two unsigned long fields per auxv entry).
- self.assertEqual(len(auxv_data) % (2*word_size), 0)
+ # Ensure auxv data is a multiple of 2*word_size (there should be two
+ # unsigned long fields per auxv entry).
+ self.assertEqual(len(auxv_data) % (2 * word_size), 0)
# print("auxv contains {} entries".format(len(auxv_data) / (2*word_size)))
@debugserver_test
@@ -179,10 +193,12 @@ class TestGdbRemoteAuxvSupport(gdbremote_testcase.GdbRemoteTestCaseBase):
auxv_dict = self.build_auxv_dict(endian, word_size, auxv_data)
self.assertIsNotNone(auxv_dict)
- iterated_auxv_data = self.read_binary_data_in_chunks("qXfer:auxv:read::", 2*word_size)
+ iterated_auxv_data = self.read_binary_data_in_chunks(
+ "qXfer:auxv:read::", 2 * word_size)
self.assertIsNotNone(iterated_auxv_data)
- auxv_dict_iterated = self.build_auxv_dict(endian, word_size, iterated_auxv_data)
+ auxv_dict_iterated = self.build_auxv_dict(
+ endian, word_size, iterated_auxv_data)
self.assertIsNotNone(auxv_dict_iterated)
# Verify both types of data collection returned same content.