Bug 3055 - SyscallEventInfo cross-platform oddity
Summary: SyscallEventInfo cross-platform oddity
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Yao Qi
Depends on:
Blocks: 1524
  Show dependency treegraph
Reported: 2006-08-15 15:18 UTC by Tom Tromey
Modified: 2006-09-08 11:43 UTC (History)
1 user (show)

See Also:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2006-08-15 15:18:24 UTC
On x86 SyscallEventInfo.returnCode apparently does not sign-extend
the return result of a 'close'.  However, Yao says that sign extension
does happen on PPC64.

I think it would be preferable for this behavior to be platform independent.
Also I think the sign extension approach is simpler for the end user.
Comment 1 Yao Qi 2006-08-31 16:29:09 UTC
Hi, Tom,
Could you explain a little about 
"SyscallEventInfo.returnCode apparently does not sign-extend the return result
of a 'close'"
What do you mean "close" here?  SYS_close?

I think I misunderstand "sign extend" for the first time on maillist, and I will
have a look about it.

On PPC64, the sign of the reture value is determined by one bit in
CCR,(Condation Code Register).
Comment 2 Tom Tromey 2006-08-31 18:43:51 UTC
Yes, I mean SYS_close.

The question is how to check whether a system call returned an error.
My current check looks like this:

	  && (int) syscallEventInfo.returnCode(task) < 0)

... where the explicit cast is needed to handle the lack of sign extension.
I think it would be friendlier to explicitly sign-extend.
Comment 3 Yao Qi 2006-09-08 11:43:32 UTC
Post my patch against this bug,

but no one review this patch.

Tom, Could you have a look?  If it is OK, I will check in.  Thanks!