From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8629 invoked by alias); 7 Apr 2004 00:19:31 -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 8590 invoked from network); 7 Apr 2004 00:19:22 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.114.7) by sources.redhat.com with SMTP; 7 Apr 2004 00:19:22 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i370JL0J000357 for ; Wed, 7 Apr 2004 02:19:21 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i370JLkF065629 for ; Wed, 7 Apr 2004 02:19:21 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i370JLNa065626; Wed, 7 Apr 2004 02:19:21 +0200 (CEST) Date: Wed, 07 Apr 2004 00:19:00 -0000 Message-Id: <200404070019.i370JLNa065626@elgar.kettenis.dyndns.org> From: Mark Kettenis To: gdb-patches@sources.redhat.com Subject: [PATCH] Add StackGhost support to corelow.c X-SW-Source: 2004-04/txt/msg00162.txt.bz2 This adds support for StackGhost cookies in core files. Will check this in in a few days. Mark Index: ChangeLog from Mark Kettenis * corelow.c (core_xfer_partial): Add support for TARGET_OBJECT_WCOOKIE. Index: corelow.c =================================================================== RCS file: /cvs/src/src/gdb/corelow.c,v retrieving revision 1.36 diff -u -p -r1.36 corelow.c --- corelow.c 28 Feb 2004 18:04:36 -0000 1.36 +++ corelow.c 7 Apr 2004 00:17:54 -0000 @@ -564,6 +564,38 @@ core_xfer_partial (struct target_ops *op } return -1; + case TARGET_OBJECT_WCOOKIE: + if (readbuf) + { + /* When the aux vector is stored in core file, BFD + represents this with a fake section called ".wcookie". */ + + struct bfd_section *section; + bfd_size_type size; + char *contents; + + section = bfd_get_section_by_name (core_bfd, ".wcookie"); + if (section == NULL) + return -1; + + size = bfd_section_size (core_bfd, section); + if (offset >= size) + return 0; + size -= offset; + if (size > len) + size = len; + if (size > 0 && + ! bfd_get_section_contents (core_bfd, section, readbuf, + (file_ptr) offset, size)) + { + warning ("Couldn't read StackGhost cookie in core file."); + return -1; + } + + return size; + } + return -1; + default: if (ops->beneath != NULL) return ops->beneath->to_xfer_partial (ops->beneath, object, annex,