Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* "set record instruction-history" ?
@ 2013-03-25 17:23 Pedro Alves
  2013-03-25 17:25 ` Metzger, Markus T
  0 siblings, 1 reply; 9+ messages in thread
From: Pedro Alves @ 2013-03-25 17:23 UTC (permalink / raw)
  To: GDB Patches, Metzger, Markus T

Hi Markus,

I'm going through all "uinteger" commands in the tree, and
finding several cases of commands that actually shouldn't
be "uinteger", but "zuinteger".

"record instruction-history"'s implementation looks odd enough that
I don't understand what's going on.  The docs don't mention anything
about 0 being special or meaning "unlimited", but I take it that's
the intent?

What's the intent of:

  /* The "record instruction-history" command.  */

  static void
  cmd_record_insn_history (char *arg, int from_tty)
  {
    int flags, size;

    require_record_target ();

    flags = get_insn_history_modifiers (&arg);

    /* We use a signed size to also indicate the direction.  Make sure that
       unlimited remains unlimited.  */
    size = (int) record_insn_history_size;
    if (size < 0)
      size = INT_MAX;

these last three lines here, though?

One can't set this option to negative values:

  (gdb) set record instruction-history-size -2
  integer -2 out of range

The fact that it maps all negatives to INT_MAX is odd,
and needing to set the option to high-enough unsigned 32-bit
integers that trigger that bit of code looks quite
non-user-friendly, even if it didn't always map to INT_MAX:

  (gdb) set record instruction-history-size 0xffffff00
  (gdb) show record instruction-history-size
  Number of instructions to print in "record instruction-history" is 4294967040.

(and exposes 32-bitness to the user, that I'd rather not)

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-03-27  9:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-25 17:23 "set record instruction-history" ? Pedro Alves
2013-03-25 17:25 ` Metzger, Markus T
2013-03-25 19:55   ` Pedro Alves
2013-03-26 16:21     ` Metzger, Markus T
2013-03-26 16:53       ` Pedro Alves
2013-03-26 16:58         ` Metzger, Markus T
2013-03-26 19:35           ` Pedro Alves
2013-03-27 10:03             ` Metzger, Markus T
2013-03-27 11:23               ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox