gdb/common/print-utils.h - gdb

Macros defined

Source code

  1. /* Cell-based print utility routines for GDB, the GNU debugger.

  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 COMMON_CELLS_H
  15. #define COMMON_CELLS_H

  16. /* %d for LONGEST.  The result is stored in a circular static buffer,
  17.    NUMCELLS deep.  */

  18. extern char *pulongest (ULONGEST u);

  19. /* %u for ULONGEST.  The result is stored in a circular static buffer,
  20.    NUMCELLS deep.  */

  21. extern char *plongest (LONGEST l);

  22. extern char *phex (ULONGEST l, int sizeof_l);

  23. /* Convert a ULONGEST into a HEX string, like %lx.  The result is
  24.    stored in a circular static buffer, NUMCELLS deep.  */

  25. extern char *phex_nz (ULONGEST l, int sizeof_l);

  26. /* Converts a LONGEST to a C-format hexadecimal literal and stores it
  27.    in a static string.  Returns a pointer to this string.  */

  28. extern char *hex_string (LONGEST num);

  29. /* Converts a LONGEST number to a C-format hexadecimal literal and
  30.    stores it in a static string.  Returns a pointer to this string
  31.    that is valid until the next call.  The number is padded on the
  32.    left with 0s to at least WIDTH characters.  */

  33. extern char *hex_string_custom (LONGEST num, int width);

  34. /* Convert VAL to a numeral in the given radix.  For
  35. * radix 10, IS_SIGNED may be true, indicating a signed quantity;
  36. * otherwise VAL is interpreted as unsigned.  If WIDTH is supplied,
  37. * it is the minimum width (0-padded if needed).  USE_C_FORMAT means
  38. * to use C format in all cases.  If it is false, then 'x'
  39. * and 'o' formats do not include a prefix (0x or leading 0).  */

  40. extern char *int_string (LONGEST val, int radix, int is_signed, int width,
  41.                          int use_c_format);

  42. /* Convert a CORE_ADDR into a string.  */

  43. extern const char *core_addr_to_string (const CORE_ADDR addr);

  44. extern const char *core_addr_to_string_nz (const CORE_ADDR addr);

  45. extern const char *host_address_to_string (const void *addr);

  46. #endif /* COMMON_CELLS_H */