From: Daniel Jacobowitz <drow@mvista.com>
To: GDB <gdb@sourceware.cygnus.com>
Subject: Re: PATCH: Re: [RFHelp] Linux, threads, and regsets in thread_db
Date: Tue, 06 Nov 2001 14:28:00 -0000 [thread overview]
Message-ID: <20011116150001.A19660@nevyn.them.org> (raw)
In-Reply-To: <20011115085508.D10945@lucon.org>
On Thu, Nov 15, 2001 at 08:55:08AM -0800, H . J . Lu wrote:
> In my case, gdb in thread mode will cal "fetch_register" in infptrace.c.
> Since nothing is running, I got
>
> reading register sp (#29): No such process.
>
> I don't know why it works for you.
OK, I misunderstood what you meant by "after the process has run". I
see the problem. I'll send another patch that I think is more accurate
later today, once I test it a bit.
> > > Another problem is when I set a break point in a thread function, only
> > > the first thread stops. I got
> > >
> > > (gdb) b process
> > > Breakpoint 1 at 0x400a38: file Examples/ex1.c, line 14.
> > > (gdb) r
> > > Starting program: /export/build/gnu/glibc/build-mipsel-linux/linuxthreads/ex1
> > > [New Thread 1024 (LWP 26552)]
> > > [New Thread 2049 (LWP 26569)]
> > > [New Thread 1026 (LWP 26570)]
> > > [Switching to Thread 1026 (LWP 26570)]
> > >
> > > Breakpoint 1, process (arg=0x1000) at Examples/ex1.c:14
> > > 14 fprintf (stderr, "Starting process %s\n", (char *) arg);
> > > ...
> > > Program received signal SIGTRAP, Trace/breakpoint trap.
> > > [Switching to Thread 1024 (LWP 26552)]
> > > 0x2ab8de24 in __syscall_rt_sigsuspend () at soinit.c:56
> > > 56 soinit.c: No such file or directory.
> > >
> > > But it may be a kernel bug.
> >
> > Something is suspicious here. The process in sigsuspend should have
> > been stopped with SIGSTOP, not SIGTRAP... is this an example program
> > from glibc?
>
> Yes, linuxthreads/ex1 from glibc.
OK, I can reproduce this too. This has something to do with
mishandling thread exit.
> > > 2001-11-14 H.J. Lu (hjl@gnu.org)
> > >
> > > * mips-tdep.c (heuristic_proc_desc): Read register only when
> > > target is running.
> >
> > I can't see why this changes behavior in the way you're seeing. I'm
>
> Why do you think that? Why does anyone want to read a register when
> nothing is running?
We never want to read that register from after_prologue; the current
stack pointer is not relevant.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
prev parent reply other threads:[~2001-11-16 19:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-24 18:27 Daniel Jacobowitz
2001-09-25 3:09 ` Mark Kettenis
[not found] ` <20011003170848.A30843@lucon.org>
[not found] ` <20011003211007.A12210@nevyn.them.org>
2001-11-03 12:32 ` PATCH: " H . J . Lu
2001-11-03 14:25 ` Daniel Jacobowitz
2001-11-03 16:54 ` H . J . Lu
2001-11-06 14:28 ` Daniel Jacobowitz [this message]
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=20011116150001.A19660@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb@sourceware.cygnus.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