From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19459 invoked by alias); 25 Jun 2007 00:36:48 -0000 Received: (qmail 19451 invoked by uid 22791); 25 Jun 2007 00:36:47 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 25 Jun 2007 00:36:45 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 6760098304; Mon, 25 Jun 2007 00:36:43 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 3D967982DC; Mon, 25 Jun 2007 00:36:43 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1I2cYr-0008Qq-E4; Sun, 24 Jun 2007 20:36:09 -0400 Date: Mon, 25 Jun 2007 03:09:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sourceware.org Cc: Alex Subject: [rfc] Do not read from the executable if ptrace fails Message-ID: <20070625003609.GA31395@caradoc.them.org> Mail-Followup-To: gdb-patches@sourceware.org, Alex MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-06/txt/msg00443.txt.bz2 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 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);