This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[rfc] Add uiout param to libgdb functions


Hello,

The attached adds a UIOUT param to the libgdb function calls.  Any
thoughts, it is really pretty straight forward.

	Andrew


2001-09-07  Andrew Cagney  <ac131313@redhat.com>

	* thread.c (do_captured_thread_select): Add uiout parameter.
	(do_captured_list_thread_ids): Ditto.
	* breakpoint.c (do_captured_breakpoint_query): Ditto.

	* breakpoint.c (gdb_breakpoint_query): Update.  Use
	catch_exceptions.
	* thread.c (gdb_list_thread_ids): Ditto.
	(gdb_thread_select): Ditto.
	(thread_command): Pass uiout to gdb_thread_select.

	* gdb.h (gdb_breakpoint_query): Add parameter ui_out.
	(gdb_thread_select, gdb_list_thread_ids): Ditto.

Index: mi/ChangeLog
2001-08-12  Andrew Cagney  <ac131313@redhat.com>

	* mi-main.c (mi_cmd_thread_select): Pass uiout to
	gdb_thread_select.
	(mi_cmd_thread_list_ids): Pass uiout to gdb_list_thread_ids.

	* mi-cmd-break.c (breakpoint_notify): Pass uiout to
	gdb_breakpoint_query.

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.52
diff -p -r1.52 breakpoint.c
*** breakpoint.c	2001/08/02 11:58:28	1.52
--- breakpoint.c	2001/09/07 23:13:20
*************** struct captured_breakpoint_query_args
*** 3526,3532 ****
    };
  
  static int
! do_captured_breakpoint_query (void *data)
  {
    struct captured_breakpoint_query_args *args = data;
    register struct breakpoint *b;
--- 3526,3532 ----
    };
  
  static int
! do_captured_breakpoint_query (struct ui_out *uiout, void *data)
  {
    struct captured_breakpoint_query_args *args = data;
    register struct breakpoint *b;
*************** do_captured_breakpoint_query (void *data
*** 3543,3556 ****
  }
  
  enum gdb_rc
! gdb_breakpoint_query (/* output object, */ int bnum)
  {
    struct captured_breakpoint_query_args args;
    args.bnum = bnum;
    /* For the moment we don't trust print_one_breakpoint() to not throw
       an error. */
!   return catch_errors (do_captured_breakpoint_query, &args,
! 		       NULL, RETURN_MASK_ALL);
  }
  
  /* Return non-zero if B is user settable (breakpoints, watchpoints,
--- 3543,3556 ----
  }
  
  enum gdb_rc
! gdb_breakpoint_query (struct ui_out *uiout, int bnum)
  {
    struct captured_breakpoint_query_args args;
    args.bnum = bnum;
    /* For the moment we don't trust print_one_breakpoint() to not throw
       an error. */
!   return catch_exceptions (uiout, do_captured_breakpoint_query, &args,
! 			   NULL, RETURN_MASK_ALL);
  }
  
  /* Return non-zero if B is user settable (breakpoints, watchpoints,
Index: gdb.h
===================================================================
RCS file: /cvs/src/src/gdb/gdb.h,v
retrieving revision 1.1
diff -p -r1.1 gdb.h
*** gdb.h	2001/07/28 19:48:15	1.1
--- gdb.h	2001/09/07 23:13:20
*************** enum gdb_rc {
*** 44,50 ****
  
  /* Print the specified breakpoint on GDB_STDOUT. (Eventually this
     function will ``print'' the object on ``output''). */
! enum gdb_rc gdb_breakpoint_query (/* struct {ui,gdb}_out *output, */ int bnum);
  
  /* Create a breakpoint at ADDRESS (a GDB source and line). */
  enum gdb_rc gdb_breakpoint (char *address, char *condition,
--- 44,50 ----
  
  /* Print the specified breakpoint on GDB_STDOUT. (Eventually this
     function will ``print'' the object on ``output''). */
! enum gdb_rc gdb_breakpoint_query (struct ui_out *uiout, int bnum);
  
  /* Create a breakpoint at ADDRESS (a GDB source and line). */
  enum gdb_rc gdb_breakpoint (char *address, char *condition,
*************** enum gdb_rc gdb_breakpoint (char *addres
*** 52,60 ****
  			    int thread, int ignore_count);
  
  /* Switch thread and print notification. */
! enum gdb_rc gdb_thread_select (/* output object */ char *tidstr);
  
  /* Print a list of known thread ids. */
! enum gdb_rc gdb_list_thread_ids (/* output object */);
  
  #endif
--- 52,60 ----
  			    int thread, int ignore_count);
  
  /* Switch thread and print notification. */
! enum gdb_rc gdb_thread_select (struct ui_out *uiout, char *tidstr);
  
  /* Print a list of known thread ids. */
! enum gdb_rc gdb_list_thread_ids (struct ui_out *uiout);
  
  #endif
Index: thread.c
===================================================================
RCS file: /cvs/src/src/gdb/thread.c,v
retrieving revision 1.18
diff -p -r1.18 thread.c
*** thread.c	2001/07/28 19:48:15	1.18
--- thread.c	2001/09/07 23:13:20
*************** in_thread_list (ptid_t ptid)
*** 257,263 ****
  /* Print a list of thread ids currently known, and the total number of
     threads. To be used from within catch_errors. */
  static int 
! do_captured_list_thread_ids (void *arg)
  {
    struct thread_info *tp;
    int num = 0;
--- 257,264 ----
  /* Print a list of thread ids currently known, and the total number of
     threads. To be used from within catch_errors. */
  static int 
! do_captured_list_thread_ids (struct ui_out *uiout,
! 			     void *arg)
  {
    struct thread_info *tp;
    int num = 0;
*************** do_captured_list_thread_ids (void *arg)
*** 278,287 ****
  /* Official gdblib interface function to get a list of thread ids and
     the total number. */
  enum gdb_rc
! gdb_list_thread_ids (/* output object */)
  {
!   return catch_errors (do_captured_list_thread_ids, NULL,
! 		       NULL, RETURN_MASK_ALL);
  }
  #endif
  
--- 279,288 ----
  /* Official gdblib interface function to get a list of thread ids and
     the total number. */
  enum gdb_rc
! gdb_list_thread_ids (struct ui_out *uiout)
  {
!   return catch_exceptions (uiout, do_captured_list_thread_ids, NULL,
! 			   NULL, RETURN_MASK_ALL);
  }
  #endif
  
*************** thread_command (char *tidstr, int from_t
*** 683,693 ****
        return;
      }
  
!   gdb_thread_select (tidstr);
  }
  
  static int
! do_captured_thread_select (void *tidstr)
  {
    int num;
    struct thread_info *tp;
--- 684,695 ----
        return;
      }
  
!   gdb_thread_select (uiout, tidstr);
  }
  
  static int
! do_captured_thread_select (struct ui_out *uiout,
! 			   void *tidstr)
  {
    int num;
    struct thread_info *tp;
*************** see the IDs of currently known threads."
*** 736,745 ****
  }
  
  enum gdb_rc
! gdb_thread_select (char *tidstr)
  {
!   return catch_errors (do_captured_thread_select, tidstr,
! 		       NULL, RETURN_MASK_ALL);
  }
  
  /* Commands with a prefix of `thread'.  */
--- 738,748 ----
  }
  
  enum gdb_rc
! gdb_thread_select (struct ui_out *uiout,
! 		   char *tidstr)
  {
!   return catch_exceptions (uiout, do_captured_thread_select, tidstr,
! 			   NULL, RETURN_MASK_ALL);
  }
  
  /* Commands with a prefix of `thread'.  */
Index: mi/mi-cmd-break.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmd-break.c,v
retrieving revision 1.5
diff -p -r1.5 mi-cmd-break.c
*** mi-cmd-break.c	2001/07/28 19:48:15	1.5
--- mi-cmd-break.c	2001/09/07 23:13:21
*************** enum
*** 44,50 ****
  static void
  breakpoint_notify (int b)
  {
!   gdb_breakpoint_query (b);
  }
  
  
--- 44,50 ----
  static void
  breakpoint_notify (int b)
  {
!   gdb_breakpoint_query (uiout, b);
  }
  
  
Index: mi/mi-main.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
retrieving revision 1.23
diff -p -r1.23 mi-main.c
*** mi-main.c	2001/07/28 19:48:15	1.23
--- mi-main.c	2001/09/07 23:13:21
*************** mi_cmd_thread_select (char *command, cha
*** 230,236 ****
        return MI_CMD_ERROR;
      }
    else
!     rc = gdb_thread_select (argv[0]);
  
    if (rc == GDB_RC_FAIL)
      return MI_CMD_CAUGHT_ERROR;
--- 230,236 ----
        return MI_CMD_ERROR;
      }
    else
!     rc = gdb_thread_select (uiout, argv[0]);
  
    if (rc == GDB_RC_FAIL)
      return MI_CMD_CAUGHT_ERROR;
*************** mi_cmd_thread_list_ids (char *command, c
*** 251,257 ****
      }
    else
  #ifdef UI_OUT
!     rc = gdb_list_thread_ids ();
  #endif
  
    if (rc == GDB_RC_FAIL)
--- 251,257 ----
      }
    else
  #ifdef UI_OUT
!     rc = gdb_list_thread_ids (uiout);
  #endif
  
    if (rc == GDB_RC_FAIL)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]