| OLD | NEW |
| 1 /* Support for printing Java types for GDB, the GNU debugger. | 1 /* Support for printing Java types for GDB, the GNU debugger. |
| 2 Copyright (C) 1997-2000, 2007-2012 Free Software Foundation, Inc. | 2 Copyright (C) 1997-2000, 2007-2012 Free Software Foundation, Inc. |
| 3 | 3 |
| 4 This file is part of GDB. | 4 This file is part of GDB. |
| 5 | 5 |
| 6 This program is free software; you can redistribute it and/or modify | 6 This program is free software; you can redistribute it and/or modify |
| 7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
| 8 the Free Software Foundation; either version 3 of the License, or | 8 the Free Software Foundation; either version 3 of the License, or |
| 9 (at your option) any later version. | 9 (at your option) any later version. |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 /* Local functions */ | 33 /* Local functions */ |
| 34 | 34 |
| 35 static void java_type_print_base (struct type * type, | 35 static void java_type_print_base (struct type * type, |
| 36 struct ui_file *stream, int show, | 36 struct ui_file *stream, int show, |
| 37 int level); | 37 int level); |
| 38 | 38 |
| 39 static void | 39 static void |
| 40 java_type_print_derivation_info (struct ui_file *stream, struct type *type) | 40 java_type_print_derivation_info (struct ui_file *stream, struct type *type) |
| 41 { | 41 { |
| 42 char *name; | 42 const char *name; |
| 43 int i; | 43 int i; |
| 44 int n_bases; | 44 int n_bases; |
| 45 int prev; | 45 int prev; |
| 46 | 46 |
| 47 n_bases = TYPE_N_BASECLASSES (type); | 47 n_bases = TYPE_N_BASECLASSES (type); |
| 48 | 48 |
| 49 for (i = 0, prev = 0; i < n_bases; i++) | 49 for (i = 0, prev = 0; i < n_bases; i++) |
| 50 { | 50 { |
| 51 int kind; | 51 int kind; |
| 52 | 52 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 len = TYPE_NFN_FIELDS (type); | 201 len = TYPE_NFN_FIELDS (type); |
| 202 if (len) | 202 if (len) |
| 203 fprintf_filtered (stream, "\n"); | 203 fprintf_filtered (stream, "\n"); |
| 204 | 204 |
| 205 /* Print out the methods. */ | 205 /* Print out the methods. */ |
| 206 | 206 |
| 207 for (i = 0; i < len; i++) | 207 for (i = 0; i < len; i++) |
| 208 { | 208 { |
| 209 struct fn_field *f; | 209 struct fn_field *f; |
| 210 int j; | 210 int j; |
| 211 » char *method_name; | 211 » const char *method_name; |
| 212 » char *name; | 212 » const char *name; |
| 213 int is_constructor; | 213 int is_constructor; |
| 214 int n_overloads; | 214 int n_overloads; |
| 215 | 215 |
| 216 f = TYPE_FN_FIELDLIST1 (type, i); | 216 f = TYPE_FN_FIELDLIST1 (type, i); |
| 217 n_overloads = TYPE_FN_FIELDLIST_LENGTH (type, i); | 217 n_overloads = TYPE_FN_FIELDLIST_LENGTH (type, i); |
| 218 method_name = TYPE_FN_FIELDLIST_NAME (type, i); | 218 method_name = TYPE_FN_FIELDLIST_NAME (type, i); |
| 219 name = type_name_no_tag (type); | 219 name = type_name_no_tag (type); |
| 220 is_constructor = name && strcmp (method_name, name) == 0; | 220 is_constructor = name && strcmp (method_name, name) == 0; |
| 221 | 221 |
| 222 for (j = 0; j < n_overloads; j++) | 222 for (j = 0; j < n_overloads; j++) |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 } | 322 } |
| 323 break; | 323 break; |
| 324 | 324 |
| 325 default: | 325 default: |
| 326 c_type_print_base (type, stream, show, level); | 326 c_type_print_base (type, stream, show, level); |
| 327 } | 327 } |
| 328 } | 328 } |
| 329 | 329 |
| 330 /* LEVEL is the depth to indent lines by. */ | 330 /* LEVEL is the depth to indent lines by. */ |
| 331 | 331 |
| 332 extern void c_type_print_varspec_suffix (struct type *, struct ui_file *, | |
| 333 int, int, int); | |
| 334 | |
| 335 void | 332 void |
| 336 java_print_type (struct type *type, const char *varstring, | 333 java_print_type (struct type *type, const char *varstring, |
| 337 struct ui_file *stream, int show, int level) | 334 struct ui_file *stream, int show, int level) |
| 338 { | 335 { |
| 339 int demangled_args; | 336 int demangled_args; |
| 340 | 337 |
| 341 java_type_print_base (type, stream, show, level); | 338 java_type_print_base (type, stream, show, level); |
| 342 | 339 |
| 343 if (varstring != NULL && *varstring != '\0') | 340 if (varstring != NULL && *varstring != '\0') |
| 344 { | 341 { |
| 345 fputs_filtered (" ", stream); | 342 fputs_filtered (" ", stream); |
| 346 fputs_filtered (varstring, stream); | 343 fputs_filtered (varstring, stream); |
| 347 } | 344 } |
| 348 | 345 |
| 349 /* For demangled function names, we have the arglist as part of the name, | 346 /* For demangled function names, we have the arglist as part of the name, |
| 350 so don't print an additional pair of ()'s. */ | 347 so don't print an additional pair of ()'s. */ |
| 351 | 348 |
| 352 demangled_args = varstring != NULL && strchr (varstring, '(') != NULL; | 349 demangled_args = varstring != NULL && strchr (varstring, '(') != NULL; |
| 353 c_type_print_varspec_suffix (type, stream, show, 0, demangled_args); | 350 c_type_print_varspec_suffix (type, stream, show, 0, demangled_args); |
| 354 } | 351 } |
| OLD | NEW |