From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29185 invoked by alias); 17 Oct 2005 14:52:57 -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 29178 invoked by uid 22791); 17 Oct 2005 14:52:55 -0000 Received: from fra-del-03.spheriq.net (HELO fra-del-03.spheriq.net) (195.46.51.99) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 17 Oct 2005 14:52:55 +0000 Received: from fra-out-02.spheriq.net (fra-out-02.spheriq.net [195.46.51.130]) by fra-del-03.spheriq.net with ESMTP id j9HEqqx7007802 for ; Mon, 17 Oct 2005 14:52:52 GMT Received: from fra-cus-01.spheriq.net (fra-cus-01.spheriq.net [195.46.51.37]) by fra-out-02.spheriq.net with ESMTP id j9HEqoSE022604 for ; Mon, 17 Oct 2005 14:52:50 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by fra-cus-01.spheriq.net with ESMTP id j9HEqmAR031047 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Mon, 17 Oct 2005 14:52:49 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0DF09DA46 for ; Mon, 17 Oct 2005 14:52:48 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id 54B54474DF; Mon, 17 Oct 2005 14:55:31 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A2AB4759BB for ; Mon, 17 Oct 2005 14:55:30 +0000 (UTC) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E0F2D474D5 for ; Mon, 17 Oct 2005 14:55:28 +0000 (GMT) Received: from [164.129.15.13] (terrorhawk.bri.st.com [164.129.15.13]) by mail1.bri.st.com (MOS 3.5.8-GR) with ESMTP id CCW00997 (AUTH "andrew stubbs"); Mon, 17 Oct 2005 15:52:43 +0100 (BST) Message-ID: <4353BA69.1030401@st.com> Date: Mon, 17 Oct 2005 14:52:00 -0000 From: Andrew STUBBS User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: PATCH: Problem union comparision in TUI Content-Type: multipart/mixed; boundary="------------030304050107070505020400" X-O-Spoofed: Not Scanned X-O-General-Status: No X-O-Spam1-Status: Not Scanned X-O-Spam2-Status: Not Scanned X-O-URL-Status: Not Scanned X-O-Virus1-Status: No X-O-Virus2-Status: Not Scanned X-O-Virus3-Status: No X-O-Virus4-Status: No X-O-Virus5-Status: Not Scanned X-O-Image-Status: Not Scanned X-O-Attach-Status: Not Scanned X-SpheriQ-Ver: 2.3.0 X-SW-Source: 2005-10/txt/msg00135.txt.bz2 This is a multi-part message in MIME format. --------------030304050107070505020400 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1168 Hi, I have observed this problem in the sh-elf configuration of GDB. It is not visible in the i686-linux configuration because it uses the following union in a different way. /* Structure describing source line or line address */ union tui_line_or_address { int line_no; CORE_ADDR addr; }; The problem is that the union is always compared using 'addr'. In the case where it was set using 'line_no', as it is in sh-elf, half the union contains garbage. This appears to be killing the comparison in tui_set_is_exec_point_at() in tui-winsource.c. The result is that the current line is never highlighted as it should be. I assume the reason it works on i686-linux is that that host/target uses the addr field rather than the line_no field. The attached patch provides one way to fix the problem. I could not think of any way to fix the comparison because there is no way I can see to know which mode it is using, so I have changed the type of line_no in the union to match the type of addr. This does not seem to be the Right Thing to do with a union (because it might as well be one variable), but I can't see any other down side. Andrew Stubbs --------------030304050107070505020400 Content-Type: text/plain; name="tui-union-compare.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tui-union-compare.patch" Content-length: 429 Index: src/gdb/tui/tui-data.h =================================================================== --- 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; }; --------------030304050107070505020400--