Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Dec 2004 11:39:38 -0800
From:      John-Mark Gurney <gurney_j@resnet.uoregon.edu>
To:        Peter Jeremy <PeterJeremy@optushome.com.au>
Cc:        FreeBSD Architecture Mailing List <arch@freebsd.org>
Subject:   Re: Header files with enums instead of defines?
Message-ID:  <20041223193938.GF19624@funkthat.com>
In-Reply-To: <20041222090855.GO79646@cirb503493.alcatel.com.au>
References:  <20041222010143.GS53357@wantadilla.lemis.com> <20041222090855.GO79646@cirb503493.alcatel.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <errno.h> 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."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041223193938.GF19624>