Skip to content

Commit aad1da8

Browse files
committed
Add unit test
1 parent 7f3c702 commit aad1da8

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
C_SOURCES := main.c
2+
include Makefile.rules
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import lldb
2+
from lldbsuite.test.lldbtest import *
3+
from lldbsuite.test import lldbutil
4+
5+
6+
class TestCase(TestBase):
7+
def test(self):
8+
self.build()
9+
lldbutil.run_to_source_breakpoint(self, "break here", lldb.SBFileSpec("main.c"))
10+
self.expect("v player", substrs=['"Dirk" (41)'])
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <stdio.h>
2+
3+
struct Player {
4+
char *name;
5+
int number;
6+
};
7+
8+
__attribute__((used, section("__DATA_CONST,__lldbsummaries"))) unsigned char
9+
_Movie_type_summary[] = "\x01" // version
10+
"\x25" // record size
11+
"\x07" // type name size
12+
"Player\0" // type name
13+
"\x1c" // summary string size
14+
"${var.name} (${var.number})"; // summary string
15+
16+
int main() {
17+
struct Player player;
18+
player.name = "Dirk";
19+
player.number = 41;
20+
puts("break here");
21+
return 0;
22+
}

0 commit comments

Comments
 (0)