diff options
author | Mark Kettenis <kettenis@gnu.org> | 2004-01-10 17:58:30 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2004-01-10 17:58:30 +0000 |
commit | 79b1ab3d3208bad63b691318eb8226c6bdc5c230 (patch) | |
tree | 97c833b5a17bc050cced4440fe77071621c6189a /gdb/x86-64-tdep.c | |
parent | 6470d250697a88ab127acaa9e63adc1c5de56ea6 (diff) | |
download | gdb-79b1ab3d3208bad63b691318eb8226c6bdc5c230.zip gdb-79b1ab3d3208bad63b691318eb8226c6bdc5c230.tar.gz gdb-79b1ab3d3208bad63b691318eb8226c6bdc5c230.tar.bz2 |
* x86-64-tdep.c (amd64_non_pod_p): New function.
(amd64_classify_aggregate): Return class memory for non-POD
C++ structure types.
Diffstat (limited to 'gdb/x86-64-tdep.c')
-rw-r--r-- | gdb/x86-64-tdep.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c index 242d597..fcb29ed 100644 --- a/gdb/x86-64-tdep.c +++ b/gdb/x86-64-tdep.c @@ -270,6 +270,19 @@ amd64_merge_classes (enum amd64_reg_class class1, enum amd64_reg_class class2) static void amd64_classify (struct type *type, enum amd64_reg_class class[2]); +/* Return non-zero if TYPE is a non-POD structure or union type. */ + +static int +amd64_non_pod_p (struct type *type) +{ + /* ??? A class with a base class certainly isn't POD, but does this + catch all non-POD structure types? */ + if (TYPE_CODE (type) == TYPE_CODE_STRUCT && TYPE_N_BASECLASSES (type) > 0) + return 1; + + return 0; +} + /* Classify TYPE according to the rules for aggregate (structures and arrays) and union types, and store the result in CLASS. */ @@ -281,7 +294,7 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2]) /* 1. If the size of an object is larger than two eightbytes, or in C++, is a non-POD structure or union type, or contains unaligned fields, it has class memory. */ - if (len > 16) + if (len > 16 || amd64_non_pod_p (type)) { class[0] = class[1] = AMD64_MEMORY; return; |