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


On Wed, Oct 19, 2005 at 10:48:53AM +0100, Andrew STUBBS wrote:
> Is there any reason for using a union here? It's not like one value is 
> float and the other int - both are ints and the fact that you can't tell 
> which you are using shows nobody actually uses the distinction (unless I 
> have missed something). The union doesn't save any space, nor does it 
> make the code any more efficient.
> 
> We could just use:
> 
> CORE_ADDR line_or_address;
> 
> and leave it at that.

I'd rather that.

It seems possible to figure out which one it's using - always file line
numbers for source displays and addresses for assembly displays.

          if ((win == TUI_SRC_WIN
               && bp->source_file
               && (strcmp (src->filename, bp->source_file) == 0)
               && bp->line_number == line->line_or_addr.line_no)
              || (win == TUI_DISASM_WIN
                  && bp->loc->address == line->line_or_addr.addr))

But why bother...

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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