X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fexpprint.c;h=b3337cdaae8b344ba82c4350994f0cacf11cb209;hb=a12ac51333cf97f4da0597d049cc694b4535e7dd;hp=648e66aaf3836bfacc0f974234e5d5530465f13a;hpb=2a998fc0370ac0b32051eb31238699d92e1dd81a;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/expprint.c b/gdb/expprint.c index 648e66aaf3..b3337cdaae 100644 --- a/gdb/expprint.c +++ b/gdb/expprint.c @@ -1,6 +1,6 @@ /* Print in infix form a struct expression. - Copyright (C) 1986-2013 Free Software Foundation, Inc. + Copyright (C) 1986-2016 Free Software Foundation, Inc. This file is part of GDB. @@ -26,10 +26,8 @@ #include "parser-defs.h" #include "user-regs.h" /* For user_reg_map_regnum_to_name. */ #include "target.h" -#include "gdb_string.h" #include "block.h" #include "objfiles.h" -#include "gdb_assert.h" #include "valprint.h" #include @@ -242,7 +240,7 @@ print_subexp_standard (struct expression *exp, int *pos, { char *s, *nextS; - s = alloca (strlen (selector) + 1); + s = (char *) alloca (strlen (selector) + 1); strcpy (s, selector); for (tem = 0; tem < nargs; tem++) { @@ -282,7 +280,7 @@ print_subexp_standard (struct expression *exp, int *pos, a simple string, revert back to array printing. Note that the last expression element is an explicit null terminator byte, which doesn't get printed. */ - tempstr = alloca (nargs); + tempstr = (char *) alloca (nargs); pc += 4; while (tem < nargs) { @@ -802,8 +800,6 @@ dump_subexp_body_standard (struct expression *exp, case BINOP_ASSIGN_MODIFY: case BINOP_VAL: case BINOP_CONCAT: - case BINOP_IN: - case BINOP_RANGE: case BINOP_END: case STRUCTOP_MEMBER: case STRUCTOP_MPTR: @@ -934,7 +930,7 @@ dump_subexp_body_standard (struct expression *exp, gdb_print_host_address (exp->elts[elt + 1].type, stream); fprintf_filtered (stream, " (__thread /* \"%s\" */ ", (exp->elts[elt].objfile == NULL ? "(null)" - : exp->elts[elt].objfile->name)); + : objfile_name (exp->elts[elt].objfile))); type_print (exp->elts[elt + 1].type, NULL, stream, 0); fprintf_filtered (stream, ")"); elt = dump_subexp (exp, stream, elt + 3); @@ -1011,12 +1007,29 @@ dump_subexp_body_standard (struct expression *exp, elt = dump_subexp (exp, stream, elt); } break; + case OP_STRING: + { + LONGEST len = exp->elts[elt].longconst; + LONGEST type = exp->elts[elt + 1].longconst; + + fprintf_filtered (stream, "Language-specific string type: %s", + plongest (type)); + + /* Skip length. */ + elt += 1; + + /* Skip string content. */ + elt += BYTES_TO_EXP_ELEM (len); + + /* Skip length and ending OP_STRING. */ + elt += 2; + } + break; default: case OP_NULL: case MULTI_SUBSCRIPT: case OP_F77_UNDETERMINED_ARGLIST: case OP_COMPLEX: - case OP_STRING: case OP_BOOL: case OP_M2_STRING: case OP_THIS: