Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc] Do not read from the executable if ptrace fails
@ 2007-06-25  3:09 Daniel Jacobowitz
  2007-06-26  0:53 ` Joel Brobecker
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2007-06-25  3:09 UTC (permalink / raw)
  To: gdb-patches; +Cc: Alex

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);


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-07-24 13:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-25  3:09 [rfc] Do not read from the executable if ptrace fails Daniel Jacobowitz
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox