Article View: gnu.gdb.bug
Article #251a bug, a feature
From: Chris Smith
Date: Fri, 01 Sep 1989 13:57
Date: Fri, 01 Sep 1989 13:57
40 lines
1287 bytes
1287 bytes
A bug: the "set" command decides that it is looking at a subcommand
when it is actually looking at an expression in cases like this:
set args_print ()
set environment_doohickey()
----
A feature: it would be handy to have a command to look up the error
message for an errno value.
Here is code for the command
info errno
or info errno <expression>
static void
errno_info (arg, from_tty)
char *arg;
int from_tty;
{
int err;
extern int sys_nerr;
extern char *sys_errlist[];
if (arg)
err = parse_and_eval_address (arg);
else
err = parse_and_eval_address ("errno");
printf_filtered ("errno %d: %s\n", err,
err < sys_nerr ? sys_errlist[err] : "unknown error");
}
[...]
add_info ("errno", errno_info,
"Display the system error message for errno, the error code returned by\n\
the last failing system call. With an argument, display the message for\n\
that value of errno.");
Technical Details
Message-ID:
<1650@convex.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!sun-barr!texsun!convex!mozart!csmithShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!sun-barr!texsun!convex!mozart!csmith From: csmith@mozart.uucp (Chris Smith) Newsgroups: gnu.gdb.bug Subject: a bug, a feature Message-ID: <1650@convex.UUCP> Date: 1 Sep 89 13:57:01 GMT Sender: usenet@convex.UUCP Reply-To: csmith@convex.com Lines: 40