GDB (xrefs)

Macros | Functions
scm-utils.c File Reference
`#include "defs.h"`
`#include "guile-internal.h"`

Go to the source code of this file.

## Macros
#define | CHECK_TYPE(ok, arg, position, func_name, expected_type)

## Functions
void | gdbscm_define_variables (const scheme_variable *variables, int is_public)
void | gdbscm_define_functions (const scheme_function *functions, int is_public)
void | gdbscm_define_integer_constants (const scheme_integer_constant *constants, int is_public)
void | gdbscm_printf (SCM port, const char *format,...)
void | gdbscm_debug_display (SCM obj)
void | gdbscm_debug_write (SCM obj)
static int | count_keywords (const SCM *keywords)
static int | validate_arg_format (const char *format)
static SCM | extract_arg (char format_char, SCM arg, void *argp, const char *func_name, int position)
static int | lookup_keyword (const SCM *keyword_list, SCM keyword)
void | gdbscm_parse_function_args (const char *func_name, int beginning_arg_pos, const SCM *keywords, const char *format,...)
SCM | gdbscm_scm_from_longest (LONGEST l)
LONGEST | gdbscm_scm_to_longest (SCM l)
SCM | gdbscm_scm_from_ulongest (ULONGEST l)
ULONGEST | gdbscm_scm_to_ulongest (SCM u)
void | gdbscm_dynwind_xfree (void *ptr)
int | gdbscm_is_procedure (SCM proc)
char * | gdbscm_gc_xstrdup (const char *str)
const char *const * | gdbscm_gc_dup_argv (char **argv)
int | gdbscm_guile_version_is_at_least (int major, int minor, int micro)

## Macro Definition Documentation

## ◆ CHECK_TYPE

#define CHECK_TYPE | ( |  | ok,
|  |  | arg,
|  |  | position,
|  |  | func_name,
|  |  | expected_type
| ) |  |

Value:
do { \
if (!(ok)) \
{ \
return gdbscm_make_type_error ((func_name), (position), (arg), \
(expected_type)); \
} \
} while (0)
gdbscm_make_type_error
SCM gdbscm_make_type_error(const char *subr, int arg_pos, SCM bad_value, const char *expected_type)
Definition: scm-exception.c:234

Definition at line 182 of file scm-utils.c.

Referenced by extract_arg().

## Function Documentation

## ◆ count_keywords()

static int count_keywords | ( | const SCM * | keywords | ) |
| static

Definition at line 119 of file scm-utils.c.

Referenced by gdbscm_parse_function_args().

## ◆ extract_arg()

static SCM extract_arg | ( | char | format_char,
|  | SCM | arg,
|  | void * | argp,
|  | const char * | func_name,
|  | int | position
| ) |  |
| static

Definition at line 197 of file scm-utils.c.

References _, CHECK_TYPE, gdb_assert_not_reached, gdbscm_is_bool, gdbscm_is_true, gdbscm_scm_to_c_string(), gdbscm_scm_to_longest(), gdbscm_scm_to_ulongest(), INT_MAX, INT_MIN, LONG_MAX, UINT_MAX, and ULONG_MAX.

Referenced by gdbscm_parse_function_args().

## ◆ gdbscm_debug_display()

void gdbscm_debug_display | ( | SCM | obj | ) |

Definition at line 94 of file scm-utils.c.

## ◆ gdbscm_debug_write()

void gdbscm_debug_write | ( | SCM | obj | ) |

Definition at line 106 of file scm-utils.c.

## ◆ gdbscm_define_functions()

void gdbscm_define_functions | ( | const scheme_function * | functions,
|  | int | is_public
| ) |  |

Definition at line 44 of file scm-utils.c.

References scheme_function::doc_string, scheme_function::func, gdbscm_documentation_symbol, gdbscm_scm_from_c_string(), scheme_function::name, scheme_function::optional, scheme_function::required, and scheme_function::rest.

Referenced by gdbscm_initialize_arches(), gdbscm_initialize_blocks(), gdbscm_initialize_breakpoints(), gdbscm_initialize_commands(), gdbscm_initialize_disasm(), gdbscm_initialize_exceptions(), gdbscm_initialize_frames(), gdbscm_initialize_iterators(), gdbscm_initialize_lazy_strings(), gdbscm_initialize_math(), gdbscm_initialize_objfiles(), gdbscm_initialize_parameters(), gdbscm_initialize_ports(), gdbscm_initialize_pretty_printers(), gdbscm_initialize_pspaces(), gdbscm_initialize_smobs(), gdbscm_initialize_strings(), gdbscm_initialize_symbols(), gdbscm_initialize_symtabs(), gdbscm_initialize_types(), and gdbscm_initialize_values().

## ◆ gdbscm_define_integer_constants()

void gdbscm_define_integer_constants | ( | const scheme_integer_constant * | constants,
|  | int | is_public
| ) |  |

Definition at line 63 of file scm-utils.c.

References scheme_integer_constant::name, and scheme_integer_constant::value.

Referenced by gdbscm_initialize_breakpoints(), gdbscm_initialize_commands(), gdbscm_initialize_frames(), gdbscm_initialize_parameters(), gdbscm_initialize_symbols(), and gdbscm_initialize_types().

## ◆ gdbscm_define_variables()

void gdbscm_define_variables | ( | const scheme_variable * | variables,
|  | int | is_public
| ) |  |

Definition at line 29 of file scm-utils.c.

References scheme_variable::name, and scheme_variable::value.

## ◆ gdbscm_dynwind_xfree()

void gdbscm_dynwind_xfree | ( | void * | ptr | ) |

Definition at line 571 of file scm-utils.c.

References xfree().

Referenced by gdbscm_parse_command_name(), gdbscm_set_breakpoint_stop_x(), and gdbscm_value_to_string().

## ◆ gdbscm_gc_dup_argv()

const char* const* gdbscm_gc_dup_argv | ( | char ** | argv | ) |

Definition at line 600 of file scm-utils.c.

References gdb::argv.

Referenced by compute_enum_list().

## ◆ gdbscm_gc_xstrdup()

char* gdbscm_gc_xstrdup | ( | const char * | str | ) |

Definition at line 587 of file scm-utils.c.

Referenced by gdbscm_make_breakpoint(), gdbscm_make_command(), gdbscm_make_parameter(), gdbscm_register_command_x(), and gdbscm_register_parameter_x().

## ◆ gdbscm_guile_version_is_at_least()

int gdbscm_guile_version_is_at_least | ( | int | major,
|  | int | minor,
|  | int | micro
| ) |  |

Definition at line 631 of file scm-utils.c.

References gdbscm_guile_major_version, gdbscm_guile_micro_version, and gdbscm_guile_minor_version.

Referenced by gdbscm_value_to_string().

## ◆ gdbscm_is_procedure()

int gdbscm_is_procedure | ( | SCM | proc | ) |

Definition at line 579 of file scm-utils.c.

References gdbscm_is_true.

Referenced by cmdscm_completer(), gdbscm_breakpoint_cond_says_stop(), gdbscm_breakpoint_has_cond(), gdbscm_make_command(), gdbscm_make_iterator(), gdbscm_make_parameter(), gdbscm_make_pretty_printer(), gdbscm_register_parameter_x(), gdbscm_set_breakpoint_stop_x(), pascm_set_func(), pascm_show_func(), ppscm_print_children(), and ppscm_search_pp_list().

## ◆ gdbscm_parse_function_args()

void gdbscm_parse_function_args | ( | const char * | func_name,
|  | int | beginning_arg_pos,
|  | const SCM * | keywords,
|  | const char * | format,
|  |  | ...
| ) |  |

Definition at line 377 of file scm-utils.c.

References _, count_keywords(), extract_arg(), gdb_assert, gdbscm_is_false, gdbscm_make_error(), gdbscm_throw(), lookup_keyword(), status, validate_arg_format(), VEC, VEC_free, VEC_iterate, VEC_safe_push, and xfree().

Referenced by gdbscm_arch_disassemble(), gdbscm_find_pc_line(), gdbscm_frame_read_register(), gdbscm_frame_read_var(), gdbscm_history_ref(), gdbscm_lookup_block(), gdbscm_lookup_global_symbol(), gdbscm_lookup_symbol(), gdbscm_lookup_type(), gdbscm_make_breakpoint(), gdbscm_make_command(), gdbscm_make_lazy_value(), gdbscm_make_parameter(), gdbscm_make_value(), gdbscm_open_memory(), gdbscm_parse_and_eval(), gdbscm_string_to_argv(), gdbscm_symbol_value(), gdbscm_unwind_stop_reason_string(), gdbscm_value_to_lazy_string(), gdbscm_value_to_string(), and tyscm_array_1().

## ◆ gdbscm_printf()

void gdbscm_printf | ( | SCM | port,
|  | const char * | format,
|  |  | ...
| ) |  |

Definition at line 79 of file scm-utils.c.

References string, xfree(), and xstrvprintf().

## ◆ gdbscm_scm_from_longest()

SCM gdbscm_scm_from_longest | ( | LONGEST | l | ) |

Definition at line 533 of file scm-utils.c.

Referenced by gdbscm_memory_port_seek(), gdbscm_type_range(), and gdbscm_value_to_integer().

## ◆ gdbscm_scm_from_ulongest()

SCM gdbscm_scm_from_ulongest | ( | ULONGEST | l | ) |

Definition at line 552 of file scm-utils.c.

Referenced by dascm_make_insn(), gdbscm_arch_disassemble(), gdbscm_block_end(), gdbscm_block_start(), gdbscm_disasm_read_memory_worker(), gdbscm_frame_pc(), gdbscm_lazy_string_address(), gdbscm_memory_port_flush(), gdbscm_memory_port_range(), gdbscm_memory_port_write(), gdbscm_open_memory(), gdbscm_sal_last(), gdbscm_sal_pc(), and gdbscm_value_to_integer().

## ◆ gdbscm_scm_to_longest()

LONGEST gdbscm_scm_to_longest | ( | SCM | l | ) |

Definition at line 544 of file scm-utils.c.

Referenced by extract_arg(), vlscm_convert_number(), and vlscm_convert_typed_number().

## ◆ gdbscm_scm_to_ulongest()

ULONGEST gdbscm_scm_to_ulongest | ( | SCM | u | ) |

Definition at line 563 of file scm-utils.c.

Referenced by extract_arg(), vlscm_convert_number(), and vlscm_convert_typed_number().

## ◆ lookup_keyword()

static int lookup_keyword | ( | const SCM * | keyword_list,
|  | SCM | keyword
| ) |  |
| static

Definition at line 295 of file scm-utils.c.

Referenced by gdbscm_parse_function_args().

## ◆ validate_arg_format()

static int validate_arg_format | ( | const char * | format | ) |
| static

Definition at line 136 of file scm-utils.c.

References gdb_assert, gdb_assert_not_reached, and type::length.

Referenced by gdbscm_parse_function_args().