From cc503c8aa2d3163546a64753ebecddd804822be9 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 10 Aug 2004 22:36:39 +0000 Subject: [PATCH] 2004-08-10 Andrew Cagney * main.c (captured_main): Delete call to init_malloc. * defs.h (init_malloc): Delete declaration. * utils.c (mmalloc, mrealloc, mcalloc, mfree) (init_malloc): Delete functions. Index: testsuite/ChangeLog 2004-08-10 Andrew Cagney * gdb.gdb/selftest.exp (do_steps_and_nexts): Remove code to skip init_malloc call. --- gdb/ChangeLog | 5 +++++ gdb/defs.h | 2 -- gdb/main.c | 3 --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.gdb/selftest.exp | 4 ---- gdb/utils.c | 36 ------------------------------ 6 files changed, 10 insertions(+), 45 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9043fffb8c5..973ca13089c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2004-08-10 Andrew Cagney + * main.c (captured_main): Delete call to init_malloc. + * defs.h (init_malloc): Delete declaration. + * utils.c (mmalloc, mrealloc, mcalloc, mfree) + (init_malloc): Delete functions. + * defs.h (xmfree): Delete. * utils.c (xmfree): Delete function. (xfree): Inline calls to xmfree and mfree. diff --git a/gdb/defs.h b/gdb/defs.h index 3f6e7207a16..8e2ba64d39e 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -358,8 +358,6 @@ extern int subset_compare (char *, char *); extern char *safe_strerror (int); -extern void init_malloc (void *); - extern void request_quit (int); extern void do_cleanups (struct cleanup *); diff --git a/gdb/main.c b/gdb/main.c index 0042962c5dc..d331bc546ca 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -157,9 +157,6 @@ captured_main (void *data) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - /* This needs to happen before the first use of malloc. */ - init_malloc (NULL); - #ifdef HAVE_SBRK lim_at_start = (char *) sbrk (0); #endif diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 7bb16b8e18f..bc5afb76cb5 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-08-10 Andrew Cagney + + * gdb.gdb/selftest.exp (do_steps_and_nexts): Remove code to skip + init_malloc call. + 2004-08-10 Michael Chastain * ChangeLog: Add copyright notice. The notice is copied diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp index 4196b74e786..283de5100d9 100644 --- a/gdb/testsuite/gdb.gdb/selftest.exp +++ b/gdb/testsuite/gdb.gdb/selftest.exp @@ -105,10 +105,6 @@ proc do_steps_and_nexts {} { set description "next over mac_init and everything it calls" set command "next" } - -re ".*init_malloc.*$gdb_prompt $" { - set description "next over init_malloc and everything it calls" - set command "next" - } -re ".*lim_at_start.*$gdb_prompt $" { set description "next over lim_at_start initialization" set command "next" diff --git a/gdb/utils.c b/gdb/utils.c index 25fca5ae604..be99780cf69 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -983,42 +983,6 @@ request_quit (int signo) quit (); } -/* Memory management stuff (malloc friends). */ - -static void * -mmalloc (void *md, size_t size) -{ - return malloc (size); /* NOTE: GDB's only call to malloc() */ -} - -static void * -mrealloc (void *md, void *ptr, size_t size) -{ - if (ptr == 0) /* Guard against old realloc's */ - return mmalloc (md, size); - else - return realloc (ptr, size); /* NOTE: GDB's only call to ralloc() */ -} - -static void * -mcalloc (void *md, size_t number, size_t size) -{ - return calloc (number, size); /* NOTE: GDB's only call to calloc() */ -} - -static void -mfree (void *md, void *ptr) -{ - free (ptr); /* NOTE: GDB's only call to free() */ -} - -/* This used to do something interesting with USE_MMALLOC. - * It can be retired any time. -- chastain 2004-01-19. */ -void -init_malloc (void *md) -{ -} - /* Called when a memory allocation fails, with the number of bytes of memory requested in SIZE. */