code ‣ See "Debugging Go Code with GDB" ‣ https://golang.org/doc/gdb ‣ GDB debugger ver 7.1+ ‣ To inspect a live process or a core dump from DWARF ‣ Go ver 1.4+ ‣ Go v1.2~1.3.3 are not working (DWARF has been missing)
useful debugging information ‣ Pass `-gcflags "-N -l"` to disable optimizations of compile ‣ For example: `go build -gcflags "-N -l" /path/to/repo` ‣ Pass `-ldflags "-w"` to omit the debug information ‣ For example: `go build -ldflags "-w" /path/to/repo`
info locals val = 833358128335 n = 3 num = 0xc20803e4d3 "1000" err = {tab = 0xc20802e170, data = 0xc20802e160} (gdb) num := r.URL.Query().Get("num") n, err := strconv.Atoi(num) > if err != nil { fmt.Fprintln(os.Stderr, err)
info locals val = 833358128335 n = 3 num = 0xc20803e4d3 "1000" err = {tab = 0xc20802e170, data = 0xc20802e160} (gdb) num := r.URL.Query().Get("num") n, err := strconv.Atoi(num) > if err != nil { fmt.Fprintln(os.Stderr, err)
it was my fault. ‣ Be careful if you will install GDB How to Install GDB on OS X (Needs to sign your certification) $ brew install homebrew/dupes/gdb $ gdb -‐v
it was my fault. ‣ Be careful if you will install GDB How to Install GDB on OS X (Needs to sign your certification) $ brew install homebrew/dupes/gdb $ gdb -‐v GNU gdb 6.3.50-‐20050815 (Apple version gdb-‐1824) (Wed Feb 6 22:51:23 UTC 2013)
it was my fault. ‣ Be careful if you will install GDB How to Install GDB on OS X (Needs to sign your certification) $ brew install homebrew/dupes/gdb $ gdb -‐v GNU gdb 6.3.50-‐20050815 (Apple version gdb-‐1824) (Wed Feb 6 22:51:23 UTC 2013)