Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: drow@false.org (Daniel Jacobowitz)
Cc: brobecker@adacore.com (Joel Brobecker),
	gdb-patches@sourceware.org,         alex00882007@gmail.com (Alex)
Subject: Re: [rfc] Do not read from the executable if ptrace fails
Date: Mon, 23 Jul 2007 22:05:00 -0000	[thread overview]
Message-ID: <200707232124.l6NLOuab008027@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <20070723191542.GA12138@caradoc.them.org> from "Daniel Jacobowitz" at Jul 23, 2007 03:15:42 PM

Daniel Jacobowitz wrote:

> > This used to work (probably accidentally?), but is broken by
> > this patch.  Any suggestions how to fix it?  Should the overlay
> > logic from xfer_memory be moved to memory_xfer_partial, maybe?
> 
> That sounds reasonable.  What about if we check for an unmapped
> overlay address at the same point we handle trust_readonly?

Like so?  Tested on spu-elf, fixes the overlay test case.

Bye,
Ulrich


ChangeLog:

	* target.c (memory_xfer_partial): Accesses to unmapped overlay
	sections should always go to the executable file.

Index: gdb/target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.144
diff -c -p -r1.144 target.c
*** gdb/target.c	1 Jul 2007 22:35:55 -0000	1.144
--- gdb/target.c	23 Jul 2007 20:39:33 -0000
*************** memory_xfer_partial (struct target_ops *
*** 1017,1022 ****
--- 1017,1030 ----
  	return xfer_memory (memaddr, readbuf, len, 0, NULL, ops);
      }
  
+   /* Likewise for accesses to unmapped overlay sections.  */
+   if (readbuf != NULL && overlay_debugging)
+     {
+       asection *section = find_pc_overlay (memaddr);
+       if (pc_in_unmapped_range (memaddr, section))
+ 	return xfer_memory (memaddr, readbuf, len, 0, NULL, ops);
+     }
+ 
    /* Try GDB's internal data cache.  */
    region = lookup_mem_region (memaddr);
    /* region->hi == 0 means there's no upper bound.  */


-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


  reply	other threads:[~2007-07-23 21:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-25  3:09 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 [this message]
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=200707232124.l6NLOuab008027@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=alex00882007@gmail.com \
    --cc=brobecker@adacore.com \
    --cc=drow@false.org \
    --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