Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: gdb/expprint.c

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gdb/exec.c ('k') | gdb/expression.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Print in infix form a struct expression. 1 /* Print in infix form a struct expression.
2 2
3 Copyright (C) 1986, 1988-1989, 1991-2000, 2003, 2007-2012 Free 3 Copyright (C) 1986, 1988-1989, 1991-2000, 2003, 2007-2012 Free
4 Software Foundation, Inc. 4 Software Foundation, Inc.
5 5
6 This file is part of GDB. 6 This file is part of GDB.
7 7
8 This program is free software; you can redistribute it and/or modify 8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or 10 the Free Software Foundation; either version 3 of the License, or
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 { 129 {
130 fputs_filtered (SYMBOL_PRINT_NAME (BLOCK_FUNCTION (b)), stream); 130 fputs_filtered (SYMBOL_PRINT_NAME (BLOCK_FUNCTION (b)), stream);
131 fputs_filtered ("::", stream); 131 fputs_filtered ("::", stream);
132 } 132 }
133 fputs_filtered (SYMBOL_PRINT_NAME (exp->elts[pc + 2].symbol), stream); 133 fputs_filtered (SYMBOL_PRINT_NAME (exp->elts[pc + 2].symbol), stream);
134 } 134 }
135 return; 135 return;
136 136
137 case OP_VAR_ENTRY_VALUE: 137 case OP_VAR_ENTRY_VALUE:
138 { 138 {
139 struct block *b;
140
141 (*pos) += 2; 139 (*pos) += 2;
142 fprintf_filtered (stream, "%s@entry", 140 fprintf_filtered (stream, "%s@entry",
143 SYMBOL_PRINT_NAME (exp->elts[pc + 1].symbol)); 141 SYMBOL_PRINT_NAME (exp->elts[pc + 1].symbol));
144 } 142 }
145 return; 143 return;
146 144
147 case OP_LAST: 145 case OP_LAST:
148 (*pos) += 2; 146 (*pos) += 2;
149 fprintf_filtered (stream, "$%d", 147 fprintf_filtered (stream, "$%d",
150 longest_to_int (exp->elts[pc + 1].longconst)); 148 longest_to_int (exp->elts[pc + 1].longconst));
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 op_print_tab = current_language->la_op_print_tab; 638 op_print_tab = current_language->la_op_print_tab;
641 for (tem = 0; op_print_tab[tem].opcode != OP_NULL; tem++) 639 for (tem = 0; op_print_tab[tem].opcode != OP_NULL; tem++)
642 if (op_print_tab[tem].opcode == op) 640 if (op_print_tab[tem].opcode == op)
643 return op_print_tab[tem].string; 641 return op_print_tab[tem].string;
644 return NULL; 642 return NULL;
645 } 643 }
646 644
647 /* Support for dumping the raw data from expressions in a human readable 645 /* Support for dumping the raw data from expressions in a human readable
648 form. */ 646 form. */
649 647
650 static char *op_name (struct expression *, enum exp_opcode);
651 static int dump_subexp_body (struct expression *exp, struct ui_file *, int); 648 static int dump_subexp_body (struct expression *exp, struct ui_file *, int);
652 649
653 /* Name for OPCODE, when it appears in expression EXP. */ 650 /* Name for OPCODE, when it appears in expression EXP. */
654 651
655 static char * 652 char *
656 op_name (struct expression *exp, enum exp_opcode opcode) 653 op_name (struct expression *exp, enum exp_opcode opcode)
657 { 654 {
658 return exp->language_defn->la_exp_desc->op_name (opcode); 655 return exp->language_defn->la_exp_desc->op_name (opcode);
659 } 656 }
660 657
661 /* Default name for the standard operator OPCODE (i.e., one defined in 658 /* Default name for the standard operator OPCODE (i.e., one defined in
662 the definition of enum exp_opcode). */ 659 the definition of enum exp_opcode). */
663 660
664 char * 661 char *
665 op_name_standard (enum exp_opcode opcode) 662 op_name_standard (enum exp_opcode opcode)
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 965
969 len = longest_to_int (exp->elts[elt + 1].longconst); 966 len = longest_to_int (exp->elts[elt + 1].longconst);
970 elem_name = &exp->elts[elt + 2].string; 967 elem_name = &exp->elts[elt + 2].string;
971 968
972 fprintf_filtered (stream, "Field name: `%.*s'", len, elem_name); 969 fprintf_filtered (stream, "Field name: `%.*s'", len, elem_name);
973 elt += 4 + BYTES_TO_EXP_ELEM (len + 1); 970 elt += 4 + BYTES_TO_EXP_ELEM (len + 1);
974 } 971 }
975 break; 972 break;
976 case TYPE_INSTANCE: 973 case TYPE_INSTANCE:
977 { 974 {
978 char *elem_name;
979 LONGEST len; 975 LONGEST len;
980 976
981 len = exp->elts[elt++].longconst; 977 len = exp->elts[elt++].longconst;
982 fprintf_filtered (stream, "%s TypeInstance: ", plongest (len)); 978 fprintf_filtered (stream, "%s TypeInstance: ", plongest (len));
983 while (len-- > 0) 979 while (len-- > 0)
984 { 980 {
985 fprintf_filtered (stream, "Type @"); 981 fprintf_filtered (stream, "Type @");
986 gdb_print_host_address (exp->elts[elt].type, stream); 982 gdb_print_host_address (exp->elts[elt].type, stream);
987 fprintf_filtered (stream, " ("); 983 fprintf_filtered (stream, " (");
988 type_print (exp->elts[elt].type, NULL, stream, 0); 984 type_print (exp->elts[elt].type, NULL, stream, 0);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 fputs_filtered ("Type printing not yet supported....", stream); 1024 fputs_filtered ("Type printing not yet supported....", stream);
1029 fprintf_filtered (stream, "'\n\tLanguage %s, %d elements, %ld bytes each.\n", 1025 fprintf_filtered (stream, "'\n\tLanguage %s, %d elements, %ld bytes each.\n",
1030 exp->language_defn->la_name, exp->nelts, 1026 exp->language_defn->la_name, exp->nelts,
1031 (long) sizeof (union exp_element)); 1027 (long) sizeof (union exp_element));
1032 fputs_filtered ("\n", stream); 1028 fputs_filtered ("\n", stream);
1033 1029
1034 for (elt = 0; elt < exp->nelts;) 1030 for (elt = 0; elt < exp->nelts;)
1035 elt = dump_subexp (exp, stream, elt); 1031 elt = dump_subexp (exp, stream, elt);
1036 fputs_filtered ("\n", stream); 1032 fputs_filtered ("\n", stream);
1037 } 1033 }
OLDNEW
« no previous file with comments | « gdb/exec.c ('k') | gdb/expression.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698