* gdb_obstack.h (obconcat): Move declaration here, from...
authorTom Tromey <tromey@redhat.com>
Mon, 21 Jan 2013 18:15:32 +0000 (18:15 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 21 Jan 2013 18:15:32 +0000 (18:15 +0000)
* symfile.h (obconcat): ... here.
* gdb_obstack.c: New file.
(obconcat): Move from...
* symfile.c (obconcat): ... here.
* Makefile.in (SFILES): Add gdb_obstack.c.
(COMMON_OBS): Add gdb_obstack.o.

gdb/ChangeLog
gdb/Makefile.in
gdb/gdb_obstack.c [new file with mode: 0644]
gdb/gdb_obstack.h
gdb/symfile.c
gdb/symfile.h

index 74d1dcb0127750e4f92304ebbd1970158e66ab59..6ef74bc4381678290d3cab1b7461d4ff1bf20ef1 100644 (file)
@@ -1,3 +1,13 @@
+2013-01-21  Tom Tromey  <tromey@redhat.com>
+
+       * gdb_obstack.h (obconcat): Move declaration here, from...
+       * symfile.h (obconcat): ... here.
+       * gdb_obstack.c: New file.
+       (obconcat): Move from...
+       * symfile.c (obconcat): ... here.
+       * Makefile.in (SFILES): Add gdb_obstack.c.
+       (COMMON_OBS): Add gdb_obstack.o.
+
 2013-01-21  Tom Tromey  <tromey@redhat.com>
 
        * symfile.h (obsavestring): Don't declare.
index 7305e6dd8feb268f3ef4f6a2c67e743856e6229d..6746e64def4d1431d83fe4d52d7852ceb0944f7b 100644 (file)
@@ -713,7 +713,8 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \
        exceptions.c expprint.c \
        f-exp.y f-lang.c f-typeprint.c f-valprint.c filesystem.c \
        findcmd.c findvar.c frame.c frame-base.c frame-unwind.c \
-       gdbarch.c arch-utils.c gdb_bfd.c gdbtypes.c gnu-v2-abi.c gnu-v3-abi.c \
+       gdbarch.c arch-utils.c gdb_bfd.c gdb_obstack.c \
+       gdbtypes.c gnu-v2-abi.c gnu-v3-abi.c \
        go-exp.y go-lang.c go-typeprint.c go-valprint.c \
        inf-loop.c \
        infcall.c \
@@ -883,7 +884,8 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
        macrotab.o macrocmd.o macroexp.o macroscope.o \
        mi-common.o \
        event-loop.o event-top.o inf-loop.o completer.o \
-       gdbarch.o arch-utils.o gdbtypes.o gdb_bfd.o osabi.o copying.o \
+       gdbarch.o arch-utils.o gdbtypes.o gdb_bfd.o gdb_obstack.o \
+       osabi.o copying.o \
        memattr.o mem-break.o target.o parse.o language.o buildsym.o \
        findcmd.o \
        std-regs.o \
diff --git a/gdb/gdb_obstack.c b/gdb/gdb_obstack.c
new file mode 100644 (file)
index 0000000..df34968
--- /dev/null
@@ -0,0 +1,47 @@
+/* Obstack wrapper for GDB.
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include "defs.h"
+#include "gdb_obstack.h"
+
+/* Concatenate NULL terminated variable argument list of `const char *'
+   strings; return the new string.  Space is found in the OBSTACKP.
+   Argument list must be terminated by a sentinel expression `(char *)
+   NULL'.  */
+
+char *
+obconcat (struct obstack *obstackp, ...)
+{
+  va_list ap;
+
+  va_start (ap, obstackp);
+  for (;;)
+    {
+      const char *s = va_arg (ap, const char *);
+
+      if (s == NULL)
+       break;
+
+      obstack_grow_str (obstackp, s);
+    }
+  va_end (ap);
+  obstack_1grow (obstackp, 0);
+
+  return obstack_finish (obstackp);
+}
index 96196b705e4d75cb2f726efb565017fd259e2338..1459ee96b852b95b07e756f6a1ba7e0bd3099bfd 100644 (file)
 #define obstack_grow_wstr(OBSTACK, WSTRING) \
   obstack_grow (OBSTACK, WSTRING, sizeof (gdb_wchar_t) * gdb_wcslen (WSTRING))
 
+/* Concatenate NULL terminated variable argument list of `const char
+   *' strings; return the new string.  Space is found in the OBSTACKP.
+   Argument list must be terminated by a sentinel expression `(char *)
+   NULL'.  */
+
+extern char *obconcat (struct obstack *obstackp, ...) ATTRIBUTE_SENTINEL;
+
 #endif
index f610e673b9de1034a9ea8e3a25f79a95fdcd3cc4..2f87260626225824bb4caf3122a2e5fc000ca768 100644 (file)
@@ -151,32 +151,6 @@ static VEC (sym_fns_ptr) *symtab_fns = NULL;
 int auto_solib_add = 1;
 \f
 
-/* Concatenate NULL terminated variable argument list of `const char *'
-   strings; return the new string.  Space is found in the OBSTACKP.
-   Argument list must be terminated by a sentinel expression `(char *)
-   NULL'.  */
-
-char *
-obconcat (struct obstack *obstackp, ...)
-{
-  va_list ap;
-
-  va_start (ap, obstackp);
-  for (;;)
-    {
-      const char *s = va_arg (ap, const char *);
-
-      if (s == NULL)
-       break;
-
-      obstack_grow_str (obstackp, s);
-    }
-  va_end (ap);
-  obstack_1grow (obstackp, 0);
-
-  return obstack_finish (obstackp);
-}
-
 /* True if we are reading a symbol table.  */
 
 int currently_reading_symtab = 0;
index ad9a4e27c8bc0e2b0b3c8a5bd94c67674b8a7253..8caec8e048cae220c915a6aeb59c54e09184f3d5 100644 (file)
@@ -506,13 +506,6 @@ extern struct section_addr_info
 extern void free_section_addr_info (struct section_addr_info *);
 
 
-/* Concatenate NULL terminated variable argument list of `const char
-   *' strings; return the new string.  Space is found in the OBSTACKP.
-   Argument list must be terminated by a sentinel expression `(char *)
-   NULL'.  */
-
-extern char *obconcat (struct obstack *obstackp, ...) ATTRIBUTE_SENTINEL;
-
                        /*   Variables   */
 
 /* If non-zero, shared library symbols will be added automatically
This page took 0.029215 seconds and 4 git commands to generate.