Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [committed][gdb/tdep] Handle static field in i386_16_byte_align_p
@ 2020-12-04 12:37 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2020-12-04 12:37 UTC (permalink / raw)
  To: gdb-patches

Hi,

When running test-case on gdb.cp/many-args.exp with target board unix/-m32, I
run into:
...
(gdb) p check_val (ref_val, ref_val, ... , ref_val, ref_val)^M
$1 = false^M
(gdb) FAIL: gdb.cp/many-args.exp: check passing many structures
...

The test source contains struct ss:
...
typedef int v4si __attribute__ ((vector_size (16)));

struct ss
{
  static v4si static_field;
  unsigned char aa;
};
...
and i386_16_byte_align_p returns true for this type.

Fix this by skipping static fields in i386_16_byte_align_p.

Tested on x86_64-linux.

Committed to trunk.

Thanks,
- Tom

[gdb/tdep] Handle static field in i386_16_byte_align_p

gdb/ChangeLog:

2020-12-03  Tom de Vries  <tdevries@suse.de>

	PR tdep/27007
	* i386-tdep.c (i386_16_byte_align_p): Skip static fields.

---
 gdb/i386-tdep.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 00de4e1ccb..ad02ad679b 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -2644,6 +2644,8 @@ i386_16_byte_align_p (struct type *type)
       int i;
       for (i = 0; i < type->num_fields (); i++)
 	{
+	  if (field_is_static (&type->field (i)))
+	    continue;
 	  if (i386_16_byte_align_p (type->field (i).type ()))
 	    return 1;
 	}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-04 12:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 12:37 [committed][gdb/tdep] Handle static field in i386_16_byte_align_p Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox