This is the mail archive of the gdb-patches@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: [RFA/java] Don't print overly long repeated elements in an array


On Tue, Apr 02, 2002 at 02:14:06AM -0500, Daniel Jacobowitz wrote:
> The current Java array printer will print no more than ``set print
> elements'' number of items to the screen.  This patch changes it to
> print no more than that number total elements of the array, even if it
> turns out to be far fewer screen items.  The difference is because Java
> condenses repeated elements when printing.
> 
> The old behavior is more friendly; it lets you see that, of your ten
> thousand array elements, only two are non-NULL.  However, if the
> ``length'' field was corrupt GDB was prone to going into an endless (or
> very, very long) loop.  There was a several-MB blank area above the top
> of the stack on my testcase... GDB tried to read it all.  I prefer to
> be safe by default; it's easy enough to change the maximum via ``set
> print elements'' if you know you're dealing with a large sparse array.
> 
> Is this OK?  Any other preference on how it should be done, Per?
> 
> -- 
> Daniel Jacobowitz                           Carnegie Mellon University
> MontaVista Software                         Debian GNU/Linux Developer
> 
> 2002-04-02  Daniel Jacobowitz  <drow@mvista.com>
> 
> 	* jv-valprint (java_value_print): Limit read array elements by
> 	print_max instead of printed arrray elements.

In case anyone's still counting out there, I'm withdrawing this patch. 
All other languages do it the same way Java did before the patch. 
Perhaps that should still be fixed; but not by making Java
inconsistent.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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