Review Board 2.0.15


Debug: Implement getArgument() and function skipping for ARM.

Review Request #244 - Created Sept. 15, 2010 and submitted

Information
Ali Saidi
gem5
Reviewers
Default
Debug: Implement getArgument() and function skipping for ARM.

In the process make add skipFuction() to handle isa specific function skipping
instead of ifdefs and other ugliness. For almost all ABIs, 64 bit arguments can
only start in even registers.  Size is now passed to getArgument() so that 32
bit systems can make decisions about register selection for 64 bit arguments.

   
Posted (Sept. 15, 2010, 10:53 p.m.)



  
  1. My PC changes will probably make this a simpler and make the ifdef go away, but it might still be a good idea to make it ISA specific since the return address might not always come from a register (x86 is an example) and you might have to fiddle with the stack (x86). I think this change is generally headed in the right direction, although I also agree with Nate that your handling of number seems off.
src/arch/arm/utility.cc (Diff revision 1)
 
 
I'm somewhat confused about the "int &number".  Why exactly does it need to be a reference now?  Why is number incremented in some cases and not others?  I thought I understood that you were trying to align it to an even register, but below, you have two number++ statements in one block.  Perhaps you could explain in a comment a bit more about what's going on and why it's now a reference.
Posted (Sept. 26, 2010, 8:34 a.m.)



  
src/arch/arm/utility.cc (Diff revision 1)
 
 
If you pass in register number 1 and then want to read a 64 bit register, 64 bit arguments are only passed in even registers, so you have to increment it to 2 to start reading the first 32 bits and then increment it again to 3 to read the next 32 bits to assemble a 64bit int.
  1. But then you have to increment it to 4 so its ready for the next call. Otherwise if you then tried to read a 32 bit argument you'd get 3 again. This is assuming, of course, that this has the same semantics as the syscall argument functions where the increment happens in the function and not outside of it, but I think that's what we should be doing.
  2. The Argument object does a single increment after a call, which takes care of the common case. Really, I tested it, it works.