On Thu, Nov 26, 2020 at 11:50 AM Kn <hit.zhang...@gmail.com> wrote:
>
> Hi, I am writing a golang debugger and some documents to show others the 
> knowledge about how to develop a golang debugger.
>
> I notice go debug/elf, debug/gosym is enough for the occasions like lookup 
> symbol, pcToLn, lnToPC, maybe even for backtrace?
>
> I want to know why go generate .gosymtab (now it is empty) and .gopclntab, 
> why don't we use the .symtab or .debug_line, debug_frame, etc? Does it have 
> relations about plan9 object  symtab? Are the generated .debug_* sections 
> generated for common utilities, like readelf, etc?

The .gopclntab section is loaded into memory at run time and used to
do stack tracebacks and by functions like runtime.Callers.  The
.symtab and .debug sections are not loaded into memory; they are
available to debuggers, but not to the running programs.  They used by
debuggers like delve and gdb.

The .gopclntab format was once based on the Plan 9 format, but it has
changed significantly over time.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXpgK8SLnzMX5fhCt7emH10TbPOt62_q7NPvoF_h3C%2BMw%40mail.gmail.com.

Reply via email to