Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [obish] Zap m* methods
@ 2004-08-10 22:38 Andrew Cagney
  2004-08-10 22:59 ` Michael Chastain
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2004-08-10 22:38 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 205 bytes --]

Final one, this zaps mmalloc, et.al., along with init_malloc (the latter 
also removed from selftest.exp).  The former are never called, the 
latter is empty.

Tested on PPC NetBSD m/c.

committed,
Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 3370 bytes --]

2004-08-10  Andrew Cagney  <cagney@gnu.org>

	* 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  <cagney@gnu.org>

	* gdb.gdb/selftest.exp (do_steps_and_nexts): Remove code to skip
	init_malloc call.

Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.158
diff -p -u -r1.158 defs.h
--- defs.h	10 Aug 2004 21:52:04 -0000	1.158
+++ defs.h	10 Aug 2004 22:28:04 -0000
@@ -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 *);
Index: main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.43
diff -p -u -r1.43 main.c
--- main.c	26 Jul 2004 19:01:51 -0000	1.43
+++ main.c	10 Aug 2004 22:28:04 -0000
@@ -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
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.130
diff -p -u -r1.130 utils.c
--- utils.c	10 Aug 2004 21:52:05 -0000	1.130
+++ utils.c	10 Aug 2004 22:28:04 -0000
@@ -983,42 +983,6 @@ request_quit (int signo)
     quit ();
 }
 \f
-/* 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. */
 
Index: testsuite/gdb.gdb/selftest.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.gdb/selftest.exp,v
retrieving revision 1.1
diff -p -u -r1.1 selftest.exp
--- testsuite/gdb.gdb/selftest.exp	19 Jul 2004 13:58:21 -0000	1.1
+++ testsuite/gdb.gdb/selftest.exp	10 Aug 2004 22:28:05 -0000
@@ -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"

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

* Re: [obish] Zap m* methods
  2004-08-10 22:38 [obish] Zap m* methods Andrew Cagney
@ 2004-08-10 22:59 ` Michael Chastain
  2004-08-10 23:04   ` Andrew Cagney
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Chastain @ 2004-08-10 22:59 UTC (permalink / raw)
  To: gdb-patches, cagney

Actually, I would like to keep the init_malloc in selftest.exp.

Here's why.  When I look for regressions in gdb, I use the current
test suite with the old gdb and the new gdb.  So it helps if the
current test suite doesn't do "default { fail; return }" when I
run it with gdb 6.2.  I can live with the "fail" but it's the
"return" that kills me, by killing the rest of selftest.exp.

This is going to get a bit more important than usual because test suites
before the current test suite don't work well with gcc 3.5 prerelease.
(Current test suite still has problems but I'm working on them).

Andrew, okay with you if I put the init_malloc back?

Michael C


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

* Re: [obish] Zap m* methods
  2004-08-10 22:59 ` Michael Chastain
@ 2004-08-10 23:04   ` Andrew Cagney
  2004-08-10 23:14     ` Michael Chastain
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2004-08-10 23:04 UTC (permalink / raw)
  To: Michael Chastain; +Cc: gdb-patches

> Actually, I would like to keep the init_malloc in selftest.exp.
> 
> Here's why.  When I look for regressions in gdb, I use the current
> test suite with the old gdb and the new gdb.  So it helps if the
> current test suite doesn't do "default { fail; return }" when I
> run it with gdb 6.2.  I can live with the "fail" but it's the
> "return" that kills me, by killing the rest of selftest.exp.
> 
> This is going to get a bit more important than usual because test suites
> before the current test suite don't work well with gcc 3.5 prerelease.
> (Current test suite still has problems but I'm working on them).
> 
> Andrew, okay with you if I put the init_malloc back?

Ok, not so obish then, can you, I'm mid way through testing step.

Andrew



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

* Re: [obish] Zap m* methods
  2004-08-10 23:04   ` Andrew Cagney
@ 2004-08-10 23:14     ` Michael Chastain
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Chastain @ 2004-08-10 23:14 UTC (permalink / raw)
  To: cagney; +Cc: gdb-patches

Andrew Cagney <cagney@gnu.org> wrote:
> Ok, not so obish then, can you, I'm mid way through testing step.

Yeah, I'll pick it up.

Maybe I could say

  -re "init_malloc" {
    # removed from gdb HEAD 2004-08-10
    fail "old gdb"
    set command "next"
  }

I'll play with it a bit.

Got a lot of processes on my run queue too.

Michael C


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

end of thread, other threads:[~2004-08-10 23:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-10 22:38 [obish] Zap m* methods Andrew Cagney
2004-08-10 22:59 ` Michael Chastain
2004-08-10 23:04   ` Andrew Cagney
2004-08-10 23:14     ` Michael Chastain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox