* Changes MOZ_TRACE_MALLOC ifdefs to NS_TRACE_MALLOC ifdefs
* Links against the trace-malloc utils against libxpcom instead of just xpcomds
* Builds NSPR in debug mode on win32 if trace-malloc is enabled
* Adds a few "defined()" checks to diffbloatdump.pl so that it will work for
perl 5.6.1
* Adds a couple of checks for \r so that diffbloatdump.pl works on win32.

Bug #126915 r=bryner/dbaron a=asa
This commit is contained in:
seawood%netscape.com 2002-02-26 09:26:10 +00:00
Родитель 12dbac237e
Коммит 0df019b037
5 изменённых файлов: 20 добавлений и 17 удалений

Просмотреть файл

@ -306,12 +306,10 @@ endif
# No opt to give sane callstacks.
#
ifdef NS_TRACE_MALLOC
_WIN32_TM_FLAGS=-Zi -Od -UDEBUG -DNDEBUG
OS_CFLAGS += $(_WIN32_TM_FLAGS)
OS_CXXFLAGS += $(_WIN32_TM_FLAGS)
MOZ_OPTIMIZE_FLAGS=-Zi -Od -UDEBUG -DNDEBUG
OS_LDFLAGS += /DEBUG /DEBUGTYPE:CV /PDB:NONE /OPT:REF /OPT:nowin98
endif
# MOZ_TRACE_MALLOC
# NS_TRACE_MALLOC
# if MOZ_DEBUG is not set and MOZ_MAPINFO
MAPFILE=$(LIBRARY_NAME).map
@ -561,26 +559,26 @@ ifeq ($(OS_ARCH),WINNT)
#//------------------------------------------------------------------------
ifdef USE_STATIC_LIBS
RTL_FLAGS=-MT # Statically linked multithreaded RTL
ifneq (,$(MOZ_DEBUG)$(MOZ_TRACE_MALLOC))
ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC))
RTL_FLAGS=-MTd # Statically linked multithreaded MSVC4.0 debug RTL
endif # MOZ_DEBUG || MOZ_TRACE_MALLOC
endif # MOZ_DEBUG || NS_TRACE_MALLOC
else # !USE_STATIC_LIBS
ifdef USE_NON_MT_LIBS
RTL_FLAGS=-ML # Statically linked non-multithreaded LIBC RTL
ifneq (,$(MOZ_DEBUG)$(MOZ_TRACE_MALLOC))
ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC))
RTL_FLAGS=-MLd # Statically linked non-multithreaded LIBC debug RTL
endif # MOZ_DEBUG || MOZ_TRACE_MALLOC
endif # MOZ_DEBUG || NS_TRACE_MALLOC
else # ! USE_NON_MT_LIBS
RTL_FLAGS=-MD # Dynamically linked, multithreaded RTL
ifneq (,$(MOZ_DEBUG)$(MOZ_TRACE_MALLOC))
ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC))
ifndef MOZ_NO_DEBUG_RTL
RTL_FLAGS=-MDd # Dynamically linked, multithreaded MSVC4.0 debug RTL
endif
endif # MOZ_DEBUG || MOZ_TRACE_MALLOC
endif # MOZ_DEBUG || NS_TRACE_MALLOC
endif # USE_NON_MT_LIBS
endif # USE_STATIC_LIBS
endif # WINNT

Просмотреть файл

@ -45,7 +45,7 @@ include $(topsrcdir)/config/config.mk
LIBS += \
$(LIBS_DIR) \
tmreader.$(OBJ_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)xpcomds_s.$(LIB_SUFFIX) \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(NULL)

Просмотреть файл

@ -85,7 +85,7 @@ sub add_file($$) {
my @stack;
# read the data at the memory location
while ( ($line = <$infile>) && substr($line,0,1) eq "\t" ) {
while ( defined($infile) && ($line = <$infile>) && substr($line,0,1) eq "\t" ) {
# do nothing
}
@ -97,7 +97,7 @@ sub add_file($$) {
$line = $1;
}
$stack[$#stack+1] = $line;
} while ( ($line = <$infile>) && $line ne "\n" );
} while ( defined($infile) && ($line = <$infile>) && $line ne "\n" && $line ne "\r\n" );
return \@stack;
}
@ -131,8 +131,8 @@ sub add_file($$) {
while ( ! eof(INFILE) ) {
# read the type and address
my $line = <INFILE>;
unless ($line =~ /.*\((\d*)\)\n/) {
die "badly formed allocation header";
unless ($line =~ /.*\((\d*)\)[\r|\n]/) {
die "badly formed allocation header in $infile";
}
my $size;
if ($::opt_allocation_count) {
@ -146,6 +146,8 @@ sub add_file($$) {
close INFILE;
}
sub print_node_indent($$$);
sub print_calltree() {
sub print_indent($) {
my ($i) = @_;

Просмотреть файл

@ -74,7 +74,10 @@ EXPORTS = \
ifdef NS_TRACE_MALLOC
CSRCS += nsTraceMalloc.c
CPPSRCS += nsTypeInfo.cpp
CPPSRCS += nsTypeInfo.cpp
ifeq ($(OS_ARCH),WINNT)
CPPSRCS += nsDebugHelpWin32.cpp nsWinTraceMalloc.cpp
endif
EXPORTS += nsTraceMalloc.h
DEFINES += -DNS_TRACE_MALLOC
endif

Просмотреть файл

@ -133,7 +133,7 @@ endif
ifeq ($(OS_ARCH),WINNT)
DEFINES += -DWIN32_LEAN_AND_MEAN
EXTRA_DSO_LDOPTS += shell32.lib ole32.lib
ifneq (,$(MOZ_DEBUG)$(MOZ_TRACE_MALLOC))
ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC))
EXTRA_DSO_LDOPTS += imagehlp.lib
endif
endif # WINNT