summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2010-10-01 16:02:46 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2010-10-01 16:02:46 -0500
commit518b5e5b1c71259ce0badc29f98db46a73c59442 (patch)
tree40260de5559f292aac501ca99f2b1f0b72098cb8 /src/sim
parentb331b02669f95adf4744b1e7db50ad4b231fb704 (diff)
downloadgem5-518b5e5b1c71259ce0badc29f98db46a73c59442.tar.xz
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. The number argument is now passed by reference because getArgument() will need to change it based on the size of the argument and the current argument number. For ARM, if the argument number is odd and a 64-bit register is requested the number must first be incremented to because all 64 bit arguments are passed in an even argument register. Then the number will be incremented again to access both halves of the argument.
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/arguments.cc4
-rw-r--r--src/sim/arguments.hh10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/sim/arguments.cc b/src/sim/arguments.cc
index 339a57f90..511fc630d 100644
--- a/src/sim/arguments.cc
+++ b/src/sim/arguments.cc
@@ -50,8 +50,8 @@ Arguments::Data::alloc(size_t size)
}
uint64_t
-Arguments::getArg(bool fp)
+Arguments::getArg(uint8_t size, bool fp)
{
- return TheISA::getArgument(tc, number, fp);
+ return TheISA::getArgument(tc, number, size, fp);
}
diff --git a/src/sim/arguments.hh b/src/sim/arguments.hh
index abc3da812..97b848e03 100644
--- a/src/sim/arguments.hh
+++ b/src/sim/arguments.hh
@@ -45,7 +45,7 @@ class Arguments
protected:
ThreadContext *tc;
int number;
- uint64_t getArg(bool fp = false);
+ uint64_t getArg(uint8_t size, bool fp = false);
protected:
class Data : public RefCounted
@@ -82,7 +82,7 @@ class Arguments
// for checking if an argument is NULL
bool operator!() {
- return getArg() == 0;
+ return getArg(TheISA::MachineBytes) == 0;
}
Arguments &operator++() {
@@ -130,20 +130,20 @@ class Arguments
template <class T>
operator T() {
assert(sizeof(T) <= sizeof(uint64_t));
- T data = static_cast<T>(getArg());
+ T data = static_cast<T>(getArg(sizeof(T)));
return data;
}
template <class T>
operator T *() {
T *buf = (T *)data->alloc(sizeof(T));
- CopyData(tc, buf, getArg(), sizeof(T));
+ CopyData(tc, buf, getArg(sizeof(T)), sizeof(T));
return buf;
}
operator char *() {
char *buf = data->alloc(2048);
- CopyStringOut(tc, buf, getArg(), 2048);
+ CopyStringOut(tc, buf, getArg(TheISA::MachineBytes), 2048);
return buf;
}
};