From: "Burkhardt, Glenn" <Glenn.Burkhardt@goodrich.com>
To: "Pedro Alves" <pedro@codesourcery.com>, <gdb@sourceware.org>
Subject: RE: fail to attach to process on Solaris
Date: Tue, 20 Sep 2011 23:22:00 -0000 [thread overview]
Message-ID: <F69D5B35CAB1F043B9EE359EDA4318DC0CE8B06B@nhc0ex17.goodrich.root.local> (raw)
In-Reply-To: <201109022224.29804.pedro@codesourcery.com>
The problem appears that thread debug library has callback for register
get operation that's connected to "sol-thread.c:ps_lgetregs()". In the
case that fails, the thread exists, but the calling sequence tries to
lookup registers for a LWP with the same ID as the thread.
#0 find_procinfo_or_die (pid=12276, tid=67) at procfs.c:489
#1 0x000a1cd0 in procfs_fetch_registers (ops=0x7293d8,
regcache=0x71b1d0,
regnum=-1) at procfs.c:3483
#2 0x0012feec in sol_thread_fetch_registers (ops=0x718a70,
regcache=0x71b1d0,
regnum=-1) at sol-thread.c:457
#3 0x00231af0 in target_fetch_registers (regcache=0x71b1d0, regno=-1)
at target.c:3417
#4 0x00130e48 in ps_lgetregs (ph=0x700998, lwpid=67,
gregset=0xffbfe37c)
at sol-thread.c:923
#5 0xff0735dc in td_thr_getgregs () from /usr/lib/libthread_db.so.1
#6 0x0012fff8 in sol_thread_fetch_registers (ops=0x718a70,
regcache=0x71b3b0,
regnum=68) at sol-thread.c:473
For this stack trace of 'gdb', 'sol_thread_fetch_registers()' is passed
(gdb) frame
#6 0x0012fff8 in sol_thread_fetch_registers (ops=0x718a70,
regcache=0x71b3b0,
regnum=68) at sol-thread.c:473
473 val = p_td_thr_getgregs (&thandle, gregset);
(gdb) p *regcache
$24 = {descr = 0x84fc40, aspace = 0x7aa258, registers = 0x846c48 "",
register_status = 0x14f37c0 "", readonly_p = 0, ptid = {pid = 12276,
lwp = 0, tid = 67}}
So it's looking for registers from a thread that's not associated with
an LWP. But the
function 'ps_lgetregs()' is always looking for the registers on the LWP
list.
I can't see how the callback 'ps_lgetregs()' is connected to the thread
debug library. In fact, the documentation for the thread debug library
seems sparse. I've only been able to find out about it in the man pages
and comments section of sol-thread.c So any pointers to documentation
would be helpful.
Also, any theory of operation about gdb's register caching would also be
helpful.
Thanks.
> -----Original Message-----
> From: Pedro Alves [mailto:pedro@codesourcery.com]
> Sent: Friday, September 02, 2011 5:24 PM
> To: gdb@sourceware.org
> Cc: Burkhardt, Glenn
> Subject: Re: fail to attach to process on Solaris
>
>
> On Monday 22 August 2011 16:05:10, Burkhardt, Glenn wrote:
> > I can't seem to attach to a process that's running multiple threads.
> > Any help is appreciated. I've included the print output from the
> > whole session, but the problem is the line:
> >
> > procfs: couldn't find pid 15719 (kernel thread 67) in procinfo list.
>
> Been a while since I looked at the solaris backend, so I
> can't help much off hand. I'm affraid you'll need to debug
> this yourself.
> Starting with "set debug infrun 1" may help. I'd start by
> understanding why does gdb think 67 should be in the list.
>
> --
> Pedro Alves
>
next prev parent reply other threads:[~2011-09-20 23:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-22 15:05 Burkhardt, Glenn
2011-09-02 21:24 ` Pedro Alves
2011-09-20 23:22 ` Burkhardt, Glenn [this message]
2011-09-21 14:26 ` Pedro Alves
2011-09-21 16:19 ` Burkhardt, Glenn
2011-09-21 16:46 ` Pedro Alves
2011-09-21 17:16 ` Burkhardt, Glenn
2011-09-21 17:39 ` Pedro Alves
2011-09-21 18:38 ` Burkhardt, Glenn
2011-09-21 18:45 ` Burkhardt, Glenn
2011-09-21 16:28 ` Burkhardt, Glenn
2011-09-22 13:13 Burkhardt, Glenn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=F69D5B35CAB1F043B9EE359EDA4318DC0CE8B06B@nhc0ex17.goodrich.root.local \
--to=glenn.burkhardt@goodrich.com \
--cc=gdb@sourceware.org \
--cc=pedro@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox