From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id GEL/Ga4tyl9MMQAAWB0awg (envelope-from ) for ; Fri, 04 Dec 2020 07:38:06 -0500 Received: by simark.ca (Postfix, from userid 112) id 68B651F0AB; Fri, 4 Dec 2020 07:38:06 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C73BC1E552 for ; Fri, 4 Dec 2020 07:38:05 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2F63E397302E; Fri, 4 Dec 2020 12:38:05 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 83DCC3846416 for ; Fri, 4 Dec 2020 12:38:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 83DCC3846416 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 7F656AC75 for ; Fri, 4 Dec 2020 12:38:01 +0000 (UTC) Date: Fri, 4 Dec 2020 13:37:59 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/tdep] Handle static field in i386_16_byte_align_p Message-ID: <20201204123758.GA4771@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "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 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; }