aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2006-12-26 05:03:11 +0000
committerJoel Brobecker <brobecker@gnat.com>2006-12-26 05:03:11 +0000
commit4bd87714779b546da4cde8365653cb716738afd9 (patch)
treece9b05b179986920f815241afe347efb2535968f /gdb
parentcbe5be5a1d81d95f36d0830683bbd1d1ffd60def (diff)
downloadgdb-4bd87714779b546da4cde8365653cb716738afd9.zip
gdb-4bd87714779b546da4cde8365653cb716738afd9.tar.gz
gdb-4bd87714779b546da4cde8365653cb716738afd9.tar.bz2
* sparc64-tdep.c (sparc64_extract_return_value): Add handling
for array types. (sparc64_store_return_value): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/sparc64-tdep.c19
2 files changed, 25 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index bf28d52..36ac21e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2006-12-26 Joel brobecker <brobecker@adacore.com>
+
+ * sparc64-tdep.c (sparc64_extract_return_value): Add handling
+ for array types.
+ (sparc64_store_return_value): Likewise.
+
2006-12-18 Daniel Jacobowitz <dan@codesourcery.com>
* breakpoint.c (watchpoint_check): Double-check the found frame.
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
index 01c8961..a3a734b 100644
--- a/gdb/sparc64-tdep.c
+++ b/gdb/sparc64-tdep.c
@@ -1086,6 +1086,15 @@ sparc64_extract_return_value (struct type *type, struct regcache *regcache,
regcache_cooked_read (regcache, SPARC_F0_REGNUM + i, buf + i * 4);
memcpy (valbuf, buf, len);
}
+ else if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
+ {
+ /* Small arrays are returned the same way as small structures. */
+ gdb_assert (len <= 32);
+
+ for (i = 0; i < ((len + 7) / 8); i++)
+ regcache_cooked_read (regcache, SPARC_O0_REGNUM + i, buf + i * 8);
+ memcpy (valbuf, buf, len);
+ }
else
{
/* Integral and pointer return values. */
@@ -1131,6 +1140,16 @@ sparc64_store_return_value (struct type *type, struct regcache *regcache,
for (i = 0; i < len / 4; i++)
regcache_cooked_write (regcache, SPARC_F0_REGNUM + i, buf + i * 4);
}
+ else if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
+ {
+ /* Small arrays are returned the same way as small structures. */
+ gdb_assert (len <= 32);
+
+ memset (buf, 0, sizeof (buf));
+ memcpy (buf, valbuf, len);
+ for (i = 0; i < ((len + 7) / 8); i++)
+ regcache_cooked_write (regcache, SPARC_O0_REGNUM + i, buf + i * 8);
+ }
else
{
/* Integral and pointer return values. */