Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: David Carlton <carlton@kealia.com>
To: Elena Zannoni <ezannoni@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: [rfa] use allocate_block more
Date: Thu, 11 Sep 2003 23:28:00 -0000	[thread overview]
Message-ID: <yf2znha52ho.fsf_-_@hawaii.kealia.com> (raw)
In-Reply-To: <16222.12105.616302.481564@localhost.redhat.com> (Elena Zannoni's message of "Tue, 9 Sep 2003 15:51:37 -0400")

On Tue, 9 Sep 2003 15:51:37 -0400, Elena Zannoni <ezannoni@redhat.com> said:

> I think it would make sense, in a next pass, to have all the creation
> of blocks go through the new function.

Well, I was planning to do that; here's what I came up with instead.
The problem is that mdebugread.c currently doesn't allocate blocks on
an obstack at all!  That should presumably be fixed ("rm mdebugread.c"
would be my preferred method), but I didn't feel like doing that
right now; I'd rather leave it up to somebody with access to a machine
using mdebugread.

Tested on i686-pc-linux-gnu, GCC 3.2, DWARF 2; no new regressions.  OK
to commit?

David Carlton
carlton@kealia.com

2003-09-11  David Carlton  <carlton@kealia.com>

	* buildsym.c (finish_block): Use allocate_block to allocate the
	block.
	* mdebugread.c (new_block): Add FIXME.

Index: buildsym.c
===================================================================
RCS file: /cvs/src/src/gdb/buildsym.c,v
retrieving revision 1.33
diff -u -p -r1.33 buildsym.c
--- buildsym.c	11 Jun 2003 23:29:46 -0000	1.33
+++ buildsym.c	11 Sep 2003 22:58:08 -0000
@@ -231,19 +231,15 @@ finish_block (struct symbol *symbol, str
   register struct pending_block *pblock;
   struct pending_block *opblock;
 
-  /* Initialize the block's dictionary.  */
+  block = allocate_block (&objfile->symbol_obstack);
 
   if (symbol)
     {
-      block = (struct block *) 
-	obstack_alloc (&objfile->symbol_obstack, sizeof (struct block));
       BLOCK_DICT (block) = dict_create_linear (&objfile->symbol_obstack,
 					       *listhead);
     }
   else
     {
-      block = (struct block *) 
-	obstack_alloc (&objfile->symbol_obstack, sizeof (struct block));
       BLOCK_DICT (block) = dict_create_hashed (&objfile->symbol_obstack,
 					       *listhead);
     }
Index: mdebugread.c
===================================================================
RCS file: /cvs/src/src/gdb/mdebugread.c,v
retrieving revision 1.47
diff -u -p -r1.47 mdebugread.c
--- mdebugread.c	11 Jun 2003 23:29:47 -0000	1.47
+++ mdebugread.c	11 Sep 2003 22:58:14 -0000
@@ -4696,6 +4696,9 @@ new_bvect (int nblocks)
 static struct block *
 new_block (enum block_type type)
 {
+  /* FIXME: carlton/2003-09-11: This should use allocate_block to
+     allocate the block.  Which, in turn, suggests that the block
+     should be allocated on an obstack.  */
   struct block *retval = xzalloc (sizeof (struct block));
 
   if (type == FUNCTION_BLOCK)


  parent reply	other threads:[~2003-09-11 23:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-16 20:22 [rfa] generate symbols associated to namespaces David Carlton
2003-06-22 17:42 ` Daniel Jacobowitz
2003-06-24 19:00   ` David Carlton
2003-06-24 19:02     ` Daniel Jacobowitz
2003-06-27 16:04       ` David Carlton
2003-06-27 21:58         ` David Carlton
2003-06-27 22:32           ` David Carlton
2003-08-05 16:30           ` David Carlton
2003-08-05 17:54           ` Daniel Jacobowitz
2003-08-05 18:06             ` David Carlton
2003-08-05 18:08               ` Daniel Jacobowitz
2003-08-05 18:18                 ` David Carlton
2003-08-31 19:29             ` Daniel Jacobowitz
2003-09-02 16:38               ` David Carlton
2003-09-09 19:42           ` Elena Zannoni
2003-09-09 20:28             ` David Carlton
2003-09-09 22:17               ` Elena Zannoni
2003-09-09 23:25                 ` David Carlton
2003-09-11 19:52                   ` David Carlton
2003-09-17 20:41                     ` David Carlton
2003-09-11 23:28             ` David Carlton [this message]
2003-09-11 23:33               ` [rfa] use allocate_block more Elena Zannoni
2003-09-11 23:44                 ` David Carlton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yf2znha52ho.fsf_-_@hawaii.kealia.com \
    --to=carlton@kealia.com \
    --cc=ezannoni@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox