Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: include registerization info for gdb #2430

Open
ianlancetaylor opened this issue Nov 8, 2011 · 11 comments
Open

cmd/compile: include registerization info for gdb #2430

ianlancetaylor opened this issue Nov 8, 2011 · 11 comments
Milestone

Comments

@ianlancetaylor
Copy link
Contributor

What steps will reproduce the problem?

foo.go:

package main

import "os"

type I interface{}

func main() {
    var i I = 1
    os.Exit(i.(int))
}

6g foo.go
6l foo.6
gdb 6.out
GNU gdb (GDB) 7.2-gg20
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>;
Type "show copying" and "show warranty" for licensing/warranty
details.
This GDB was configured as "x86_64-linux".

<http://wiki/Main/GnuDebugger  FAQ: http://go/gdb  Email: gdb-team  IRC: #gdb>
Hey, I'm GDB 7.x.  Check me out!  http://wiki/Main/Gdb7x

Reading symbols from /home/iant/gcc/gccgo2-objdir/6.out...done.
Loading Go Runtime support.
(gdb) break foo.go:9
Breakpoint 1 at 0x400c36: file /home/iant/foo1.go, line 9.
(gdb) run
Starting program: /home/iant/gcc/gccgo2-objdir/6.out 

Breakpoint 1, main.main () at /home/iant/foo1.go:9
9       os.Exit(i.(int))
(gdb) print i
No symbol "i" in current context.
(gdb) info locals
No locals.
(gdb) step
runtime.assertE2T (t=void, e=void) at /home/iant/go/src/pkg/runtime/iface.c:286
286 runtime·assertE2T(Type *t, Eface e, ...)
(gdb) finish
Run till exit from #0  runtime.assertE2T (t=void, e=void)
    at /home/iant/go/src/pkg/runtime/iface.c:286
0x0000000000400c4f in main.main () at /home/iant/foo1.go:9
9       os.Exit(i.(int))
(gdb) print i
No symbol "i" in current context.
(gdb) step
os.Exit (code=1) at /home/iant/go/src/pkg/os/proc.go:34
34  func Exit(code int) { syscall.Exit(code) }



What is the expected output?

I expect to see information about the local variable.
@rsc
Copy link
Contributor

rsc commented Dec 9, 2011

Comment 1:

Labels changed: added priority-later, removed priority-medium.

@rsc
Copy link
Contributor

rsc commented Dec 12, 2011

Comment 2:

Labels changed: added priority-go1.

@lvdlvd
Copy link

lvdlvd commented Dec 15, 2011

Comment 3:

This seems to happen for local variables that have been registerized completely, so that
their stack frame entry has been eliminated.   6nm shows no entry for 'i' in foo.6, nor
does it occur in 6g -S output.
then if it were present, the ld/dwarf code currently does not describe information about
registerized variables.
i'll think about the best way to pass both hurdles.

@rsc
Copy link
Contributor

rsc commented Dec 15, 2011

Comment 4:

If this is only about registerized variables then it can wait until after Go 1.
Nothing in the tool chain preserves that information.

Labels changed: added priority-later, removed priority-go1.

@rsc
Copy link
Contributor

rsc commented Jan 29, 2012

Comment 5:

Labels changed: added priority-someday, removed priority-later.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 6:

Owner changed to @rsc.

@gopherbot
Copy link

Comment 7 by martin.kobetic@jadedpixel.com:

not seeing locals at all makes debugging quite difficult. Is there any workaround for
this? Anything better than disassembling the function and then trying to infer the
values directly from the registers?

@rsc
Copy link
Contributor

rsc commented Oct 23, 2013

Comment 8:

The usual workaround is print statements.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 9:

Labels changed: added repo-main.

@rsc
Copy link
Contributor

rsc commented Mar 3, 2014

Comment 10:

Adding Release=None to all Priority=Someday bugs.

Labels changed: added release-none.

@rsc
Copy link
Contributor

rsc commented Sep 15, 2014

Comment 11:

Issue #7659 has been merged into this issue.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title cmd/gc: include registerization info for gdb cmd/compile: include registerization info for gdb Jun 8, 2015
@rsc rsc removed their assignment Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants