The places, and the line table in them, are made whatever Rt declares: a kernel keeps its lines for gdb
| @@ -2340,8 +2340,9 @@ | ||
| 2340 | 2340 | one of them alone stops the compiler with "Rt has calls but no teller", |
| 2341 | 2341 | naming the other. `-s` leaves all of them out, and the ELF's symbols and |
| 2342 | 2342 | line numbers with them. Without `-s`, an `Rt` that declares none still |
| 2343 | -has its symbols in the ELF (what a debugger reads), but no line table, which | |
| 2344 | -lives in the places table. A failed check in such a program is told by | |
| 2343 | +has its symbols and line numbers in the ELF, what a debugger reads: the | |
| 2344 | +places table, which holds the line table, is made whatever `Rt` declares, | |
| 2345 | +and only its address is left out. A failed check in such a program is told by | |
| 2345 | 2346 | its address: `fail` is given `at`, an address inside the code, and it is |
| 2346 | 2347 | for `Rt` to print it, or look it up in the symbols. A hosted program's |
| 2347 | 2348 | `Rt` is raz's, which declares them all, so its output is as before. |
| @@ -77,6 +77,9 @@ | ||
| 77 | 77 | end; |
| 78 | 78 | end; |
| 79 | 79 | end; |
| 80 | + (* the places hold the line table a debugger reads, so they are made | |
| 81 | + even when Rt takes no address of them, a kernel's Rt with no places *) | |
| 82 | + if (placesChunk >= 0) and not Chunk.chunks[placesChunk].live then Chunk.setLive(placesChunk); end; | |
| 80 | 83 | end; |
| 81 | 84 | |
| 82 | 85 | (* Gives the live chunks of one section their places, from start; |
| @@ -193,19 +193,19 @@ | ||
| 193 | 193 | end; |
| 194 | 194 | |
| 195 | 195 | (* What Rt is given for telling where a failed check was, as far as it |
| 196 | - declares it. The places table (and the line table in it) is made only | |
| 197 | - if Rt has `places`, a variable for its address; Rt's calls, place and | |
| 196 | + declares it. The places table, which holds the line table a debugger | |
| 197 | + reads, is always made (Link.markLive keeps it); Rt is given its | |
| 198 | + address only if it has `places`, a variable for it. Rt's calls, place and | |
| 198 | 199 | startProfile are linked to the variables teller, placer and profiler |
| 199 | 200 | (profiled: unless -noprofile or -bare). An Rt that declares none of |
| 200 | 201 | these, a kernel's, gets a failed check with only the raw address of |
| 201 | - the failing call, as with -s, and still has the ELF's symbols. *) | |
| 202 | + the failing call, as with -s, and still has the ELF's symbols and | |
| 203 | + lines. *) | |
| 202 | 204 | proc giveRtPlaces(rt: ^Sym.Module; profiled: BOOL); |
| 203 | 205 | begin |
| 204 | - if declares(rt, "places") then | |
| 205 | - Link.setPlaces(Chunk.newChunk(Chunk.secRodata, -1, -1)); | |
| 206 | - Chunk.setData(Link.placesChunk, nil, 0, 8); | |
| 207 | - addLink(Link.placesChunk, objIn(rt, "places")); | |
| 208 | - end; | |
| 206 | + Link.setPlaces(Chunk.newChunk(Chunk.secRodata, -1, -1)); | |
| 207 | + Chunk.setData(Link.placesChunk, nil, 0, 8); | |
| 208 | + if declares(rt, "places") then addLink(Link.placesChunk, objIn(rt, "places")); end; | |
| 209 | 209 | addPair(rt, "calls", "teller"); |
| 210 | 210 | addPair(rt, "place", "placer"); |
| 211 | 211 | if profiled then addPair(rt, "startProfile", "profiler"); end; |
| @@ -165,7 +165,7 @@ | ||
| 165 | 165 | statusFail=$( { ( exec $out/own/OwnFail ) > $out/own/OwnFail.out 2>&1; echo $?; } 2>/dev/null ) |
| 166 | 166 | if [ $status = 3 ] && [ $statusFail = 2 ] && [ "$(cat $out/own/Own.out)" = hello ] \ |
| 167 | 167 | && [ "$(cat $out/own/OwnFail.out)" = 'check failed: 0' ] \ |
| 168 | - && readelf -s $out/own/Own | grep -q ' Own.main$'; then pass=$((pass + 1)) | |
| 168 | + && readelf -s $out/own/Own | grep -q ' Own.main$' && readelf --debug-dump=decodedline $out/own/Own | grep -q 'Own.raz'; then pass=$((pass + 1)) | |
| 169 | 169 | else echo "FAIL own Rt: status $status, $statusFail"; cat $out/own/Own.out $out/own/OwnFail.out; fail=$((fail + 1)); fi |
| 170 | 170 | |
| 171 | 171 | # what src/ asks of lib/ is what doc/compiler.md lists (test/asks.sh) |