GDB (API)
|
00001 /* longjmp-free interface between gdb and gdbtk. 00002 Copyright (C) 1999, 2000, 2002, 2008, 2013 Free Software Foundation, Inc. 00003 00004 This file is part of GDB. 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. */ 00020 00021 #include "defs.h" 00022 #include "frame.h" 00023 #include "value.h" 00024 #include "varobj.h" 00025 #include "block.h" 00026 #include "exceptions.h" 00027 #include "language.h" 00028 #include "valprint.h" 00029 #include "gdbtk-wrapper.h" 00030 00031 /* 00032 * Wrapper functions exported to the world 00033 */ 00034 00035 gdb_result GDB_value_fetch_lazy (value_ptr); 00036 00037 gdb_result GDB_evaluate_expression (struct expression *, value_ptr *); 00038 00039 gdb_result GDB_type_print (value_ptr, char *, struct ui_file *, int); 00040 00041 gdb_result GDB_val_print (struct type *type, char *valaddr, 00042 CORE_ADDR address, struct ui_file *stream, 00043 int format, int deref_ref, int recurse, 00044 enum val_prettyformat pretty); 00045 00046 gdb_result GDB_value_equal (value_ptr, value_ptr, int *); 00047 00048 /* 00049 gdb_result GDB_parse_exp_1 (char **stringptr, struct block *block, int comma, 00050 struct expression **result); 00051 */ 00052 00053 gdb_result GDB_evaluate_type (struct expression *exp, value_ptr * result); 00054 00055 gdb_result GDB_block_for_pc (CORE_ADDR pc, struct block **result); 00056 00057 gdb_result GDB_block_innermost_frame (struct block *block, 00058 struct frame_info **result); 00059 00060 gdb_result GDB_reinit_frame_cache (void); 00061 00062 gdb_result GDB_value_ind (value_ptr val, value_ptr * rval); 00063 00064 gdb_result GDB_value_slice (value_ptr val, int low, int num, 00065 value_ptr * rval); 00066 00067 gdb_result GDB_value_coerce_array (value_ptr val, value_ptr * rval); 00068 00069 gdb_result GDB_value_struct_elt (value_ptr * argp, value_ptr * args, 00070 char *name, int *static_memfunc, 00071 char *err, value_ptr * rval); 00072 00073 gdb_result GDB_value_cast (struct type *type, value_ptr val, 00074 value_ptr * rval); 00075 00076 gdb_result GDB_get_frame_block (struct frame_info *fi, struct block **rval); 00077 00078 gdb_result GDB_get_prev_frame (struct frame_info *fi, 00079 struct frame_info **result); 00080 00081 gdb_result GDB_get_next_frame (struct frame_info *fi, 00082 struct frame_info **result); 00083 00084 gdb_result GDB_find_relative_frame (struct frame_info *fi, 00085 int *start, struct frame_info **result); 00086 00087 gdb_result GDB_get_current_frame (struct frame_info **result); 00088 00089 gdb_result GDB_varobj_update (struct varobj **varp, int explicit, 00090 VEC (varobj_update_result) **changes); 00091 00092 /* 00093 * Private functions for this file 00094 */ 00095 static gdb_result call_wrapped_function (catch_errors_ftype *, 00096 struct gdb_wrapper_arguments *); 00097 00098 static int wrap_type_print (char *); 00099 00100 static int wrap_evaluate_expression (char *); 00101 00102 static int wrap_value_fetch_lazy (char *); 00103 00104 static int wrap_val_print (char *); 00105 00106 static int wrap_value_equal (char *); 00107 00108 /* 00109 static int wrap_parse_exp_1 (char *opaque_arg); 00110 */ 00111 00112 static int wrap_evaluate_type (char *opaque_arg); 00113 00114 static int wrap_block_for_pc (char *opaque_arg); 00115 00116 static int wrap_block_innermost_frame (char *opaque_arg); 00117 00118 static int wrap_reinit_frame_cache (char *opaque_arg); 00119 00120 static int wrap_value_ind (char *opaque_arg); 00121 00122 static int wrap_value_slice (char *opaque_arg); 00123 00124 static int wrap_value_coerce_array (char *opaque_arg); 00125 00126 static int wrap_value_struct_elt (char *opaque_arg); 00127 00128 static int wrap_value_cast (char *opaque_arg); 00129 00130 static int wrap_get_frame_block (char *opaque_arg); 00131 00132 static int wrap_get_prev_frame (char *opaque_arg); 00133 00134 static int wrap_get_next_frame (char *opaque_arg); 00135 00136 static int wrap_find_relative_frame (char *opaque_arg); 00137 00138 static int wrap_get_current_frame (char *opaque_arg); 00139 00140 static int wrap_varobj_update (char *opaque_arg); 00141 00142 static gdb_result 00143 call_wrapped_function (catch_errors_ftype *fn, struct gdb_wrapper_arguments *arg) 00144 { 00145 if (!catch_errors (fn, (char *) &arg, "", RETURN_MASK_ERROR)) 00146 { 00147 /* An error occurred */ 00148 return GDB_ERROR; 00149 } 00150 00151 return GDB_OK; 00152 } 00153 00154 gdb_result 00155 GDB_type_print (value_ptr val, char *varstring, 00156 struct ui_file *stream, int show) 00157 { 00158 struct gdb_wrapper_arguments args; 00159 00160 args.args[0].ptr = val; 00161 args.args[1].ptr = varstring; 00162 args.args[2].ptr = stream; 00163 args.args[3].integer = show; 00164 return call_wrapped_function ((catch_errors_ftype *) wrap_type_print, &args); 00165 } 00166 00167 static int 00168 wrap_type_print (char *a) 00169 { 00170 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) a; 00171 value_ptr val = (value_ptr) (*args)->args[0].ptr; 00172 char *varstring = (*args)->args[1].ptr; 00173 struct ui_file *stream = (struct ui_file *) (*args)->args[2].ptr; 00174 int show = (*args)->args[3].integer; 00175 type_print (value_type (val), varstring, stream, show); 00176 return 1; 00177 } 00178 00179 gdb_result 00180 GDB_val_print (struct type *type, 00181 char *valaddr, 00182 CORE_ADDR address, 00183 struct ui_file *stream, 00184 int format, 00185 int deref_ref, 00186 int recurse, 00187 enum val_prettyformat pretty) 00188 { 00189 struct gdb_wrapper_arguments args; 00190 00191 args.args[0].ptr = type; 00192 args.args[1].ptr = valaddr; 00193 args.args[2].ptr = &address; 00194 args.args[3].ptr = stream; 00195 args.args[4].integer = format; 00196 args.args[5].integer = deref_ref; 00197 args.args[6].integer = recurse; 00198 args.args[7].integer = pretty; 00199 00200 return call_wrapped_function ((catch_errors_ftype *) wrap_val_print, &args); 00201 } 00202 00203 static int 00204 wrap_val_print (char *a) 00205 { 00206 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) a; 00207 struct type *type; 00208 const gdb_byte *valaddr; 00209 CORE_ADDR address; 00210 struct ui_file *stream; 00211 int format; 00212 int recurse; 00213 struct value_print_options opts; 00214 00215 type = (struct type *) (*args)->args[0].ptr; 00216 valaddr = (gdb_byte *) (*args)->args[1].ptr; 00217 address = *(CORE_ADDR *) (*args)->args[2].ptr; 00218 stream = (struct ui_file *) (*args)->args[3].ptr; 00219 format = (*args)->args[4].integer; 00220 get_formatted_print_options (&opts, format); 00221 opts.deref_ref = (*args)->args[5].integer; 00222 recurse = (*args)->args[6].integer; 00223 opts.prettyformat = (enum val_prettyformat) (*args)->args[7].integer; 00224 00225 val_print (type, valaddr, 0, address, stream, recurse, NULL, &opts, 00226 current_language); 00227 return 1; 00228 } 00229 00230 gdb_result 00231 GDB_value_fetch_lazy (value_ptr value) 00232 { 00233 struct gdb_wrapper_arguments args; 00234 00235 args.args[0].ptr = value; 00236 return call_wrapped_function ((catch_errors_ftype *) wrap_value_fetch_lazy, &args); 00237 } 00238 00239 static int 00240 wrap_value_fetch_lazy (char *a) 00241 { 00242 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) a; 00243 00244 value_fetch_lazy ((value_ptr) (*args)->args[0].ptr); 00245 return 1; 00246 } 00247 00248 gdb_result 00249 GDB_evaluate_expression (struct expression *exp, value_ptr *value) 00250 { 00251 struct gdb_wrapper_arguments args; 00252 gdb_result result; 00253 args.args[0].ptr = exp; 00254 00255 result = call_wrapped_function ((catch_errors_ftype *) wrap_evaluate_expression, &args); 00256 if (result != GDB_OK) 00257 return result; 00258 00259 *value = (value_ptr) args.result.ptr; 00260 return GDB_OK; 00261 } 00262 00263 static int 00264 wrap_evaluate_expression (char *a) 00265 { 00266 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) a; 00267 00268 (*args)->result.ptr = 00269 evaluate_expression ((struct expression *) (*args)->args[0].ptr); 00270 return 1; 00271 } 00272 00273 gdb_result 00274 GDB_value_equal (value_ptr val1, value_ptr val2, int *result) 00275 { 00276 struct gdb_wrapper_arguments args; 00277 gdb_result r; 00278 00279 args.args[0].ptr = val1; 00280 args.args[1].ptr = val2; 00281 00282 r = call_wrapped_function ((catch_errors_ftype *) wrap_value_equal, &args); 00283 if (r != GDB_OK) 00284 return r; 00285 00286 *result = args.result.integer; 00287 return GDB_OK; 00288 } 00289 00290 static int 00291 wrap_value_equal (char *a) 00292 { 00293 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) a; 00294 value_ptr val1, val2; 00295 00296 val1 = (value_ptr) (*args)->args[0].ptr; 00297 val2 = (value_ptr) (*args)->args[1].ptr; 00298 00299 (*args)->result.integer = value_equal (val1, val2); 00300 return 1; 00301 } 00302 00303 /* 00304 gdb_result 00305 GDB_parse_exp_1 (char **stringptr, struct block *block, 00306 int comma, struct expression **result) 00307 { 00308 struct gdb_wrapper_arguments args; 00309 gdb_result r; 00310 00311 args.args[0].ptr = stringptr; 00312 args.args[1].ptr = block; 00313 args.args[2].integer = comma; 00314 00315 r = call_wrapped_function ((catch_errors_ftype *) wrap_parse_exp_1, &args); 00316 if (r != GDB_OK) 00317 return r; 00318 00319 *result = (struct expression *) args.result.ptr; 00320 return GDB_OK; 00321 } 00322 00323 static int 00324 wrap_parse_exp_1 (char *opaque_arg) 00325 { 00326 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; 00327 struct block *block; 00328 char **stringptr; 00329 int comma; 00330 00331 stringptr = (char **) (*args)->args[0].ptr; 00332 block = (struct block *) (*args)->args[1].ptr; 00333 comma = (*args)->args[2].integer; 00334 00335 (*args)->result.ptr = parse_exp_1 (stringptr, block, comma); 00336 return 1; 00337 } 00338 */ 00339 00340 gdb_result 00341 GDB_evaluate_type (struct expression *exp, value_ptr *result) 00342 { 00343 struct gdb_wrapper_arguments args; 00344 gdb_result r; 00345 00346 args.args[0].ptr = exp; 00347 00348 r = call_wrapped_function ((catch_errors_ftype *) wrap_evaluate_type, &args); 00349 if (r != GDB_OK) 00350 return r; 00351 00352 *result = (value_ptr) args.result.ptr; 00353 return GDB_OK; 00354 } 00355 00356 static int 00357 wrap_evaluate_type (char *opaque_arg) 00358 { 00359 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; 00360 struct expression *exp; 00361 00362 exp = (struct expression *) (*args)->args[0].ptr; 00363 (*args)->result.ptr = evaluate_type (exp); 00364 return 1; 00365 } 00366 00367 gdb_result 00368 GDB_block_for_pc (CORE_ADDR pc, struct block **result) 00369 { 00370 struct gdb_wrapper_arguments args; 00371 gdb_result r; 00372 00373 args.args[0].ptr = &pc; 00374 00375 r = call_wrapped_function ((catch_errors_ftype *) wrap_block_for_pc, &args); 00376 if (r != GDB_OK) 00377 return r; 00378 00379 *result = (struct block *) args.result.ptr; 00380 return GDB_OK; 00381 } 00382 00383 static int 00384 wrap_block_for_pc (char *opaque_arg) 00385 { 00386 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; 00387 CORE_ADDR pc; 00388 00389 pc = *(CORE_ADDR *) (*args)->args[0].ptr; 00390 (*args)->result.ptr = block_for_pc (pc); 00391 return 1; 00392 } 00393 00394 gdb_result 00395 GDB_block_innermost_frame (struct block *block, struct frame_info **result) 00396 { 00397 struct gdb_wrapper_arguments args; 00398 gdb_result r; 00399 00400 args.args[0].ptr = block; 00401 00402 r = call_wrapped_function ((catch_errors_ftype *) wrap_block_innermost_frame, &args); 00403 if (r != GDB_OK) 00404 return r; 00405 00406 *result = (struct frame_info *) args.result.ptr; 00407 return GDB_OK; 00408 } 00409 00410 static int 00411 wrap_block_innermost_frame (char *opaque_arg) 00412 { 00413 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; 00414 struct block *block; 00415 00416 block = (struct block *) (*args)->args[0].ptr; 00417 (*args)->result.ptr = block_innermost_frame (block); 00418 return 1; 00419 } 00420 00421 gdb_result 00422 GDB_reinit_frame_cache (void) 00423 { 00424 gdb_result r; 00425 00426 r = call_wrapped_function ((catch_errors_ftype *) wrap_reinit_frame_cache, NULL); 00427 if (r != GDB_OK) 00428 return r; 00429 00430 return GDB_OK; 00431 } 00432 00433 static int 00434 wrap_reinit_frame_cache (char *opaque_arg) 00435 { 00436 reinit_frame_cache (); 00437 return 1; 00438 } 00439 00440 gdb_result 00441 GDB_value_ind (value_ptr val, value_ptr *rval) 00442 { 00443 struct gdb_wrapper_arguments args; 00444 gdb_result r; 00445 00446 args.args[0].ptr = val; 00447 00448 r = call_wrapped_function ((catch_errors_ftype *) wrap_value_ind, &args); 00449 if (r != GDB_OK) 00450 return r; 00451 00452 *rval = (value_ptr) args.result.ptr; 00453 return GDB_OK; 00454 } 00455 00456 static int 00457 wrap_value_ind (char *opaque_arg) 00458 { 00459 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; 00460 value_ptr val; 00461 00462 val = (value_ptr) (*args)->args[0].ptr; 00463 (*args)->result.ptr = value_ind (val); 00464 return 1; 00465 } 00466 00467 gdb_result 00468 GDB_value_slice (value_ptr val, int low, int num, value_ptr *rval) 00469 { 00470 struct gdb_wrapper_arguments args; 00471 gdb_result r; 00472 00473 args.args[0].ptr = val; 00474 args.args[1].integer = low; 00475 args.args[2].integer = num; 00476 00477 r = call_wrapped_function ((catch_errors_ftype *) wrap_value_slice, &args); 00478 if (r != GDB_OK) 00479 return r; 00480 00481 *rval = (value_ptr) args.result.ptr; 00482 return GDB_OK; 00483 } 00484 00485 static int 00486 wrap_value_slice (char *opaque_arg) 00487 { 00488 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; 00489 value_ptr val; 00490 int low, num; 00491 00492 val = (value_ptr) (*args)->args[0].ptr; 00493 low = (*args)->args[1].integer; 00494 num = (*args)->args[2].integer; 00495 (*args)->result.ptr = value_slice (val, low, num); 00496 return 1; 00497 } 00498 00499 gdb_result 00500 GDB_value_coerce_array (value_ptr val, value_ptr *rval) 00501 { 00502 struct gdb_wrapper_arguments args; 00503 gdb_result r; 00504 00505 args.args[0].ptr = val; 00506 00507 r = call_wrapped_function ((catch_errors_ftype *) wrap_value_coerce_array, 00508 &args); 00509 if (r != GDB_OK) 00510 return r; 00511 00512 *rval = (value_ptr) args.result.ptr; 00513 return GDB_OK; 00514 } 00515 00516 static int 00517 wrap_value_coerce_array (char *opaque_arg) 00518 { 00519 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; 00520 value_ptr val; 00521 00522 val = (value_ptr) (*args)->args[0].ptr; 00523 (*args)->result.ptr = value_coerce_array (val); 00524 return 1; 00525 } 00526 00527 gdb_result 00528 GDB_value_struct_elt (value_ptr *argp, 00529 value_ptr *args, 00530 char *name, 00531 int *static_memfunc, 00532 char *err, 00533 value_ptr *rval) 00534 { 00535 struct gdb_wrapper_arguments argss; 00536 gdb_result r; 00537 00538 argss.args[0].ptr = argp; 00539 argss.args[1].ptr = args; 00540 argss.args[2].ptr = name; 00541 argss.args[3].ptr = static_memfunc; 00542 argss.args[4].ptr = err; 00543 r = call_wrapped_function ((catch_errors_ftype *) wrap_value_struct_elt, &argss); 00544 if (r != GDB_OK) 00545 return r; 00546 00547 *rval = (value_ptr) argss.result.ptr; 00548 return GDB_OK; 00549 } 00550 00551 static int 00552 wrap_value_struct_elt (char *opaque_arg) 00553 { 00554 struct gdb_wrapper_arguments **argss = (struct gdb_wrapper_arguments **) opaque_arg; 00555 value_ptr *argp, *args; 00556 char *name; 00557 int *static_memfunc; 00558 char *err; 00559 00560 argp = (value_ptr *) (*argss)->args[0].ptr; 00561 args = (value_ptr *) (*argss)->args[1].ptr; 00562 name = (char *) (*argss)->args[2].ptr; 00563 static_memfunc = (int *) (*argss)->args[3].ptr; 00564 err = (char *) (*argss)->args[4].ptr; 00565 00566 (*argss)->result.ptr = value_struct_elt (argp, args, name, static_memfunc, err); 00567 return 1; 00568 } 00569 00570 gdb_result 00571 GDB_value_cast (struct type *type, value_ptr val, value_ptr *rval) 00572 { 00573 struct gdb_wrapper_arguments args; 00574 gdb_result r; 00575 00576 args.args[0].ptr = type; 00577 args.args[1].ptr = val; 00578 00579 r = call_wrapped_function ((catch_errors_ftype *) wrap_value_cast, &args); 00580 if (r != GDB_OK) 00581 return r; 00582 00583 *rval = (value_ptr) args.result.ptr; 00584 return GDB_OK; 00585 } 00586 00587 static int 00588 wrap_value_cast (char *opaque_arg) 00589 { 00590 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; 00591 value_ptr val; 00592 struct type *type; 00593 00594 type = (struct type *) (*args)->args[0].ptr; 00595 val = (value_ptr) (*args)->args[1].ptr; 00596 (*args)->result.ptr = value_cast (type, val); 00597 00598 return 1; 00599 } 00600 00601 gdb_result 00602 GDB_get_frame_block (struct frame_info *fi, struct block **rval) 00603 { 00604 struct gdb_wrapper_arguments args; 00605 gdb_result r; 00606 00607 args.args[0].ptr = fi; 00608 00609 r = call_wrapped_function ((catch_errors_ftype *) wrap_get_frame_block, &args); 00610 if (r != GDB_OK) 00611 return r; 00612 00613 *rval = (struct block *) args.result.ptr; 00614 return GDB_OK; 00615 } 00616 00617 static int 00618 wrap_get_frame_block (char *opaque_arg) 00619 { 00620 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; 00621 struct frame_info *fi; 00622 00623 fi = (struct frame_info *) (*args)->args[0].ptr; 00624 (*args)->result.ptr = get_frame_block (fi, NULL); 00625 00626 return 1; 00627 } 00628 00629 gdb_result 00630 GDB_get_prev_frame (struct frame_info *fi, struct frame_info **result) 00631 { 00632 struct gdb_wrapper_arguments args; 00633 gdb_result r; 00634 00635 args.args[0].ptr = fi; 00636 r = call_wrapped_function ((catch_errors_ftype *) wrap_get_prev_frame, &args); 00637 if (r != GDB_OK) 00638 return r; 00639 00640 *result = (struct frame_info *) args.result.ptr; 00641 return GDB_OK; 00642 } 00643 00644 static int 00645 wrap_get_prev_frame (char *opaque_arg) 00646 { 00647 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; 00648 struct frame_info *fi = (struct frame_info *) (*args)->args[0].ptr; 00649 00650 (*args)->result.ptr = get_prev_frame (fi); 00651 return 1; 00652 } 00653 00654 gdb_result 00655 GDB_get_next_frame (struct frame_info *fi, struct frame_info **result) 00656 { 00657 struct gdb_wrapper_arguments args; 00658 gdb_result r; 00659 00660 args.args[0].ptr = fi; 00661 r = call_wrapped_function ((catch_errors_ftype *) wrap_get_next_frame, &args); 00662 if (r != GDB_OK) 00663 return r; 00664 00665 *result = (struct frame_info *) args.result.ptr; 00666 return GDB_OK; 00667 } 00668 00669 static int 00670 wrap_get_next_frame (char *opaque_arg) 00671 { 00672 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; 00673 struct frame_info *fi = (struct frame_info *) (*args)->args[0].ptr; 00674 00675 (*args)->result.ptr = get_next_frame (fi); 00676 return 1; 00677 } 00678 00679 gdb_result 00680 GDB_find_relative_frame (struct frame_info *fi, int *start, 00681 struct frame_info **result) 00682 { 00683 struct gdb_wrapper_arguments args; 00684 gdb_result r; 00685 00686 args.args[0].ptr = fi; 00687 args.args[1].ptr = start; 00688 00689 r = call_wrapped_function ((catch_errors_ftype *) wrap_find_relative_frame, 00690 &args); 00691 if (r != GDB_OK) 00692 return r; 00693 00694 *result = (struct frame_info *) args.result.ptr; 00695 return GDB_OK; 00696 } 00697 00698 static int 00699 wrap_find_relative_frame (char *opaque_arg) 00700 { 00701 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; 00702 struct frame_info *fi = (struct frame_info *) (*args)->args[0].ptr; 00703 int *start = (int *) (*args)->args[1].ptr; 00704 00705 (*args)->result.ptr = find_relative_frame (fi, start); 00706 return 1; 00707 } 00708 00709 gdb_result 00710 GDB_get_current_frame (struct frame_info **result) 00711 { 00712 struct gdb_wrapper_arguments args; 00713 gdb_result r; 00714 00715 r = call_wrapped_function ((catch_errors_ftype *) wrap_get_current_frame, 00716 &args); 00717 if (r != GDB_OK) 00718 return r; 00719 00720 *result = (struct frame_info *) args.result.ptr; 00721 return GDB_OK; 00722 } 00723 00724 static int 00725 wrap_get_current_frame (char *opaque_arg) 00726 { 00727 struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; 00728 00729 (*args)->result.ptr = get_current_frame (); 00730 return 1; 00731 } 00732 00733 gdb_result 00734 GDB_varobj_update (struct varobj **varp, int explicit, 00735 VEC (varobj_update_result) **changes) 00736 { 00737 struct gdb_wrapper_arguments args; 00738 gdb_result r; 00739 00740 args.args[0].ptr = varp; 00741 args.args[1].integer = explicit; 00742 00743 r = call_wrapped_function ((catch_errors_ftype *) wrap_varobj_update, &args); 00744 if (r != GDB_OK) 00745 return r; 00746 00747 *changes = args.result.ptr; 00748 return GDB_OK; 00749 } 00750 00751 static int wrap_varobj_update (char *opaque_arg) 00752 { 00753 struct gdb_wrapper_arguments **args 00754 = (struct gdb_wrapper_arguments **) opaque_arg; 00755 struct varobj **varp = (struct varobj **) (*args)->args[0].ptr; 00756 int explicit = (*args)->args[1].integer; 00757 (*args)->result.ptr = varobj_update (varp, explicit); 00758 return 1; 00759 }