| OLD | NEW |
| 1 /* Print values for GNU debugger GDB. | 1 /* Print values for GNU debugger GDB. |
| 2 | 2 |
| 3 Copyright (C) 1986-2012 Free Software Foundation, Inc. | 3 Copyright (C) 1986-2013 Free Software Foundation, Inc. |
| 4 | 4 |
| 5 This file is part of GDB. | 5 This file is part of GDB. |
| 6 | 6 |
| 7 This program is free software; you can redistribute it and/or modify | 7 This program is free software; you can redistribute it and/or modify |
| 8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
| 9 the Free Software Foundation; either version 3 of the License, or | 9 the Free Software Foundation; either version 3 of the License, or |
| 10 (at your option) any later version. | 10 (at your option) any later version. |
| 11 | 11 |
| 12 This program is distributed in the hope that it will be useful, | 12 This program is distributed in the hope that it will be useful, |
| 13 but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 GNU General Public License for more details. | 15 GNU General Public License for more details. |
| 16 | 16 |
| 17 You should have received a copy of the GNU General Public License | 17 You should have received a copy of the GNU General Public License |
| 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */ | 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
| 19 | 19 |
| 20 #include "defs.h" | 20 #include "defs.h" |
| 21 #include "gdb_string.h" | 21 #include <string.h> |
| 22 #include "frame.h" | 22 #include "frame.h" |
| 23 #include "symtab.h" | 23 #include "symtab.h" |
| 24 #include "gdbtypes.h" | 24 #include "gdbtypes.h" |
| 25 #include "value.h" | 25 #include "value.h" |
| 26 #include "language.h" | 26 #include "language.h" |
| 27 #include "expression.h" | 27 #include "expression.h" |
| 28 #include "gdbcore.h" | 28 #include "gdbcore.h" |
| 29 #include "gdbcmd.h" | 29 #include "gdbcmd.h" |
| 30 #include "target.h" | 30 #include "target.h" |
| 31 #include "breakpoint.h" | 31 #include "breakpoint.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 43 #include "dfp.h" | 43 #include "dfp.h" |
| 44 #include "valprint.h" | 44 #include "valprint.h" |
| 45 #include "exceptions.h" | 45 #include "exceptions.h" |
| 46 #include "observer.h" | 46 #include "observer.h" |
| 47 #include "solist.h" | 47 #include "solist.h" |
| 48 #include "parser-defs.h" | 48 #include "parser-defs.h" |
| 49 #include "charset.h" | 49 #include "charset.h" |
| 50 #include "arch-utils.h" | 50 #include "arch-utils.h" |
| 51 #include "cli/cli-utils.h" | 51 #include "cli/cli-utils.h" |
| 52 #include "format.h" | 52 #include "format.h" |
| 53 #include "source.h" |
| 53 | 54 |
| 54 #ifdef TUI | 55 #ifdef TUI |
| 55 #include "tui/tui.h" /* For tui_active et al. */ | 56 #include "tui/tui.h" /* For tui_active et al. */ |
| 56 #endif | 57 #endif |
| 57 | 58 |
| 58 struct format_data | 59 struct format_data |
| 59 { | 60 { |
| 60 int count; | 61 int count; |
| 61 char format; | 62 char format; |
| 62 char size; | 63 char size; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 { | 116 { |
| 116 fprintf_filtered (file, _("Printing of source filename and " | 117 fprintf_filtered (file, _("Printing of source filename and " |
| 117 "line number with <symbol> is %s.\n"), | 118 "line number with <symbol> is %s.\n"), |
| 118 value); | 119 value); |
| 119 } | 120 } |
| 120 | 121 |
| 121 /* Number of auto-display expression currently being displayed. | 122 /* Number of auto-display expression currently being displayed. |
| 122 So that we can disable it if we get a signal within it. | 123 So that we can disable it if we get a signal within it. |
| 123 -1 when not doing one. */ | 124 -1 when not doing one. */ |
| 124 | 125 |
| 125 int current_display_number; | 126 static int current_display_number; |
| 126 | 127 |
| 127 struct display | 128 struct display |
| 128 { | 129 { |
| 129 /* Chain link to next auto-display item. */ | 130 /* Chain link to next auto-display item. */ |
| 130 struct display *next; | 131 struct display *next; |
| 131 | 132 |
| 132 /* The expression as the user typed it. */ | 133 /* The expression as the user typed it. */ |
| 133 char *exp_string; | 134 char *exp_string; |
| 134 | 135 |
| 135 /* Expression to be evaluated and displayed. */ | 136 /* Expression to be evaluated and displayed. */ |
| 136 struct expression *exp; | 137 struct expression *exp; |
| 137 | 138 |
| 138 /* Item number of this auto-display item. */ | 139 /* Item number of this auto-display item. */ |
| 139 int number; | 140 int number; |
| 140 | 141 |
| 141 /* Display format specified. */ | 142 /* Display format specified. */ |
| 142 struct format_data format; | 143 struct format_data format; |
| 143 | 144 |
| 144 /* Program space associated with `block'. */ | 145 /* Program space associated with `block'. */ |
| 145 struct program_space *pspace; | 146 struct program_space *pspace; |
| 146 | 147 |
| 147 /* Innermost block required by this expression when evaluated. */ | 148 /* Innermost block required by this expression when evaluated. */ |
| 148 struct block *block; | 149 const struct block *block; |
| 149 | 150 |
| 150 /* Status of this display (enabled or disabled). */ | 151 /* Status of this display (enabled or disabled). */ |
| 151 int enabled_p; | 152 int enabled_p; |
| 152 }; | 153 }; |
| 153 | 154 |
| 154 /* Chain of expressions whose values should be displayed | 155 /* Chain of expressions whose values should be displayed |
| 155 automatically each time the program stops. */ | 156 automatically each time the program stops. */ |
| 156 | 157 |
| 157 static struct display *display_chain; | 158 static struct display *display_chain; |
| 158 | 159 |
| 159 static int display_number; | 160 static int display_number; |
| 160 | 161 |
| 161 /* Walk the following statement or block through all displays. | 162 /* Walk the following statement or block through all displays. |
| 162 ALL_DISPLAYS_SAFE does so even if the statement deletes the current | 163 ALL_DISPLAYS_SAFE does so even if the statement deletes the current |
| 163 display. */ | 164 display. */ |
| 164 | 165 |
| 165 #define ALL_DISPLAYS(B) \ | 166 #define ALL_DISPLAYS(B) \ |
| 166 for (B = display_chain; B; B = B->next) | 167 for (B = display_chain; B; B = B->next) |
| 167 | 168 |
| 168 #define ALL_DISPLAYS_SAFE(B,TMP) \ | 169 #define ALL_DISPLAYS_SAFE(B,TMP) \ |
| 169 for (B = display_chain; \ | 170 for (B = display_chain; \ |
| 170 B ? (TMP = B->next, 1): 0; \ | 171 B ? (TMP = B->next, 1): 0; \ |
| 171 B = TMP) | 172 B = TMP) |
| 172 | 173 |
| 173 /* Prototypes for exported functions. */ | 174 /* Prototypes for exported functions. */ |
| 174 | 175 |
| 175 void output_command (char *, int); | |
| 176 | |
| 177 void _initialize_printcmd (void); | 176 void _initialize_printcmd (void); |
| 178 | 177 |
| 179 /* Prototypes for local functions. */ | 178 /* Prototypes for local functions. */ |
| 180 | 179 |
| 181 static void do_one_display (struct display *); | 180 static void do_one_display (struct display *); |
| 182 | 181 |
| 183 | 182 |
| 184 | 183 |
| 185 /* Decode a format specification. *STRING_PTR should point to it. | 184 /* Decode a format specification. *STRING_PTR should point to it. |
| 186 OFORMAT and OSIZE are used as defaults for the format and size | 185 OFORMAT and OSIZE are used as defaults for the format and size |
| 187 if none are given in the format specification. | 186 if none are given in the format specification. |
| 188 If OSIZE is zero, then the size field of the returned value | 187 If OSIZE is zero, then the size field of the returned value |
| 189 should be set only if a size is explicitly specified by the | 188 should be set only if a size is explicitly specified by the |
| 190 user. | 189 user. |
| 191 The structure returned describes all the data | 190 The structure returned describes all the data |
error: old chunk mismatch |
None
| OLD | NEW |