9
9
from lldbsuite .test .lldbtest import *
10
10
from lldbsuite .test import lldbutil
11
11
12
-
13
12
class ProcessSaveCoreMinidumpTestCase (TestBase ):
14
13
def verify_core_file (
15
14
self , core_path , expected_pid , expected_modules , expected_threads
16
15
):
17
- breakpoint ()
18
16
# To verify, we'll launch with the mini dump
19
17
target = self .dbg .CreateTarget (None )
20
18
process = target .LoadCore (core_path )
@@ -44,13 +42,14 @@ def verify_core_file(
44
42
thread_id = thread .GetThreadID ()
45
43
self .assertIn (thread_id , expected_threads )
46
44
oldest_frame = thread .GetFrameAtIndex (thread .GetNumFrames () - 1 )
47
- stack_start = oldest_frame .GetSymbol (). GetStartAddress (). GetFileAddress ()
45
+ stack_start = oldest_frame .GetSP ()
48
46
frame = thread .GetFrameAtIndex (0 )
49
47
sp = frame .GetSP ()
50
- stack_size = stack_start - (sp - red_zone )
51
- byte_array = process .ReadMemory (sp - red_zone + 1 , stack_size , error )
52
- self .assertTrue (error .Success (), "Failed to read stack" )
53
- self .assertEqual (stack_size - 1 , len (byte_array ), "Incorrect stack size read" ),
48
+ error = lldb .SBError ()
49
+ process .ReadMemory (sp - red_zone + 1 , 1 , error )
50
+ self .assertTrue (error .Success (), error .GetCString ())
51
+ process .ReadMemory (stack_start - 1 , 1 , error )
52
+ self .assertTrue (error .Success (), error .GetCString ())
54
53
55
54
56
55
self .dbg .DeleteTarget (target )
@@ -59,6 +58,7 @@ def verify_core_file(
59
58
@skipUnlessPlatform (["linux" ])
60
59
def test_save_linux_mini_dump (self ):
61
60
"""Test that we can save a Linux mini dump."""
61
+
62
62
self .build ()
63
63
exe = self .getBuildArtifact ("a.out" )
64
64
core_stack = self .getBuildArtifact ("core.stack.dmp" )
0 commit comments