public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* __register_frame and gdb
@ 1997-11-22 18:26 H.J. Lu
  1997-11-26  6:10 ` Fred Fish
  0 siblings, 1 reply; 3+ messages in thread
From: H.J. Lu @ 1997-11-22 18:26 UTC (permalink / raw)
  To: egcs

Hi,

__register_frame () called from the .init section calls malloc ().
But mmcheckf () called by init_malloc () in gdb wants itself to be
called before any malloc calls. Otherwise gdb will say

warning: failed to install memory consistency checks; configuration
should define NO_MMCHECK or MMCHECK_FORCE

I don't see there is an easy fix since __register_frame () is called
before main (). We can put init_malloc () in the .init section. But
it has to be before __register_frame (). Can we put __register_frame ()
in crtend.o? Since __register_frame () is unique to gcc, we can
use the gcc feature to deal with __register_frame (). I just
want to know if __register_frame () can be put in crtend.o.

Thanks.

-- 
H.J. Lu (hjl@gnu.org)

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

* Re: __register_frame and gdb
  1997-11-22 18:26 __register_frame and gdb H.J. Lu
@ 1997-11-26  6:10 ` Fred Fish
  0 siblings, 0 replies; 3+ messages in thread
From: Fred Fish @ 1997-11-26  6:10 UTC (permalink / raw)
  To: H.J. Lu; +Cc: egcs

> __register_frame () called from the .init section calls malloc ().
> But mmcheckf () called by init_malloc () in gdb wants itself to be
> called before any malloc calls. Otherwise gdb will say
> 
> warning: failed to install memory consistency checks; configuration
> should define NO_MMCHECK or MMCHECK_FORCE

Perhaps the solution is to have mmalloc install it's own consistency
checks the first time it is called, rather than depending upon the
application to explicitly make a call to set up consistency checking.
It could do this based on an environment variable for example.  Or we
could just hardcode it to always be on and live with the small runtime
penalty.

-Fred




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

* Re: __register_frame and gdb
       [not found] <m0xZRl5-0004efC.cygnus.egcs@ocean.lucon.org>
@ 1997-11-26  0:57 ` Jason Merrill
  0 siblings, 0 replies; 3+ messages in thread
From: Jason Merrill @ 1997-11-26  0:57 UTC (permalink / raw)
  To: H.J. Lu, egcs

>>>>> H J Lu <hjl@lucon.org> writes:

> I don't see there is an easy fix since __register_frame () is called
> before main (). We can put init_malloc () in the .init section. But
> it has to be before __register_frame (). Can we put __register_frame ()
> in crtend.o?

No.  __register_frame needs to be called before any static constructors
that might throw exceptions.

Jason

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

end of thread, other threads:[~1997-11-26  6:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-22 18:26 __register_frame and gdb H.J. Lu
1997-11-26  6:10 ` Fred Fish
     [not found] <m0xZRl5-0004efC.cygnus.egcs@ocean.lucon.org>
1997-11-26  0:57 ` Jason Merrill

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).