* [patch/rfc] Don't include vector registers in ``info registers''
@ 2002-08-08 16:52 Andrew Cagney
2002-08-08 17:07 ` Andrew Cagney
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Andrew Cagney @ 2002-08-08 16:52 UTC (permalink / raw)
To: gdb-patches
Hello,
The attached patch modifies the generic ``info registsters'' command so
that it precludes vector registers (in addition to floating-point
registers). The online doco indicates:
(gdb) help info registers
List of integer registers and their contents, for selected stack frame.
Register name as argument means describe only that register.
(gdb) help info all-registers
List of all registers and their contents, for selected stack frame.
Register name as argument means describe only that register.
I think the change makes the behavour a better match for both the
documentation and what I think is the intent of the command. Print a
minimal set of registers.
It will eventually affect the i386 -- I've a patch to change the type of
xmm [and mmx] registers to true vectors. When that is in, ``info
registers'' will stop displaying the xmm registers.
Thoughts?
enjoy,
Andrew
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [patch/rfc] Don't include vector registers in ``info registers'' 2002-08-08 16:52 [patch/rfc] Don't include vector registers in ``info registers'' Andrew Cagney @ 2002-08-08 17:07 ` Andrew Cagney 2002-08-08 19:07 ` Elena Zannoni ` (2 more replies) 2002-08-08 18:33 ` Daniel Jacobowitz 2002-08-08 18:50 ` Michael Snyder 2 siblings, 3 replies; 11+ messages in thread From: Andrew Cagney @ 2002-08-08 17:07 UTC (permalink / raw) To: Andrew Cagney; +Cc: gdb-patches [-- Attachment #1: Type: text/plain, Size: 940 bytes --] [With patch] > Hello, > > The attached patch modifies the generic ``info registsters'' command so that it precludes vector registers (in addition to floating-point registers). The online doco indicates: > > (gdb) help info registers > List of integer registers and their contents, for selected stack frame. > Register name as argument means describe only that register. > (gdb) help info all-registers > List of all registers and their contents, for selected stack frame. > Register name as argument means describe only that register. > > I think the change makes the behavour a better match for both the documentation and what I think is the intent of the command. Print a minimal set of registers. > > It will eventually affect the i386 -- I've a patch to change the type of xmm [and mmx] registers to true vectors. When that is in, ``info registers'' will stop displaying the xmm registers. > > Thoughts? > > enjoy, > Andrew [-- Attachment #2: diffs --] [-- Type: text/plain, Size: 1747 bytes --] 2002-08-08 Andrew Cagney <cagney@redhat.com> * infcmd.c (do_registers_info): Rename parameter ``fpregs'' to ``print_all''. Only print vector registers when ``print_all''. Index: infcmd.c =================================================================== RCS file: /cvs/src/src/gdb/infcmd.c,v retrieving revision 1.49 diff -u -r1.49 infcmd.c --- infcmd.c 3 Jul 2002 20:36:54 -0000 1.49 +++ infcmd.c 8 Aug 2002 21:14:22 -0000 @@ -1549,9 +1549,9 @@ #ifdef REGISTER_NAMES char *gdb_register_names[] = REGISTER_NAMES; #endif -/* Print out the machine register regnum. If regnum is -1, - print all registers (fpregs == 1) or all non-float registers - (fpregs == 0). +/* Print out the machine register regnum. If regnum is -1, print all + registers (all == 1) or all non-float and non-vector registers (all + == 0). For most machines, having all_registers_info() print the register(s) one per line is good enough. If a different format @@ -1561,7 +1561,7 @@ to provide that format. */ void -do_registers_info (int regnum, int fpregs) +do_registers_info (int regnum, int print_all) { register int i; int numregs = NUM_REGS + NUM_PSEUDO_REGS; @@ -1570,11 +1570,17 @@ for (i = 0; i < numregs; i++) { - /* Decide between printing all regs, nonfloat regs, or specific reg. */ + /* Decide between printing all regs, non-float / vector regs, or + specific reg. */ if (regnum == -1) { - if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT && !fpregs) - continue; + if (!print_all) + { + if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT) + continue; + if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i))) + continue; + } } else { ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch/rfc] Don't include vector registers in ``info registers'' 2002-08-08 17:07 ` Andrew Cagney @ 2002-08-08 19:07 ` Elena Zannoni 2002-08-08 19:24 ` Andrew Cagney 2002-08-13 14:45 ` Andrew Cagney 2002-08-09 11:39 ` Andrew Cagney 2002-08-15 17:12 ` Andrew Cagney 2 siblings, 2 replies; 11+ messages in thread From: Elena Zannoni @ 2002-08-08 19:07 UTC (permalink / raw) To: Andrew Cagney; +Cc: gdb-patches Ah, compare with what the rs6000-tdep.c has: rs6000_do_registers_info(). I made the same change, but also added a skipping of the print of a single vector register in decimal, it was taking up too much screen real estate. /* If not a vector register, print it also in decimal. */ if (!altivec_register_p (i)) { printf_filtered ("\t"); val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, gdb_stdout, 0, 1, 0, Val_pretty_default); } I also did something different: defining altivec_register_p(). I was envisioning this predicate becoming an architecture method called vector_register_p(). Another thing I've done in rs6000-tdep.c is the 'info vector' command (even though it is called 'info altivec'). I'll be submitting shortly another powerpc variation (the e500) which has vector registers, so I generalized things a bit in that file, wrt vector registers. Elena Andrew Cagney writes: > [With patch] > > > > Hello, > > > > The attached patch modifies the generic ``info registsters'' command so that it precludes vector registers (in addition to floating-point registers). The online doco indicates: > > > > (gdb) help info registers > > List of integer registers and their contents, for selected stack frame. > > Register name as argument means describe only that register. > > (gdb) help info all-registers > > List of all registers and their contents, for selected stack frame. > > Register name as argument means describe only that register. > > > > I think the change makes the behavour a better match for both the documentation and what I think is the intent of the command. Print a minimal set of registers. > > > > It will eventually affect the i386 -- I've a patch to change the type of xmm [and mmx] registers to true vectors. When that is in, ``info registers'' will stop displaying the xmm registers. > > > > Thoughts? > > > > enjoy, > > Andrew > > 2002-08-08 Andrew Cagney <cagney@redhat.com> > > * infcmd.c (do_registers_info): Rename parameter ``fpregs'' to > ``print_all''. Only print vector registers when ``print_all''. > > Index: infcmd.c > =================================================================== > RCS file: /cvs/src/src/gdb/infcmd.c,v > retrieving revision 1.49 > diff -u -r1.49 infcmd.c > --- infcmd.c 3 Jul 2002 20:36:54 -0000 1.49 > +++ infcmd.c 8 Aug 2002 21:14:22 -0000 > @@ -1549,9 +1549,9 @@ > #ifdef REGISTER_NAMES > char *gdb_register_names[] = REGISTER_NAMES; > #endif > -/* Print out the machine register regnum. If regnum is -1, > - print all registers (fpregs == 1) or all non-float registers > - (fpregs == 0). > +/* Print out the machine register regnum. If regnum is -1, print all > + registers (all == 1) or all non-float and non-vector registers (all > + == 0). > > For most machines, having all_registers_info() print the > register(s) one per line is good enough. If a different format > @@ -1561,7 +1561,7 @@ > to provide that format. */ > > void > -do_registers_info (int regnum, int fpregs) > +do_registers_info (int regnum, int print_all) > { > register int i; > int numregs = NUM_REGS + NUM_PSEUDO_REGS; > @@ -1570,11 +1570,17 @@ > > for (i = 0; i < numregs; i++) > { > - /* Decide between printing all regs, nonfloat regs, or specific reg. */ > + /* Decide between printing all regs, non-float / vector regs, or > + specific reg. */ > if (regnum == -1) > { > - if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT && !fpregs) > - continue; > + if (!print_all) > + { > + if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT) > + continue; > + if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i))) > + continue; > + } > } > else > { ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch/rfc] Don't include vector registers in ``info registers'' 2002-08-08 19:07 ` Elena Zannoni @ 2002-08-08 19:24 ` Andrew Cagney 2002-08-13 14:45 ` Andrew Cagney 1 sibling, 0 replies; 11+ messages in thread From: Andrew Cagney @ 2002-08-08 19:24 UTC (permalink / raw) To: Elena Zannoni; +Cc: gdb-patches > Another thing I've done in rs6000-tdep.c is the 'info vector' command > (even though it is called 'info altivec'). Hmm, ``info vector-registers'' sounds good to me. Andrew ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch/rfc] Don't include vector registers in ``info registers'' 2002-08-08 19:07 ` Elena Zannoni 2002-08-08 19:24 ` Andrew Cagney @ 2002-08-13 14:45 ` Andrew Cagney 1 sibling, 0 replies; 11+ messages in thread From: Andrew Cagney @ 2002-08-13 14:45 UTC (permalink / raw) To: Elena Zannoni; +Cc: gdb-patches > Ah, compare with what the rs6000-tdep.c has: > rs6000_do_registers_info(). > > I made the same change, but also added a skipping of the print of a > single vector register in decimal, it was taking up too much screen > real estate. > > /* If not a vector register, print it also in decimal. */ > if (!altivec_register_p (i)) > { > printf_filtered ("\t"); > val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, > gdb_stdout, 0, 1, 0, Val_pretty_default); > } Hmm, yes, the vector register output is a bit long. > I also did something different: defining altivec_register_p(). I was > envisioning this predicate becoming an architecture method called > vector_register_p(). Yes, I know GUI people are crying out for some sort of register attribute mechanism. If/when it is added the current tests could quickly be replaced with more generic code that, by default, used the current heuristics. > Another thing I've done in rs6000-tdep.c is the 'info vector' command > (even though it is called 'info altivec'). > > I'll be submitting shortly another powerpc variation (the e500) which > has vector registers, so I generalized things a bit in that file, wrt > vector registers. Hmm... Andrew ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch/rfc] Don't include vector registers in ``info registers'' 2002-08-08 17:07 ` Andrew Cagney 2002-08-08 19:07 ` Elena Zannoni @ 2002-08-09 11:39 ` Andrew Cagney 2002-08-15 17:12 ` Andrew Cagney 2 siblings, 0 replies; 11+ messages in thread From: Andrew Cagney @ 2002-08-09 11:39 UTC (permalink / raw) To: Andrew Cagney; +Cc: gdb-patches Not my day. > It will eventually affect the i386 -- I've a patch to change the type of xmm [and mmx] registers to true vectors. When that is in, ``info registers'' will stop displaying the xmm registers. I figured out why it wasn't already affecting the i386. That's been converted to the new vec128i already and the test is out-of-date :-( > + if (!print_all) > + { > + if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT) > + continue; > + if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i))) > + continue; > + } This would need to read something like: if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == struct or union && first field's type was a vector) continue; What the heck, time for ``register_attribute()''. Andrew ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch/rfc] Don't include vector registers in ``info registers'' 2002-08-08 17:07 ` Andrew Cagney 2002-08-08 19:07 ` Elena Zannoni 2002-08-09 11:39 ` Andrew Cagney @ 2002-08-15 17:12 ` Andrew Cagney 2 siblings, 0 replies; 11+ messages in thread From: Andrew Cagney @ 2002-08-15 17:12 UTC (permalink / raw) To: Andrew Cagney; +Cc: gdb-patches > 2002-08-08 Andrew Cagney <cagney@redhat.com> > > * infcmd.c (do_registers_info): Rename parameter ``fpregs'' to > ``print_all''. Only print vector registers when ``print_all''. > I've checked this in. `info registers', by default, excludes vector registers. Andrew ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch/rfc] Don't include vector registers in ``info registers'' 2002-08-08 16:52 [patch/rfc] Don't include vector registers in ``info registers'' Andrew Cagney 2002-08-08 17:07 ` Andrew Cagney @ 2002-08-08 18:33 ` Daniel Jacobowitz 2002-08-08 18:45 ` Michael Snyder 2002-08-08 19:35 ` Andrew Cagney 2002-08-08 18:50 ` Michael Snyder 2 siblings, 2 replies; 11+ messages in thread From: Daniel Jacobowitz @ 2002-08-08 18:33 UTC (permalink / raw) To: Andrew Cagney; +Cc: gdb-patches On Thu, Aug 08, 2002 at 07:51:57PM -0400, Andrew Cagney wrote: > Hello, > > The attached patch modifies the generic ``info registsters'' command so > that it precludes vector registers (in addition to floating-point > registers). The online doco indicates: > > (gdb) help info registers > List of integer registers and their contents, for selected stack frame. > Register name as argument means describe only that register. > (gdb) help info all-registers > List of all registers and their contents, for selected stack frame. > Register name as argument means describe only that register. > > I think the change makes the behavour a better match for both the > documentation and what I think is the intent of the command. Print a > minimal set of registers. > > It will eventually affect the i386 -- I've a patch to change the type of > xmm [and mmx] registers to true vectors. When that is in, ``info > registers'' will stop displaying the xmm registers. > > Thoughts? My only comment is that I would also like ``info registers'' not to print kernel-mode or processor status registers, since that seems (to me) to be appropriate; it should print registers for stack/pc and computation primarily, not things like the MSR. Might be harder to do generically though. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch/rfc] Don't include vector registers in ``info registers'' 2002-08-08 18:33 ` Daniel Jacobowitz @ 2002-08-08 18:45 ` Michael Snyder 2002-08-08 19:35 ` Andrew Cagney 1 sibling, 0 replies; 11+ messages in thread From: Michael Snyder @ 2002-08-08 18:45 UTC (permalink / raw) To: Daniel Jacobowitz; +Cc: Andrew Cagney, gdb-patches Daniel Jacobowitz wrote: > > On Thu, Aug 08, 2002 at 07:51:57PM -0400, Andrew Cagney wrote: > > Hello, > > > > The attached patch modifies the generic ``info registsters'' command so > > that it precludes vector registers (in addition to floating-point > > registers). The online doco indicates: > > > > (gdb) help info registers > > List of integer registers and their contents, for selected stack frame. > > Register name as argument means describe only that register. > > (gdb) help info all-registers > > List of all registers and their contents, for selected stack frame. > > Register name as argument means describe only that register. > > > > I think the change makes the behavour a better match for both the > > documentation and what I think is the intent of the command. Print a > > minimal set of registers. > > > > It will eventually affect the i386 -- I've a patch to change the type of > > xmm [and mmx] registers to true vectors. When that is in, ``info > > registers'' will stop displaying the xmm registers. > > > > Thoughts? > > My only comment is that I would also like ``info registers'' not to > print kernel-mode or processor status registers, since that seems (to > me) to be appropriate; it should print registers for stack/pc and > computation primarily, not things like the MSR. > > Might be harder to do generically though. That would mean that in order to see things like the status and control registers, you would have to do info all-reg, which would then spit out all your FP and VEC registers too. Folks who need the in-between registers might not like that. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch/rfc] Don't include vector registers in ``info registers'' 2002-08-08 18:33 ` Daniel Jacobowitz 2002-08-08 18:45 ` Michael Snyder @ 2002-08-08 19:35 ` Andrew Cagney 1 sibling, 0 replies; 11+ messages in thread From: Andrew Cagney @ 2002-08-08 19:35 UTC (permalink / raw) To: Daniel Jacobowitz; +Cc: gdb-patches > On Thu, Aug 08, 2002 at 07:51:57PM -0400, Andrew Cagney wrote: > >> Hello, >> >> The attached patch modifies the generic ``info registsters'' command so >> that it precludes vector registers (in addition to floating-point >> registers). The online doco indicates: >> >> (gdb) help info registers >> List of integer registers and their contents, for selected stack frame. >> Register name as argument means describe only that register. >> (gdb) help info all-registers >> List of all registers and their contents, for selected stack frame. >> Register name as argument means describe only that register. >> >> I think the change makes the behavour a better match for both the >> documentation and what I think is the intent of the command. Print a >> minimal set of registers. >> >> It will eventually affect the i386 -- I've a patch to change the type of >> xmm [and mmx] registers to true vectors. When that is in, ``info >> registers'' will stop displaying the xmm registers. >> >> Thoughts? > > > My only comment is that I would also like ``info registers'' not to > print kernel-mode or processor status registers, since that seems (to > me) to be appropriate; it should print registers for stack/pc and > computation primarily, not things like the MSR. Yes. There has been talk of adding a register attribute function. I suspect, though, that the function is of more use to GUI's then the CLI. > Might be harder to do generically though. Yes. I suspect the reality is that every architecture will eventually ends up with a custom info-registers function. Simply because they want the output to be something useful. Might even end up doing this for the i386. I think we need to be careful to not fall into the trap of over engineering the default function. Instead, encourage each target to do it custom but do provide some useful register print routines. -- Thinking out loud. Perhaphs the default ``info float[-registers]'' should scan for and print any floating-point registers and only print ``no float'' if none are found. enjoy, Andrew ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch/rfc] Don't include vector registers in ``info registers'' 2002-08-08 16:52 [patch/rfc] Don't include vector registers in ``info registers'' Andrew Cagney 2002-08-08 17:07 ` Andrew Cagney 2002-08-08 18:33 ` Daniel Jacobowitz @ 2002-08-08 18:50 ` Michael Snyder 2 siblings, 0 replies; 11+ messages in thread From: Michael Snyder @ 2002-08-08 18:50 UTC (permalink / raw) To: Andrew Cagney; +Cc: gdb-patches Andrew Cagney wrote: > > Hello, > > The attached patch modifies the generic ``info registsters'' command so > that it precludes vector registers (in addition to floating-point > registers). The online doco indicates: > > (gdb) help info registers > List of integer registers and their contents, for selected stack frame. > Register name as argument means describe only that register. > (gdb) help info all-registers > List of all registers and their contents, for selected stack frame. > Register name as argument means describe only that register. > > I think the change makes the behavour a better match for both the > documentation and what I think is the intent of the command. Print a > minimal set of registers. This matches what I implemented for at least one vector machine. And my intuition agrees with yours -- info registers should produce a display that fits in one screen, if possible. Masses of registers should be displayed some other way. > It will eventually affect the i386 -- I've a patch to change the type of > xmm [and mmx] registers to true vectors. When that is in, ``info > registers'' will stop displaying the xmm registers. > > Thoughts? Not having seen your patch (?), I wonder how you distinguished vector registers from generic ones. ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2002-08-16 0:12 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2002-08-08 16:52 [patch/rfc] Don't include vector registers in ``info registers'' Andrew Cagney 2002-08-08 17:07 ` Andrew Cagney 2002-08-08 19:07 ` Elena Zannoni 2002-08-08 19:24 ` Andrew Cagney 2002-08-13 14:45 ` Andrew Cagney 2002-08-09 11:39 ` Andrew Cagney 2002-08-15 17:12 ` Andrew Cagney 2002-08-08 18:33 ` Daniel Jacobowitz 2002-08-08 18:45 ` Michael Snyder 2002-08-08 19:35 ` Andrew Cagney 2002-08-08 18:50 ` Michael Snyder
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox