GDB (xrefs)
Classes | Functions | Variables
/home/stan/gdb/src/gdb/ui-file.c File Reference
#include "defs.h"
#include "ui-file.h"
#include "gdb_obstack.h"
#include "gdb_string.h"
#include "gdb_select.h"
#include "filestuff.h"
#include <errno.h>

Go to the source code of this file.

Classes

struct  ui_file
struct  accumulated_ui_file
struct  mem_file
struct  stdio_file
struct  tee_file

Functions

struct ui_fileui_file_new (void)
void ui_file_delete (struct ui_file *file)
static int null_file_isatty (struct ui_file *file)
static void null_file_rewind (struct ui_file *file)
static void null_file_put (struct ui_file *file, ui_file_put_method_ftype *write, void *dest)
static void null_file_flush (struct ui_file *file)
static void null_file_write (struct ui_file *file, const char *buf, long sizeof_buf)
static long null_file_read (struct ui_file *file, char *buf, long sizeof_buf)
static void null_file_fputs (const char *buf, struct ui_file *file)
static void null_file_write_async_safe (struct ui_file *file, const char *buf, long sizeof_buf)
static void null_file_delete (struct ui_file *file)
static int null_file_fseek (struct ui_file *stream, long offset, int whence)
void * ui_file_data (struct ui_file *file)
void gdb_flush (struct ui_file *file)
int ui_file_isatty (struct ui_file *file)
void ui_file_rewind (struct ui_file *file)
void ui_file_put (struct ui_file *file, ui_file_put_method_ftype *write, void *dest)
void ui_file_write (struct ui_file *file, const char *buf, long length_buf)
void ui_file_write_async_safe (struct ui_file *file, const char *buf, long length_buf)
long ui_file_read (struct ui_file *file, char *buf, long length_buf)
int ui_file_fseek (struct ui_file *file, long offset, int whence)
void fputs_unfiltered (const char *buf, struct ui_file *file)
void set_ui_file_flush (struct ui_file *file, ui_file_flush_ftype *flush_ptr)
void set_ui_file_isatty (struct ui_file *file, ui_file_isatty_ftype *isatty_ptr)
void set_ui_file_rewind (struct ui_file *file, ui_file_rewind_ftype *rewind_ptr)
void set_ui_file_put (struct ui_file *file, ui_file_put_ftype *put_ptr)
void set_ui_file_write (struct ui_file *file, ui_file_write_ftype *write_ptr)
void set_ui_file_write_async_safe (struct ui_file *file, ui_file_write_async_safe_ftype *write_async_safe_ptr)
void set_ui_file_read (struct ui_file *file, ui_file_read_ftype *read_ptr)
void set_ui_file_fputs (struct ui_file *file, ui_file_fputs_ftype *fputs_ptr)
void set_ui_file_fseek (struct ui_file *file, ui_file_fseek_ftype *fseek_ptr)
void set_ui_file_data (struct ui_file *file, void *data, ui_file_delete_ftype *delete_ptr)
static void do_ui_file_xstrdup (void *context, const char *buffer, long length)
char * ui_file_xstrdup (struct ui_file *file, long *length)
static void do_ui_file_obsavestring (void *context, const char *buffer, long length)
char * ui_file_obsavestring (struct ui_file *file, struct obstack *obstack, long *length)
static struct ui_filemem_file_new (void)
static void mem_file_delete (struct ui_file *file)
struct ui_filemem_fileopen (void)
static void mem_file_rewind (struct ui_file *file)
static void mem_file_put (struct ui_file *file, ui_file_put_method_ftype *write, void *dest)
void mem_file_write (struct ui_file *file, const char *buffer, long length_buffer)
static struct ui_filestdio_file_new (FILE *file, int close_p)
static void stdio_file_delete (struct ui_file *file)
static void stdio_file_flush (struct ui_file *file)
static long stdio_file_read (struct ui_file *file, char *buf, long length_buf)
static void stdio_file_write (struct ui_file *file, const char *buf, long length_buf)
static void stdio_file_write_async_safe (struct ui_file *file, const char *buf, long length_buf)
static void stdio_file_fputs (const char *linebuffer, struct ui_file *file)
static int stdio_file_isatty (struct ui_file *file)
static int stdio_file_fseek (struct ui_file *file, long offset, int whence)
struct ui_filestderr_fileopen (void)
struct ui_filestdio_fileopen (FILE *file)
struct ui_filegdb_fopen (const char *name, const char *mode)
struct ui_filetee_file_new (struct ui_file *one, int close_one, struct ui_file *two, int close_two)
static void tee_file_delete (struct ui_file *file)
static void tee_file_flush (struct ui_file *file)
static void tee_file_write (struct ui_file *file, const char *buf, long length_buf)
static void tee_file_fputs (const char *linebuffer, struct ui_file *file)
static int tee_file_isatty (struct ui_file *file)

Variables

static ui_file_isatty_ftype null_file_isatty
static ui_file_write_ftype null_file_write
static ui_file_write_ftype null_file_write_async_safe
static ui_file_fputs_ftype null_file_fputs
static ui_file_read_ftype null_file_read
static ui_file_flush_ftype null_file_flush
static ui_file_delete_ftype null_file_delete
static ui_file_rewind_ftype null_file_rewind
static ui_file_put_ftype null_file_put
static ui_file_fseek_ftype null_file_fseek
int ui_file_magic
static ui_file_rewind_ftype mem_file_rewind
static ui_file_put_ftype mem_file_put
static ui_file_write_ftype mem_file_write
static ui_file_delete_ftype mem_file_delete
static int mem_file_magic
static ui_file_write_ftype stdio_file_write
static
ui_file_write_async_safe_ftype 
stdio_file_write_async_safe
static ui_file_fputs_ftype stdio_file_fputs
static ui_file_read_ftype stdio_file_read
static ui_file_isatty_ftype stdio_file_isatty
static ui_file_delete_ftype stdio_file_delete
static ui_file_flush_ftype stdio_file_flush
static ui_file_fseek_ftype stdio_file_fseek
static int stdio_file_magic
static ui_file_write_ftype tee_file_write
static ui_file_fputs_ftype tee_file_fputs
static ui_file_isatty_ftype tee_file_isatty
static ui_file_delete_ftype tee_file_delete
static ui_file_flush_ftype tee_file_flush
static int tee_file_magic

Function Documentation

static void do_ui_file_obsavestring ( void *  context,
const char *  buffer,
long  length 
) [static]

Definition at line 357 of file ui-file.c.

Referenced by ui_file_obsavestring().

static void do_ui_file_xstrdup ( void *  context,
const char *  buffer,
long  length 
) [static]
void fputs_unfiltered ( const char *  ,
struct ui_file  
)
void gdb_flush ( struct ui_file file)

Definition at line 195 of file ui-file.c.

References ui_file::to_flush.

Referenced by ada_lookup_struct_elt_type(), ada_print_scalar(), ada_val_print_1(), ATTRIBUTE_PRINTF(), c_val_print(), captured_main(), cli_flush(), command_line_handler(), command_line_input(), darwin_attach(), darwin_detach(), dbx_psymtab_to_symtab_1(), dbx_read_symtab(), display_gdb_prompt(), display_info(), do_examine(), do_one_display(), dwarf2_read_symtab(), echo_command(), extended_remote_attach_1(), f_val_print(), follow_exec(), fork_inferior(), gdb_disassembly(), gdb_os_flush_stderr(), gdb_os_flush_stdout(), gdb_readline(), gdb_wait_for_event(), gdbtk_call_wrapper(), gdbtk_load_asm(), generic_val_print(), gnu_attach(), gnu_detach(), handle_command(), handle_inferior_event(), inf_ptrace_attach(), inf_ptrace_detach(), load_srec(), m2_val_print(), m32r_load(), m32r_load_section(), m32r_upload_command(), mdebug_build_psymtabs(), mdebug_read_symtab(), mem_info_command(), mi_breakpoint_created(), mi_breakpoint_deleted(), mi_breakpoint_modified(), mi_cmd_gdb_exit(), mi_command_loop(), mi_command_param_changed(), mi_console_file_fputs(), mi_console_raw_packet(), mi_execute_command(), mi_execute_command_input_handler(), mi_flush(), mi_inferior_added(), mi_inferior_appeared(), mi_inferior_exit(), mi_inferior_removed(), mi_load_progress(), mi_memory_changed(), mi_new_thread(), mi_on_normal_stop(), mi_on_resume(), mi_record_changed(), mi_solib_loaded(), mi_solib_unloaded(), mi_thread_exit(), mi_traceframe_changed(), mi_tsv_created(), mi_tsv_deleted(), mi_tsv_modified(), mips_error(), mips_receive_header(), mips_xfer_memory(), output_command_const(), pascal_val_print(), print_any_exception(), print_disassembly(), print_flush(), print_frame_info(), print_sys_errmsg(), print_type_scalar(), proceed(), procfs_attach(), procfs_detach(), procfs_set_exec_trap(), psymtab_to_symtab_1(), putpkt_binary(), read_command_lines(), remote_console_output(), remote_detach_1(), remote_fileio_func_write(), report_initial_inferior(), require_partial_symbols(), safe_symbol_file_add(), safe_symbol_file_add_cleanup(), serial_log_command(), serial_readchar(), serial_write(), shell_escape(), symbol_file_add_with_addrs(), unwind_command(), val_print(), val_print_string(), vwarning(), windows_attach(), windows_detach(), xcoff_psymtab_to_symtab_1(), and xcoff_read_symtab().

struct ui_file* gdb_fopen ( const char *  name,
const char *  mode 
) [read]
static void mem_file_delete ( struct ui_file file) [static]
static struct ui_file * mem_file_new ( void  ) [static, read]
static void mem_file_put ( struct ui_file file,
ui_file_put_method_ftype write,
void *  dest 
) [static]
static void mem_file_rewind ( struct ui_file file) [static]
void mem_file_write ( struct ui_file file,
const char *  buffer,
long  length_buffer 
)
struct ui_file* mem_fileopen ( void  ) [read]
static void null_file_delete ( struct ui_file file) [static]

Definition at line 172 of file ui-file.c.

static void null_file_flush ( struct ui_file file) [static]

Definition at line 106 of file ui-file.c.

static void null_file_fputs ( const char *  buf,
struct ui_file file 
) [static]

Definition at line 150 of file ui-file.c.

References null_file_write, and ui_file::to_write.

static int null_file_fseek ( struct ui_file stream,
long  offset,
int  whence 
) [static]

Definition at line 178 of file ui-file.c.

static int null_file_isatty ( struct ui_file file) [static]

Definition at line 86 of file ui-file.c.

static void null_file_put ( struct ui_file file,
ui_file_put_method_ftype write,
void *  dest 
) [static]

Definition at line 98 of file ui-file.c.

static long null_file_read ( struct ui_file file,
char *  buf,
long  sizeof_buf 
) [static]

Definition at line 141 of file ui-file.c.

static void null_file_rewind ( struct ui_file file) [static]

Definition at line 92 of file ui-file.c.

static void null_file_write ( struct ui_file file,
const char *  buf,
long  sizeof_buf 
) [static]

Definition at line 112 of file ui-file.c.

References null_file_fputs, and ui_file::to_fputs.

static void null_file_write_async_safe ( struct ui_file file,
const char *  buf,
long  sizeof_buf 
) [static]

Definition at line 164 of file ui-file.c.

void set_ui_file_data ( struct ui_file file,
void *  data,
ui_file_delete_ftype delete_ptr 
)
void set_ui_file_flush ( struct ui_file file,
ui_file_flush_ftype flush_ptr 
)

Definition at line 255 of file ui-file.c.

References ui_file::to_flush.

Referenced by mi_console_file_new(), stdio_file_new(), tee_file_new(), tui_file_new(), and ui_file_new().

void set_ui_file_fputs ( struct ui_file file,
ui_file_fputs_ftype fputs_ptr 
)
void set_ui_file_fseek ( struct ui_file file,
ui_file_fseek_ftype fseek_ptr 
)

Definition at line 305 of file ui-file.c.

References ui_file::to_fseek.

Referenced by stdio_file_new(), and ui_file_new().

void set_ui_file_isatty ( struct ui_file file,
ui_file_isatty_ftype isatty_ptr 
)

Definition at line 261 of file ui-file.c.

References ui_file::to_isatty.

Referenced by stdio_file_new(), tee_file_new(), tui_file_new(), and ui_file_new().

void set_ui_file_put ( struct ui_file file,
ui_file_put_ftype put_ptr 
)

Definition at line 273 of file ui-file.c.

References ui_file::to_put.

Referenced by mem_file_new(), tui_file_new(), and ui_file_new().

void set_ui_file_read ( struct ui_file file,
ui_file_read_ftype read_ptr 
)

Definition at line 293 of file ui-file.c.

References ui_file::to_read.

Referenced by gdbtk_fileopenin(), stdio_file_new(), and ui_file_new().

void set_ui_file_rewind ( struct ui_file file,
ui_file_rewind_ftype rewind_ptr 
)

Definition at line 267 of file ui-file.c.

References ui_file::to_rewind.

Referenced by mem_file_new(), tui_file_new(), and ui_file_new().

void set_ui_file_write ( struct ui_file file,
ui_file_write_ftype write_ptr 
)

Definition at line 279 of file ui-file.c.

References ui_file::to_write.

Referenced by mem_file_new(), stderr_fileopen(), stdio_file_new(), tee_file_new(), and ui_file_new().

void set_ui_file_write_async_safe ( struct ui_file file,
ui_file_write_async_safe_ftype write_async_safe_ptr 
)

Definition at line 286 of file ui-file.c.

References ui_file::to_write_async_safe.

Referenced by stdio_file_new(), and ui_file_new().

struct ui_file* stderr_fileopen ( void  ) [read]

Definition at line 680 of file ui-file.c.

References set_ui_file_fputs(), set_ui_file_write(), and stdio_fileopen().

Referenced by captured_main(), and gdb_setup_readline().

static void stdio_file_delete ( struct ui_file file) [static]
static void stdio_file_flush ( struct ui_file file) [static]
static void stdio_file_fputs ( const char *  linebuffer,
struct ui_file file 
) [static]
static int stdio_file_fseek ( struct ui_file file,
long  offset,
int  whence 
) [static]
static int stdio_file_isatty ( struct ui_file file) [static]
static struct ui_file * stdio_file_new ( FILE *  file,
int  close_p 
) [static, read]
static long stdio_file_read ( struct ui_file file,
char *  buf,
long  length_buf 
) [static]
static void stdio_file_write ( struct ui_file file,
const char *  buf,
long  length_buf 
) [static]
static void stdio_file_write_async_safe ( struct ui_file file,
const char *  buf,
long  length_buf 
) [static]

Definition at line 596 of file ui-file.c.

References stdio_file::fd, stdio_file::magic, stdio_file_magic, and ui_file_data().

struct ui_file* stdio_fileopen ( FILE *  file) [read]

Definition at line 714 of file ui-file.c.

References stdio_file_new().

Referenced by captured_main(), gdb_setup_readline(), and stderr_fileopen().

static void tee_file_delete ( struct ui_file file) [static]
static void tee_file_flush ( struct ui_file file) [static]
static void tee_file_fputs ( const char *  linebuffer,
struct ui_file file 
) [static]
static int tee_file_isatty ( struct ui_file file) [static]
struct ui_file* tee_file_new ( struct ui_file one,
int  close_one,
struct ui_file two,
int  close_two 
) [read]
static void tee_file_write ( struct ui_file file,
const char *  buf,
long  length_buf 
) [static]
void* ui_file_data ( struct ui_file file)
void ui_file_delete ( struct ui_file file)
int ui_file_fseek ( struct ui_file file,
long  offset,
int  whence 
)

Definition at line 243 of file ui-file.c.

References ui_file::to_fseek.

int ui_file_isatty ( struct ui_file file)

Definition at line 201 of file ui-file.c.

References ui_file::to_isatty.

Referenced by init_page_info(), tee_file_isatty(), tui_allowed_p(), and tui_init().

struct ui_file* ui_file_new ( void  ) [read]
char* ui_file_obsavestring ( struct ui_file file,
struct obstack *  obstack,
long *  length 
)
void ui_file_put ( struct ui_file file,
ui_file_put_method_ftype write,
void *  dest 
)
long ui_file_read ( struct ui_file file,
char *  buf,
long  length_buf 
)

Definition at line 237 of file ui-file.c.

References ui_file::to_read.

Referenced by remote_fileio_func_read().

void ui_file_rewind ( struct ui_file file)
void ui_file_write ( struct ui_file file,
const char *  buf,
long  length_buf 
)
void ui_file_write_async_safe ( struct ui_file file,
const char *  buf,
long  length_buf 
)

Definition at line 229 of file ui-file.c.

References ui_file::to_write_async_safe.

Referenced by sigchld_handler().

char* ui_file_xstrdup ( struct ui_file file,
long *  length 
)

Variable Documentation

Definition at line 389 of file ui-file.c.

Referenced by mem_file_new().

int mem_file_magic [static]

Definition at line 387 of file ui-file.c.

Referenced by mem_file_new().

Definition at line 386 of file ui-file.c.

Referenced by mem_file_new().

Definition at line 388 of file ui-file.c.

Referenced by mem_file_new().

Definition at line 37 of file ui-file.c.

Referenced by ui_file_new().

Definition at line 36 of file ui-file.c.

Referenced by ui_file_new().

Definition at line 34 of file ui-file.c.

Referenced by null_file_write(), and ui_file_new().

Definition at line 40 of file ui-file.c.

Referenced by ui_file_new().

Definition at line 31 of file ui-file.c.

Referenced by ui_file_new().

Definition at line 39 of file ui-file.c.

Referenced by ui_file_new().

Definition at line 35 of file ui-file.c.

Referenced by ui_file_new().

Definition at line 38 of file ui-file.c.

Referenced by ui_file_new().

Definition at line 32 of file ui-file.c.

Referenced by null_file_fputs(), and ui_file_new().

Definition at line 33 of file ui-file.c.

Referenced by ui_file_new().

Definition at line 493 of file ui-file.c.

Referenced by stdio_file_new().

Definition at line 495 of file ui-file.c.

Referenced by stdio_file_new().

Definition at line 490 of file ui-file.c.

Referenced by stdio_file_new().

Definition at line 496 of file ui-file.c.

Referenced by stdio_file_new().

Definition at line 492 of file ui-file.c.

Referenced by stdio_file_new().

Definition at line 491 of file ui-file.c.

Referenced by stdio_file_new().

Definition at line 488 of file ui-file.c.

Referenced by stdio_file_new().

Definition at line 489 of file ui-file.c.

Referenced by stdio_file_new().

Definition at line 734 of file ui-file.c.

Referenced by tee_file_new().

Definition at line 735 of file ui-file.c.

Referenced by tee_file_new().

Definition at line 732 of file ui-file.c.

Referenced by tee_file_new().

Definition at line 733 of file ui-file.c.

Referenced by tee_file_new().

int tee_file_magic [static]

Definition at line 731 of file ui-file.c.

Referenced by tee_file_new().

Definition at line 57 of file ui-file.c.

Referenced by ui_file_data(), and ui_file_new().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines