about summary refs log tree commit diff stats
path: root/translate_subx_debug
blob: 021de0a435f83de61eb4f26447ea6256ab0752fe (plain) (blame)
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
#!/bin/sh
# Translate SubX files with debug information on Linux.
#
# Mu's core tooling has a gap:
#   0. The C++ translator 'subx translate' can generate debug information on
#   Linux or BSD or Mac, but doesn't support any syntax sugar.
#   1. The self-hosted translator 'translate' runs in emulated mode and can
#   run on Linux or BSD or Mac. However, syntax sugar passes (sigils and
#   calls) can be very slow to run emulated.
#   2. The self-hosted translator 'translate_subx' runs natively on Linux. It is
#   fast, but you get no trace for runs and zero error-checking on the code
#   emitted by sigils and calls. Which could still be buggy.
#
# This script is a hack to get the best of all worlds. We run natively what we
# must, and leverage as much debug information as possible. This arrangement
# is snappy but requires Linux just like 'translate_subx'. You also are on your
# own to mentally map desugared instructions in traces and error messages back
# to the original sources.

set -e

cat $*          |apps/braces          > a.braces
cat a.braces    |apps/calls           > a.calls
cat a.calls     |apps/sigils          > a.sigils

./bootstrap --debug translate a.sigils -o a.elf

chmod +x a.elf
>cd2458c0 ^
0ae975c2 ^

30b5f112 ^
b21edfaa ^
9482ce61 ^
5c53e02d ^
30b5f112 ^





09cd2881 ^


a952776b ^
09cd2881 ^


1900402f ^
30b5f112 ^


446027b9 ^
30b5f112 ^






316b6a7b ^
30b5f112 ^
316b6a7b ^
cce01f1d ^
316b6a7b ^

30b5f112 ^
216493ef ^
316b6a7b ^
16fbdedc ^
b4482b9f ^
216493ef ^

b4482b9f ^
216493ef ^

b4482b9f ^
216493ef ^
5bccee93 ^
abc2f0de ^
97d96746 ^

cce01f1d ^
5bccee93 ^
f91b21a1 ^
2bda22c3 ^
a00095c8 ^
2bda22c3 ^

30b5f112 ^
b21edfaa ^
f082563b ^
57dc5f14 ^
01e13f98 ^
295cb0da ^
56602278 ^
f0f3a739 ^
35239ee3 ^

84ccee20 ^
fb7001cf ^
72c1c496 ^
bab75cae ^
0aa758cb ^
3c1db1cd ^
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154