Make gdb_stdout&co be per UI
[deliverable/binutils-gdb.git] / gdb / top.c
index cae90d659784ab3d525e6fb59e35efec045c5cc1..a34635b8b508aaa0e8c635bf54eddb0797b91143 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -86,6 +86,21 @@ extern void initialize_all_files (void);
 #define DEFAULT_PROMPT "(gdb) "
 #endif
 
+/* Generate a function that exports a pointer to a field of the
+   current UI.  */
+
+#define gen_ret_current_ui_field_ptr(type, name)       \
+type *                                                 \
+current_ui_## name ## _ptr (void)                      \
+{                                                      \
+  return &current_ui->m_ ## name;              \
+}
+
+gen_ret_current_ui_field_ptr (struct ui_file *, gdb_stdout)
+gen_ret_current_ui_field_ptr (struct ui_file *, gdb_stdin)
+gen_ret_current_ui_field_ptr (struct ui_file *, gdb_stderr)
+gen_ret_current_ui_field_ptr (struct ui_file *, gdb_stdlog)
+
 /* Initialization file name for gdb.  This is host-dependent.  */
 
 const char gdbinit[] = GDBINIT;
This page took 0.026262 seconds and 4 git commands to generate.