public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* MAX_SECTIONS is way too small
@ 2003-05-14 22:46 Mark Mitchell
  2003-05-14 22:58 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Mitchell @ 2003-05-14 22:46 UTC (permalink / raw)
  To: gdb


Presently, MAX_SECTIONS and SECT_OFF_MAX are set to 64.

That's far too small when using G++, which can generate a linkonce
section per template instantiation, yielding thousands of sections in
the output file.  

GDB does not even bother to check SECT_OFF_MAX; it just goes looking
at memory past the end of objfile->section_offsets rather happily.

This problem is the cause of GNATS PR 1171.

It can be easily fixed by bumping MAX_SECTIONS and SECT_OFF_MAX to
larger values; to get that test to work you need to make them about
6000.

But, this should not be a hard-wired constant.

Before, I go fiddling around trying to make these things dynamic, does
anyone have any comments they'd like to make? :-)

Thanks,

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

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

* Re: MAX_SECTIONS is way too small
  2003-05-14 22:46 MAX_SECTIONS is way too small Mark Mitchell
@ 2003-05-14 22:58 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2003-05-14 22:58 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: gdb

On Wed, May 14, 2003 at 03:46:21PM -0700, Mark Mitchell wrote:
> 
> Presently, MAX_SECTIONS and SECT_OFF_MAX are set to 64.
> 
> That's far too small when using G++, which can generate a linkonce
> section per template instantiation, yielding thousands of sections in
> the output file.  
> 
> GDB does not even bother to check SECT_OFF_MAX; it just goes looking
> at memory past the end of objfile->section_offsets rather happily.
> 
> This problem is the cause of GNATS PR 1171.
> 
> It can be easily fixed by bumping MAX_SECTIONS and SECT_OFF_MAX to
> larger values; to get that test to work you need to make them about
> 6000.
> 
> But, this should not be a hard-wired constant.
> 
> Before, I go fiddling around trying to make these things dynamic, does
> anyone have any comments they'd like to make? :-)

How's "yes please" sound?

This has been on my TODO for I have no idea how long now.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

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

end of thread, other threads:[~2003-05-14 22:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-14 22:46 MAX_SECTIONS is way too small Mark Mitchell
2003-05-14 22:58 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).