/usr/share/go/src/pkg/runtime is not on gdb's auto-load safe-path

Bug #1076454 reported by Mike Carifio
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
golang-1.6 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Config
======

# series
$ lsb_release -rd
Description: Ubuntu 12.10
Release: 12.10

# pkg
$ apt-cache policy golang-src
golang-src:
  Installed: 2:1.0.2-2
  Candidate: 2:1.0.2-2
  Version table:
 *** 2:1.0.2-2 0
        500 http://us.archive.ubuntu.com/ubuntu/ quantal/universe i386 Packages

Problem
=======

Gdb is the canonical debugger for go programs. Package golang-src provides a python file /usr/share/go/src/pkg/runtime/runtime-gdb.py to assist go programmers with specialized gdb commands (I don't really know just how useful they are). gdb complains when it starts that it can't load /usr/share/go/src/pkg/runtime/runtime-gdb.py because its not on the "auto-load safe-path":

$ gdb ./hello
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 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 "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/mcarifio/tech/golang/workspace/src/hello/hello...done.
warning: File "/usr/share/go/src/pkg/runtime/runtime-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning above
(gdb)

I mitigated this by adding the following gdb directive in /etc/gdb/gdbinit:

add-auto-load-safe-path /usr/share/go/src/pkg/runtime

Then:

$ gdb ./hello
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 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 "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/mcarifio/tech/golang/workspace/src/hello/hello...done.
Loading Go Runtime support.
^^^^^^^^^^^^^^^^^^^^^^^^^^ success indicated above
(gdb)

I'm not sure how best to solve this in general, but golang-src probably needs to configure gdb to accept
/usr/share/go/src/pkg/runtime/runtime-gdb.py as safe.

It took me a little while to figure out how auto-load safe-path works, how gdb initializes on start, where the files are located such as /etc/gdb/gdbinit and ~/.gdbinit. So it takes a little investigation for a programmer to reconstruct what I did above. But its also a fixable annoyance.

Tags: gdb golang
Mike Carifio (carifio)
tags: added: gdb golang
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in golang (Ubuntu):
status: New → Confirmed
affects: golang (Ubuntu) → golang-1.6 (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.