From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4573 invoked by alias); 19 Oct 2005 09:15:14 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 4564 invoked by uid 22791); 19 Oct 2005 09:15:11 -0000 Received: from romy.inter.net.il (HELO romy.inter.net.il) (192.114.186.66) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 19 Oct 2005 09:15:11 +0000 Received: from HOME-C4E4A596F7 (IGLD-84-228-161-125.inter.net.il [84.228.161.125]) by romy.inter.net.il (MOS 3.5.8-GR) with ESMTP id CSW27965 (AUTH halo1); Wed, 19 Oct 2005 11:15:07 +0200 (IST) Date: Wed, 19 Oct 2005 09:15:00 -0000 Message-Id: From: Eli Zaretskii To: Andrew STUBBS CC: gdb-patches@sources.redhat.com In-reply-to: <4353BA69.1030401@st.com> (message from Andrew STUBBS on Mon, 17 Oct 2005 15:51:21 +0100) Subject: Re: PATCH: Problem union comparision in TUI Reply-to: Eli Zaretskii References: <4353BA69.1030401@st.com> X-SW-Source: 2005-10/txt/msg00156.txt.bz2 > Date: Mon, 17 Oct 2005 15:51:21 +0100 > From: Andrew STUBBS > > --- src.orig/gdb/tui/tui-data.h 2004-03-13 14:14:01.000000000 +0000 > +++ src/gdb/tui/tui-data.h 2005-10-17 14:21:23.000000000 +0100 > @@ -149,7 +149,7 @@ enum tui_register_display_type > /* Structure describing source line or line address */ > union tui_line_or_address > { > - int line_no; > + CORE_ADDR line_no; > CORE_ADDR addr; > }; IMHO, a better way of fixing this would be to change tui_line_or_address to be a struct as follows: /* Structure describing source line or line address */ struct tui_line_or_address { unsigned char what union { int line_no; CORE_ADDR addr; } u; }; and then fill the `what' member as appropriate and use the right part of the union in the comparison.