From: Joel Brobecker Date: Tue, 26 Dec 2006 05:03:11 +0000 (+0000) Subject: * sparc64-tdep.c (sparc64_extract_return_value): Add handling X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4bd87714779b546da4cde8365653cb716738afd9;p=binutils-gdb.git * sparc64-tdep.c (sparc64_extract_return_value): Add handling for array types. (sparc64_store_return_value): Likewise. --- 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 + + * sparc64-tdep.c (sparc64_extract_return_value): Add handling + for array types. + (sparc64_store_return_value): Likewise. + 2006-12-18 Daniel Jacobowitz * 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. */