| OLD | NEW |
| 1 /* Generic code for supporting multiple C++ ABI's | 1 /* Generic code for supporting multiple C++ ABI's |
| 2 | 2 |
| 3 Copyright (C) 2001-2003, 2005-2012 Free Software Foundation, Inc. | 3 Copyright (C) 2001-2003, 2005-2012 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. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 return NULL; | 104 return NULL; |
| 105 return (*current_cp_abi.virtual_fn_field) (arg1p, f, j, | 105 return (*current_cp_abi.virtual_fn_field) (arg1p, f, j, |
| 106 type, offset); | 106 type, offset); |
| 107 } | 107 } |
| 108 | 108 |
| 109 struct type * | 109 struct type * |
| 110 value_rtti_type (struct value *v, int *full, | 110 value_rtti_type (struct value *v, int *full, |
| 111 int *top, int *using_enc) | 111 int *top, int *using_enc) |
| 112 { | 112 { |
| 113 struct type *ret = NULL; | 113 struct type *ret = NULL; |
| 114 struct gdb_exception e; | 114 volatile struct gdb_exception e; |
| 115 | 115 |
| 116 if ((current_cp_abi.rtti_type) == NULL) | 116 if ((current_cp_abi.rtti_type) == NULL) |
| 117 return NULL; | 117 return NULL; |
| 118 TRY_CATCH (e, RETURN_MASK_ERROR) | 118 TRY_CATCH (e, RETURN_MASK_ERROR) |
| 119 { | 119 { |
| 120 ret = (*current_cp_abi.rtti_type) (v, full, top, using_enc); | 120 ret = (*current_cp_abi.rtti_type) (v, full, top, using_enc); |
| 121 } | 121 } |
| 122 if (e.reason < 0) | 122 if (e.reason < 0) |
| 123 return NULL; | 123 return NULL; |
| 124 return ret; | 124 return ret; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 struct value * | 163 struct value * |
| 164 cplus_method_ptr_to_value (struct value **this_p, | 164 cplus_method_ptr_to_value (struct value **this_p, |
| 165 struct value *method_ptr) | 165 struct value *method_ptr) |
| 166 { | 166 { |
| 167 if (current_cp_abi.method_ptr_to_value == NULL) | 167 if (current_cp_abi.method_ptr_to_value == NULL) |
| 168 error (_("GDB does not support pointers to methods on this target")); | 168 error (_("GDB does not support pointers to methods on this target")); |
| 169 return (*current_cp_abi.method_ptr_to_value) (this_p, method_ptr); | 169 return (*current_cp_abi.method_ptr_to_value) (this_p, method_ptr); |
| 170 } | 170 } |
| 171 | 171 |
| 172 /* See cp-abi.h. */ |
| 173 |
| 174 void |
| 175 cplus_print_vtable (struct value *value) |
| 176 { |
| 177 if (current_cp_abi.print_vtable == NULL) |
| 178 error (_("GDB cannot print the vtable on this target")); |
| 179 return (*current_cp_abi.print_vtable) (value); |
| 180 } |
| 181 |
| 172 int | 182 int |
| 173 cp_pass_by_reference (struct type *type) | 183 cp_pass_by_reference (struct type *type) |
| 174 { | 184 { |
| 175 if ((current_cp_abi.pass_by_reference) == NULL) | 185 if ((current_cp_abi.pass_by_reference) == NULL) |
| 176 return 0; | 186 return 0; |
| 177 return (*current_cp_abi.pass_by_reference) (type); | 187 return (*current_cp_abi.pass_by_reference) (type); |
| 178 } | 188 } |
| 179 | 189 |
| 180 /* Set the current C++ ABI to SHORT_NAME. */ | 190 /* Set the current C++ ABI to SHORT_NAME. */ |
| 181 | 191 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 | 339 |
| 330 add_cmd ("cp-abi", class_obscure, set_cp_abi_cmd, _("\ | 340 add_cmd ("cp-abi", class_obscure, set_cp_abi_cmd, _("\ |
| 331 Set the ABI used for inspecting C++ objects.\n\ | 341 Set the ABI used for inspecting C++ objects.\n\ |
| 332 \"set cp-abi\" with no arguments will list the available ABIs."), | 342 \"set cp-abi\" with no arguments will list the available ABIs."), |
| 333 &setlist); | 343 &setlist); |
| 334 | 344 |
| 335 add_cmd ("cp-abi", class_obscure, show_cp_abi_cmd, | 345 add_cmd ("cp-abi", class_obscure, show_cp_abi_cmd, |
| 336 _("Show the ABI used for inspecting C++ objects."), | 346 _("Show the ABI used for inspecting C++ objects."), |
| 337 &showlist); | 347 &showlist); |
| 338 } | 348 } |
| OLD | NEW |