aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2003-10-10 19:20:31 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2003-10-10 19:20:31 +0000
commit7fe958be01489f0309b1b822b7cb191ccafe23af (patch)
tree1b616eae4ea97e3c434debb6e0cb86befacfb334 /gdb
parent3f997a978d8a747afbf345c97e1a5dcc87c17732 (diff)
downloadgdb-7fe958be01489f0309b1b822b7cb191ccafe23af.zip
gdb-7fe958be01489f0309b1b822b7cb191ccafe23af.tar.gz
gdb-7fe958be01489f0309b1b822b7cb191ccafe23af.tar.bz2
2003-10-10 Elena Zannoni <ezannoni@redhat.com>
* sh-tdep.c (sh_use_struct_convention): Clarify one case in comment.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/sh-tdep.c12
2 files changed, 16 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d170797..5bc5854 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2003-10-10 Elena Zannoni <ezannoni@redhat.com>
+
+ * sh-tdep.c (sh_use_struct_convention): Clarify one case in
+ comment.
+
2003-10-10 Corinna Vinschen <vinschen@redhat.com>
* sh-tdep.c (sh_use_struct_convention): Clean up to have a
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index eee7698..3d8c629 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -568,7 +568,7 @@ sh_skip_prologue (CORE_ADDR start_pc)
All other aggregate types are returned by address. The caller
function passes the address of an area large enough to hold the
aggregate value in R2. The called function stores the result in
- this location."
+ this location.
To reiterate, structs smaller than 8 bytes could also be returned
in memory, if they don't pass the "same size and alignment as an
@@ -582,6 +582,16 @@ sh_skip_prologue (CORE_ADDR start_pc)
the return value from foo() will be in memory, not
in R0, because there is no 3-byte integer type.
+ Similarly, in
+
+ struct s { char c[2]; } wibble;
+ struct s foo(void) { return wibble; }
+
+ because a struct containing two chars has alignment 1, that matches
+ type char, but size 2, that matches type short. There's no integer
+ type that has alignment 1 and size 2, so the struct is returned in
+ memory.
+
*/
static int