* cp-namespace.c (cp_set_block_scope): Remove.
authorTom Tromey <tromey@redhat.com>
Fri, 25 Jan 2013 17:55:24 +0000 (17:55 +0000)
committerTom Tromey <tromey@redhat.com>
Fri, 25 Jan 2013 17:55:24 +0000 (17:55 +0000)
* cp-support.h (cp_set_block_scope): Remove.
* dbxread.c: Include block.h.
(cp_set_block_scope): New function.
(process_one_symbol): Update.
* dwarf2read.c (read_func_scope): Use block_set_scope.

gdb/ChangeLog
gdb/cp-namespace.c
gdb/cp-support.h
gdb/dbxread.c
gdb/dwarf2read.c

index bb9692b44df42d25b67403acec2aee9ff48a1f49..d3c8be4deb11c24fe42004f6d150b3d54675a748 100644 (file)
@@ -1,3 +1,12 @@
+2013-01-25  Tom Tromey  <tromey@redhat.com>
+
+       * cp-namespace.c (cp_set_block_scope): Remove.
+       * cp-support.h (cp_set_block_scope): Remove.
+       * dbxread.c: Include block.h.
+       (cp_set_block_scope): New function.
+       (process_one_symbol): Update.
+       * dwarf2read.c (read_func_scope): Use block_set_scope.
+
 2013-01-25  Pedro Alves  <palves@redhat.com>
 
        * remote.c (add_current_inferior_and_thread): Tweak comment.
index 32f6d34997d408ce148c1df25524f31fb2165ad0..c137eec2b7f9beaf71c64a5e849f3a309ff130cb 100644 (file)
@@ -205,43 +205,6 @@ cp_add_using_directive (const char *dest,
   using_directives = new;
 }
 
-/* Record the namespace that the function defined by SYMBOL was
-   defined in, if necessary.  BLOCK is the associated block; use
-   OBSTACK for allocation.  */
-
-void
-cp_set_block_scope (const struct symbol *symbol,
-                   struct block *block,
-                   struct obstack *obstack,
-                   const char *processing_current_prefix,
-                   int processing_has_namespace_info)
-{
-  if (processing_has_namespace_info)
-    {
-      block_set_scope
-       (block, obstack_copy0 (obstack, processing_current_prefix,
-                              strlen (processing_current_prefix)),
-        obstack);
-    }
-  else if (SYMBOL_DEMANGLED_NAME (symbol) != NULL)
-    {
-      /* Try to figure out the appropriate namespace from the
-        demangled name.  */
-
-      /* FIXME: carlton/2003-04-15: If the function in question is
-        a method of a class, the name will actually include the
-        name of the class as well.  This should be harmless, but
-        is a little unfortunate.  */
-
-      const char *name = SYMBOL_DEMANGLED_NAME (symbol);
-      unsigned int prefix_len = cp_entire_prefix_len (name);
-
-      block_set_scope (block,
-                      obstack_copy0 (obstack, name, prefix_len),
-                      obstack);
-    }
-}
-
 /* Test whether or not NAMESPACE looks like it mentions an anonymous
    namespace; return nonzero if so.  */
 
index 3734886818eca9fb7f01a4eb011ef55357a756b9..c7141d51cd3601c508c21eb97d34b2c982bf9dad 100644 (file)
@@ -189,12 +189,6 @@ extern void cp_add_using_directive (const char *dest,
                                    int copy_names,
                                     struct obstack *obstack);
 
-extern void cp_set_block_scope (const struct symbol *symbol,
-                               struct block *block,
-                               struct obstack *obstack,
-                               const char *processing_current_prefix,
-                               int processing_has_namespace_info);
-
 extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol,
                                              struct objfile *objfile);
 
index fcd4d82152367040ca841c9c013fdc9ac4f5a8bd..09b46a024a05f65b623a8b9acdfa4fc6c5d1a51a 100644 (file)
@@ -55,6 +55,7 @@
 #include "cp-abi.h"
 #include "cp-support.h"
 #include "psympriv.h"
+#include "block.h"
 
 #include "gdb_assert.h"
 #include "gdb_string.h"
@@ -2706,6 +2707,34 @@ read_ofile_symtab (struct objfile *objfile, struct partial_symtab *pst)
 }
 \f
 
+/* Record the namespace that the function defined by SYMBOL was
+   defined in, if necessary.  BLOCK is the associated block; use
+   OBSTACK for allocation.  */
+
+static void
+cp_set_block_scope (const struct symbol *symbol,
+                   struct block *block,
+                   struct obstack *obstack)
+{
+  if (SYMBOL_DEMANGLED_NAME (symbol) != NULL)
+    {
+      /* Try to figure out the appropriate namespace from the
+        demangled name.  */
+
+      /* FIXME: carlton/2003-04-15: If the function in question is
+        a method of a class, the name will actually include the
+        name of the class as well.  This should be harmless, but
+        is a little unfortunate.  */
+
+      const char *name = SYMBOL_DEMANGLED_NAME (symbol);
+      unsigned int prefix_len = cp_entire_prefix_len (name);
+
+      block_set_scope (block,
+                      obstack_copy0 (obstack, name, prefix_len),
+                      obstack);
+    }
+}
+
 /* This handles a single symbol from the symbol-file, building symbols
    into a GDB symtab.  It takes these arguments and an implicit argument.
 
@@ -2813,8 +2842,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
 
          /* For C++, set the block's scope.  */
          if (SYMBOL_LANGUAGE (new->name) == language_cplus)
-           cp_set_block_scope (new->name, block, &objfile->objfile_obstack,
-                               "", 0);
+           cp_set_block_scope (new->name, block, &objfile->objfile_obstack);
 
          /* May be switching to an assembler file which may not be using
             block relative stabs, so reset the offset.  */
@@ -3219,8 +3247,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
                  /* For C++, set the block's scope.  */
                  if (SYMBOL_LANGUAGE (new->name) == language_cplus)
                    cp_set_block_scope (new->name, block,
-                                       &objfile->objfile_obstack,
-                                       "", 0);
+                                       &objfile->objfile_obstack);
                }
 
              new = push_context (0, valu);
index 6395eca8a558b8916d39c24647d085240d85b007..e4f7b942d90477ee9bcdf12ff3f5c1e965257760 100644 (file)
@@ -9564,10 +9564,10 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
                         lowpc, highpc, objfile);
 
   /* For C++, set the block's scope.  */
-  if (cu->language == language_cplus || cu->language == language_fortran)
-    cp_set_block_scope (new->name, block, &objfile->objfile_obstack,
-                       determine_prefix (die, cu),
-                       processing_has_namespace_info);
+  if ((cu->language == language_cplus || cu->language == language_fortran)
+      && processing_has_namespace_info)
+    block_set_scope (block, determine_prefix (die, cu),
+                    &objfile->objfile_obstack);
 
   /* If we have address ranges, record them.  */
   dwarf2_record_block_ranges (die, block, baseaddr, cu);
This page took 0.032478 seconds and 4 git commands to generate.