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: [rfc][00/37] Eliminate builtin_type_ macros


Hi Ulrich,

> I still got a few regressions with our testsuite, which I will
> investigate now. Can you hold the patch off a little while longer?

OK, our testsuite found 2 issues:
 
  1. Pointer arithmetics, in particular "PTR + PTR" or "PTR - PTR"
     expressions. For instance:

       (gdb) print b'address - a'address
       Argument to arithmetic operation not a number or boolean.
     
     It's worth mentioning that the problem was already present
     with pointer addition (adding two pointers doesn't necessarily
     make a lot of sense, but anyway...).

     The regression on the substraction is because we replaced the
     call to (rip'ed) value_sub by a call to value_binop, which
     doesn't support pointer differences.

     I think the semantics of pointer differences in Ada are different
     from C. It's just a number substraction.  So I just added support
     for it directly at the caller site, thus calling value_binop
     only for values that it supports. Same for addition.

  2. The second problem is just an oversight. You needed a variable
     to store the int builtin type, and unfortunately you reused
     a variable that was still in use.
     See ada-lang.c (evaluate_subexp) [OP_ATR_SIZE].

     For now, I just used builtin_type_int32. Not ideal, but should
     be large enough for the vast majority of objects we actually
     have to deal with in real life.

Two suggested patches attached...

BTW: I tested on x86-linux (DWARF & STABS) as well as on x86_64-linux
(DWARF only, obviously).

-- 
Joel

Attachment: 01-ptrdiff.diff
Description: Text document

Attachment: 02-size_atr.diff
Description: Text document


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