Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@gnu.org>
To: gdb-patches@sources.redhat.com
Subject: [commit] malloc and sys/wait.h tweaks
Date: Fri, 15 Oct 2004 13:30:00 -0000	[thread overview]
Message-ID: <416FD0F7.6010603@gnu.org> (raw)

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

FYI, ARI tweaks,

Only interesting bit is that I changed the .l.c and .y.c rules so that 
they don't do s/xmalloc/xxmalloc/.

committed,
Andrew

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

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

	* ada-exp.y, ada-lex.l: Use xmalloc and xrealloc through out.
	* inf-ptrace.c: Include "gdb_wait.h" instead of <wait.h>.
	* Makefile.in (.y.c, .l.c): Don't replace xmalloc with xxmalloc.
	Update dependencies.

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.641
diff -p -u -r1.641 Makefile.in
--- Makefile.in	12 Oct 2004 22:18:54 -0000	1.641
+++ Makefile.in	15 Oct 2004 13:09:41 -0000
@@ -656,7 +656,7 @@ cp_support_h = cp-support.h $(symtab_h)
 dcache_h = dcache.h
 defs_h = defs.h $(config_h) $(ansidecl_h) $(gdb_locale_h) $(gdb_signals_h) \
 	$(libiberty_h) $(bfd_h) $(ui_file_h) $(xm_h) $(nm_h) $(tm_h) \
-	$(fopen_same_h) $(gdbarch_h)
+	$(fopen_bin_h) $(gdbarch_h)
 dictionary_h = dictionary.h
 disasm_h = disasm.h
 doublest_h = doublest.h $(floatformat_h)
@@ -1575,8 +1575,8 @@ po/$(PACKAGE).pot: force
 	     -e '/extern.*realloc/d' \
 	     -e '/extern.*free/d' \
 	     -e '/include.*malloc.h/d' \
-	     -e 's/malloc/xmalloc/g' \
-	     -e 's/realloc/xrealloc/g' \
+	     -e 's/[^x]malloc/xmalloc/g' \
+	     -e 's/[^x]realloc/xrealloc/g' \
 	     -e '/^#line.*y.tab.c/d' \
 	  < $@.tmp > $@.new
 	-rm $@.tmp
@@ -1589,8 +1589,8 @@ po/$(PACKAGE).pot: force
 	        -e '/extern.*realloc/d' \
 	        -e '/extern.*free/d' \
 	        -e '/include.*malloc.h/d' \
-	        -e 's/malloc/xmalloc/g' \
-	        -e 's/realloc/xrealloc/g' \
+	        -e 's/[^x]malloc/xmalloc/g' \
+	        -e 's/[^x]realloc/xrealloc/g' \
 		-e 's/yy_flex_xrealloc/yyxrealloc/g' \
 	      < $@ > $@.new && \
 	    rm -f $@ && \
@@ -2083,7 +2083,7 @@ inflow.o: inflow.c $(defs_h) $(frame_h) 
 	$(inflow_h)
 inf-ptrace.o: inf-ptrace.c $(defs_h) $(observer_h) $(gdb_ptrace_h) \
 	$(inflow_h) $(inferior_h) $(regcache_h) $(command_h) $(gdbcore_h) \
-	$(inf_child_h) $(gdbcmd_h) $(gdb_string_h)
+	$(inf_child_h) $(gdbcmd_h) $(gdb_string_h) $(gdb_wait_h)
 infptrace.o: infptrace.c $(defs_h) $(command_h) $(frame_h) $(gdbcore_h) \
 	$(inferior_h) $(regcache_h) $(target_h) $(gdb_assert_h) \
 	$(gdb_wait_h) $(gdb_string_h) $(gdb_dirent_h) $(gdb_ptrace_h)
@@ -2148,10 +2148,11 @@ m2-valprint.o: m2-valprint.c $(defs_h) $
 	$(m2_lang_h)
 m32r-linux-nat.o: m32r-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
 	$(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \
-	$(m32r_tdep_h)
+	$(gregset_h) $(m32r_tdep_h)
 m32r-linux-tdep.o: m32r-linux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \
 	$(value_h) $(regcache_h) $(inferior_h) $(osabi_h) $(reggroups_h) \
-	$(gdb_string_h) $(glibc_tdep_h) $(solib_svr4_h) $(m32r_tdep_h)
+	$(gdb_string_h) $(glibc_tdep_h) $(solib_svr4_h) $(trad_frame_h) \
+	$(frame_unwind_h) $(m32r_tdep_h)
 m32r-rom.o: m32r-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
 	$(serial_h) $(symtab_h) $(command_h) $(gdbcmd_h) $(symfile_h) \
 	$(gdb_string_h) $(objfiles_h) $(inferior_h) $(regcache_h)
@@ -2187,7 +2188,7 @@ m68k-tdep.o: m68k-tdep.c $(defs_h) $(dwa
 	$(inferior_h) $(regcache_h) $(arch_utils_h) $(osabi_h) $(dis_asm_h) \
 	$(m68k_tdep_h) $(gregset_h)
 m88kbsd-nat.o: m88kbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
-	$(target_h) $(m88k_tdep_h) $(inf_ptrace.h)
+	$(target_h) $(m88k_tdep_h) $(inf_ptrace_h)
 m88k-tdep.o: m88k-tdep.c $(defs_h) $(arch_utils_h) $(dis_asm_h) $(frame_h) \
 	$(frame_base_h) $(frame_unwind_h) $(gdbcore_h) $(gdbtypes_h) \
 	$(regcache_h) $(regset_h) $(symtab_h) $(trad_frame_h) $(value_h) \
@@ -2608,8 +2609,9 @@ symtab.o: symtab.c $(defs_h) $(symtab_h)
 	$(frame_h) $(target_h) $(value_h) $(symfile_h) $(objfiles_h) \
 	$(gdbcmd_h) $(call_cmds_h) $(gdb_regex_h) $(expression_h) \
 	$(language_h) $(demangle_h) $(inferior_h) $(linespec_h) $(source_h) \
-	$(filenames_h) $(objc_lang_h) $(hashtab_h) $(gdb_obstack_h) \
-	$(block_h) $(dictionary_h) $(gdb_string_h) $(gdb_stat_h) $(cp_abi_h)
+	$(filenames_h) $(objc_lang_h) $(ada_lang_h) $(hashtab_h) \
+	$(gdb_obstack_h) $(block_h) $(dictionary_h) $(gdb_string_h) \
+	$(gdb_stat_h) $(cp_abi_h)
 target.o: target.c $(defs_h) $(gdb_string_h) $(target_h) $(gdbcmd_h) \
 	$(symtab_h) $(inferior_h) $(bfd_h) $(symfile_h) $(objfiles_h) \
 	$(gdb_wait_h) $(dcache_h) $(regcache_h) $(gdb_assert_h) $(gdbcore_h)
@@ -2675,8 +2677,8 @@ values.o: values.c $(defs_h) $(gdb_strin
 	$(gdb_assert_h) $(regcache_h) $(block_h)
 varobj.o: varobj.c $(defs_h) $(value_h) $(expression_h) $(frame_h) \
 	$(language_h) $(wrapper_h) $(gdbcmd_h) $(gdb_string_h) $(varobj_h)
-vaxbsd-nat.o: vaxbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
-	$(target_h) $(vax_tdep_h) $(inf_ptrace_h) $(bsd_kvm_h)
+vaxbsd-nat.o: vaxbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) $(target_h) \
+	$(vax_tdep_h) $(inf_ptrace_h) $(bsd_kvm_h)
 vax-nat.o: vax-nat.c $(defs_h) $(inferior_h) $(gdb_assert_h) $(vax_tdep_h)
 vaxnbsd-tdep.o: vaxnbsd-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h) \
 	$(vax_tdep_h) $(solib_svr4_h) $(gdb_string_h)
Index: ada-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/ada-exp.y,v
retrieving revision 1.13
diff -p -u -r1.13 ada-exp.y
--- ada-exp.y	6 Oct 2004 09:28:55 -0000	1.13
+++ ada-exp.y	15 Oct 2004 13:09:41 -0000
@@ -852,7 +852,7 @@ write_object_renaming (struct block *ori
 	  if (end == NULL)
 	    end = suffix + strlen (suffix);
 	  field_name.length = end - suffix;
-	  field_name.ptr = (char *) malloc (end - suffix + 1);
+	  field_name.ptr = xmalloc (end - suffix + 1);
 	  strncpy (field_name.ptr, suffix, end - suffix);
 	  field_name.ptr[end - suffix] = '\000';
 	  suffix = end;
Index: ada-lex.l
===================================================================
RCS file: /cvs/src/src/gdb/ada-lex.l,v
retrieving revision 1.10
diff -p -u -r1.10 ada-lex.l
--- ada-lex.l	9 Oct 2004 04:56:48 -0000	1.10
+++ ada-lex.l	15 Oct 2004 13:09:41 -0000
@@ -345,7 +345,7 @@ resize_tempbuf (unsigned int n)
   if (tempbufsize < n)
     {
       tempbufsize = (n+63) & ~63;
-      tempbuf = (char *) realloc (tempbuf, tempbufsize);
+      tempbuf = xrealloc (tempbuf, tempbufsize);
     }
 }
 
Index: inf-ptrace.c
===================================================================
RCS file: /cvs/src/src/gdb/inf-ptrace.c,v
retrieving revision 1.10
diff -p -u -r1.10 inf-ptrace.c
--- inf-ptrace.c	1 Oct 2004 16:12:26 -0000	1.10
+++ inf-ptrace.c	15 Oct 2004 13:09:41 -0000
@@ -32,7 +32,7 @@
 #include "gdbcmd.h"
 #include "gdb_string.h"
 
-#include <sys/wait.h>
+#include "gdb_wait.h"
 #include <signal.h>
 
 /* HACK: Save the ptrace ops returned by ptrace_target.  */

             reply	other threads:[~2004-10-15 13:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-15 13:30 Andrew Cagney [this message]
2004-10-15 14:08 ` Andreas Schwab
2004-10-15 14:44   ` Andrew Cagney

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=416FD0F7.6010603@gnu.org \
    --to=cagney@gnu.org \
    --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