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 3 PR gdb/16959] gdb hangs in infinite recursion



On 3/24/2018 12:23 PM, Simon Marchi wrote:
On 2018-03-24 14:54, Wei-min Pan wrote:
Please note the check_typedef() call (now redundant and removed)
before calling cp_print_value_fields().
So passing the resolved type is correct.

I think it's better if functions don't assume too much what other functions need (original type vs real type). cp_print_value_fields may not require the real type today, but maybe that will change one day, and that call will have to be changed (if we even notice it).  So in that sense, it's better to always pass down the original type and let functions get the real type for their own use if they need it.

Simon

The original code is like:

-      type = check_typedef (type);
-      cp_print_value_fields (type, value_enclosing_type (val),

So it's passing the real type. Do you think that we still need to pass the original type?

Weimin


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