166e63ce3Schristos /* Stack manipulation commands, for GDB the GNU Debugger. 266e63ce3Schristos 3*1424dfb3Schristos Copyright (C) 2003-2020 Free Software Foundation, Inc. 466e63ce3Schristos 566e63ce3Schristos This file is part of GDB. 666e63ce3Schristos 766e63ce3Schristos This program is free software; you can redistribute it and/or modify 866e63ce3Schristos it under the terms of the GNU General Public License as published by 966e63ce3Schristos the Free Software Foundation; either version 3 of the License, or 1066e63ce3Schristos (at your option) any later version. 1166e63ce3Schristos 1266e63ce3Schristos This program is distributed in the hope that it will be useful, 1366e63ce3Schristos but WITHOUT ANY WARRANTY; without even the implied warranty of 1466e63ce3Schristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1566e63ce3Schristos GNU General Public License for more details. 1666e63ce3Schristos 1766e63ce3Schristos You should have received a copy of the GNU General Public License 1866e63ce3Schristos along with this program. If not, see <http://www.gnu.org/licenses/>. */ 1966e63ce3Schristos 2066e63ce3Schristos #ifndef STACK_H 2166e63ce3Schristos #define STACK_H 2266e63ce3Schristos 2307163879Schristos /* Access method used by the MI -stack-select-frame command to switch to 2407163879Schristos frame FI. This differs from SELECT_FRAME in that the observers for a 2507163879Schristos user selected context change will be triggered. */ 2666e63ce3Schristos 2707163879Schristos void select_frame_for_mi (struct frame_info *fi); 2807163879Schristos 2907163879Schristos gdb::unique_xmalloc_ptr<char> find_frame_funname (struct frame_info *frame, 3007163879Schristos enum language *funlang, 3107163879Schristos struct symbol **funcp); 3266e63ce3Schristos 3366e63ce3Schristos typedef void (*iterate_over_block_arg_local_vars_cb) (const char *print_name, 3466e63ce3Schristos struct symbol *sym, 3566e63ce3Schristos void *cb_data); 3666e63ce3Schristos 3726a53354Schristos void iterate_over_block_arg_vars (const struct block *block, 3866e63ce3Schristos iterate_over_block_arg_local_vars_cb cb, 3966e63ce3Schristos void *cb_data); 4066e63ce3Schristos 4126a53354Schristos void iterate_over_block_local_vars (const struct block *block, 4266e63ce3Schristos iterate_over_block_arg_local_vars_cb cb, 4366e63ce3Schristos void *cb_data); 4466e63ce3Schristos 45*1424dfb3Schristos /* Initialize *WHAT to be a copy of the user desired print what frame info. 46*1424dfb3Schristos If !WHAT.has_value (), the printing function chooses a default set of 47*1424dfb3Schristos information to print, otherwise the printing function should print 48*1424dfb3Schristos the relevant information. */ 49*1424dfb3Schristos 50*1424dfb3Schristos void get_user_print_what_frame_info (gdb::optional<enum print_what> *what); 51*1424dfb3Schristos 52*1424dfb3Schristos /* Return true if we should display the address in addition to the location, 53*1424dfb3Schristos because we are in the middle of a statement. */ 54*1424dfb3Schristos 55*1424dfb3Schristos bool frame_show_address (struct frame_info *frame, struct symtab_and_line sal); 56*1424dfb3Schristos 57*1424dfb3Schristos /* Forget the last sal we displayed. */ 58*1424dfb3Schristos 5948596154Schristos void clear_last_displayed_sal (void); 60*1424dfb3Schristos 61*1424dfb3Schristos /* Is our record of the last sal we displayed valid? If not, the 62*1424dfb3Schristos get_last_displayed_* functions will return NULL or 0, as appropriate. */ 63*1424dfb3Schristos 64*1424dfb3Schristos bool last_displayed_sal_is_valid (void); 65*1424dfb3Schristos 66*1424dfb3Schristos /* Get the pspace of the last sal we displayed, if it's valid, otherwise 67*1424dfb3Schristos return nullptr. */ 68*1424dfb3Schristos 6948596154Schristos struct program_space* get_last_displayed_pspace (void); 70*1424dfb3Schristos 71*1424dfb3Schristos /* Get the address of the last sal we displayed, if it's valid, otherwise 72*1424dfb3Schristos return an address of 0. */ 73*1424dfb3Schristos 7448596154Schristos CORE_ADDR get_last_displayed_addr (void); 75*1424dfb3Schristos 76*1424dfb3Schristos /* Get the symtab of the last sal we displayed, if it's valid, otherwise 77*1424dfb3Schristos return nullptr. */ 78*1424dfb3Schristos 7948596154Schristos struct symtab* get_last_displayed_symtab (void); 80*1424dfb3Schristos 81*1424dfb3Schristos /* Get the line of the last sal we displayed, if it's valid, otherwise 82*1424dfb3Schristos return 0. */ 83*1424dfb3Schristos 8448596154Schristos int get_last_displayed_line (void); 85*1424dfb3Schristos 86*1424dfb3Schristos /* Get the last sal we displayed, if it's valid, otherwise return a 87*1424dfb3Schristos symtab_and_line constructed in its default state. */ 88*1424dfb3Schristos 8907163879Schristos symtab_and_line get_last_displayed_sal (); 9048596154Schristos 91*1424dfb3Schristos /* Completer for the "frame apply all" command. */ 92*1424dfb3Schristos void frame_apply_all_cmd_completer (struct cmd_list_element *ignore, 93*1424dfb3Schristos completion_tracker &tracker, 94*1424dfb3Schristos const char *text, const char */*word*/); 95*1424dfb3Schristos 9666e63ce3Schristos #endif /* #ifndef STACK_H */ 97