diff options
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/sparc64-tdep.c | 19 |
2 files changed, 25 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bf28d52a0fc..36ac21e37e7 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 01c8961205c..a3a734bff80 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. */ |