Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* stupify MAX_REGISTER_{RAW,VIRTUAL}_SIZE
@ 2003-04-02  0:13 Andrew Cagney
  2003-04-02  0:20 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cagney @ 2003-04-02  0:13 UTC (permalink / raw)
  To: gdb

Hmm,

The architecture vector contains the two macros:

	MAX_REGISTER_RAW_SIZE
	MAX_REGISTER_VIRTUAL_SIZE

which provide small per-architecture upper bounds on a register.  They 
are used when allocating scratch buffers (typically using alloca()). 
The regcache provides a successor - max_register_size().

I'm now wondering if it would be easier to simply define:

	enum { MAX_REGISTER_SIZE = 16 };

and then, if that ever proves to be too small, make it bigger.  Just as 
long as no one creates an architecture with >~2k registers ....

Andrew


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

* Re: stupify MAX_REGISTER_{RAW,VIRTUAL}_SIZE
  2003-04-02  0:13 stupify MAX_REGISTER_{RAW,VIRTUAL}_SIZE Andrew Cagney
@ 2003-04-02  0:20 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2003-04-02  0:20 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb

On Tue, Apr 01, 2003 at 07:13:40PM -0500, Andrew Cagney wrote:
> Hmm,
> 
> The architecture vector contains the two macros:
> 
> 	MAX_REGISTER_RAW_SIZE
> 	MAX_REGISTER_VIRTUAL_SIZE
> 
> which provide small per-architecture upper bounds on a register.  They 
> are used when allocating scratch buffers (typically using alloca()). 
> The regcache provides a successor - max_register_size().
> 
> I'm now wondering if it would be easier to simply define:
> 
> 	enum { MAX_REGISTER_SIZE = 16 };
> 
> and then, if that ever proves to be too small, make it bigger.  Just as 
> long as no one creates an architecture with >~2k registers ....

Entirely in favor!

I've got a port which supports 20, and we'll probably be seeing 32 in
new platforms soon - but I don't think using a constant will get out of
hand for a long time. 

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

end of thread, other threads:[~2003-04-02  0:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-02  0:13 stupify MAX_REGISTER_{RAW,VIRTUAL}_SIZE Andrew Cagney
2003-04-02  0:20 ` Daniel Jacobowitz

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