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 4/4] Don't throw an error in 'info registers' for unavailable MIPS GP registers.


On 04/18/2017 10:33 PM, Maciej W. Rozycki wrote:
> 
> The use of angle brackets with the latter variant is consistent with other 
> targets, so I might have just a slight preference for it, but I'll be 
> happy to accept input from other people.

FWIW, I'd find using anything but <unavailable> when that's what
GDB means to be making the port be gratuitously different.
"<unavailable>" always means the same thing in gdb -- gdb knows
the value materially exists, but it can't get at it for some
reason (e.g., ptrace does not expose it, a core dump is trimmed, value
not collect in a trace frame, etc.).

Also, I'm not absolutely sure I'm following the code correctly, but ISTM
that the current mips table printing code can already print strings larger
than unavailable, like "<invalid float>" in mips_print_fp_register?

I also noticed that there's code in print_gp_register_row that handles
printing large registers separately:

      if (mips_float_register_p (gdbarch, regnum))
	break;			/* End the row: reached FP register.  */
      /* Large registers are handled separately.  */
      if (register_size (gdbarch, regnum) > mips_abi_regsize (gdbarch))
	{
...
	  /* Print this register on a row by itself.  */

supposedly to avoid column misalignment.  Maybe <unavailable> registers could
be printed on a row by themselves too?

(Or the column width could extended if there's an unavailable register, but I'm
sort of trying to avoid suggesting a deeper change.)

Note that while the mips table format is more compact, the generic
format has the advantage that is prints symbol information, like:

>> rip            0xffffffff8058bb12       0xffffffff8058bb12 <sched_switch+1218>

I definitely agree that it'd be nice to make the generic code
always print the columns neatly aligned.

(Maybe the ideal would be if the generic code learned about MIPS compact
format and users could pick the format they want with a format switch
like "info register /c" or some such.  But again, that'd be a larger
change which I'd not like to require.)

Thanks,
Pedro Alves


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