gdb script never loads

122 views
Skip to first unread message

Daniel Huckstep

unread,
Apr 30, 2013, 5:06:39 PM4/30/13
to golan...@googlegroups.com
When I use gdb to debug go, which granted is fairly rare, the go support python script never loads. It's never loaded for me, but only lately I started to care.

Dumping out the sections, it has __debug_gdb_scri while the docs in the python script say it looks for .debug_gdb_scripts

This is on go 1.0.3/OSX Mountain Lion/gdb 7.5.1 using no extra gcflags or anything else.

I can load the script manually and it works, but that's no fun.

Ideas? Does it just not work on OSX because the section names are different?

- Daniel

minux

unread,
Apr 30, 2013, 8:41:09 PM4/30/13
to Daniel Huckstep, golan...@googlegroups.com
in fact, it is a bug of gdb. the real issue is that the gdb is looking for
an impossible (too long) section name on OS X: __debug_gdb_script
 

Daniel Huckstep

unread,
May 2, 2013, 9:15:30 PM5/2/13
to golan...@googlegroups.com, Daniel Huckstep
Blargh. So am I just stuck on OSX? I briefly looked at the gdb 7.6 notes but didn't see anything that would suggest it fixes this.

Has anybody had this work on OSX?

- Daniel

Ian Lance Taylor

unread,
May 2, 2013, 9:33:43 PM5/2/13
to Daniel Huckstep, golan...@googlegroups.com
On Thu, May 2, 2013 at 6:15 PM, Daniel Huckstep
<darkh...@darkhelmetlive.com> wrote:
> Blargh. So am I just stuck on OSX? I briefly looked at the gdb 7.6 notes but
> didn't see anything that would suggest it fixes this.
>
> Has anybody had this work on OSX?

This is something to ask the gdb maintainers: how do embedded GDB
scripts work on OS X?

Ian


> On Tuesday, April 30, 2013 6:41:09 PM UTC-6, minux wrote:
>>
>>
>> On Wednesday, May 1, 2013, Daniel Huckstep wrote:
>>>
>>> When I use gdb to debug go, which granted is fairly rare, the go support
>>> python script never loads. It's never loaded for me, but only lately I
>>> started to care.
>>>
>>> Dumping out the sections, it has __debug_gdb_scri while the docs in the
>>> python script say it looks for .debug_gdb_scripts
>>>
>>> This is on go 1.0.3/OSX Mountain Lion/gdb 7.5.1 using no extra gcflags or
>>> anything else.
>>>
>>> I can load the script manually and it works, but that's no fun.
>>>
>>> Ideas? Does it just not work on OSX because the section names are
>>> different?
>>
>> in fact, it is a bug of gdb. the real issue is that the gdb is looking for
>> an impossible (too long) section name on OS X: __debug_gdb_script
>>
>
> --
> 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...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Duncan Holm

unread,
May 3, 2013, 8:48:54 AM5/3/13
to golan...@googlegroups.com
For the time being, we can at least reduce the manual loading to typing "g" by putting this in a .gdbinit file:

define g
python
import subprocess as p
cmd = ["go", "env", "GOROOT"]
gdb_cmd = "source %s/src/pkg/runtime/runtime-gdb.py" % p.check_output(cmd)[:-1]
gdb.execute(gdb_cmd)
end

--
Reply all
Reply to author
Forward
0 new messages