From owner-freebsd-arch@FreeBSD.ORG Thu Dec 23 19:39:49 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B48EF16A4CE for ; Thu, 23 Dec 2004 19:39:49 +0000 (GMT) Received: from mail1.speakeasy.net (mail1.speakeasy.net [216.254.0.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7CAEA43D53 for ; Thu, 23 Dec 2004 19:39:49 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: (qmail 9936 invoked from network); 23 Dec 2004 19:39:48 -0000 Received: from gate.funkthat.com (HELO hydrogen.funkthat.com) ([69.17.45.168]) (envelope-sender ) by mail1.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 23 Dec 2004 19:39:48 -0000 Received: from hydrogen.funkthat.com (fqpszc@localhost.funkthat.com [127.0.0.1])iBNJddGH051398; Thu, 23 Dec 2004 11:39:39 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.10/8.12.10/Submit) id iBNJdc5p051397; Thu, 23 Dec 2004 11:39:38 -0800 (PST) Date: Thu, 23 Dec 2004 11:39:38 -0800 From: John-Mark Gurney To: Peter Jeremy Message-ID: <20041223193938.GF19624@funkthat.com> Mail-Followup-To: Peter Jeremy , Greg 'groggy' Lehey , FreeBSD Architecture Mailing List References: <20041222010143.GS53357@wantadilla.lemis.com> <20041222090855.GO79646@cirb503493.alcatel.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041222090855.GO79646@cirb503493.alcatel.com.au> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html cc: Greg 'groggy' Lehey cc: FreeBSD Architecture Mailing List Subject: Re: Header files with enums instead of defines? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Dec 2004 19:39:49 -0000 Peter Jeremy wrote this message on Wed, Dec 22, 2004 at 20:08 +1100: > An alternative suggestion for you: Write a gdb macro which takes an > int and prints it as an errno. Something like a shorthand version of: > print (enum { EPERM=1, ENOENT=2, ..., EILSEQ=86})xerrno > should work. > > You would probably write a [insert scripting language of choice] script > to convert into the appropriate gdb macro. If you have a running program context (in userland), just do: print (char *)strerror(errnovalue) -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."