Skip to content

Commit 1235949

Browse files
petr-bauchdanpoe
authored andcommitted
Address comments wrt regression tests
Mostly specifying why they are not supported now.
1 parent 5a64ecc commit 1235949

File tree

26 files changed

+83
-52
lines changed

26 files changed

+83
-52
lines changed
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
FUTURE
2-
arrays.exe
2+
arrays.gb
33
--breakpoint manipulate_data --symbols test_struct
44
analyzing symbol: test_struct
5-
GENERATED CODE:
5+
GENERATED CODE:
66
\{
77
char _test_struct_childs0_options0_text_1\[\]="accept";
88
char _test_struct_childs0_options1_text_2\[\]="unique0";
@@ -11,14 +11,17 @@ GENERATED CODE:
1111
char _test_struct_childs3_options1_text_5\[\]="unique3";
1212
struct a_typet test_struct_0=\{ .config=\{ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 \}, .initalized=0,
1313
.values=\{ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171 \}, .childs=\{ \{ .id=12, .options=\{ \{ .text=\(char \*\)&_test_struct_childs0_options0_text_1 \},
14-
\{ .text=\(char \*\)&_test_struct_childs0_options1_text_2 \} \} \},
14+
\{ .text=\(char \*\)&_test_struct_childs0_options1_text_2 \} \} \},
1515
\{ .id=13, .options=\{ \{ .text=\(char \*\)&_test_struct_childs0_options0_text_1 \},
16-
\{ .text=\(char \*\)&_test_struct_childs1_options1_text_3 \} \} \},
16+
\{ .text=\(char \*\)&_test_struct_childs1_options1_text_3 \} \} \},
1717
\{ .id=14, .options=\{ \{ .text=\(char \*\)&_test_struct_childs0_options0_text_1 \},
18-
\{ .text=\(char \*\)&_test_struct_childs2_options1_text_4 \} \} \},
18+
\{ .text=\(char \*\)&_test_struct_childs2_options1_text_4 \} \} \},
1919
\{ .id=15, .options=\{ \{ .text=\(char \*\)&_test_struct_childs0_options0_text_1 \},
2020
\{ .text=\(char \*\)&_test_struct_childs3_options1_text_5 \} \} \} \} \};
2121
test_struct = &test_struct_0;
2222
\}
2323
^EXIT=0$
2424
^SIGNAL=0$
25+
--
26+
--
27+
`values` is an array of unsigned chars which we currently cannot extract from GDB

regression/memory-analyzer/arrays_01/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
2-
main.exe
2+
main.gb
33
--breakpoint checkpoint --symbols array
44
array = \{ 1, 4, 3 \};
55
^EXIT=0$

regression/memory-analyzer/chain.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ set -e
55
memory_analyzer=$1
66
goto_gcc=$2
77
name=${*:$#}
8-
name=${name%.exe}
8+
name=${name%.gb}
99
args=${*:3:$#-3}
1010

11-
$goto_gcc -g -std=c11 -o "${name}.exe" "${name}.c"
12-
$memory_analyzer $args "${name}.exe"
11+
$goto_gcc -g -std=c11 -o "${name}.gb" "${name}.c"
12+
$memory_analyzer $args "${name}.gb"
Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
FUTURE
2-
cycles.exe
1+
CORE
2+
cycles.gb
33
--breakpoint process_buffer --symbols buffer
4-
char buffer_start__data_1\[\]="snow";
5-
char buffer_start__next__data_3\[\]="sun";
6-
char buffer_start__next__next__data_5\[\]="rain";
7-
char buffer_start__next__next__next__data_7\[\]="thunder storm";
8-
struct cycle_buffer_entry buffer_start__next__next__next_6\=\{ \.data\=\(char \*\)&buffer_start__next__next__next__data_7, \.next\=\(\(struct cycle_buffer_entry \*\)NULL\) \};
9-
struct cycle_buffer_entry buffer_start__next__next_4\=\{ \.data\=\(char \*\)&buffer_start__next__next__data_5, \.next\=&buffer_start__next__next__next_6 \};
10-
struct cycle_buffer_entry buffer_start__next_2\=\{ \.data\=\(char \*\)&buffer_start__next__data_3, \.next\=&buffer_start__next__next_4 \};
11-
cycle_buffer_entry_t buffer_start_0\=\{ \.data\=\(char \*\)&buffer_start__data_1, \.next\=&buffer_start__next_2 \};
12-
buffer\.start \= &buffer_start_0;
13-
buffer\.end \= &buffer_start__next__next__next_6;
14-
buffer\.start\-\>next\-\>next\-\>next\-\>next \= &buffer_start_0;
4+
cycle_buffer_entry_t tmp;
5+
char tmp\$0\[\];
6+
struct cycle_buffer_entry tmp\$1;
7+
char tmp\$2\[\];
8+
struct cycle_buffer_entry tmp\$3;
9+
char tmp\$4\[\];
10+
struct cycle_buffer_entry tmp\$5;
11+
char tmp\$6\[\];
12+
tmp\$0 = \"snow\";
13+
tmp\$2 = \"sun\";
14+
tmp\$4 = \"rain\";
15+
tmp\$6 = \"thunder storm\";
16+
tmp\$5 = \{ .data=tmp\$6, .next=\(\(struct cycle_buffer_entry \*\)0\) \};
17+
tmp\$3 = \{ .data=tmp\$4, .next=&tmp\$5 \};
18+
tmp\$1 = \{ .data=tmp\$2, .next=&tmp\$3 \};
19+
tmp = \{ .data=tmp\$0, .next=&tmp\$1 \};
20+
buffer = \{ .start=&tmp, .end=&tmp\$5 \};
21+
buffer.start->next->next->next->next = &tmp;
1522
^EXIT=0$
1623
^SIGNAL=0$
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
2-
main.exe
2+
main.gb
33
--breakpoint checkpoint --symbols x,p,st,a --symtab-snapshot --json-ui
44
^EXIT=0$
55
^SIGNAL=0$

regression/memory-analyzer/primitive_types/primitive_types.c renamed to regression/memory-analyzer/plain_old_datatypes/plain_old_datatypes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/// Pointer references are tested and ensured, that for example f and f_1 are
66
/// pointing to the same int value location after running memory-analyzer.
77

8-
#include "primitive_types.h"
8+
#include "plain_old_datatypes.h"
99
int my_function(char *s)
1010
{
1111
int a = 10;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CORE
2+
plain_old_datatypes.gb
3+
--breakpoint my_function --symbols e,f,f_1,d,g,h
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
char tmp\[\];
7+
struct mapping_things tmp\$0;
8+
char tmp\$1\[\];
9+
e = 17;
10+
f = &e;
11+
f_1 = &e;
12+
tmp = \"test2\";
13+
d = \{ .a=4, .b=tmp, .c=-32 \};
14+
tmp\$0 = \{ .a=0, .b=\(\(char \*\)0\), .c=0 \};
15+
g = &tmp\$0;
16+
tmp\$1 = \"test\";
17+
h = tmp\$1;

regression/memory-analyzer/pointer_01/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
2-
main.exe
2+
main.gb
33
--breakpoint checkpoint --symbols x,p
44
x = 3;
55
p = &x;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
2-
main.exe
2+
main.gb
33
--breakpoint checkpoint --symbols p,x
44
^EXIT=0$
55
^SIGNAL=0$

regression/memory-analyzer/pointer_03/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
2-
main.exe
2+
main.gb
33
--breakpoint checkpoint --symbols x,p
44
x = 3;
55
p = &x;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
2-
main.exe
2+
main.gb
33
--breakpoint checkpoint --symbols x,p1,p2
44
^EXIT=0$
55
^SIGNAL=0$
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
2-
main.exe
2+
main.gb
33
--breakpoint checkpoint --symbols p1,x,p2
44
^EXIT=0$
55
^SIGNAL=0$
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
2-
main.exe
2+
main.gb
33
--breakpoint checkpoint --symbols p,x
44
^EXIT=0$
55
^SIGNAL=0$
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
2-
main.exe
2+
main.gb
33
--breakpoint checkpoint --symbols p
44
^EXIT=0$
55
^SIGNAL=0$
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
KNOWNBUG
2-
main.exe
2+
main.gb
33
--breakpoint checkpoint --symbols p
44
^EXIT=0$
55
^SIGNAL=0$
6+
--
7+
--
8+
p has type void*, the value it points to has type void; right now we can't initialize expression of that type

regression/memory-analyzer/pointer_to_struct_01/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
2-
main.exe
2+
main.gb
33
--breakpoint checkpoint --symbols p
44
struct S tmp;
55
tmp = \{ \.next=\(\(struct S \*\)(NULL|0)\) \};

regression/memory-analyzer/primitive_types/test.desc

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
KNOWNBUG
2-
main.exe
1+
CORE
2+
main.gb
33
--breakpoint checkpoint --symbols s
4-
char tmp\[4\];
5-
tmp = "abc";
4+
char tmp\[\];
5+
tmp = \"abc\";
66
s = tmp;
77
^EXIT=0$
88
^SIGNAL=0$

regression/memory-analyzer/structs_01/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
2-
main.exe
2+
main.gb
33
--breakpoint checkpoint --symbols st
44
st = \{ .c1=1, .c2=3 \};
55
^EXIT=0$

regression/memory-analyzer/structs_02/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
2-
main.exe
2+
main.gb
33
--breakpoint checkpoint --symbols st
44
signed int tmp;
55
tmp = 3;
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
KNOWNBUG
2-
main.exe
1+
CORE
2+
main.gb
33
--breakpoint checkpoint --symbols st
4-
char tmp[4];
5-
tmp = "abc";
4+
char tmp\[\];
5+
tmp = \"abc\";
66
st = \{ .c1=1, .c2=tmp \};
77
^EXIT=0$
88
^SIGNAL=0$
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
KNOWNBUG
2-
main.exe
2+
main.gb
33
--breakpoint checkpoint --symbols st
44
st = \{ .c1=1, .c2='x' \};
55
^EXIT=0$
66
^SIGNAL=0$
7+
--
8+
--
9+
cannot extract single characters from GDB for now

regression/memory-analyzer/structs_05/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
2-
main.exe
2+
main.gb
33
--breakpoint checkpoint --symbols st
44
st = \{ .c1=1, .a=\{ 2, 3 \} \};
55
^EXIT=0$

regression/memory-analyzer/structs_06/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
2-
main.exe
2+
main.gb
33
--breakpoint checkpoint --symbols st
44
st = \{ \.c=1, \.t=\{ \.i=2 \} \};
55
^EXIT=0$
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
KNOWNBUG
2-
void_pointer.exe
2+
void_pointer.gb
33
--breakpoint void_pointer.c:17 --symbols a_void_pointer,a_second_void_pointer,a_third_void_pointer,blob
44
^EXIT=0$
55
^SIGNAL=0$
6+
--
7+
--
8+
void pointer unsupported for now

0 commit comments

Comments
 (0)