Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sourceware.org
Cc: Alex <alex00882007@gmail.com>
Subject: [rfc] Do not read from the executable if ptrace fails
Date: Mon, 25 Jun 2007 03:09:00 -0000	[thread overview]
Message-ID: <20070625003609.GA31395@caradoc.them.org> (raw)

The old memory read methods used to have a target_has_all_memory
check.  It was broken at some point, probably around the introduction
of target_xfer_partial, and when I redid all the memory interfaces
last year I didn't try to fix it.  But there's a bug report about
this, which I've been meaning to come back to.

The attached fixes it.  If we try to read from a ptrace target, and
it fails, we do not continue down the target stack.  This won't affect
core debugging.

Any comments, or shall I apply this?

-- 
Daniel Jacobowitz
CodeSourcery

2007-06-24  Daniel Jacobowitz  <dan@codesourcery.com>

	PR symtab/2161
	* target.c (memory_xfer_partial): Do not continue past targets with
	all memory.

Index: target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.143
diff -u -p -r1.143 target.c
--- target.c	9 Jun 2007 13:42:16 -0000	1.143
+++ target.c	25 Jun 2007 00:29:17 -0000
@@ -1084,6 +1084,11 @@ memory_xfer_partial (struct target_ops *
       if (res > 0)
 	return res;
 
+      /* We want to continue past core files to executables, but not
+	 past a running target's memory.  */
+      if (ops->to_has_all_memory)
+	return res;
+
       ops = ops->beneath;
     }
   while (ops != NULL);


             reply	other threads:[~2007-06-25  0:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-25  3:09 Daniel Jacobowitz [this message]
2007-06-26  0:53 ` Joel Brobecker
2007-07-01 22:36   ` Daniel Jacobowitz
2007-07-23 19:15     ` Ulrich Weigand
2007-07-23 21:25       ` Daniel Jacobowitz
2007-07-23 22:05         ` Ulrich Weigand
2007-07-23 22:54           ` Daniel Jacobowitz
2007-07-24 13:03             ` Ulrich Weigand

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=20070625003609.GA31395@caradoc.them.org \
    --to=drow@false.org \
    --cc=alex00882007@gmail.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