[bug-notifications] [gcc4core 0004967]: Can't use gdb to list out source code from gccgo compiled binary with -g option

Mantis Bug Tracker noreply at opencsw.org
Tue Jun 26 16:51:52 CEST 2012


A NOTE has been added to this issue. 
====================================================================== 
https://www.opencsw.org/mantis/view.php?id=4967 
====================================================================== 
Reported By:                tjyang
Assigned To:                
====================================================================== 
Project:                    gcc4core
Issue ID:                   4967
Category:                   regular use
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-06-26 16:23 CEST
Last Modified:              2012-06-26 16:51 CEST
====================================================================== 
Summary:                    Can't use gdb to list out source code from gccgo
compiled binary with -g option
Description: 
The test helloworld.go was compiled and ran ok  by gccgo 4.7.1as shown
below. 
But when doing a debugging session to list out source code, it failed.

$ cat helloworld.go
package main

import "fmt"

func main() {
        fmt.Println("Hello, World")
}
$ ./hellow
Hello, World
$


====================================================================== 

---------------------------------------------------------------------- 
 (0009984) dam (administrator) - 2012-06-26 16:51
 https://www.opencsw.org/mantis/view.php?id=4967#c9984 
---------------------------------------------------------------------- 
Works like charm on the buildfarm:

unstable10s% /opt/csw/bin/gccgo -g -o hellow helloworld.go
unstable10s% /opt/csw/bin/gdb ./hellow
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.10".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/dam/tmp/hellow...done.
(gdb) l
34      
35      extern void runtime_main (void);
36      static void mainstart (void *);
37      
38      /* The main function.  */
39      
40      int
41      main (int argc, char **argv)
42      {
43        runtime_check ();
(gdb) 


It looks like buildfarm-pathes have crept into the binary:

unstable10s% truss -f /opt/csw/bin/gdb ./hellow 2>&1 | grep maciej
8173:  
stat("/home/maciej/src/opencsw/pkg/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/gcc-4.7.1/libgo/runtime/go-main.c",
0xFFFFFFFF7FFFE700) = 0
8173:  
open("/home/maciej/src/opencsw/pkg/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/gcc-4.7.1/libgo/runtime/go-main.c",
O_RDONLY) = 6
8173:  
resolvepath("/home/maciej/src/opencsw/pkg/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/gcc-4.7.1/libgo/runtime/",
"/home/maciej/src/opencsw/pkg/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/gcc-4.7.1/libgo/runtime",
1024) = 106



More information about the bug-notifications mailing list