From: Fred Fish Date: Tue, 12 Nov 1991 17:50:14 +0000 (+0000) Subject: Remove internal gdb definition of fixed arg count concat() function and X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=58ae87f612e884727a3fc18a2d623534589463a4;p=binutils-gdb.git Remove internal gdb definition of fixed arg count concat() function and convert to use of variable arg count concat() in libiberty. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3109a7b824b..d857fcfbe78 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +Tue Nov 12 09:40:07 1991 Fred Fish (fnf at cygnus.com) + + * utils.c, rem-multi.shar: Remove fixed arg count version of + concat(). + + * altos-xdep.c, arm-xdep.c, coffread.c, command.c, convex-xdep.c, + core.c, dwarfread.c, gould-xdep.c, infcmd.c, language.c, + m88k-xdep.c, main.c, printcmd.c, pyr-xdep.c, source.c, + sun386-xdep.c, symm-xdep.c, umax-xdep.c, values.c, xcoffread.c: + Change all instances of use of fixed args concat() to variable + args concat() now located in libiberty. + Tue Nov 12 07:23:46 1991 John Gilmore (gnu at cygnus.com) * Makefile.in: Add xcoffread.c, xcoffexec.c. diff --git a/gdb/altos-xdep.c b/gdb/altos-xdep.c index fbc289bccbe..8cbdfc9a0d9 100644 --- a/gdb/altos-xdep.c +++ b/gdb/altos-xdep.c @@ -153,7 +153,7 @@ core_file_command (filename, from_tty) corefile = savestring (filename, strlen (filename)); else { - corefile = concat (current_directory, "/", filename); + corefile = concat (current_directory, "/", filename, NULL); } set_current_frame ( create_new_frame (read_register (FP_REGNUM), diff --git a/gdb/arm-xdep.c b/gdb/arm-xdep.c index 885d3bbe224..e03e16d3bf1 100644 --- a/gdb/arm-xdep.c +++ b/gdb/arm-xdep.c @@ -261,7 +261,7 @@ core_file_command (filename, from_tty) corefile = savestring (filename, strlen (filename)); else { - corefile = concat (current_directory, "/", filename); + corefile = concat (current_directory, "/", filename, NULL); } set_current_frame ( create_new_frame (read_register (FP_REGNUM), diff --git a/gdb/coffread.c b/gdb/coffread.c index 11aaf5077a5..f42f22b1f61 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -1484,7 +1484,7 @@ patch_type (type, real_type) { if (TYPE_NAME (target)) free (TYPE_NAME (target)); - TYPE_NAME (target) = concat (TYPE_NAME (real_target), "", ""); + TYPE_NAME (target) = concat (TYPE_NAME (real_target), NULL); } } @@ -1691,7 +1691,7 @@ process_coff_symbol (cs, aux) if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0 && (TYPE_FLAGS (SYMBOL_TYPE (sym)) & TYPE_FLAG_PERM) == 0) TYPE_NAME (SYMBOL_TYPE (sym)) - = concat (SYMBOL_NAME (sym), "", ""); + = concat (SYMBOL_NAME (sym), NULL); /* Keep track of any type which points to empty structured type, so it can be filled from a definition from another file */ @@ -1719,7 +1719,7 @@ process_coff_symbol (cs, aux) ? "enum " : (cs->c_sclass == C_STRTAG ? "struct " : "union ")), - SYMBOL_NAME (sym)); + SYMBOL_NAME (sym), NULL); add_symbol_to_list (sym, &file_symbols); break; @@ -1870,7 +1870,7 @@ decode_base_type (cs, c_type, aux) /* anonymous structure type */ type = coff_alloc_type (cs->c_symnum); TYPE_CODE (type) = TYPE_CODE_STRUCT; - TYPE_NAME (type) = concat ("struct ", "", ""); + TYPE_NAME (type) = concat ("struct ", "", NULL); TYPE_LENGTH (type) = 0; TYPE_FIELDS (type) = 0; TYPE_NFIELDS (type) = 0; @@ -1888,7 +1888,7 @@ decode_base_type (cs, c_type, aux) { /* anonymous union type */ type = coff_alloc_type (cs->c_symnum); - TYPE_NAME (type) = concat ("union ", "", ""); + TYPE_NAME (type) = concat ("union ", "", NULL); TYPE_LENGTH (type) = 0; TYPE_FIELDS (type) = 0; TYPE_NFIELDS (type) = 0; diff --git a/gdb/command.c b/gdb/command.c index a1ce588c224..d8839401cd2 100644 --- a/gdb/command.c +++ b/gdb/command.c @@ -216,7 +216,7 @@ add_show_from_set (setcmd, list) /* Replace "set " at start of docstring with "show ". */ if (setcmd->doc[0] == 'S' && setcmd->doc[1] == 'e' && setcmd->doc[2] == 't' && setcmd->doc[3] == ' ') - showcmd->doc = concat ("Show ", setcmd->doc + 4, ""); + showcmd->doc = concat ("Show ", setcmd->doc + 4, NULL); else fprintf (stderr, "GDB internal error: Bad docstring for set command\n"); diff --git a/gdb/convex-xdep.c b/gdb/convex-xdep.c index 57646abb670..bfce6ebd6f6 100644 --- a/gdb/convex-xdep.c +++ b/gdb/convex-xdep.c @@ -913,7 +913,7 @@ core_file_command (filename, from_tty) if (filename[0] == '/') corefile = savestring (filename, strlen (filename)); else - corefile = concat (current_directory, "/", filename); + corefile = concat (current_directory, "/", filename, NULL); printf_filtered ("Program %s ", u.u_comm); diff --git a/gdb/core.c b/gdb/core.c index 8ff3119bb3b..8b6895d323c 100644 --- a/gdb/core.c +++ b/gdb/core.c @@ -112,7 +112,7 @@ core_open (filename, from_tty) filename = tilde_expand (filename); if (filename[0] != '/') { - temp = concat (current_directory, "/", filename); + temp = concat (current_directory, "/", filename, NULL); free (filename); filename = temp; } diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index 546c25edd25..0201945afc5 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -910,7 +910,7 @@ DEFUN(struct_type, (dip, thisdie, enddie), TYPE_LENGTH (type) = dip -> at_byte_size; tpart3 = ""; } - TYPE_NAME (type) = concat (tpart1, tpart2, tpart3); + TYPE_NAME (type) = concat (tpart1, tpart2, tpart3, NULL); thisdie += dip -> dielength; while (thisdie < enddie) { @@ -1326,7 +1326,7 @@ DEFUN(enum_type, (dip), struct dieinfo *dip) TYPE_LENGTH (type) = dip -> at_byte_size; tpart3 = ""; } - TYPE_NAME (type) = concat (tpart1, tpart2, tpart3); + TYPE_NAME (type) = concat (tpart1, tpart2, tpart3, NULL); if ((scan = dip -> at_element_list) != NULL) { (void) memcpy (&temp, scan, sizeof (temp)); diff --git a/gdb/gould-xdep.c b/gdb/gould-xdep.c index 36d6b20412f..bd6276dbb50 100644 --- a/gdb/gould-xdep.c +++ b/gdb/gould-xdep.c @@ -119,7 +119,7 @@ core_file_command (filename, from_tty) corefile = savestring (filename, strlen (filename)); else { - corefile = concat (current_directory, "/", filename); + corefile = concat (current_directory, "/", filename, NULL); } set_current_frame ( create_new_frame (read_register (FP_REGNUM), diff --git a/gdb/language.c b/gdb/language.c index 76509fc5b8b..2ddad677a14 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -299,7 +299,7 @@ set_lang_str() if (language_mode == language_mode_auto) prefix = "auto; currently "; - language = concat(prefix, current_language->la_name, ""); + language = concat(prefix, current_language->la_name, NULL); } void @@ -326,7 +326,7 @@ set_type_str() error ("Unrecognized type check setting."); } - type = concat(prefix,tmp,""); + type = concat(prefix,tmp,NULL); } void @@ -353,7 +353,7 @@ set_range_str() error ("Unrecognized range check setting."); } - range = concat(pref,tmp,""); + range = concat(pref,tmp,NULL); } diff --git a/gdb/m88k-xdep.c b/gdb/m88k-xdep.c index 5ecd12df306..835d8a229f2 100644 --- a/gdb/m88k-xdep.c +++ b/gdb/m88k-xdep.c @@ -266,7 +266,7 @@ core_file_command (filename, from_tty) corefile = savestring (filename, strlen (filename)); else { - corefile = concat (current_directory, "/", filename); + corefile = concat (current_directory, "/", filename, NULL); } init_tdesc(); current_context = init_dcontext(); diff --git a/gdb/pyr-xdep.c b/gdb/pyr-xdep.c index 85b1c58a7aa..4a89db9498e 100644 --- a/gdb/pyr-xdep.c +++ b/gdb/pyr-xdep.c @@ -342,7 +342,7 @@ core_file_command (filename, from_tty) corefile = savestring (filename, strlen (filename)); else { - corefile = concat (current_directory, "/", filename); + corefile = concat (current_directory, "/", filename, NULL); } #if 1 || defined(PYRAMID_CONTROL_FRAME_DEBUGGING) diff --git a/gdb/rem-multi.shar b/gdb/rem-multi.shar index 51ac56c7eea..110e060a879 100644 --- a/gdb/rem-multi.shar +++ b/gdb/rem-multi.shar @@ -292,18 +292,6 @@ savestring (ptr, size) return p; } -char * -concat (s1, s2, s3) - char *s1, *s2, *s3; -{ - register int len = strlen (s1) + strlen (s2) + strlen (s3) + 1; - register char *val = (char *) xmalloc (len); - strcpy (val, s1); - strcat (val, s2); - strcat (val, s3); - return val; -} - void print_spaces (n, file) register int n; diff --git a/gdb/sun386-xdep.c b/gdb/sun386-xdep.c index b5bdbd212cf..4ecb54223c6 100644 --- a/gdb/sun386-xdep.c +++ b/gdb/sun386-xdep.c @@ -194,7 +194,7 @@ core_file_command (filename, from_tty) corefile = savestring (filename, strlen (filename)); else { - corefile = concat (current_directory, "/", filename); + corefile = concat (current_directory, "/", filename, NULL); } set_current_frame ( create_new_frame (read_register (FP_REGNUM), diff --git a/gdb/symm-xdep.c b/gdb/symm-xdep.c index 409476a5d71..28713079aee 100644 --- a/gdb/symm-xdep.c +++ b/gdb/symm-xdep.c @@ -232,7 +232,7 @@ printf("u.u_tsize= %#x, u.u_dsize= %#x, u.u_ssize= %#x, stack_off= %#x\n", corefile = savestring (filename, strlen (filename)); else { - corefile = concat (current_directory, "/", filename); + corefile = concat (current_directory, "/", filename, NULL); } set_current_frame(create_new_frame(read_register(FP_REGNUM), diff --git a/gdb/umax-xdep.c b/gdb/umax-xdep.c index 3406bdec806..81183766bb0 100644 --- a/gdb/umax-xdep.c +++ b/gdb/umax-xdep.c @@ -126,7 +126,7 @@ core_file_command (filename, from_tty) corefile = savestring (filename, strlen (filename)); else { - corefile = concat (current_directory, "/", filename); + corefile = concat (current_directory, "/", filename, NULL); } set_current_frame ( create_new_frame (read_register (FP_REGNUM), diff --git a/gdb/values.c b/gdb/values.c index a7f959e4376..eac4d59096e 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -384,7 +384,7 @@ lookup_internalvar (name) return var; var = (struct internalvar *) xmalloc (sizeof (struct internalvar)); - var->name = concat (name, "", ""); + var->name = concat (name, NULL); var->value = allocate_value (builtin_type_void); release_value (var->value); var->next = internalvars; diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index d3d07cab1d4..912c9d11ae9 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -825,7 +825,7 @@ process_xcoff_symbol (cs) TYPE_NAME (ttype) = concat ( TYPE_CODE (ttype) == TYPE_CODE_UNION ? "union " : TYPE_CODE (ttype) == TYPE_CODE_STRUCT? "struct " : "enum ", - SYMBOL_NAME (sym), ""); + SYMBOL_NAME (sym), NULL); else if (!TYPE_NAME (ttype)) /* else, regular typedef. */ TYPE_NAME (ttype) = SYMBOL_NAME (sym);