uploaded a fresh shapshot. I will undo the s/Type/Gotype/, which turned out to be unnecessary ...
14 years, 1 month ago
(2011-01-27 07:39:07 UTC)
#7
uploaded a fresh shapshot. I will undo the s/Type/Gotype/, which turned out
to be unnecessary and get back to you.
/L
On Thu, Jan 27, 2011 at 08:23, Luuk van Dijk <lvd@google.com> wrote:
> i have a fix for that pending.
>
>
> On Thu, Jan 27, 2011 at 03:33, mattn <mattn.jp@gmail.com> wrote:
>
>> below is a part of generated runtime_defs.go:
>>
>> type g struct {
>> stackguard *uint8
>> stackbase *uint8
>> _defer *defer // ############### line86
>> panic *panic
>> sched gobuf
>> stack0 *uint8
>> entry *uint8
>> alllink *g
>> param unsafe.Pointer
>> status int16
>> goid int
>> selgen uint
>> schedlink *g
>> readyonstop uint8
>> ispanic uint8
>> m *m
>> lockedm *m
>> sig int
>> sigcode0 uint
>> sigcode1 uint
>> sigpc uint
>> }
>>
>>
>
all comments addressed i think and all tests pass. will test that gdb-ing still all ...
14 years, 1 month ago
(2011-01-27 08:29:06 UTC)
#8
all comments addressed i think and all tests pass.
will test that gdb-ing still all works, and will ponder recovering from missing
types in dwarf.c, so changing struct names and member names in runtime/*.[ch]
won't kill the linker.
does your type g still have a member of type '*defer'? On Thu, Jan 27, ...
14 years, 1 month ago
(2011-01-27 10:26:42 UTC)
#10
does your type g still have a member of type '*defer'?
On Thu, Jan 27, 2011 at 11:19, mattn <mattn.jp@gmail.com> wrote:
> I re-compiled cc/8c/8g/8l .
> And I deleted runtime_defs.go before make runtime package.
>
>
below is a generaetd file. https://gist.github.com/798338 On 2011/01/27 10:26:42, lvd wrote: > does your type ...
14 years, 1 month ago
(2011-01-27 10:35:13 UTC)
#11
below is a generaetd file.
https://gist.github.com/798338
On 2011/01/27 10:26:42, lvd wrote:
> does your type g still have a member of type '*defer'?
>
> On Thu, Jan 27, 2011 at 11:19, mattn <mailto:mattn.jp@gmail.com> wrote:
>
> > I re-compiled cc/8c/8g/8l .
> > And I deleted runtime_defs.go before make runtime package.
> >
> >
there is some weridness starting on line 434, structures with missing 'type foo struct {' ...
14 years, 1 month ago
(2011-01-27 10:52:33 UTC)
#12
there is some weridness starting on line 434, structures with missing 'type
foo struct {' lines.
i can't reproduce it when i build with GOARCH=386 GOOS=linux.
could you send me the output of
for i in proc.c iface.c hashmap.c chan.c; do
8c -q -Iwindows -I386 -Iwindows/386 -wF -D__WINDOWS__ $i
done
maybe its just the awk filter in mkgodefs.sh
On Thu, Jan 27, 2011 at 11:35, <mattn.jp@gmail.com> wrote:
> below is a generaetd file.
>
> https://gist.github.com/798338
>
>
> On 2011/01/27 10:26:42, lvd wrote:
>
>> does your type g still have a member of type '*defer'?
>>
>
> On Thu, Jan 27, 2011 at 11:19, mattn <mailto:mattn.jp@gmail.com>
>>
> wrote:
>
> > I re-compiled cc/8c/8g/8l .
>> > And I deleted runtime_defs.go before make runtime package.
>> >
>> >
>>
>
>
>
> http://codereview.appspot.com/4047047/
>
i uploaded a snapshot with a mkgodefs.sh that should be able to withstand an onslaught ...
14 years, 1 month ago
(2011-01-28 08:57:06 UTC)
#13
i uploaded a snapshot with a mkgodefs.sh that should be able to withstand an
onslaught of \r's , could you check if that works for you?
On Thu, Jan 27, 2011 at 12:02, mattn <mattn.jp@gmail.com> wrote:
> https://gist.github.com/798355
>
> Please check it.
> Thanks.
>
>
On Fri, Jan 28, 2011 at 11:54, mattn <mattn.jp@gmail.com> wrote: > error above gone. :) ...
14 years, 1 month ago
(2011-01-28 10:59:08 UTC)
#14
On Fri, Jan 28, 2011 at 11:54, mattn <mattn.jp@gmail.com> wrote:
> error above gone. :)
>
> are there any new ones?
> But I don't understand what was fixed completely. Can you show me the
> simply test?
>
>
>
the awk script filters out definitions of types it has already seen. in case
of structs this can span multiple lines, so the /{$/ pattern tests if the
line ends with a '{' and if so enters 'skip' mode. for some reason for you
that pattern didnt trigger, presumably because there was a carriage-return
character between the '{' and the '$' (which is a special character that
means end-of-line'). So now i changed the pattern to match a '{',optionally
followed by anything that is not a '}'.
/L
On Fri, Jan 28, 2011 at 12:11, mattn <mattn.jp@gmail.com> wrote: > > > On Friday, ...
14 years, 1 month ago
(2011-01-28 11:26:18 UTC)
#15
On Fri, Jan 28, 2011 at 12:11, mattn <mattn.jp@gmail.com> wrote:
>
>
> On Friday, January 28, 2011 7:59:04 PM UTC+9, lvd wrote:
>>
>>
>>
>> On Fri, Jan 28, 2011 at 11:54, mattn <mattn.jp@gmail.com> wrote:
>>
>>> error above gone. :)
>>>
>>> are there any new ones?
>>
>
> I don't get new errors.
>
>
>>
>>
>>> But I don't understand what was fixed completely. Can you show me the
>>> simply test?
>>>
>>>
>>>
>> the awk script filters out definitions of types it has already seen. in
>> case of structs this can span multiple lines, so the /{$/ pattern tests if
>> the line ends with a '{' and if so enters 'skip' mode. for some reason for
>> you that pattern didnt trigger, presumably because there was a
>> carriage-return character between the '{' and the '$' (which is a special
>> character that means end-of-line'). So now i changed the pattern to match a
>> '{',optionally followed by anything that is not a '}'.
>>
>
>
> and I know that you changed script mkgodefs.sh . sorry that mean: "What
> effect your changes to go on win32".
> If you have the simply go code that can check, please let me see. :)
>
ah, i see.
there should be zero changes to the behaviour of your programs.
The dwarf debug info depends on some Go type and variable declarations in
the runtime that must mirror their C counterparts exactly. These were
hand-coded in pkg/runtime/*_defs.go. this CL automates their generation,
eliminating a possible likely future cause of bugs in the debugging code
(which would be annoying as hell).
to test that things still work, eg compile something from test/, open it in
gdb, set a breakpoint somewhere in the middle, run and print some slices,
maps and channels, as well as inspect some goroutines (with 'info
goroutines')
eg:
$ cd play
$ 6g ../go/test/interface/convert.go
$ 6l convert.6
$ gdb 6.out
you should see gdb saying 'Loading Go Runtime support.'
then
(gdb) b 140
(gdb) r
(gdb) p 'main.e'
$2 = {str = "hello", len = 5}
(gdb) whatis 'main.e'
type = main.Empty
(gdb) whatis 'main.s'
type = main.Stringer
(gdb) info goroutines
* 1 running scheduler
etc
i just noticed i have left some print statements lying around in
runtime-gdb.py, i'll remove that and upload a fresh snapshot.
> Thanks a lot.
> - Yasuhiro Matsumoto
>
>
On Fri, Jan 28, 2011 at 12:37, mattn <mattn.jp@gmail.com> wrote: > Here is output: > ...
14 years, 1 month ago
(2011-01-28 11:45:39 UTC)
#16
On Fri, Jan 28, 2011 at 12:37, mattn <mattn.jp@gmail.com> wrote:
> Here is output:
> --------------------------
> C:\temp\go\test\interface>gdb 8.out.exe
> 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 "mingw32".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from C:\temp\go\test\interface/8.out.exe...done.
>
< here it should say:
Loading Go Runtime support.
> (gdb) b 140
> Breakpoint 1 at 0x40178c: file C:/temp/go/test/interface/convert.go, line
> 140.
> (gdb) r
> Starting program: C:\temp\go\test\interface/8.out.exe
> [New Thread 5124.0x9d0]
>
> Breakpoint 1, main.main () at C:/temp/go/test/interface/convert.go:140
> 140 hello(sl.String())
> (gdb) p 'main.e'
> $1 = {_type = 0x40eedc, data = 0x4f00f0}
>
> (gdb) whatis 'main.e'
> type = main.Empty
> (gdb) whatis 'main.s'
> type = main.Stringer
> (gdb) info goroutines
> Undefined info command: "goroutines". Try "help info".
> (gdb) q
> --------------------------
>
> I see two changes against your e-mail.
> First is:
> --------------------------
> (gdb) p 'main.e'
> $1 = {_type = 0x40eedc, data = 0x4f00f0}
> --------------------------
> Second is:
> --------------------------
> (gdb) info goroutines
> Undefined info command: "goroutines". Try "help info".
> --------------------------
>
> Is this ok?
>
>
so no. the runtime-gdb.py script didnt load.
i think someone else is working on getting that working on windows.
for now, maybe you can force it by hand:
(gdb) source /path/to/go/src/pkg/runtime/runtime-gdb.py
you should see "Loading Go Runtime support." then.
/L
That must be some stale version of some library you have lying around. On Fri, ...
14 years, 1 month ago
(2011-01-28 12:22:39 UTC)
#17
That must be some stale version of some library you have lying around.
On Fri, Jan 28, 2011 at 13:07, mattn <mattn.jp@gmail.com> wrote:
> I got another erorr.
>
> ----------------------------
> # cd /path/to/go/src/pkg/exp/datafmt
> # make
> 8g -o _go_.8 datafmt.go parser.go
> datafmt.go:211: inconsistent definition for type runtime.uncommonType
> during import
> struct { name *string; pkgPath *string; methods []runtime.method }
> struct { name *string; pkgPath *string; methods []runtime._method }
> datafmt.go:211: inconsistent definition for type runtime.method during
> import
> struct { name *string; pkgPath *string; mtyp *runtime.Type; typ
> *runtime.Type; ifn unsafe.Pointer; tfn unsafe.Pointer }
> struct { name *string; pkgpath *string; mtyp *runtime._type; typ
> *runtime._type; ifn func(); tfn func() }
> ----------------------------
>
>
> On Friday, January 28, 2011 8:51:11 PM UTC+9, mattn wrote:
>>
>> Ah, my gdb.exe don't support python script. X-(
>>
>> ---------------------
>> (gdb) source c:/temp/go/src/pkg/runtime/runtime-gdb.py
>> c:/temp/go/src/pkg/runtime/runtime-gdb.py:5: Error in sourced command
>> file:
>> Undefined command: "". Try "help".
>> ---------------------
>>
>> It's difficult for me that I re-compile gdb for now. X-(
>>
>> On Friday, January 28, 2011 8:45:33 PM UTC+9, lvd wrote:
>>>
>>>
>>>
>>> On Fri, Jan 28, 2011 at 12:37, mattn <mattn.jp@gmail.com> wrote:
>>>
>>>> Here is output:
>>>> --------------------------
>>>> C:\temp\go\test\interface>gdb 8.out.exe
>>>> 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 "mingw32".
>>>> For bug reporting instructions, please see:
>>>> <http://www.gnu.org/software/gdb/bugs/>...
>>>> Reading symbols from C:\temp\go\test\interface/8.out.exe...done.
>>>>
>>>
>>> < here it should say:
>>> Loading Go Runtime support.
>>>
>>>
>>>
>>>> (gdb) b 140
>>>> Breakpoint 1 at 0x40178c: file C:/temp/go/test/interface/convert.go,
>>>> line 140.
>>>> (gdb) r
>>>> Starting program: C:\temp\go\test\interface/8.out.exe
>>>> [New Thread 5124.0x9d0]
>>>>
>>>> Breakpoint 1, main.main () at C:/temp/go/test/interface/convert.go:140
>>>> 140 hello(sl.String())
>>>> (gdb) p 'main.e'
>>>> $1 = {_type = 0x40eedc, data = 0x4f00f0}
>>>>
>>>> (gdb) whatis 'main.e'
>>>> type = main.Empty
>>>> (gdb) whatis 'main.s'
>>>> type = main.Stringer
>>>> (gdb) info goroutines
>>>> Undefined info command: "goroutines". Try "help info".
>>>> (gdb) q
>>>> --------------------------
>>>>
>>>> I see two changes against your e-mail.
>>>> First is:
>>>> --------------------------
>>>> (gdb) p 'main.e'
>>>> $1 = {_type = 0x40eedc, data = 0x4f00f0}
>>>> --------------------------
>>>> Second is:
>>>> --------------------------
>>>> (gdb) info goroutines
>>>> Undefined info command: "goroutines". Try "help info".
>>>> --------------------------
>>>>
>>>> Is this ok?
>>>>
>>>>
>>> so no. the runtime-gdb.py script didnt load.
>>>
>>> i think someone else is working on getting that working on windows.
>>>
>>> for now, maybe you can force it by hand:
>>> (gdb) source /path/to/go/src/pkg/runtime/runtime-gdb.py
>>>
>>> you should see "Loading Go Runtime support." then.
>>>
>>>
>>> /L
>>>
>>>
>>
LGTM after tweaks below assuming it all still builds. :-) http://codereview.appspot.com/4047047/diff/59001/src/cmd/ld/dwarf.c File src/cmd/ld/dwarf.c (right): http://codereview.appspot.com/4047047/diff/59001/src/cmd/ld/dwarf.c#newcode988 ...
14 years, 1 month ago
(2011-01-28 16:59:37 UTC)
#18
Issue 4047047: code review 4047047: runtime: automaticaly generated Go declarations for C v...
(Closed)
Created 14 years, 1 month ago by lvd
Modified 14 years, 1 month ago
Reviewers: rsc, mattn
Base URL:
Comments: 24