From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30162 invoked by alias); 13 Jan 2004 17:01:15 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 30152 invoked from network); 13 Jan 2004 17:01:14 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 13 Jan 2004 17:01:14 -0000 Received: by localhost.redhat.com (Postfix, from userid 469) id 079D21A440D; Tue, 13 Jan 2004 11:59:42 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16388.9214.960234.384619@localhost.redhat.com> Date: Tue, 13 Jan 2004 17:01:00 -0000 To: gdb-patches@sources.redhat.com Subject: [RFA] gcore: ignore no protection segments X-SW-Source: 2004-01/txt/msg00344.txt.bz2 This is necessary, otherwise a later read/write to that memory will jam the kernel. elena 2004-01-12 Elena Zannoni * gcore.c (gcore_create_callback): Skip any memory segment that has no permissions set. Index: gcore.c =================================================================== RCS file: /cvs/src/src/gdb/gcore.c,v retrieving revision 1.13 diff -u -p -r1.13 gcore.c --- gcore.c 11 Oct 2003 01:56:53 -0000 1.13 +++ gcore.c 13 Jan 2004 16:50:14 -0000 @@ -1,6 +1,6 @@ /* Generate a core file for the inferior process. - Copyright 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -313,6 +313,17 @@ gcore_create_callback (CORE_ADDR vaddr, bfd *obfd = data; asection *osec; flagword flags = SEC_ALLOC | SEC_HAS_CONTENTS | SEC_LOAD; + + if (read == 0 && write == 0 && exec == 0) + { + if (info_verbose) + { + fprintf_filtered (gdb_stdout, "Ignore segment, %lld bytes at 0x%s\n",+ (long long) size, paddr_nz (vaddr)); + } + + return 0; + } if (write == 0) {