blob: f82a2e290a24ed97c4b4ff39c6a2b5dea5cd5799 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
""" Tests that compressed debug info sections are used. """
import os
import lldb
import sys
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestCompressedDebugInfo(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
TestBase.setUp(self)
@no_debug_info_test # Prevent the genaration of the dwarf version of this test
@skipUnlessPlatform(["linux"])
def test_compressed_debug_info(self):
"""Tests that the 'frame variable' works with compressed debug info."""
self.build()
process = lldbutil.run_to_source_breakpoint(
self, "main", lldb.SBFileSpec("a.c"), exe_name="compressed.out")[1]
# The process should be stopped at a breakpoint, and the z variable should
# be in the top frame.
self.assertTrue(process.GetState() == lldb.eStateStopped,
STOPPED_DUE_TO_BREAKPOINT)
frame = process.GetThreadAtIndex(0).GetFrameAtIndex(0)
self.assertTrue(frame.FindVariable("z").IsValid(), "z is not valid")
@no_debug_info_test # Prevent the genaration of the dwarf version of this test
@skipUnlessPlatform(["linux"])
def test_compressed_debug_info_gnu(self):
"""Tests that the 'frame variable' works with gnu-style compressed debug info."""
self.build()
process = lldbutil.run_to_source_breakpoint(
self, "main", lldb.SBFileSpec("a.c"), exe_name="compressed.gnu.out")[1]
# The process should be stopped at a breakpoint, and the z variable should
# be in the top frame.
self.assertTrue(process.GetState() == lldb.eStateStopped,
STOPPED_DUE_TO_BREAKPOINT)
frame = process.GetThreadAtIndex(0).GetFrameAtIndex(0)
self.assertTrue(frame.FindVariable("z").IsValid(), "z is not valid")
|