Browse Source

Move Go to a subdir

Přemysl Janouch 1 year ago
parent
commit
886f8179ab
Signed by: Přemysl Janouch <p.janouch@gmail.com> GPG Key ID: B715679E3A361BE6
4 changed files with 9 additions and 8 deletions
  1. 9
    8
      README.adoc
  2. 0
    0
      dwarf/object-file-libc.go
  3. 0
    0
      dwarf/object-file.go
  4. 0
    0
      dwarf/simple.go

+ 9
- 8
README.adoc View File

@@ -35,25 +35,26 @@ When no input file is specified, standard input is used.  Similarly, the default
35 35
 output filename is `a.out`.  After the compilation, the resulting file can be
36 36
 run on the target platform.
37 37
 
38
-gdb
39
----
40
-You may have noticed the `gdb-experiment.go` file.  It is a non-optimizing
38
+DWARF
39
+-----
40
+You may have noticed the 'dwarf' directory.  `simple.go` is a non-optimizing
41 41
 version of the compiler targeting Linux only that adds DWARF debugging
42 42
 information mapping code locations onto lines in the `ir-dump.txt` byproduct
43 43
 output file.  It's been rewritten in Go since managing all those binary buffers
44 44
 required to build the symbol table proved to be too painful in C.
45 45
 
46
- $ go run gdb-experiment.go [INPUT-FILE] [OUTPUT-FILE]
46
+ $ go run dwarf/simple.go [INPUT-FILE] [OUTPUT-FILE]
47 47
 
48
-Use `break *0x4000b7` to get a breakpoint at the first Brainfuck instruction.
48
+Type `break *0x4000b7` into gdb to get a breakpoint at the first Brainfuck
49
+instruction.
49 50
 
50 51
 image::gdb-experiment.png[align="center"]
51 52
 
52
-There is also `gdb-object-file.go` that generates an object file that can be
53
-statically linked with `ld`, and `gdb-object-file-libc.go` generates an
53
+There is also `object-file.go` that generates an object file that can be
54
+statically linked with `ld`, and `object-file-libc.go` that generates an
54 55
 OS-independent binary that can be linked against the libc with the C compiler:
55 56
 
56
- $ go run gdb-object-file-libc.go program.bf program.o
57
+ $ go run dwarf/object-file-libc.go program.bf program.o
57 58
  $ cc program.o -o program
58 59
 
59 60
 Contributing and Support

gdb-object-file-libc.go → dwarf/object-file-libc.go View File


gdb-object-file.go → dwarf/object-file.go View File


gdb-experiment.go → dwarf/simple.go View File


Loading…
Cancel
Save