We don't implement the kill system call because implementing support
signal handlers would be rather difficult.  That said, it certainly
could be done if you really wanted to.  Korey's solution seems like a
reasonable one as well.  In fact, we might consider an exit on a
process sending a signal to itself, but ignore the others.

  Nate

On Fri, May 9, 2008 at 6:55 AM, David Robert White <[EMAIL PROTECTED]> wrote:
> Thanks Nate, that's very useful information.
>
> I might need to explain a little more detail about what I'm trying to
> achieve.
>
> I have a program that may cause a run-time error (e.g. divide by zero).  If
> I run this outside of the simulator, I can check the return code to
> determine if an error occurred.
> However, when the division by zero occurs, I get the following on the
> simulator output:
>
>   warn: ignoring syscall kill(100, 8, ...)
>
> So I guess it's ignoring the division by zero.
>
> I guess what I would need is to be able to prevent the simulator from
> ignoring this.  Any ideas?
>
> Thanks
>
> David
>
> ------------------------------
>
> Message: 7
> Date: Fri, 9 May 2008 06:03:55 -0700
> From: "nathan binkert" <[EMAIL PROTECTED]>
> Subject: Re: [m5-users] Return Code
> To: "M5 users mailing list" <[email protected]>
> Message-ID:
> <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> The exit system call is handled, so you can hack into the exitFunc()
> function in src/sim/syscall_emul.cc if you want to do it in C++. In
> python, the simulate function returns an ExitEvent object. Right now,
> you can see that we generally call only getCause() on that object.
> There is also a getCode() function that you can call to get the exit
> code. If the cause is "target called exit()" then the code is the
> exit code passed to exit.
>
> Nate
>
> On Fri, May 9, 2008 at 4:47 AM, David Robert White <[EMAIL PROTECTED]>
> wrote:
>>
>> > Hi,
>> >
>> > Can anyone please tell me how to get the return code of a program in SE
>> > mode?
>> > When my program runs within the simulator, I would like to obtain the
>> > resulting return code of the program that the simulator has run.
>> >
>> > Thanks
>> >
>> > David
>> >
>> > --
>> > David R White
>> >
>> > Research Student
>> > Department of Computer Science
>> > University of York
>> > York YO10 5DD
>> > United Kingdom
>> >
>> >
>> >
>> > _______________________________________________
>> > m5-users mailing list
>> > [email protected]
>> > http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
>> >
>> >
>
> --
> David R White
>
> Research Student
> Department of Computer Science
> University of York
> York YO10 5DD
> United Kingdom
>
> Phone: +44 (0)1904 434756
> _______________________________________________
> m5-users mailing list
> [email protected]
> http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
>
>
_______________________________________________
m5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/m5-users

Reply via email to