From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31944 invoked by alias); 1 Feb 2004 17:02:20 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 31915 invoked from network); 1 Feb 2004 17:02:19 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 1 Feb 2004 17:02:19 -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 i11H2Isk000380 for ; Sun, 1 Feb 2004 18:02:18 +0100 (CET) (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 i11H2IAX000490 for ; Sun, 1 Feb 2004 18:02:18 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i11H2HEZ000487; Sun, 1 Feb 2004 18:02:17 +0100 (CET) Date: Sun, 01 Feb 2004 17:02:00 -0000 Message-Id: <200402011702.i11H2HEZ000487@elgar.kettenis.dyndns.org> From: Mark Kettenis To: gdb@sources.redhat.com Subject: [RFC] TARGET_OBJECT_WCOOKIE X-SW-Source: 2004-02/txt/msg00001.txt.bz2 Actually the purpose of this RFC is twofold. First, I'd like to add a TARGET_OBJECT_WCOOKIE method to support the StackGhost cookie on OpenBSD/sparc. This really is something target-related rather than OS/ABI related. GDB will have to deal with StackGhost when running non-OpenBSD binaries on an OpenBSD kernel. Moreover, older OpenBSD kernels might not have StackGhost. Anyway, are there objections to adding something like the attached patch? The second issue I'd like your opinion on is related to the patch. I followed the example set by TARGET_OBJECT_UNWIND_TABLE in having a macro (NATIVE_XFER_WCOOKIE) to invoke the native-specific function that fetches the cookie. This macro would be defined in the nm.h file, but wasn't it our goal to get rid of the nm.h file sooner rather than later? Shouldn't we add another method for these kinds of hooks? The obvious alternatives are: a) Use a public function pointer, which is initialized to some do-nothing-and-return-minus-one function by default. This function pointer would be overridden by some code in the appropraite *-nat.c files. b) Use a private function pointer, and provide a function to set that pointer, along the lines of inftarg_set_find_memory_regions(). Opinions? Mark Index: inftarg.c =================================================================== RCS file: /cvs/src/src/gdb/inftarg.c,v retrieving revision 1.21 diff -u -p -r1.21 inftarg.c --- inftarg.c 14 Nov 2003 20:49:23 -0000 1.21 +++ inftarg.c 1 Feb 2004 15:55:47 -0000 @@ -1,7 +1,7 @@ /* Target-vector operations for controlling Unix child processes, for GDB. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, - 2000, 2002, 2003 Free Software Foundation, Inc. + 2000, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -577,6 +577,12 @@ child_xfer_partial (struct target_ops *o #endif return NATIVE_XFER_UNWIND_TABLE (ops, object, annex, readbuf, writebuf, offset, len); + +#ifdef NATIVE_XFER_WCOOKIE + case TARGET_OBJECT_WCOOKIE: + return NATIVE_XFER_WCOOKIE (ops, object, annex, readbuf, writebuf, + offset, len); +#endif #if 0 case TARGET_OBJECT_AUXV: Index: target.h =================================================================== RCS file: /cvs/src/src/gdb/target.h,v retrieving revision 1.55 diff -u -p -r1.55 target.h --- target.h 17 Jan 2004 21:56:12 -0000 1.55 +++ target.h 1 Feb 2004 15:55:47 -0000 @@ -226,6 +226,8 @@ enum target_object TARGET_OBJECT_MEMORY, /* Kernel Unwind Table. See "ia64-tdep.c". */ TARGET_OBJECT_UNWIND_TABLE, + /* StackGhost cookie. See "sparc-tdep.c". */ + TARGET_OBJECT_WCOOKIE, /* Possible future objects: TARGET_OBJECT_FILE, TARGET_OBJECT_PROC, TARGET_OBJECT_AUXV, ... */ };