[Developer] fwd: Re: what does L4_Copy_regs_to_mrs() actually return?

Ben Leslie benno at ok-labs.com
Wed Apr 25 00:07:23 EST 2007


----- Forwarded message from Carl van Schaik <carl at ok-labs.com> -----

Date: Tue, 24 Apr 2007 14:17:59 +1000
From: Carl van Schaik <carl at ok-labs.com>
Subject: Re: what does L4_Copy_regs_to_mrs() actually return?
Message-ID: <462D84F7.8020700 at ok-labs.com>
To: Iyad Q <ikq2754 at yahoo.com>
Cc: kenge-users at ertos.nicta.com.au
User-Agent: Thunderbird 1.5.0.10 (Windows/20070221)

Hi Iyad,

The L4_Copy_regs_to_mrs() calls returns the values of a thread stored in 
the threads L4 TCB. On uniprocessor, this should always contain the 
correct state. The only tine somthing different happens is when the 
thread is in the middle of a system call (eg Ipc).
Note that system calls don't save much state so many of the register 
values won't mean much.
Note, it seems you are running an old copy of L4/Iguana? In the old 
ertos release, kernel saving user state was very inconsistant. The 
latest OKL4 does much better. About your question re the PC value... it 
is possible for this to be a valid PC, especially if the thread is 
running in a shared library at the time. (eg libc).

Getting and setting the user registers has always been an interesting 
topic since there are many ways to do it. In Wombat, we try avoid doing 
this as much as possible, except for signal handling. We get the user to 
save their own state by jumping the thread to a special piece of code we 
map into the address space. Linux (other than for debug) does not really 
need access to thread registers so we have not had much need for direct 
thread register reading and setting.

So currently we can get user registers with L4_Copy_regs_to_mrs(), but 
not directly set user registers.
You may want to experiment with adding the equavalent function to set MRs.

regards,
Carl

Hal:

Oh yeah one other thing, this list is dead and will shortly be discontinued.
developer at okl4.org is where it's at now.
https://lists.okl4.org/mailman/listinfo/developer



Iyad Q wrote:
> Hi,
>
> I am trying to work on user thread debugging in linux, and need access to register content of the user space process.  I am using L4_Copy_regs_to_mrs(), but it seems to return incorrect information.  For example in the listing below note the return values for fp & lr.   As for the pc value, it seems that it does not reflect user thread the address range  which should be within 0x9000.
>
>   r0 = 00000000, r1 = 000008e1, r2 = 000008e1, r3 = 000008e1
>   r4 = 095f3da0, r5 = 095f3d6c, r6 = 07dc6274, r7 = 07dc605c
>   r8 = 00000001, r9 = fffff71f, r10= e0011200, fp = 00000000
>   ip = 07f95074, sp = 07ff2780, lr = 00000001, pc = 07f95060
>   cpsr = e0011200, spsr = 00000000
>
> My questions at the moment:
>
> 1) what is actually returned by the L4_Copy_regs_to_mrs() ?
> 2) How can I get user threads register values ?
> 3) How can I set user threads register values ?
>
> Thanks,
> Iyad
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
>
> _______________________________________________
> kenge-users mailing list
> kenge-users at ertos.nicta.com.au
> https://lists.ertos.nicta.com.au/mailman/listinfo/kenge-users
>   


_______________________________________________
kenge-users mailing list
kenge-users at ertos.nicta.com.au
https://lists.ertos.nicta.com.au/mailman/listinfo/kenge-users

----- End forwarded message -----



More information about the Developer mailing list