From: Jim Kingdon Date: Wed, 13 Oct 1993 18:17:49 +0000 (+0000) Subject: * printcmd.c (printf_command): Instead of using makeva* and X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9309b4d9291f1a40de779dbaf003b4e921e87c9e;p=binutils-gdb.git * printcmd.c (printf_command): Instead of using makeva* and calling vprintf, just make the appropriate calls to printf. * printcmd.c, config/pa/xm-pa.h, config/mips/xm-makeva.h, config/alpha/xm-alpha.h, config/m88k/xm-m88k.h: Remove all traces of makeva*. My apologies to everyone (including me!) who spent so much time getting it to work on various machines, but look at the bright side, at least you won't have to do it again in the future. * printcmd.c (printf_command): Make a cleanup for val_args (fixes a memory leak). --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c8fc03a2cf5..682f68dde13 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,17 @@ +Wed Oct 13 11:47:23 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * printcmd.c (printf_command): Instead of using makeva* and + calling vprintf, just make the appropriate calls to printf. + * printcmd.c, config/pa/xm-pa.h, config/mips/xm-makeva.h, + config/alpha/xm-alpha.h, config/m88k/xm-m88k.h: Remove all + traces of makeva*. My apologies to everyone (including me!) + who spent so much time getting it to work on various machines, + but look at the bright side, at least you won't have to do it + again in the future. + + * printcmd.c (printf_command): Make a cleanup for val_args (fixes + a memory leak). + Tue Oct 12 22:54:41 1993 Jim Kingdon (kingdon@lioth.cygnus.com) * config/mips/xm-mips.h: Remove comment about HAVE_SGTTY vs. usleep. diff --git a/gdb/config/alpha/xm-alpha.h b/gdb/config/alpha/xm-alpha.h index 5edc862c602..5274c3b3140 100644 --- a/gdb/config/alpha/xm-alpha.h +++ b/gdb/config/alpha/xm-alpha.h @@ -27,40 +27,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* The alpha has no siginterrupt routine. */ #define NO_SIGINTERRUPT -/* The alpha stores the first six float parameters below the va_list. - We make no distinction and store the first six parameters below - and above the va_list. */ -#define VA_FLOAT_ARGS_SIZE (6*8) -#define MAKEVA_SIZE(nargs, max_arg_size) \ - return sizeof (makeva_list) + nargs * max_arg_size + VA_FLOAT_ARGS_SIZE; -#define MAKEVA_START(list) \ - list->argindex = VA_FLOAT_ARGS_SIZE; -#define MAKEVA_ARG(list, argaddr, argsize) \ -{ \ - memcpy (&list->aligner.arg_bytes[list->argindex], argaddr, argsize); \ - if ((list->argindex - VA_FLOAT_ARGS_SIZE) < VA_FLOAT_ARGS_SIZE) \ - memcpy (&list->aligner.arg_bytes[list->argindex - VA_FLOAT_ARGS_SIZE],\ - argaddr, argsize); \ - list->argindex += argsize; \ -} -#ifdef __GNUC__ -#define MAKEVA_END(list) \ -{ \ - va_list ret; \ - ret.__base = &(list)->aligner.arg_bytes[VA_FLOAT_ARGS_SIZE]; \ - ret.__offset = 0; \ - return ret; \ -} -#else -#define MAKEVA_END(list) \ -{ \ - va_list ret; \ - ret.a0 = &(list)->aligner.arg_bytes[VA_FLOAT_ARGS_SIZE]; \ - ret.offset = 0; \ - return ret; \ -} -#endif - /* HAVE_SGTTY also works, but we have termios, so use it. */ #define HAVE_TERMIOS diff --git a/gdb/config/m88k/xm-m88k.h b/gdb/config/m88k/xm-m88k.h index 3ff35122191..8f24de93fc2 100644 --- a/gdb/config/m88k/xm-m88k.h +++ b/gdb/config/m88k/xm-m88k.h @@ -18,31 +18,3 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define HOST_BYTE_ORDER BIG_ENDIAN - -#define MAKEVA_END(list) \ - va_list retval; \ - retval.__va_arg = 0; \ - retval.__va_stk = (int *) (list)->aligner.arg_bytes; \ - retval.__va_reg = (int *) (list)->aligner.arg_bytes; \ - return retval; - -/* I don't know whether rounding the arguments to 4 or 8 bytes is correct - for the 88k, or whether it is just code borrowed from the pa. The issue - is moot for now, since printf_command only uses argsize of sizeof (int), - sizeof (double), or sizeof (long long). */ -#define MAKEVA_ARG(list, argaddr, argsize) \ - { \ - int rounded_argsize; \ - if (argsize > 8) \ - /* Currently this never happens; printf_command only uses argsize */ \ - /* of sizeof (int), sizeof (double), or sizeof (long long). */ \ - error ("MAKEVA_ARG not fully written for m88k"); \ - if (argsize <= 4) \ - rounded_argsize = 4; \ - else if (argsize <= 8) \ - rounded_argsize = 8; \ - while ((int)(&list->aligner.arg_bytes[list->argindex]) % rounded_argsize) \ - list->argindex++; \ - memcpy (&list->aligner.arg_bytes[list->argindex], argaddr, argsize); \ - list->argindex += rounded_argsize; \ - } diff --git a/gdb/config/mips/xm-makeva.h b/gdb/config/mips/xm-makeva.h index 46974e05599..4e002f96748 100644 --- a/gdb/config/mips/xm-makeva.h +++ b/gdb/config/mips/xm-makeva.h @@ -16,20 +16,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* Mips hosts need aligned va_list arguments. */ - -#define MAKEVA_ARG(list, argaddr, argsize) \ - { \ - int rounded_argsize; \ - if (argsize > 8) \ - /* Currently this never happens; printf_command only uses argsize */ \ - /* of sizeof (int), sizeof (double), or sizeof (long long). */ \ - error ("MAKEVA_ARG not fully written for mips"); \ - if (argsize <= 4) \ - rounded_argsize = 4; \ - else if (argsize <= 8) \ - rounded_argsize = 8; \ - list->argindex = (list->argindex + rounded_argsize - 1) & -rounded_argsize; \ - memcpy (&list->aligner.arg_bytes[list->argindex], argaddr, argsize); \ - list->argindex += argsize; \ - } +/* "makeva" is obsolete. This file can probably go away (unless someone + can think of some other host thing which is common to various mips + machines). */ diff --git a/gdb/config/pa/xm-pa.h b/gdb/config/pa/xm-pa.h index 4b12910f3c9..979609d4776 100644 --- a/gdb/config/pa/xm-pa.h +++ b/gdb/config/pa/xm-pa.h @@ -1,27 +1,5 @@ /* Definitions for all PA machines. */ -#define MAKEVA_START(list) \ - list->argindex = list->nargs * list->max_arg_size; - -#define MAKEVA_ARG(list, argaddr, argsize) \ - { \ - int rounded_argsize; \ - if (argsize > 8) \ - /* Currently this never happens; printf_command only uses argsize */ \ - /* of sizeof (int), sizeof (double), or sizeof (long long). */ \ - error ("MAKEVA_ARG not fully written for hp-pa"); \ - if (argsize <= 4) \ - rounded_argsize = 4; \ - else if (argsize <= 8) \ - rounded_argsize = 8; \ - list->argindex -= rounded_argsize; \ - while ((int)(&list->aligner.arg_bytes[list->argindex]) % rounded_argsize) \ - list->argindex--; \ - memcpy (&list->aligner.arg_bytes[list->argindex], argaddr, argsize); \ - } - -/* The address of the arglist is the address right after the args - (which is what you'd expect). */ -#define MAKEVA_END(list) \ - return (va_list) (list->aligner.arg_bytes \ - + list->nargs * list->max_arg_size) +/* This was created for "makeva", which is obsolete. This file can + probably go away (unless someone can think of some other host thing + which is common to various pa machines). */