This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Problem union comparision in TUI


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]