Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: Re: [commit] Fix gdb crashes when using target extended-remote against    linux gdbserver.
Date: Fri, 06 Feb 2009 02:12:00 -0000	[thread overview]
Message-ID: <200902060212.45362.pedro@codesourcery.com> (raw)
In-Reply-To: <20090206013101.5B5AAEAEE0@pedro-laptop-dell>

All that talk, and in the end...

On Friday 06 February 2009 01:31:01, Pedro Alves wrote:

> Index: src/gdb/target.c
> ===================================================================
> --- src.orig/gdb/target.c	2009-02-06 00:55:23.000000000 +0000
> +++ src/gdb/target.c	2009-02-06 00:55:34.000000000 +0000
> @@ -2218,18 +2218,15 @@ target_get_osdata (const char *type)
>    char *document;
>    struct target_ops *t;
>  
> -  if (target_can_run (&current_target))
> -    t = &current_target;
> -  else
> +  if (current_target.to_stratum == dummy_stratum)
>      t = find_default_run_target ("get OS data");
> +  else
> +    t = current_target.beneath;
>  

... this didn't take into the account the file_stratum.  The below
fixed it.  Checked in.

Oh the day I get things right the first time...

-- 
Pedro Alves

2009-02-06  Pedro Alves  <pedro@codesourcery.com>

	* target.c (target_get_osdata): Check for equal or higher than
	process_stratum, not dummy_stratum.

---
 gdb/target.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Index: src/gdb/target.c
===================================================================
--- src.orig/gdb/target.c	2009-02-06 02:01:47.000000000 +0000
+++ src/gdb/target.c	2009-02-06 02:02:59.000000000 +0000
@@ -2218,10 +2218,13 @@ target_get_osdata (const char *type)
   char *document;
   struct target_ops *t;
 
-  if (current_target.to_stratum == dummy_stratum)
-    t = find_default_run_target ("get OS data");
-  else
+  /* If we're already connected to something that can get us OS
+     related data, use it.  Otherwise, try using the native
+     target.  */
+  if (current_target.to_stratum >= process_stratum)
     t = current_target.beneath;
+  else
+    t = find_default_run_target ("get OS data");
 
   if (!t)
     return NULL;


      reply	other threads:[~2009-02-06  2:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-06  1:31 Pedro Alves
2009-02-06  2:12 ` Pedro Alves [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=200902060212.45362.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /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