hi, i'm just wondering if anyone would have any hints/links for debugging go code? (gdb in linux without an ide would be great...)
i've compiled a test with 'go test -c -N' but am still having troubles with 'info locals' (that don't show)... any hints? many thanks in advance.
Hi, I'm just wondering how to force symbols in dependent libraries (my own Go code in a parallel folder)? gdb cannot see 'locals' in a library... Cheers. Dorival
--
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.
You probably need to rebuild the stdlib with -N to reliably step into the runtime.
go install -a -v -gcflags "-N -l" std
then rebuild your program.
On Thu, Jan 16, 2014 at 9:54 PM, Abhijit Kadam <abhij...@gmail.com> wrote:
>
> Thanks. I did that and it compiled all go libs. Then ran the debugger. How
> to find how many goroutines each OS thread is running.
I don't understand the questions. Each thread runs one goroutine at a
time. Goroutines can migrate between threads. What are really trying
to find out?
> Also find the stack
> trace for OS thread. (to see goroutine stack I am using: "goroutine n bt" [n
> is the number for goroutine that I got from "info goroutines" command])
You can see the stack trace for the thread using the usual gdb "bt"
command. gdb already understands threads.
On Fri, Jan 17, 2014 at 7:28 AM, Abhijit Kadam <abhij...@gmail.com> wrote:
>
> On Friday, January 17, 2014 8:14:55 PM UTC+5:30, Ian Lance Taylor wrote:
>>
>> On Thu, Jan 16, 2014 at 9:54 PM, Abhijit Kadam <abhij...@gmail.com> wrote:
>> >
>> > Thanks. I did that and it compiled all go libs. Then ran the debugger.
>> > How
>> > to find how many goroutines each OS thread is running.
>>
>> I don't understand the questions. Each thread runs one goroutine at a
>> time. Goroutines can migrate between threads. What are really trying
>> to find out?
>
>
>
> Exactly, several are queued on each thread. The custom command of the go
> gdb extension "info goroutines" gives just total number of routines or it
> gives the routines running on main os thread and we need to switch to
> another os thread using gdb to see goutines ran by that thread.
I see. If info goroutines only shows the goroutines attached to a
particular thread, that sounds like a bug in runtime-gdb.py.
>> > Also find the stack
>> > trace for OS thread. (to see goroutine stack I am using: "goroutine n
>> > bt" [n
>> > is the number for goroutine that I got from "info goroutines" command])
>>
>> You can see the stack trace for the thread using the usual gdb "bt"
>> command. gdb already understands threads.
>
>
> Yes, you see I did fire "info threads" & "bt" etc. and was expecting stack
> trace of os thread starting from runtime upto the go code and then go back
> into the frame that has runtime code to see the goroutine queue, syscall,
> etc. To see goroutine specific stack I guess I need to use "goroutine
> <number> bt" (provided by extension)
The stack is not set up as you describe--there is no runtime code that
manages the goroutine queue and calls into the Go code. If there
were, it would be really painful to block goroutines.
Ian