improved indentation and whitespace for markdown code blocks
All code blocks in markdown have been intended by at least 4 spaces. We add `--tab-stop=8` to all `pandoc(1)` executions in order to set a better tab stop indentation, especially for tab intended code blocks. Changed `bin/pandoc-wrapper.sh` VERSION from "1.5.3 2024-03-26" to "1.6 2024-03-31". Fixed `1991/brnstnd/sorta.README.md` so that the sorta code is code blocks. Removed unneeded paragraph group in copyright in `inc/footer.default.html`. Fixed excess whitespace after list Author on entry `index.html` page. Changed `bin/output-index-author.sh` VERSION from "1.5.2 2024-03-26" to "1.6 2024-03-31". Performed `make www` to perform the above and test under macOS. TODO: Fix the problem of the initial line of code being extra intended. TODO: Fix excess whitespace around code that is inline.
This commit is contained in:
1 parent
b84c27ce02
commit
a996f8d2b8
734 files changed
+16723
-16963
No files matched your search
+46
-46
@@ -1,7 +1,7 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
NOTE: the use of the C compiler optimiser was disabled and `-g` was enabled for
|
||||
@@ -13,7 +13,7 @@ this entry because it is SUPPOSED to crash and it needs debugging symbols.
|
||||
The current status of this entry is:
|
||||
|
||||
```
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
```
|
||||
|
||||
For more detailed information see [2019 endoh bugs](../../bugs.html#2019_endoh).
|
||||
@@ -22,7 +22,7 @@ For more detailed information see [2019 endoh bugs](../../bugs.html#2019_endoh).
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./prog
|
||||
./prog
|
||||
```
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ For more detailed information see [2019 endoh bugs](../../bugs.html#2019_endoh).
|
||||
If you have `gdb(1)` installed:
|
||||
|
||||
```sh
|
||||
./try.sh
|
||||
./try.sh
|
||||
```
|
||||
|
||||
Note that in macOS installing `gdb(1)` takes multiple steps - it's not just a
|
||||
@@ -41,7 +41,7 @@ only been tested with linux.
|
||||
You might also wish to try:
|
||||
|
||||
```sh
|
||||
gdb ./prog || lldb ./prog
|
||||
gdb ./prog || lldb ./prog
|
||||
```
|
||||
|
||||
and then type in `r` (to run program) and then `bt` (for backtrace).
|
||||
@@ -60,53 +60,53 @@ ascii` when debugging it to reveal its purpose.
|
||||
Compile prog.c with no optimization.
|
||||
|
||||
```sh
|
||||
cc -g -O0 -o prog prog.c
|
||||
cc -g -O0 -o prog prog.c
|
||||
```
|
||||
|
||||
Then, run it. You will see a segmentation fault.
|
||||
|
||||
```sh
|
||||
$ ./prog
|
||||
Segmentation fault (core dumped)
|
||||
$ ./prog
|
||||
Segmentation fault (core dumped)
|
||||
```
|
||||
|
||||
Let's debug. As usual, run it under gdb.
|
||||
|
||||
```sh
|
||||
$ gdb ./prog
|
||||
(gdb) run
|
||||
Starting program: /home/.../prog
|
||||
$ gdb ./prog
|
||||
(gdb) run
|
||||
Starting program: /home/.../prog
|
||||
|
||||
Program received signal SIGSEGV, Segmentation fault.
|
||||
0x0000000000000000 in ?? ()
|
||||
Program received signal SIGSEGV, Segmentation fault.
|
||||
0x0000000000000000 in ?? ()
|
||||
```
|
||||
|
||||
Okay, check the backtrace.
|
||||
|
||||
```
|
||||
(gdb) backtrace
|
||||
#0 0x0000000000000000 in ?? ()
|
||||
#1 0x0000555555555201 in x23 () at prog.c:35
|
||||
#2 0x000055555555571a in x64 () at prog.c:100
|
||||
#3 0x0000555555555747 in x65 () at prog.c:101
|
||||
#4 0x0000555555555774 in x66 () at prog.c:102
|
||||
#5 0x00005555555557ce in x69 () at prog.c:105
|
||||
#6 0x0000555555555828 in x6e () at prog.c:110
|
||||
#7 0x0000555555555747 in x65 () at prog.c:101
|
||||
...
|
||||
(gdb) backtrace
|
||||
#0 0x0000000000000000 in ?? ()
|
||||
#1 0x0000555555555201 in x23 () at prog.c:35
|
||||
#2 0x000055555555571a in x64 () at prog.c:100
|
||||
#3 0x0000555555555747 in x65 () at prog.c:101
|
||||
#4 0x0000555555555774 in x66 () at prog.c:102
|
||||
#5 0x00005555555557ce in x69 () at prog.c:105
|
||||
#6 0x0000555555555828 in x6e () at prog.c:110
|
||||
#7 0x0000555555555747 in x65 () at prog.c:101
|
||||
...
|
||||
```
|
||||
|
||||
See the line numbers and lookup the ASCII table.
|
||||
|
||||
```
|
||||
35 = '#'
|
||||
100 = 'd'
|
||||
101 = 'e'
|
||||
102 = 'f'
|
||||
105 = 'i'
|
||||
110 = 'n'
|
||||
101 = 'e'
|
||||
...
|
||||
35 = '#'
|
||||
100 = 'd'
|
||||
101 = 'e'
|
||||
102 = 'f'
|
||||
105 = 'i'
|
||||
110 = 'n'
|
||||
101 = 'e'
|
||||
...
|
||||
```
|
||||
|
||||
### One more thing:
|
||||
@@ -114,27 +114,27 @@ See the line numbers and lookup the ASCII table.
|
||||
The original program can be used as a GDB command file.
|
||||
|
||||
```
|
||||
gdb -q -x prog.c ./prog | cat
|
||||
Reading symbols from ./prog...done.
|
||||
gdb -q -x prog.c ./prog | cat
|
||||
Reading symbols from ./prog...done.
|
||||
|
||||
Program received signal SIGSEGV, Segmentation fault.
|
||||
0x0000000000000000 in ?? ()
|
||||
#0 0x0000000000000000 in ?? ()
|
||||
#1 0x0000555555555201 in x23 () at prog.c:35
|
||||
#2 0x000055555555571a in x64 () at prog.c:100
|
||||
#3 0x0000555555555747 in x65 () at prog.c:101
|
||||
#4 0x0000555555555774 in x66 () at prog.c:102
|
||||
#5 0x00005555555557ce in x69 () at prog.c:105
|
||||
#6 0x0000555555555828 in x6e () at prog.c:110
|
||||
#7 0x0000555555555747 in x65 () at prog.c:101
|
||||
...
|
||||
Program received signal SIGSEGV, Segmentation fault.
|
||||
0x0000000000000000 in ?? ()
|
||||
#0 0x0000000000000000 in ?? ()
|
||||
#1 0x0000555555555201 in x23 () at prog.c:35
|
||||
#2 0x000055555555571a in x64 () at prog.c:100
|
||||
#3 0x0000555555555747 in x65 () at prog.c:101
|
||||
#4 0x0000555555555774 in x66 () at prog.c:102
|
||||
#5 0x00005555555557ce in x69 () at prog.c:105
|
||||
#6 0x0000555555555828 in x6e () at prog.c:110
|
||||
#7 0x0000555555555747 in x65 () at prog.c:101
|
||||
...
|
||||
```
|
||||
|
||||
By using this, you can confirm that it is actually a quine.
|
||||
|
||||
```sh
|
||||
gdb -q -x prog.c ./prog | sed -n -r 's/#.*:([0-9]+)/\1/p' | awk '{printf "%c",$1}' > prog2.c
|
||||
diff prog.c prog2.c
|
||||
gdb -q -x prog.c ./prog | sed -n -r 's/#.*:([0-9]+)/\1/p' | awk '{printf "%c",$1}' > prog2.c
|
||||
diff prog.c prog2.c
|
||||
```
|
||||
|
||||
<!--
|
||||
|
||||
Reference in new issue
Block a user