On Mon, Jun 02, 2014 at 07:35:55PM +0530, Zubin Mithra wrote:
> Hey Dmitry,
> 
> >> $ strace -yeclose cat /dev/null
> >> close(3</etc/ld.so.cache>)              = 0</dev/pts/1>
> >> close(3</lib64/libc-2.19.so>)           = 0</dev/pts/1>
> >> close(3</dev/null>)                     = 0</dev/pts/1>
> >> close(1</dev/pts/1>)                    = 0</dev/pts/1>
> >> close(2</dev/pts/1>)                    = 0</dev/pts/1>
> >> +++ exited with 0 +++
> 
> I had tested it out by running it on a few binaries. I hadn't noticed
> that erroneous decoding in the output, but it was present.
> 
> > btw, wouldn't it be better to introduce a new return value code, e.g.
> > RVAL_FD, and update these several handlers to return RVAL_FD instead
> > of RVAL_DECIMAL, so that no sys_func checks would be necessary?
> >
> > sys_dup and sys_delete_module would have to be split out anyway.
> 
> Got it. Please find below a git diff of the code changes to have
> return fd decoding for sys_open. I'll send over a patch as soon as I'm
> done with the other syscalls.

OK

> Do the changes to RVAL macros look good?

Yes.

> 
> diff --git a/defs.h b/defs.h
> index c862de5..7f23f45 100644
> --- a/defs.h
> +++ b/defs.h
> @@ -533,10 +533,11 @@ extern const struct xlat whence_codes[];
>  # endif
>  # define RVAL_LUDECIMAL 007 /* long unsigned decimal format */
>  #endif
> -#define RVAL_MASK 007 /* mask for these values */
> +#define RVAL_FD 010

Just add a short comment for the new value, too.


-- 
ldv

Attachment: pgpBaPNULuL3O.pgp
Description: PGP signature

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to