* infrun.c: Move DO_DEFERRED_STORES from proceed() to resume().

The child can be proceeded from inside wait_for_inferior in
        evaluating breakpoint conditions, and DO_DEFERRED_STORES was
        getting skipped in that case.

        * expprint.c (print_subexp):  Use filtered output, since the
        subroutines we call use it, otherwise the output is horribly
        mangled, since output of wrappable stuff comes out late.
This commit is contained in:
John Gilmore 1991-08-02 08:46:10 +00:00
parent 89eec0d391
commit 10147c02f3
2 changed files with 63 additions and 46 deletions

View file

@ -1,6 +1,16 @@
Fri Aug 2 00:13:06 1991 John Gilmore (gnu at cygint.cygnus.com) Fri Aug 2 00:13:06 1991 John Gilmore (gnu at cygint.cygnus.com)
* infrun.c: Move DO_DEFERRED_STORES from proceed() to resume().
The child can be proceeded from inside wait_for_inferior in
evaluating breakpoint conditions, and DO_DEFERRED_STORES was
getting skipped in that case.
* expprint.c (print_subexp): Use filtered output, since the
subroutines we call use it, otherwise the output is horribly
mangled, since output of wrappable stuff comes out late.
* Makefile.in: Bump VERSION to 3.98.1 * Makefile.in: Bump VERSION to 3.98.1
* infrun.c (child_create_process): Use execlp to find the * infrun.c (child_create_process): Use execlp to find the
shell to exec our target program. This requires some fiddling shell to exec our target program. This requires some fiddling
with `environ' since there is no execlpe(). with `environ' since there is no execlpe().

View file

@ -3,19 +3,19 @@
This file is part of GDB. This file is part of GDB.
GDB is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option) the Free Software Foundation; either version 2 of the License, or
any later version. (at your option) any later version.
GDB is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to along with this program; if not, write to the Free Software
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h> #include <stdio.h>
#include "defs.h" #include "defs.h"
@ -126,12 +126,13 @@ print_subexp (exp, pos, stream, prec)
myprec = PREC_PREFIX; myprec = PREC_PREFIX;
assoc = 0; assoc = 0;
(*pos) += 2; (*pos) += 2;
print_subexp (exp, pos, stream, (int) myprec + assoc); print_subexp (exp, pos, stream,
fprintf (stream, " :: "); (enum precedence) ((int) myprec + assoc));
fputs_filtered (" :: ", stream);
nargs = strlen (&exp->elts[pc + 2].string); nargs = strlen (&exp->elts[pc + 2].string);
(*pos) += 1 + (nargs + sizeof (union exp_element)) / sizeof (union exp_element); (*pos) += 1 + (nargs + sizeof (union exp_element)) / sizeof (union exp_element);
fprintf (stream, &exp->elts[pc + 2].string); fputs_filtered (&exp->elts[pc + 2].string, stream);
return; return;
case OP_LONG: case OP_LONG:
@ -150,117 +151,121 @@ print_subexp (exp, pos, stream, prec)
case OP_VAR_VALUE: case OP_VAR_VALUE:
(*pos) += 2; (*pos) += 2;
fprintf (stream, "%s", SYMBOL_NAME (exp->elts[pc + 1].symbol)); fputs_filtered (SYMBOL_NAME (exp->elts[pc + 1].symbol), stream);
return; return;
case OP_LAST: case OP_LAST:
(*pos) += 2; (*pos) += 2;
fprintf (stream, "$%d", (int) exp->elts[pc + 1].longconst); fprintf_filtered (stream, "$%d",
longest_to_int (exp->elts[pc + 1].longconst));
return; return;
case OP_REGISTER: case OP_REGISTER:
(*pos) += 2; (*pos) += 2;
fprintf (stream, "$%s", reg_names[exp->elts[pc + 1].longconst]); fprintf_filtered (stream, "$%s",
longest_to_int (reg_names[exp->elts[pc + 1].longconst]));
return; return;
case OP_INTERNALVAR: case OP_INTERNALVAR:
(*pos) += 2; (*pos) += 2;
fprintf (stream, "$%s", fprintf_filtered (stream, "$%s",
internalvar_name (exp->elts[pc + 1].internalvar)); internalvar_name (exp->elts[pc + 1].internalvar));
return; return;
case OP_FUNCALL: case OP_FUNCALL:
(*pos) += 2; (*pos) += 2;
nargs = exp->elts[pc + 1].longconst; nargs = longest_to_int (exp->elts[pc + 1].longconst);
print_subexp (exp, pos, stream, PREC_SUFFIX); print_subexp (exp, pos, stream, PREC_SUFFIX);
fprintf (stream, " ("); fputs_filtered (" (", stream);
for (tem = 0; tem < nargs; tem++) for (tem = 0; tem < nargs; tem++)
{ {
if (tem != 0) if (tem != 0)
fprintf (stream, ", "); fputs_filtered (", ", stream);
print_subexp (exp, pos, stream, PREC_ABOVE_COMMA); print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
} }
fprintf (stream, ")"); fputs_filtered (")", stream);
return; return;
case OP_STRING: case OP_STRING:
nargs = strlen (&exp->elts[pc + 1].string); nargs = strlen (&exp->elts[pc + 1].string);
(*pos) += 2 + (nargs + sizeof (union exp_element)) / sizeof (union exp_element); (*pos) += 2 + (nargs + sizeof (union exp_element)) / sizeof (union exp_element);
fprintf (stream, "\""); fputs_filtered ("\"", stream);
for (tem = 0; tem < nargs; tem++) for (tem = 0; tem < nargs; tem++)
printchar ((&exp->elts[pc + 1].string)[tem], stream, '"'); printchar ((&exp->elts[pc + 1].string)[tem], stream, '"');
fprintf (stream, "\""); fputs_filtered ("\"", stream);
return; return;
case TERNOP_COND: case TERNOP_COND:
if ((int) prec > (int) PREC_COMMA) if ((int) prec > (int) PREC_COMMA)
fprintf (stream, "("); fputs_filtered ("(", stream);
/* Print the subexpressions, forcing parentheses /* Print the subexpressions, forcing parentheses
around any binary operations within them. around any binary operations within them.
This is more parentheses than are strictly necessary, This is more parentheses than are strictly necessary,
but it looks clearer. */ but it looks clearer. */
print_subexp (exp, pos, stream, PREC_HYPER); print_subexp (exp, pos, stream, PREC_HYPER);
fprintf (stream, " ? "); fputs_filtered (" ? ", stream);
print_subexp (exp, pos, stream, PREC_HYPER); print_subexp (exp, pos, stream, PREC_HYPER);
fprintf (stream, " : "); fputs_filtered (" : ", stream);
print_subexp (exp, pos, stream, PREC_HYPER); print_subexp (exp, pos, stream, PREC_HYPER);
if ((int) prec > (int) PREC_COMMA) if ((int) prec > (int) PREC_COMMA)
fprintf (stream, ")"); fputs_filtered (")", stream);
return; return;
case STRUCTOP_STRUCT: case STRUCTOP_STRUCT:
tem = strlen (&exp->elts[pc + 1].string); tem = strlen (&exp->elts[pc + 1].string);
(*pos) += 2 + (tem + sizeof (union exp_element)) / sizeof (union exp_element); (*pos) += 2 + (tem + sizeof (union exp_element)) / sizeof (union exp_element);
print_subexp (exp, pos, stream, PREC_SUFFIX); print_subexp (exp, pos, stream, PREC_SUFFIX);
fprintf (stream, ".%s", &exp->elts[pc + 1].string); fputs_filtered (".", stream);
fputs_filtered (&exp->elts[pc + 1].string, stream);
return; return;
case STRUCTOP_PTR: case STRUCTOP_PTR:
tem = strlen (&exp->elts[pc + 1].string); tem = strlen (&exp->elts[pc + 1].string);
(*pos) += 2 + (tem + sizeof (union exp_element)) / sizeof (union exp_element); (*pos) += 2 + (tem + sizeof (union exp_element)) / sizeof (union exp_element);
print_subexp (exp, pos, stream, PREC_SUFFIX); print_subexp (exp, pos, stream, PREC_SUFFIX);
fprintf (stream, "->%s", &exp->elts[pc + 1].string); fputs_filtered ("->", stream);
fputs_filtered (&exp->elts[pc + 1].string, stream);
return; return;
case BINOP_SUBSCRIPT: case BINOP_SUBSCRIPT:
print_subexp (exp, pos, stream, PREC_SUFFIX); print_subexp (exp, pos, stream, PREC_SUFFIX);
fprintf (stream, "["); fputs_filtered ("[", stream);
print_subexp (exp, pos, stream, PREC_ABOVE_COMMA); print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
fprintf (stream, "]"); fputs_filtered ("]", stream);
return; return;
case UNOP_POSTINCREMENT: case UNOP_POSTINCREMENT:
print_subexp (exp, pos, stream, PREC_SUFFIX); print_subexp (exp, pos, stream, PREC_SUFFIX);
fprintf (stream, "++"); fputs_filtered ("++", stream);
return; return;
case UNOP_POSTDECREMENT: case UNOP_POSTDECREMENT:
print_subexp (exp, pos, stream, PREC_SUFFIX); print_subexp (exp, pos, stream, PREC_SUFFIX);
fprintf (stream, "--"); fputs_filtered ("--", stream);
return; return;
case UNOP_CAST: case UNOP_CAST:
(*pos) += 2; (*pos) += 2;
if ((int) prec > (int) PREC_PREFIX) if ((int) prec > (int) PREC_PREFIX)
fprintf (stream, "("); fputs_filtered ("(", stream);
fprintf (stream, "("); fputs_filtered ("(", stream);
type_print (exp->elts[pc + 1].type, "", stream, 0); type_print (exp->elts[pc + 1].type, "", stream, 0);
fprintf (stream, ") "); fputs_filtered (") ", stream);
print_subexp (exp, pos, stream, PREC_PREFIX); print_subexp (exp, pos, stream, PREC_PREFIX);
if ((int) prec > (int) PREC_PREFIX) if ((int) prec > (int) PREC_PREFIX)
fprintf (stream, ")"); fputs_filtered (")", stream);
return; return;
case UNOP_MEMVAL: case UNOP_MEMVAL:
(*pos) += 2; (*pos) += 2;
if ((int) prec > (int) PREC_PREFIX) if ((int) prec > (int) PREC_PREFIX)
fprintf (stream, "("); fputs_filtered ("(", stream);
fprintf (stream, "{"); fputs_filtered ("{", stream);
type_print (exp->elts[pc + 1].type, "", stream, 0); type_print (exp->elts[pc + 1].type, "", stream, 0);
fprintf (stream, "} "); fputs_filtered ("} ", stream);
print_subexp (exp, pos, stream, PREC_PREFIX); print_subexp (exp, pos, stream, PREC_PREFIX);
if ((int) prec > (int) PREC_PREFIX) if ((int) prec > (int) PREC_PREFIX)
fprintf (stream, ")"); fputs_filtered (")", stream);
return; return;
case BINOP_ASSIGN_MODIFY: case BINOP_ASSIGN_MODIFY:
@ -279,7 +284,7 @@ print_subexp (exp, pos, stream, prec)
case OP_THIS: case OP_THIS:
++(*pos); ++(*pos);
fprintf (stream, "this"); fputs_filtered ("this", stream);
return; return;
default: default:
@ -294,11 +299,11 @@ print_subexp (exp, pos, stream, prec)
} }
if ((int) myprec < (int) prec) if ((int) myprec < (int) prec)
fprintf (stream, "("); fputs_filtered ("(", stream);
if ((int) opcode > (int) BINOP_END) if ((int) opcode > (int) BINOP_END)
{ {
/* Unary prefix operator. */ /* Unary prefix operator. */
fprintf (stream, "%s", op_str); fputs_filtered (op_str, stream);
print_subexp (exp, pos, stream, PREC_PREFIX); print_subexp (exp, pos, stream, PREC_PREFIX);
} }
else else
@ -307,19 +312,21 @@ print_subexp (exp, pos, stream, prec)
/* Print left operand. /* Print left operand.
If operator is right-associative, If operator is right-associative,
increment precedence for this operand. */ increment precedence for this operand. */
print_subexp (exp, pos, stream, (int) myprec + assoc); print_subexp (exp, pos, stream,
(enum precedence) ((int) myprec + assoc));
/* Print the operator itself. */ /* Print the operator itself. */
if (assign_modify) if (assign_modify)
fprintf (stream, " %s= ", op_str); fprintf_filtered (stream, " %s= ", op_str);
else if (op_str[0] == ',') else if (op_str[0] == ',')
fprintf (stream, "%s ", op_str); fprintf_filtered (stream, "%s ", op_str);
else else
fprintf (stream, " %s ", op_str); fprintf_filtered (stream, " %s ", op_str);
/* Print right operand. /* Print right operand.
If operator is left-associative, If operator is left-associative,
increment precedence for this operand. */ increment precedence for this operand. */
print_subexp (exp, pos, stream, (int) myprec + !assoc); print_subexp (exp, pos, stream,
(enum precedence) ((int) myprec + !assoc));
} }
if ((int) myprec < (int) prec) if ((int) myprec < (int) prec)
fprintf (stream, ")"); fputs_filtered (")", stream);
} }