Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "J. Johnston" <jjohnstn@redhat.com>
To: Michael Snyder <msnyder@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: RFA: Patch for corefile support
Date: Tue, 03 Jun 2003 20:03:00 -0000	[thread overview]
Message-ID: <3EDCFEF8.30703@redhat.com> (raw)
In-Reply-To: <3EDBA406.7F38D18E@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1307 bytes --]


Michael Snyder wrote:
> "J. Johnston" wrote:
> 
>>The attached patch fixes a problem in gdb when a corefile is read in
>>after a multithreaded application has been debugged.  What happens is that
>>the thread-db and lin-lwp layers are still around and run into internal
>>errors.
>>
>>The solution is simply to unpush the thread-db ops in its mourn_inferior
>>routine.  If a corefile gets loaded, there is no thread-db to interfere.
>>If another multi-threaded app gets loaded, the thread_db_new_objfile is
>>designed to bring back the thread-db layer as needed.
>>
>>This fix solves another failure in the killed.exp testsuite as well.
>>
>>Ok to commit?
>>
>>-- Jeff J.
> 
> 
> Hi Jeff, 
> 
> After reviewing the discussion, why don't you add a test for
> "keep_thread_db" as suggested by Mark, and check this in?
> Perhaps with a comment explaining that the debugging of
> statically-linked threaded programs is currently broken, but
> this will preserve sanity in case it is ever fixed.
> 
> Michael
> 
> 

Thanks Michael.  The attached patch has been checked in with the following
ChangeLog.

2003-06-03  Jeff Johnston  <jjohnstn@redhat.com>

         * thread-db.c (thread_db_mourn_inferior): Unpush thread target
         layer if not dealing with a statically-linked threaded program.

-- Jeff J.


[-- Attachment #2: thread-db.patch --]
[-- Type: text/plain, Size: 842 bytes --]

Index: thread-db.c
===================================================================
RCS file: /cvs/src/src/gdb/thread-db.c,v
retrieving revision 1.31
diff -u -r1.31 thread-db.c
--- thread-db.c	8 May 2003 22:33:14 -0000	1.31
+++ thread-db.c	3 Jun 2003 20:00:37 -0000
@@ -1011,6 +1011,18 @@
   proc_handle.pid = 0;
 
   target_beneath->to_mourn_inferior ();
+
+  /* Detach thread_db target ops if not dealing with a statically
+     linked threaded program.  This allows a corefile to be debugged
+     after finishing debugging of a threaded program.  At present,
+     debugging a statically-linked threaded program is broken, but
+     the check is added below in the event that it is fixed in the
+     future.  */
+  if (!keep_thread_db)
+    {
+      unpush_target (&thread_db_ops);
+      using_thread_db = 0;
+    }
 }
 
 static int

      reply	other threads:[~2003-06-03 20:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-27 23:05 J. Johnston
2003-02-01 13:22 ` Mark Kettenis
2003-02-01 17:00   ` Daniel Jacobowitz
2003-02-03 22:58     ` J. Johnston
2003-02-03 23:39       ` Daniel Jacobowitz
2003-02-18 17:31         ` J. Johnston
2003-06-02 19:22 ` Michael Snyder
2003-06-03 20:03   ` J. Johnston [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=3EDCFEF8.30703@redhat.com \
    --to=jjohnstn@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=msnyder@redhat.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