aboutsummaryrefslogtreecommitdiff
path: root/gdb/expprint.c
diff options
context:
space:
mode:
authorgdb-2.5.1 <gdb@fsf.org>1988-05-02 01:00:00 +0100
committerPedro Alves <palves@redhat.com>2012-06-03 15:36:30 +0100
commit632ea0ccc5c4c3f9fc06881bfedfc4b075873941 (patch)
tree96f152433c41c5f51fe57307b287eb85865a43e2 /gdb/expprint.c
parent7b4ac7e1ed2c4616bce56d1760807798be87ac9e (diff)
downloadgdb-632ea0ccc5c4c3f9fc06881bfedfc4b075873941.zip
gdb-632ea0ccc5c4c3f9fc06881bfedfc4b075873941.tar.gz
gdb-632ea0ccc5c4c3f9fc06881bfedfc4b075873941.tar.bz2
gdb-2.5.1
Diffstat (limited to 'gdb/expprint.c')
-rw-r--r--gdb/expprint.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gdb/expprint.c b/gdb/expprint.c
index 36b31c6..02a1ed3 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -79,7 +79,9 @@ static struct op_print op_print_tab[] =
{"&", UNOP_ADDR, PREC_PREFIX, 0},
{"sizeof ", UNOP_SIZEOF, PREC_PREFIX, 0},
{"++", UNOP_PREINCREMENT, PREC_PREFIX, 0},
- {"--", UNOP_PREDECREMENT, PREC_PREFIX, 0}
+ {"--", UNOP_PREDECREMENT, PREC_PREFIX, 0},
+ /* C++ */
+ {"::", BINOP_SCOPE, PREC_PREFIX, 0},
};
static void print_subexp ();
@@ -119,6 +121,18 @@ print_subexp (exp, pos, stream, prec)
opcode = exp->elts[pc].opcode;
switch (opcode)
{
+ case OP_SCOPE:
+ myprec = PREC_PREFIX;
+ assoc = 0;
+ (*pos) += 2;
+ print_subexp (exp, pos, stream, (int) myprec + assoc);
+ fprintf (stream, " :: ");
+ nargs = strlen (&exp->elts[pc + 2].string);
+ (*pos) += 1 + (nargs + sizeof (union exp_element)) / sizeof (union exp_element);
+
+ fprintf (stream, &exp->elts[pc + 2].string);
+ return;
+
case OP_LONG:
(*pos) += 3;
value_print (value_from_long (exp->elts[pc + 1].type,