This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PATCH: Problem union comparision in TUI
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Andrew STUBBS <andrew dot stubbs at st dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 19 Oct 2005 11:15:10 +0200
- Subject: Re: PATCH: Problem union comparision in TUI
- References: <4353BA69.1030401@st.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Mon, 17 Oct 2005 15:51:21 +0100
> From: Andrew STUBBS <andrew.stubbs@st.com>
>
> --- 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.