gdb/dummy-frame.h - gdb

Data types defined

Macros defined

Source code

  1. /* Code dealing with dummy stack frames, for GDB, the GNU debugger.

  2.    Copyright (C) 2002-2015 Free Software Foundation, Inc.

  3.    This file is part of GDB.

  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 3 of the License, or
  7.    (at your option) any later version.

  8.    This program is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.    GNU General Public License for more details.

  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  14. #if !defined (DUMMY_FRAME_H)
  15. #define DUMMY_FRAME_H 1

  16. #include "frame.h"

  17. struct infcall_suspend_state;
  18. struct frame_unwind;

  19. /* Push the information needed to identify, and unwind from, a dummy
  20.    frame onto the dummy frame stack.  */

  21. /* NOTE: cagney/2004-08-02: In the case of ABIs using push_dummy_code
  22.    containing more than one instruction, this interface many need to
  23.    be expanded so that it knowns the lower/upper extent of the dummy
  24.    frame's code.  */

  25. extern void dummy_frame_push (struct infcall_suspend_state *caller_state,
  26.                               const struct frame_id *dummy_id, ptid_t ptid);

  27. /* Pop the dummy frame DUMMY_ID, restoring program state to that before the
  28.    frame was created.
  29.    On return reinit_frame_cache has been called.
  30.    If the frame isn't found, flag an internal error.

  31.    NOTE: This can only pop the one frame, even if it is in the middle of the
  32.    stack, because the other frames may be for different threads, and there's
  33.    currently no way to tell which stack frame is for which thread.  */

  34. extern void dummy_frame_pop (struct frame_id dummy_id, ptid_t ptid);

  35. extern void dummy_frame_discard (struct frame_id dummy_id, ptid_t ptid);

  36. /* If the PC falls in a dummy frame, return a dummy frame
  37.    unwinder.  */

  38. extern const struct frame_unwind dummy_frame_unwind;

  39. /* Call DTOR with DTOR_DATA when DUMMY_ID frame of thread PTID gets discarded.
  40.    Dummy frame with DUMMY_ID must exist.  There must be no other call of
  41.    register_dummy_frame_dtor for that dummy frame.  */
  42. typedef void (dummy_frame_dtor_ftype) (void *data);
  43. extern void register_dummy_frame_dtor (struct frame_id dummy_id, ptid_t ptid,
  44.                                        dummy_frame_dtor_ftype *dtor,
  45.                                        void *dtor_data);

  46. /* Return 1 if there exists dummy frame with registered DTOR and DTOR_DATA.
  47.    Return 0 otherwise.  */
  48. extern int find_dummy_frame_dtor (dummy_frame_dtor_ftype *dtor,
  49.                                   void *dtor_data);

  50. #endif /* !defined (DUMMY_FRAME_H)  */