This is the mail archive of the gdb@sources.redhat.com 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: better name for var_integer et.al.


 /* Unsigned Integer.  *VAR is an unsigned int.  The user can type 0
    to mean "unlimited", which is stored in *VAR as UINT_MAX.  */
 var_uinteger,


Ada calls such numbers "Positive". var_positive might be a good name.

Or var_ordinal_number (vs cardinal number)?


 /* Like var_uinteger but signed.  *VAR is an int.  The user can type 0
    to mean "unlimited", which is stored in *VAR as INT_MAX.  */
 var_integer,

Well, the "set backtrace limit 100" bug comes from a comparison between signed (frame->limit == -1) vs unsigned (backtrace_limit == 100) comparison which is from a var_uinteger.


Using var_integer "fixes" it but lets a user enter -100.

I can't see any use for this semantics, but maybe it's due to my limited
experience. I looked at the current code, and most if not all of them
where just misuses of this kind. Some of them are really booleans (so I
suspect var_zinteger would be better), or postive numbers (so
var_positive would be better).

I not useful, I would consider just removing it.


 /* ZeroableInteger.  *VAR is an int.  Like Unsigned Integer except
    that zero really means zero.  */
 var_zinteger,


var_integer? (assuming we get rid of the non-zero signed integer)

Andrew





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