gdb/target/target.h - gdb

Macros defined

Source code

  1. /* Declarations for common target functions.

  2.    Copyright (C) 1986-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. #ifndef TARGET_COMMON_H
  15. #define TARGET_COMMON_H

  16. #include "target/waitstatus.h"
  17. #include <stdint.h>

  18. /* This header is a stopgap until more code is shared.  */

  19. /* Read LEN bytes of target memory at address MEMADDR, placing the
  20.    results in GDB's memory at MYADDR.  Return zero for success,
  21.    nonzero if any error occurs.  This function must be provided by
  22.    the client.  Implementations of this function may define and use
  23.    their own error codes, but functions in the common, nat and target
  24.    directories must treat the return code as opaque.  No guarantee is
  25.    made about the contents of the data at MYADDR if any error
  26.    occurs.  */

  27. extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
  28.                                ssize_t len);

  29. /* Read an unsigned 32-bit integer in the target's format from target
  30.    memory at address MEMADDR, storing the result in GDB's format in
  31.    GDB's memory at RESULT.  Return zero for success, nonzero if any
  32.    error occurs.  This function must be provided by the client.
  33.    Implementations of this function may define and use their own error
  34.    codes, but functions in the common, nat and target directories must
  35.    treat the return code as opaque.  No guarantee is made about the
  36.    contents of the data at RESULT if any error occurs.  */

  37. extern int target_read_uint32 (CORE_ADDR memaddr, uint32_t *result);

  38. /* Write LEN bytes from MYADDR to target memory at address MEMADDR.
  39.    Return zero for success, nonzero if any error occurs.  This
  40.    function must be provided by the client.  Implementations of this
  41.    function may define and use their own error codes, but functions
  42.    in the common, nat and target directories must treat the return
  43.    code as opaque.  No guarantee is made about the contents of the
  44.    data at MEMADDR if any error occurs.  */

  45. extern int target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr,
  46.                                 ssize_t len);

  47. /* Cause the target to stop in a continuable fashion--for instance,
  48.    under Unix, this should act like SIGSTOP--and wait for the target
  49.    to be stopped before returning.  This function must be provided by
  50.    the client.  */

  51. extern void target_stop_and_wait (ptid_t ptid);

  52. /* Restart a target previously stopped by target_stop_and_wait.
  53.    No signal is delivered to the target.  This function must be
  54.    provided by the client.  */

  55. extern void target_continue_no_signal (ptid_t ptid);

  56. #endif /* TARGET_COMMON_H */