This is the mail archive of the gdb-patches@sourceware.cygnus.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]

(patch) hpjyg19: breakpoint.c & related


***
Patch dependencies: hpjyg06 (defs.h), hpjyg15 (infrun.c)
***

This patch includes misc. changes to breakpoint.c, and the realignment
of config/pa/ files for hpux10.20, 11.00, and 11.00 2.0w *.mt and tm-*.h
files (to provide tm-hppa32.h for both 10.20 and 11.00 narrow; and
tm-hppa64.h for 11.00 wide).

ChangeLog:

1999-11-10	Jimmy Guo	<guo@cup.hp.com>

	* breakpoint.c
	(update_breakpoints_after_exec): Watchpoints can be deleted when
	exp_string is null, not addr_string.
	(mark_breakpoints_out): Remove hardware watchpoints to ensure
	that the memory_page_dictionary data structure gets
	re-initialized.
	(breakpoint_init_inferior): Disable shlib breakpoints.
	(watchpoint_check): Return WP_VALUE_NOT_CHANGED  if we couldn't
	reconstruct the frame pointer.
	(bpstat_stop_status): Keep going if breakpoint is deleted.
	(bpstat_what): Add bp_mmap handling.
	(breakpoint_1): Add bp_mmap to bptypes[]; handle printing of
	deferred bp's address info and name.
	(re_enable_breakpoints_in_shlibs): If breakpoint location is
	unknown, check if is known and expand all instances.
	(create_mmap_breakpoint,remove_mmap_breakpoints): New function.
	(mention,delete_breakpoint): tuiAllSetHasBreakAt does no screen
	updates, so call TUIDOWITHOUTTERMTRANSITION instead of TUIDO.
	(break_command_1): if default_breakpoint_valid, set addr_start
	and addr_end or the breakpoint won't have an addr_string and
	will be deleted when we do a re-run; breakpoint location might
	be in a shared library so print warning and keep the breakpoint
	around if no location is found; assign a copy of breakpoint
	condition if more than one breakpoint share the same condition.
	(break_at_finish_command_1): Set breakpoint to high -
	INSTRUCTION_SIZE (if defined), since high is the first address
	past the end of the function -- critical for architectures
	which don't have a delay slot (like IA64).
	(watch_command_1): Don't use hardware watchpoints for 'local'
	expressions which are on the stack (HPPA only).
	(breakpoint_re_set_one): Don't reset shlib disabled breakpoints
	-- they haven't been mapped in; preserve original symbol since
	decode_line_1 will advance pointer; don't mention or annotate a
	disabled breakpoint; mark breakpoint shlib_disabled or disabled
	if we cannot find the location, could be in shlib or due to
	other reasons.
	(disable_breakpoint): Don't disable a deferred breakpoint.
	(do_enable_breakpoint): Don't enable a deferred breakpoint.
	(caught_active_load,cover_parse_exp_1,cover_decode_line_1,
	save_breakpoint_condition): New functions.

	* breakpoint.h (enum bptype): Add bp_mmap.

	* defs.h (safe_free,TUIDOWITHOUTTERMTRANSITION): Define.

	* infrun.c,infcmd.c,breakpoint.c: longjmp breakpoint codes
	should be compiled in if GET_LONGJMP_TARGET is defined.

	* configure.tgt: Add mt prefix for hpux1020, hpux11, and change
          hppa64 (for HP-UX 11 2.0W) to hpux11w.

	* config/pa/hpux1020.mt: TM_FILE is now tm-hppa1020.h.

	* config/pa/hpux11.mt: TM_FILE is now tm-hppa1100.h.

	* config/pa/hpux11w.mt: New file, renamed from hppa64.mt,
	TM_FILE is now tm-hppa1100w.h.
	* config/pa/hppa64.mt: Renamed to hpux11w.mt.

	* config/pa/tm-hppa1020.h: New TM_FILE choice, includes
          tm-hppah.h and tm-hppa32.h.

	* config/pa/tm-hppa1100.h: New TM_FILE choice, includes
          tm-hppah.h and tm-hppa32.h.

	* config/pa/tm-hppa1100w.h: New TM_FILE choice, includes
          tm-hppah.h and tm-hppa64.h.

	* config/pa/tm-hppah.h: Remove HPUX_SNAP1, HPUX_SNAP2; replace
          use of GDB_TARGET_IS_HPPA_20W by HPUX_1100W.

	* config/pa/tm-hppa32.h: New file.

	* config/pa/tm-hppa64.h: Don't include tm-hppah.h, which is done
	by tm-hppa1100w.h; don't define HPUX_1100, which is done by
	tm-hppa1100.h (and tm-hppa1100w.h defines HPUX_1100W); no longer
	a TM_FILE choice.

Index: gdb/breakpoint.c
/opt/gnu/bin/diff -r -c -N  /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/breakpoint.c gdb/breakpoint.c
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/breakpoint.c	Tue Nov  9 11:53:15 1999
--- gdb/breakpoint.c	Wed Nov 10 09:54:04 1999
***************
*** 142,147 ****
--- 142,150 ----
  void
  set_breakpoint_count PARAMS ((int));
  
+ static struct expression *
+ save_breakpoint_condition PARAMS ((struct expression *));
+ 
  #if 0
  static struct breakpoint *
    create_temp_exception_breakpoint PARAMS ((CORE_ADDR));
***************
*** 168,173 ****
--- 171,192 ----
    }
  args_for_catchpoint_enable;
  
+ typedef struct
+   {
+     char **exp_string_p;
+     struct block *block;
+     struct expression *result;
+   }
+ args_for_parse_exp_1;
+ 
+ typedef struct
+   {
+     char **addr_string_p;
+     char ***canonical_p;
+     struct symtabs_and_lines result;
+   }
+ args_for_decode_line_1;
+ 
  static int watchpoint_check PARAMS ((PTR));
  
  static int cover_target_enable_exception_callback PARAMS ((PTR));
***************
*** 200,215 ****
  					 char *cond_string,
  					 enum bptype bp_kind));
  
! static void create_fork_vfork_event_catchpoint PARAMS ((int tempflag, 
  							char *cond_string,
! 							enum bptype bp_kind));
  
! static void break_at_finish_at_depth_command_1 PARAMS ((char *arg, 
! 							int flag, 
  							int from_tty));
  
! static void break_at_finish_command_1 PARAMS ((char *arg, 
! 					       int flag, 
  					       int from_tty));
  
  static void stop_command PARAMS ((char *arg, int from_tty));
--- 219,234 ----
  					 char *cond_string,
  					 enum bptype bp_kind));
  
! static void create_fork_vfork_event_catchpoint PARAMS ((int tempflag,
  							char *cond_string,
! 						        enum bptype bp_kind));
  
! static void break_at_finish_at_depth_command_1 PARAMS ((char *arg,
! 							int flag,
  							int from_tty));
  
! static void break_at_finish_command_1 PARAMS ((char *arg,
! 					       int flag,
  					       int from_tty));
  
  static void stop_command PARAMS ((char *arg, int from_tty));
***************
*** 225,240 ****
  static char *ep_parse_optional_filename PARAMS ((char **arg));
  
  #if defined(CHILD_INSERT_EXEC_CATCHPOINT)
! static void catch_exec_command_1 PARAMS ((char *arg, int tempflag, 
  					  int from_tty));
  #endif
  
! static void create_exception_catchpoint 
    PARAMS ((int tempflag, char *cond_string,
  	   enum exception_event_kind ex_event,
! 	   struct symtab_and_line * sal));
  
! static void catch_exception_command_1 
    PARAMS ((enum exception_event_kind ex_event,
  	   char *arg, int tempflag, int from_tty));
  
--- 244,259 ----
  static char *ep_parse_optional_filename PARAMS ((char **arg));
  
  #if defined(CHILD_INSERT_EXEC_CATCHPOINT)
! static void catch_exec_command_1 PARAMS ((char *arg, int tempflag,
  					  int from_tty));
  #endif
  
! static void create_exception_catchpoint
    PARAMS ((int tempflag, char *cond_string,
  	   enum exception_event_kind ex_event,
! 	   struct symtab_and_line *sal));
  
! static void catch_exception_command_1
    PARAMS ((enum exception_event_kind ex_event,
  	   char *arg, int tempflag, int from_tty));
  
***************
*** 270,275 ****
--- 289,298 ----
  /* Walk the following statement or block through all breakpoints.
     ALL_BREAKPOINTS_SAFE does so even if the statment deletes the current
     breakpoint.  */
+ /* RM: yes, but ALL_BREAKPOINTS_SAFE is _not_ safe if we delete the
+    following breakpoint in the chain. Since a breakpoint's related_breakpoint
+    field may point to any other breakpoint, be careful when deleting
+    related_breakpoints. */
  
  #define ALL_BREAKPOINTS(B)  for (B = breakpoint_chain; B; B = B->next)
  
***************
*** 404,418 ****
     Currently the string can either be a number or "$" followed by the name
     of a convenience variable.  Making it an expression wouldn't work well
     for map_breakpoint_numbers (e.g. "4 + 5 + 6").
!    
     TRAILER is a character which can be found after the number; most
!    commonly this is `-'.  If you don't want a trailer, use \0.  */ 
  static int
  get_number_trailer (pp, trailer)
       char **pp;
       int trailer;
  {
!   int retval = 0;	/* default */
    char *p = *pp;
  
    if (p == NULL)
--- 427,441 ----
     Currently the string can either be a number or "$" followed by the name
     of a convenience variable.  Making it an expression wouldn't work well
     for map_breakpoint_numbers (e.g. "4 + 5 + 6").
! 
     TRAILER is a character which can be found after the number; most
!    commonly this is `-'.  If you don't want a trailer, use \0.  */
  static int
  get_number_trailer (pp, trailer)
       char **pp;
       int trailer;
  {
!   int retval = 0;		/* default */
    char *p = *pp;
  
    if (p == NULL)
***************
*** 450,456 ****
  	/* There is no number here.  (e.g. "cond a == b").  */
  	{
  	  /* Skip non-numeric token */
! 	  while (*p && !isspace((int) *p))
  	    ++p;
  	  /* Return zero, which caller must interpret as error. */
  	  retval = 0;
--- 473,479 ----
  	/* There is no number here.  (e.g. "cond a == b").  */
  	{
  	  /* Skip non-numeric token */
! 	  while (*p && !isspace ((int) *p))
  	    ++p;
  	  /* Return zero, which caller must interpret as error. */
  	  retval = 0;
***************
*** 496,502 ****
   * pointer PP past <number2>.
   */
  
! int 
  get_number_or_range (pp)
       char **pp;
  {
--- 519,525 ----
   * pointer PP past <number2>.
   */
  
! int
  get_number_or_range (pp)
       char **pp;
  {
***************
*** 507,513 ****
    if (**pp != '-')
      {
        /* Default case: pp is pointing either to a solo number, 
! 	 or to the first number of a range.  */
        last_retval = get_number_trailer (pp, '-');
        if (**pp == '-')
  	{
--- 530,536 ----
    if (**pp != '-')
      {
        /* Default case: pp is pointing either to a solo number, 
!          or to the first number of a range.  */
        last_retval = get_number_trailer (pp, '-');
        if (**pp == '-')
  	{
***************
*** 517,551 ****
  	     Skip the '-', parse and remember the second number,
  	     and also remember the end of the final token.  */
  
! 	  temp = &end_ptr; 
! 	  end_ptr = *pp + 1; 
  	  while (isspace ((int) *end_ptr))
! 	    end_ptr++;	/* skip white space */
  	  end_value = get_number (temp);
! 	  if (end_value < last_retval) 
  	    {
  	      error ("inverted range");
  	    }
  	  else if (end_value == last_retval)
  	    {
  	      /* degenerate range (number1 == number2).  Advance the
! 		 token pointer so that the range will be treated as a
! 		 single number.  */ 
  	      *pp = end_ptr;
  	    }
  	  else
  	    in_range = 1;
  	}
      }
!   else if (! in_range)
      error ("negative value");
    else
      {
        /* pp points to the '-' that betokens a range.  All
! 	 number-parsing has already been done.  Return the next
! 	 integer value (one greater than the saved previous value).
! 	 Do not advance the token pointer 'pp' until the end of range
! 	 is reached.  */
  
        if (++last_retval == end_value)
  	{
--- 540,574 ----
  	     Skip the '-', parse and remember the second number,
  	     and also remember the end of the final token.  */
  
! 	  temp = &end_ptr;
! 	  end_ptr = *pp + 1;
  	  while (isspace ((int) *end_ptr))
! 	    end_ptr++;		/* skip white space */
  	  end_value = get_number (temp);
! 	  if (end_value < last_retval)
  	    {
  	      error ("inverted range");
  	    }
  	  else if (end_value == last_retval)
  	    {
  	      /* degenerate range (number1 == number2).  Advance the
! 	         token pointer so that the range will be treated as a
! 	         single number.  */
  	      *pp = end_ptr;
  	    }
  	  else
  	    in_range = 1;
  	}
      }
!   else if (!in_range)
      error ("negative value");
    else
      {
        /* pp points to the '-' that betokens a range.  All
!          number-parsing has already been done.  Return the next
!          integer value (one greater than the saved previous value).
!          Do not advance the token pointer 'pp' until the end of range
!          is reached.  */
  
        if (++last_retval == end_value)
  	{
***************
*** 556,564 ****
      }
    return last_retval;
  }
  
  
- 
  /* condition N EXP -- set break condition of breakpoint N to EXP.  */
  
  static void
--- 579,587 ----
      }
    return last_retval;
  }
+ 
  
  
  /* condition N EXP -- set break condition of breakpoint N to EXP.  */
  
  static void
***************
*** 641,648 ****
      if (b->number == bnum)
      {
        char tmpbuf[128];
!       sprintf (tmpbuf, 
! 	       "Type commands for when breakpoint %d is hit, one per line.", 
  	       bnum);
        l = read_command_lines (tmpbuf, from_tty);
        free_command_lines (&b->commands);
--- 664,671 ----
      if (b->number == bnum)
      {
        char tmpbuf[128];
!       sprintf (tmpbuf,
! 	       "Type commands for when breakpoint %d is hit, one per line.",
  	       bnum);
        l = read_command_lines (tmpbuf, from_tty);
        free_command_lines (&b->commands);
***************
*** 679,685 ****
    ALL_BREAKPOINTS (b)
    {
      if (b->type == bp_none)
!       warning ("reading through apparently deleted breakpoint #%d?", 
  	       b->number);
  
      /* memory breakpoint? */
--- 702,708 ----
    ALL_BREAKPOINTS (b)
    {
      if (b->type == bp_none)
!       warning ("reading through apparently deleted breakpoint #%d?",
  	       b->number);
  
      /* memory breakpoint? */
***************
*** 769,776 ****
  int
  insert_breakpoints ()
  {
!   register struct breakpoint *b, *temp;
!   int return_val = 0;	/* return success code. */
    int val = 0;
    int disabled_breaks = 0;
  
--- 792,799 ----
  int
  insert_breakpoints ()
  {
!   register struct breakpoint *b, *temp = NULL;
!   int return_val = 0;		/* return success code. */
    int val = 0;
    int disabled_breaks = 0;
  
***************
*** 784,802 ****
        /* Permanent breakpoints cannot be inserted or removed.  */
        continue;
      else if (b->type != bp_watchpoint
! 	&& b->type != bp_hardware_watchpoint
! 	&& b->type != bp_read_watchpoint
! 	&& b->type != bp_access_watchpoint
! 	&& b->type != bp_catch_fork
! 	&& b->type != bp_catch_vfork
! 	&& b->type != bp_catch_exec
! 	&& b->type != bp_catch_throw
! 	&& b->type != bp_catch_catch
! 	&& b->enable != disabled
! 	&& b->enable != shlib_disabled
! 	&& b->enable != call_disabled
! 	&& !b->inserted
! 	&& !b->duplicate)
        {
  	if (b->type == bp_hardware_breakpoint)
  	  val = target_insert_hw_breakpoint (b->address, b->shadow_contents);
--- 807,825 ----
        /* Permanent breakpoints cannot be inserted or removed.  */
        continue;
      else if (b->type != bp_watchpoint
! 	     && b->type != bp_hardware_watchpoint
! 	     && b->type != bp_read_watchpoint
! 	     && b->type != bp_access_watchpoint
! 	     && b->type != bp_catch_fork
! 	     && b->type != bp_catch_vfork
! 	     && b->type != bp_catch_exec
! 	     && b->type != bp_catch_throw
! 	     && b->type != bp_catch_catch
! 	     && b->enable != disabled
! 	     && b->enable != shlib_disabled
! 	     && b->enable != call_disabled
! 	     && !b->inserted
! 	     && !b->duplicate)
        {
  	if (b->type == bp_hardware_breakpoint)
  	  val = target_insert_hw_breakpoint (b->address, b->shadow_contents);
***************
*** 851,857 ****
  #ifdef ONE_PROCESS_WRITETEXT
  		warning ("The same program may be running in another process.");
  #endif
! 		memory_error (val, b->address);	   /* which bombs us out */
  	      }
  	  }
  	else
--- 874,880 ----
  #ifdef ONE_PROCESS_WRITETEXT
  		warning ("The same program may be running in another process.");
  #endif
! 		memory_error (val, b->address);		/* which bombs us out */
  	      }
  	  }
  	else
***************
*** 888,894 ****
  	    /* Bp set, now make sure callbacks are enabled */
  	    int val;
  	    args_for_catchpoint_enable args;
! 	    args.kind = b->type == bp_catch_catch ? 
  	      EX_EVENT_CATCH : EX_EVENT_THROW;
  	    args.enable = 1;
  	    val = catch_errors (cover_target_enable_exception_callback,
--- 911,917 ----
  	    /* Bp set, now make sure callbacks are enabled */
  	    int val;
  	    args_for_catchpoint_enable args;
! 	    args.kind = b->type == bp_catch_catch ?
  	      EX_EVENT_CATCH : EX_EVENT_THROW;
  	    args.enable = 1;
  	    val = catch_errors (cover_target_enable_exception_callback,
***************
*** 957,963 ****
  	       laziness to determine what memory GDB actually needed
  	       in order to compute the value of the expression.  */
  	    v = evaluate_expression (b->exp);
! 	    VALUE_CONTENTS(v);
  	    value_release_to_mark (mark);
  
  	    b->val_chain = v;
--- 980,986 ----
  	       laziness to determine what memory GDB actually needed
  	       in order to compute the value of the expression.  */
  	    v = evaluate_expression (b->exp);
! 	    VALUE_CONTENTS (v);
  	    value_release_to_mark (mark);
  
  	    b->val_chain = v;
***************
*** 967,983 ****
  	    for (; v; v = v->next)
  	      {
  		/* If it's a memory location, and GDB actually needed
!                    its contents to evaluate the expression, then we
!                    must watch it.  */
  		if (VALUE_LVAL (v) == lval_memory
! 		    && ! VALUE_LAZY (v))
  		  {
  		    CORE_ADDR addr;
  		    int len, type;
  
  		    addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
  		    len = TYPE_LENGTH (VALUE_TYPE (v));
! 		    type   = hw_write;
  		    if (b->type == bp_read_watchpoint)
  		      type = hw_read;
  		    else if (b->type == bp_access_watchpoint)
--- 990,1006 ----
  	    for (; v; v = v->next)
  	      {
  		/* If it's a memory location, and GDB actually needed
! 		   its contents to evaluate the expression, then we
! 		   must watch it.  */
  		if (VALUE_LVAL (v) == lval_memory
! 		    && !VALUE_LAZY (v))
  		  {
  		    CORE_ADDR addr;
  		    int len, type;
  
  		    addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
  		    len = TYPE_LENGTH (VALUE_TYPE (v));
! 		    type = hw_write;
  		    if (b->type == bp_read_watchpoint)
  		      type = hw_read;
  		    else if (b->type == bp_access_watchpoint)
***************
*** 1000,1006 ****
  		warning ("Could not insert hardware watchpoint %d.",
  			 b->number);
  		val = -1;
! 	      }               
  	  }
  	else
  	  {
--- 1023,1029 ----
  		warning ("Could not insert hardware watchpoint %d.",
  			 b->number);
  		val = -1;
! 	      }
  	  }
  	else
  	  {
***************
*** 1040,1046 ****
  	    val = target_insert_exec_catchpoint (inferior_pid);
  	    break;
  	  default:
! 	    warning ("Internal error, %s line %d.", __FILE__, __LINE__);
  	    break;
  	  }
  	if (val < 0)
--- 1063,1069 ----
  	    val = target_insert_exec_catchpoint (inferior_pid);
  	    break;
  	  default:
!             val = -1;
  	    break;
  	  }
  	if (val < 0)
***************
*** 1087,1093 ****
    int saved_inferior_pid = inferior_pid;
  
    /* FIXME: use a cleanup, to insure that inferior_pid gets replaced! */
!   inferior_pid = pid;	/* Because remove_breakpoint will use this global. */
    ALL_BREAKPOINTS (b)
    {
      if (b->inserted)
--- 1110,1116 ----
    int saved_inferior_pid = inferior_pid;
  
    /* FIXME: use a cleanup, to insure that inferior_pid gets replaced! */
!   inferior_pid = pid;		/* Because remove_breakpoint will use this global. */
    ALL_BREAKPOINTS (b)
    {
      if (b->inserted)
***************
*** 1112,1118 ****
  update_breakpoints_after_exec ()
  {
    struct breakpoint *b;
!   struct breakpoint *temp;
  
    /* Doing this first prevents the badness of having delete_breakpoint()
       write a breakpoint's current "shadow contents" to lift the bp.  That
--- 1135,1141 ----
  update_breakpoints_after_exec ()
  {
    struct breakpoint *b;
!   struct breakpoint *temp = NULL;
  
    /* Doing this first prevents the badness of having delete_breakpoint()
       write a breakpoint's current "shadow contents" to lift the bp.  That
***************
*** 1203,1209 ****
      /* Without a symbolic address, we have little hope of the
         pre-exec() address meaning the same thing in the post-exec()
         a.out. */
!     if (b->addr_string == NULL)
        {
  	delete_breakpoint (b);
  	continue;
--- 1226,1235 ----
      /* Without a symbolic address, we have little hope of the
         pre-exec() address meaning the same thing in the post-exec()
         a.out. */
!     /* RM: for watchpoints, we need an exp_string */
!     if (((b->type == bp_watchpoint || b->type == bp_hardware_watchpoint) &&
! 	 b->exp_string == NULL) ||
! 	((b->type != bp_watchpoint && b->type != bp_hardware_watchpoint) && b->addr_string == NULL))
        {
  	delete_breakpoint (b);
  	continue;
***************
*** 1228,1234 ****
      error ("Cannot detach breakpoints of inferior_pid");
  
    /* FIXME: use a cleanup, to insure that inferior_pid gets replaced! */
!   inferior_pid = pid;	/* Because remove_breakpoint will use this global. */
    ALL_BREAKPOINTS (b)
    {
      if (b->inserted)
--- 1254,1260 ----
      error ("Cannot detach breakpoints of inferior_pid");
  
    /* FIXME: use a cleanup, to insure that inferior_pid gets replaced! */
!   inferior_pid = pid;		/* Because remove_breakpoint will use this global. */
    ALL_BREAKPOINTS (b)
    {
      if (b->inserted)
***************
*** 1257,1263 ****
      return 0;
  
    if (b->type == bp_none)
!     warning ("attempted to remove apparently deleted breakpoint #%d?", 
  	     b->number);
  
    if (b->type != bp_watchpoint
--- 1283,1289 ----
      return 0;
  
    if (b->type == bp_none)
!     warning ("attempted to remove apparently deleted breakpoint #%d?",
  	     b->number);
  
    if (b->type != bp_watchpoint
***************
*** 1316,1329 ****
  	  /* For each memory reference remove the watchpoint
  	     at that address.  */
  	  if (VALUE_LVAL (v) == lval_memory
! 	      && ! VALUE_LAZY (v))
  	    {
  	      CORE_ADDR addr;
  	      int len, type;
  
  	      addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
  	      len = TYPE_LENGTH (VALUE_TYPE (v));
! 	      type   = hw_write;
  	      if (b->type == bp_read_watchpoint)
  		type = hw_read;
  	      else if (b->type == bp_access_watchpoint)
--- 1342,1355 ----
  	  /* For each memory reference remove the watchpoint
  	     at that address.  */
  	  if (VALUE_LVAL (v) == lval_memory
! 	      && !VALUE_LAZY (v))
  	    {
  	      CORE_ADDR addr;
  	      int len, type;
  
  	      addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
  	      len = TYPE_LENGTH (VALUE_TYPE (v));
! 	      type = hw_write;
  	      if (b->type == bp_read_watchpoint)
  		type = hw_read;
  	      else if (b->type == bp_access_watchpoint)
***************
*** 1410,1415 ****
--- 1436,1452 ----
    register struct breakpoint *b;
  
    ALL_BREAKPOINTS (b)
+   /* RM: remove hardware watchpoints. The memory protections are
+      not actually active when we reach here (beacuse we are in a
+      syscall), so there's no effect on the executable image. But
+      this does ensure that the memory_page_dictionary data
+      structure gets re-initialized */
+     if (b->type == bp_hardware_watchpoint &&
+ 	b->enable == enabled &&
+ 	b->inserted &&
+ 	!b->duplicate)
+     remove_breakpoint (b, mark_uninserted);
+   else
      b->inserted = 0;
  }
  
***************
*** 1429,1437 ****
  breakpoint_init_inferior (context)
       enum inf_context context;
  {
!   register struct breakpoint *b, *temp;
    static int warning_needed = 0;
  
    ALL_BREAKPOINTS_SAFE (b, temp)
    {
      b->inserted = 0;
--- 1466,1477 ----
  breakpoint_init_inferior (context)
       enum inf_context context;
  {
!   register struct breakpoint *b, *temp = NULL;
    static int warning_needed = 0;
  
+   /* RM: Surely we want to disable shlib breakpoints here? */
+   disable_breakpoints_in_shlibs (1);
+ 
    ALL_BREAKPOINTS_SAFE (b, temp)
    {
      b->inserted = 0;
***************
*** 1488,1497 ****
     ordinary breakpoint, or permanent_breakpoint_here if it's a
     permanent breakpoint.
     - When continuing from a location with an ordinary breakpoint, we
!      actually single step once before calling insert_breakpoints.
     - When continuing from a localion with a permanent breakpoint, we
!      need to use the `SKIP_PERMANENT_BREAKPOINT' macro, provided by
!      the target, to advance the PC past the breakpoint.  */
  
  enum breakpoint_here
  breakpoint_here_p (pc)
--- 1528,1537 ----
     ordinary breakpoint, or permanent_breakpoint_here if it's a
     permanent breakpoint.
     - When continuing from a location with an ordinary breakpoint, we
!    actually single step once before calling insert_breakpoints.
     - When continuing from a localion with a permanent breakpoint, we
!    need to use the `SKIP_PERMANENT_BREAKPOINT' macro, provided by
!    the target, to advance the PC past the breakpoint.  */
  
  enum breakpoint_here
  breakpoint_here_p (pc)
***************
*** 1504,1519 ****
      if ((b->enable == enabled
  	 || b->enable == permanent)
  	&& b->address == pc)	/* bp is enabled and matches pc */
!       {
! 	if (overlay_debugging &&
! 	    section_is_overlay (b->section) &&
! 	    !section_is_mapped (b->section))
! 	  continue;		/* unmapped overlay -- can't be a match */
! 	else if (b->enable == permanent)
! 	  return permanent_breakpoint_here;
! 	else
! 	  any_breakpoint_here = 1;
!       }
  
    return any_breakpoint_here ? ordinary_breakpoint_here : 0;
  }
--- 1544,1559 ----
      if ((b->enable == enabled
  	 || b->enable == permanent)
  	&& b->address == pc)	/* bp is enabled and matches pc */
!     {
!       if (overlay_debugging &&
! 	  section_is_overlay (b->section) &&
! 	  !section_is_mapped (b->section))
! 	continue;		/* unmapped overlay -- can't be a match */
!       else if (b->enable == permanent)
! 	return permanent_breakpoint_here;
!       else
! 	any_breakpoint_here = 1;
!     }
  
    return any_breakpoint_here ? ordinary_breakpoint_here : 0;
  }
***************
*** 1744,1749 ****
--- 1784,1790 ----
      }
  
    error ("Internal error (no step_resume breakpoint found)");
+   return NULL;
  }
  
  
***************
*** 1820,1834 ****
    old_chain = make_cleanup (cleanup_executing_breakpoints, 0);
  
  top:
-   /* Note that (as of this writing), our callers all appear to
-      be passing us the address of global stop_bpstat.  And, if
-      our calls to execute_control_command cause the inferior to
-      proceed, that global (and hence, *bsp) will change.
- 
-      We must be careful to not touch *bsp unless the inferior
-      has not proceeded. */
- 
-   /* This pointer will iterate over the list of bpstat's. */
    bs = *bsp;
  
    breakpoint_proceeded = 0;
--- 1861,1866 ----
***************
*** 1901,1908 ****
  
      case bp_shlib_event:
        /* Did we stop because the user set the stop_on_solib_events
! 	 variable?  (If so, we report this as a generic, "Stopped due
! 	 to shlib event" message.) */
        printf_filtered ("Stopped due to shared library event\n");
        return PRINT_NOTHING;
        break;
--- 1933,1940 ----
  
      case bp_shlib_event:
        /* Did we stop because the user set the stop_on_solib_events
!          variable?  (If so, we report this as a generic, "Stopped due
!          to shlib event" message.) */
        printf_filtered ("Stopped due to shared library event\n");
        return PRINT_NOTHING;
        break;
***************
*** 1927,1933 ****
        annotate_catchpoint (bs->breakpoint_at->number);
        printf_filtered ("\nCatchpoint %d (", bs->breakpoint_at->number);
        printf_filtered ("forked");
!       printf_filtered (" process %d), ", 
  		       bs->breakpoint_at->forked_inferior_pid);
        return PRINT_SRC_AND_LOC;
        break;
--- 1959,1965 ----
        annotate_catchpoint (bs->breakpoint_at->number);
        printf_filtered ("\nCatchpoint %d (", bs->breakpoint_at->number);
        printf_filtered ("forked");
!       printf_filtered (" process %d), ",
  		       bs->breakpoint_at->forked_inferior_pid);
        return PRINT_SRC_AND_LOC;
        break;
***************
*** 1936,1942 ****
        annotate_catchpoint (bs->breakpoint_at->number);
        printf_filtered ("\nCatchpoint %d (", bs->breakpoint_at->number);
        printf_filtered ("vforked");
!       printf_filtered (" process %d), ", 
  		       bs->breakpoint_at->forked_inferior_pid);
        return PRINT_SRC_AND_LOC;
        break;
--- 1968,1974 ----
        annotate_catchpoint (bs->breakpoint_at->number);
        printf_filtered ("\nCatchpoint %d (", bs->breakpoint_at->number);
        printf_filtered ("vforked");
!       printf_filtered (" process %d), ",
  		       bs->breakpoint_at->forked_inferior_pid);
        return PRINT_SRC_AND_LOC;
        break;
***************
*** 1950,1960 ****
        break;
  
      case bp_catch_catch:
!       if (current_exception_event && 
  	  (CURRENT_EXCEPTION_KIND == EX_EVENT_CATCH))
  	{
  	  annotate_catchpoint (bs->breakpoint_at->number);
! 	  printf_filtered ("\nCatchpoint %d (exception caught), ", 
  			   bs->breakpoint_at->number);
  	  printf_filtered ("throw location ");
  	  if (CURRENT_EXCEPTION_THROW_PC && CURRENT_EXCEPTION_THROW_LINE)
--- 1982,1992 ----
        break;
  
      case bp_catch_catch:
!       if (current_exception_event &&
  	  (CURRENT_EXCEPTION_KIND == EX_EVENT_CATCH))
  	{
  	  annotate_catchpoint (bs->breakpoint_at->number);
! 	  printf_filtered ("\nCatchpoint %d (exception caught), ",
  			   bs->breakpoint_at->number);
  	  printf_filtered ("throw location ");
  	  if (CURRENT_EXCEPTION_THROW_PC && CURRENT_EXCEPTION_THROW_LINE)
***************
*** 1979,1990 ****
        else
  	{
  	  /* really throw, some other bpstat will handle it */
! 	  return PRINT_UNKNOWN;	
  	}
        break;
  
      case bp_catch_throw:
!       if (current_exception_event && 
  	  (CURRENT_EXCEPTION_KIND == EX_EVENT_THROW))
  	{
  	  annotate_catchpoint (bs->breakpoint_at->number);
--- 2011,2022 ----
        else
  	{
  	  /* really throw, some other bpstat will handle it */
! 	  return PRINT_UNKNOWN;
  	}
        break;
  
      case bp_catch_throw:
!       if (current_exception_event &&
  	  (CURRENT_EXCEPTION_KIND == EX_EVENT_THROW))
  	{
  	  annotate_catchpoint (bs->breakpoint_at->number);
***************
*** 2008,2019 ****
  
  	  printf_filtered ("\n");
  	  /* don't bother to print location frame info */
! 	  return PRINT_SRC_ONLY; 
  	}
        else
  	{
  	  /* really catch, some other bpstat will handle it */
! 	  return PRINT_UNKNOWN;	
  	}
        break;
  
--- 2040,2051 ----
  
  	  printf_filtered ("\n");
  	  /* don't bother to print location frame info */
! 	  return PRINT_SRC_ONLY;
  	}
        else
  	{
  	  /* really catch, some other bpstat will handle it */
! 	  return PRINT_UNKNOWN;
  	}
        break;
  
***************
*** 2046,2052 ****
        break;
  
      case bp_access_watchpoint:
!       if (bs->old_val != NULL)     
  	{
  	  annotate_watchpoint (bs->breakpoint_at->number);
  	  mention (bs->breakpoint_at);
--- 2078,2084 ----
        break;
  
      case bp_access_watchpoint:
!       if (bs->old_val != NULL)
  	{
  	  annotate_watchpoint (bs->breakpoint_at->number);
  	  mention (bs->breakpoint_at);
***************
*** 2056,2062 ****
  	  bs->old_val = NULL;
  	  printf_filtered ("\nNew value = ");
  	}
!       else 
  	{
  	  mention (bs->breakpoint_at);
  	  printf_filtered ("\nValue = ");
--- 2088,2094 ----
  	  bs->old_val = NULL;
  	  printf_filtered ("\nNew value = ");
  	}
!       else
  	{
  	  mention (bs->breakpoint_at);
  	  printf_filtered ("\nValue = ");
***************
*** 2066,2073 ****
        printf_filtered ("\n");
        return PRINT_UNKNOWN;
        break;
!     /* Fall through, we don't deal with these types of breakpoints
!        here. */
  
      case bp_finish:
      case bp_none:
--- 2098,2105 ----
        printf_filtered ("\n");
        return PRINT_UNKNOWN;
        break;
!       /* Fall through, we don't deal with these types of breakpoints
!          here. */
  
      case bp_finish:
      case bp_none:
***************
*** 2133,2139 ****
     An example is the catch/throw messages, which
     don't require a location appended to the end.  
     PRINT_NOTHING: We have done some printing and we don't need any 
!    further info to be printed.*/
  
  enum print_stop_action
  bpstat_print (bs)
--- 2165,2171 ----
     An example is the catch/throw messages, which
     don't require a location appended to the end.  
     PRINT_NOTHING: We have done some printing and we don't need any 
!    further info to be printed. */
  
  enum print_stop_action
  bpstat_print (bs)
***************
*** 2148,2155 ****
    for (; bs; bs = bs->next)
      {
        val = print_bp_stop_message (bs);
!       if (val == PRINT_SRC_ONLY 
! 	  || val == PRINT_SRC_AND_LOC 
  	  || val == PRINT_NOTHING)
  	return val;
      }
--- 2180,2187 ----
    for (; bs; bs = bs->next)
      {
        val = print_bp_stop_message (bs);
!       if (val == PRINT_SRC_ONLY
! 	  || val == PRINT_SRC_AND_LOC
  	  || val == PRINT_NOTHING)
  	return val;
      }
***************
*** 2226,2231 ****
--- 2258,2269 ----
           any chance of handling watchpoints on local variables, we'll need
           the frame chain (so we can determine if we're in scope).  */
        reinit_frame_cache ();
+       /* ??? RM: If we couldn't reconstruct the frame pointer, there's no
+          hope of evaluating the variable at this point. What to do? */
+       if (((get_current_frame ())->frame) == -1)
+ 	{
+ 	  return WP_VALUE_NOT_CHANGED;
+ 	}
        fr = find_frame_addr_in_frame_chain (b->watchpoint_frame);
        within_current_scope = (fr != NULL);
        if (within_current_scope)
***************
*** 2307,2313 ****
       CORE_ADDR *pc;
       int not_a_breakpoint;
  {
!   register struct breakpoint *b, *temp;
    CORE_ADDR bp_addr;
    /* True if we've hit a breakpoint (as opposed to a watchpoint).  */
    int real_breakpoint = 0;
--- 2345,2351 ----
       CORE_ADDR *pc;
       int not_a_breakpoint;
  {
!   register struct breakpoint *b, *temp = NULL;
    CORE_ADDR bp_addr;
    /* True if we've hit a breakpoint (as opposed to a watchpoint).  */
    int real_breakpoint = 0;
***************
*** 2320,2330 ****
    char message[sizeof (message1) + 30 /* slop */ ];
  
    /* Get the address where the breakpoint would have been.  */
!   bp_addr = *pc - (not_a_breakpoint && !SOFTWARE_SINGLE_STEP_P ? 
!                    0 : DECR_PC_AFTER_BREAK);
  
    ALL_BREAKPOINTS_SAFE (b, temp)
    {
      if (b->enable == disabled
  	|| b->enable == shlib_disabled
  	|| b->enable == call_disabled)
--- 2358,2372 ----
    char message[sizeof (message1) + 30 /* slop */ ];
  
    /* Get the address where the breakpoint would have been.  */
!   bp_addr = *pc - (not_a_breakpoint && !SOFTWARE_SINGLE_STEP_P ?
! 		   0 : DECR_PC_AFTER_BREAK);
  
    ALL_BREAKPOINTS_SAFE (b, temp)
    {
+     /* RM: If breakpoint has been deleted, keep going. */
+     if (b->type == bp_none)
+       continue;
+ 
      if (b->enable == disabled
  	|| b->enable == shlib_disabled
  	|| b->enable == call_disabled)
***************
*** 2357,2364 ****
  #if defined(SOLIB_HAVE_LOAD_EVENT)
  	&& (!SOLIB_HAVE_LOAD_EVENT (inferior_pid)
  	    || ((b->dll_pathname != NULL)
! 		&& (strcmp (b->dll_pathname, 
! 			    SOLIB_LOADED_LIBRARY_PATHNAME (inferior_pid)) 
  		    != 0)))
  #endif
        )
--- 2399,2406 ----
  #if defined(SOLIB_HAVE_LOAD_EVENT)
  	&& (!SOLIB_HAVE_LOAD_EVENT (inferior_pid)
  	    || ((b->dll_pathname != NULL)
! 		&& (strcmp (b->dll_pathname,
! 			    SOLIB_LOADED_LIBRARY_PATHNAME (inferior_pid))
  		    != 0)))
  #endif
        )
***************
*** 2368,2375 ****
  #if defined(SOLIB_HAVE_UNLOAD_EVENT)
  	&& (!SOLIB_HAVE_UNLOAD_EVENT (inferior_pid)
  	    || ((b->dll_pathname != NULL)
! 		&& (strcmp (b->dll_pathname, 
! 			    SOLIB_UNLOADED_LIBRARY_PATHNAME (inferior_pid)) 
  		    != 0)))
  #endif
        )
--- 2410,2417 ----
  #if defined(SOLIB_HAVE_UNLOAD_EVENT)
  	&& (!SOLIB_HAVE_UNLOAD_EVENT (inferior_pid)
  	    || ((b->dll_pathname != NULL)
! 		&& (strcmp (b->dll_pathname,
! 			    SOLIB_UNLOADED_LIBRARY_PATHNAME (inferior_pid))
  		    != 0)))
  #endif
        )
***************
*** 2403,2409 ****
      if (b->type == bp_watchpoint ||
  	b->type == bp_hardware_watchpoint)
        {
! 	switch (catch_errors (watchpoint_check, bs, message, 
  			      RETURN_MASK_ALL))
  	  {
  	  case WP_DELETED:
--- 2445,2451 ----
      if (b->type == bp_watchpoint ||
  	b->type == bp_hardware_watchpoint)
        {
! 	switch (catch_errors (watchpoint_check, bs, message,
  			      RETURN_MASK_ALL))
  	  {
  	  case WP_DELETED:
***************
*** 2438,2444 ****
  	    break;
  	  }
        }
!     else if (b->type == bp_read_watchpoint || 
  	     b->type == bp_access_watchpoint)
        {
  	CORE_ADDR addr;
--- 2480,2486 ----
  	    break;
  	  }
        }
!     else if (b->type == bp_read_watchpoint ||
  	     b->type == bp_access_watchpoint)
        {
  	CORE_ADDR addr;
***************
*** 2451,2457 ****
  	for (v = b->val_chain; v; v = v->next)
  	  {
  	    if (VALUE_LVAL (v) == lval_memory
! 		&& ! VALUE_LAZY (v))
  	      {
  		CORE_ADDR vaddr;
  
--- 2493,2499 ----
  	for (v = b->val_chain; v; v = v->next)
  	  {
  	    if (VALUE_LVAL (v) == lval_memory
! 		&& !VALUE_LAZY (v))
  	      {
  		CORE_ADDR vaddr;
  
***************
*** 2489,2495 ****
  	      bs->print_it = print_it_done;
  	      break;
  	    }
! 	else	/* found == 0 */
  	  {
  	    /* This is a case where some watchpoint(s) triggered,
  	       but not at the address of this watchpoint (FOUND
--- 2531,2538 ----
  	      bs->print_it = print_it_done;
  	      break;
  	    }
! 	else
! 	  /* found == 0 */
  	  {
  	    /* This is a case where some watchpoint(s) triggered,
  	       but not at the address of this watchpoint (FOUND
***************
*** 2497,2503 ****
  	       watchpoint.  */
  	    bs->print_it = print_it_noop;
  	    bs->stop = 0;
!             continue;
  	  }
        }
      else
--- 2540,2546 ----
  	       watchpoint.  */
  	    bs->print_it = print_it_noop;
  	    bs->stop = 0;
! 	    continue;
  	  }
        }
      else
***************
*** 2801,2812 ****
--- 2844,2857 ----
  	       This requires no further action.  */
  	    bs_class = no_effect;
  	  break;
+ #ifdef GET_LONGJMP_TARGET
  	case bp_longjmp:
  	  bs_class = long_jump;
  	  break;
  	case bp_longjmp_resume:
  	  bs_class = long_resume;
  	  break;
+ #endif /* GET_LONGJMP_TARGET */
  	case bp_step_resume:
  	  if (bs->stop)
  	    {
***************
*** 2862,2873 ****
--- 2907,2923 ----
  	  else if (bs->stop)
  	    bs_class = bs->print ? bp_noisy : bp_silent;
  	  break;
+ 	case bp_mmap:
+ 	  bs_class = bp_nostop;
+ 	  break;
  	case bp_call_dummy:
  	  /* Make sure the action is stop (silent or noisy),
  	     so infrun.c pops the dummy frame.  */
  	  bs_class = bp_silent;
  	  retval.call_dummy = 1;
  	  break;
+ 	default:
+ 	  continue;
  	}
        current_action = table[(int) bs_class][(int) current_action];
      }
***************
*** 2930,2937 ****
        if ((ep->type != bp_catch_load) &&
  	  (ep->type != bp_catch_unload) &&
  	  (ep->type != bp_catch_catch) &&
! 	  (ep->type != bp_catch_throw))		
! 	/* pai: (temp) ADD fork/vfork here!!  */
  	continue;
  
        /* Yes; add it to the list. */
--- 2980,2987 ----
        if ((ep->type != bp_catch_load) &&
  	  (ep->type != bp_catch_unload) &&
  	  (ep->type != bp_catch_catch) &&
! 	  (ep->type != bp_catch_throw))
! 	/* add fork/vfork here ?  */
  	continue;
  
        /* Yes; add it to the list. */
***************
*** 2957,2963 ****
  #endif
        if (dll_pathname)
  	{
! 	  ep->triggered_dll_pathname = (char *) 
  	    xmalloc (strlen (dll_pathname) + 1);
  	  strcpy (ep->triggered_dll_pathname, dll_pathname);
  	}
--- 3007,3013 ----
  #endif
        if (dll_pathname)
  	{
! 	  ep->triggered_dll_pathname = (char *)
  	    xmalloc (strlen (dll_pathname) + 1);
  	  strcpy (ep->triggered_dll_pathname, dll_pathname);
  	}
***************
*** 2968,2973 ****
--- 3018,3085 ----
    *cp_list = bs;
  }
  
+ #ifdef IMPLICIT_SHLIB_EVENT_NOTIFICATION_LACKING
+ /* 
+  * caught_active_load : 
+  * 
+  * srikanth, 980830, CLLbs14756 : returns a boolean indicating whether 
+  * any of the libraries loaded by dld at this time is the subject of an 
+  * active catch load;  An informative message regarding the triggered
+  * catch load points is also produced.
+  *
+  */
+ 
+ boolean
+ caught_active_load ()
+ {
+ 
+   boolean caught = false;
+   register struct breakpoint *b;
+   extern boolean som_solib_isloaded (char *);
+   boolean named_catch = false;
+ 
+   ALL_BREAKPOINTS (b)
+   {
+     if (b->type != bp_catch_load)
+       continue;
+ 
+     if (b->enable == disabled
+ 	|| b->enable == shlib_disabled
+ 	|| b->enable == call_disabled)
+       continue;
+ 
+     if (b->dll_pathname == NULL)	/* catch anything */
+       caught = true;
+     else if (som_solib_isloaded (b->dll_pathname))	/* catch this */
+       {
+ 	caught = true;
+ 	named_catch = true;
+ 	annotate_catchpoint (b->number);
+ 	printf_filtered ("\nCatchpoint %d (", b->number);
+ 	printf_filtered ("loaded");
+ 	printf_filtered (" %s)  ", b->dll_pathname);
+       }
+   }
+ 
+   if (caught)
+     {
+       if (!named_catch)
+ 	{
+ 	  /* 
+ 	   * This is a case of catch load <any library>
+ 	   * Let us simply report all libraries that have been
+ 	   * loaded at this point. Mimic the info share command 
+ 	   */
+ 	  printf_filtered ("\nCaught shared library load\n");
+ 	  som_sharedlibrary_info_command ("", 0);	/* ignores its args */
+ 	}
+       printf_filtered ("\n");
+     }
+ 
+   return caught;
+ }
+ #endif
+ 
  /* Print information on breakpoint number BNUM, or -1 if all.
     If WATCHPOINTS is zero, process only breakpoints; if WATCHPOINTS
     is nonzero, process only watchpoints.  */
***************
*** 3013,3019 ****
      {bp_catch_vfork, "catch vfork"},
      {bp_catch_exec, "catch exec"},
      {bp_catch_catch, "catch catch"},
!     {bp_catch_throw, "catch throw"}
    };
  
    static char *bpdisps[] =
--- 3125,3132 ----
      {bp_catch_vfork, "catch vfork"},
      {bp_catch_exec, "catch exec"},
      {bp_catch_catch, "catch catch"},
!     {bp_catch_throw, "catch throw"},
!     {bp_mmap, "mmap"}
    };
  
    static char *bpdisps[] =
***************
*** 3146,3153 ****
--- 3259,3268 ----
  	case bp_hardware_breakpoint:
  	case bp_until:
  	case bp_finish:
+ #ifdef GET_LONGJMP_TARGET
  	case bp_longjmp:
  	case bp_longjmp_resume:
+ #endif /* GET_LONGJMP_TARGET */
  	case bp_step_resume:
  	case bp_through_sigtramp:
  	case bp_watchpoint_scope:
***************
*** 3156,3167 ****
  	  if (addressprint)
  	    {
  	      annotate_field (4);
! 	      /* FIXME-32x64: need a print_address_numeric with
! 	         field width */
! 	      printf_filtered
! 		("%s ",
! 		 local_hex_string_custom
! 		 ((unsigned long) b->address, "08l"));
  	    }
  
  	  annotate_field (5);
--- 3271,3283 ----
  	  if (addressprint)
  	    {
  	      annotate_field (4);
! 	      if (!b->address && b->enable == shlib_disabled)
! 		printf_filtered ("(deferred) ");
! 	      else
! 		printf_filtered
! 		  ("%s ",
! 		   longest_local_hex_string_custom
! 		   ((LONGEST) b->address, "08l"));
  	    }
  
  	  annotate_field (5);
***************
*** 3180,3188 ****
--- 3296,3312 ----
  	      fputs_filtered (b->source_file, gdb_stdout);
  	      printf_filtered (":%d", b->line_number);
  	    }
+ 	  else if (!b->address && b->enable == shlib_disabled)
+ 	    /* srikanth, JAGab25505, print name for deferred bp's */
+ 	    {
+ 	      fputs_filtered ("in ", gdb_stdout);
+ 	      fputs_filtered (b->addr_string, gdb_stdout);
+ 	    }
  	  else
  	    print_address_symbolic (b->address, gdb_stdout, demangle, " ");
  	  break;
+ 	default:
+ 	  break;
  	}
  
        if (b->thread != -1)
***************
*** 3315,3323 ****
  	    printf_filtered
  	      ("%d%s%s ",
  	       b->number,
! 	       ((b->enable == disabled || 
! 		 b->enable == shlib_disabled || 
! 		 b->enable == call_disabled) ? " (disabled)" 
  		: b->enable == permanent ? " (permanent)"
  		: ""),
  	       (others > 1) ? "," : ((others == 1) ? " and" : ""));
--- 3439,3447 ----
  	    printf_filtered
  	      ("%d%s%s ",
  	       b->number,
! 	       ((b->enable == disabled ||
! 		 b->enable == shlib_disabled ||
! 		 b->enable == call_disabled) ? " (disabled)"
  		: b->enable == permanent ? " (permanent)"
  		: ""),
  	       (others > 1) ? "," : ((others == 1) ? " and" : ""));
***************
*** 3375,3381 ****
  	  perm_bp = b;
  	  break;
  	}
! 	
        count++;
        b->duplicate = count > 1;
      }
--- 3499,3505 ----
  	  perm_bp = b;
  	  break;
  	}
! 
        count++;
        b->duplicate = count > 1;
      }
***************
*** 3388,3411 ****
        perm_bp->duplicate = 0;
  
        /* Permanent breakpoint should always be inserted.  */
!       if (! perm_bp->inserted)
  	internal_error ("allegedly permanent breakpoint is not "
  			"actually inserted");
  
        ALL_BREAKPOINTS (b)
  	if (b != perm_bp)
! 	  {
! 	    if (b->inserted)
! 	      internal_error ("another breakpoint was inserted on top of "
! 			      "a permanent breakpoint");
! 
! 	    if (b->enable != disabled
! 		&& b->enable != shlib_disabled
! 		&& b->enable != call_disabled
! 		&& b->address == address
! 		&& (overlay_debugging == 0 || b->section == section))
! 	      b->duplicate = 1;
! 	  }
      }
  }
  
--- 3512,3535 ----
        perm_bp->duplicate = 0;
  
        /* Permanent breakpoint should always be inserted.  */
!       if (!perm_bp->inserted)
  	internal_error ("allegedly permanent breakpoint is not "
  			"actually inserted");
  
        ALL_BREAKPOINTS (b)
  	if (b != perm_bp)
! 	{
! 	  if (b->inserted)
! 	    internal_error ("another breakpoint was inserted on top of "
! 			    "a permanent breakpoint");
! 
! 	  if (b->enable != disabled
! 	      && b->enable != shlib_disabled
! 	      && b->enable != call_disabled
! 	      && b->address == address
! 	      && (overlay_debugging == 0 || b->section == section))
! 	    b->duplicate = 1;
! 	}
      }
  }
  
***************
*** 3495,3501 ****
      {
        struct minimal_symbol *m;
  
!       m = lookup_minimal_symbol_text (func_name, NULL, 
  				      (struct objfile *) NULL);
        if (m)
  	sal.pc = SYMBOL_VALUE_ADDRESS (m);
--- 3619,3625 ----
      {
        struct minimal_symbol *m;
  
!       m = lookup_minimal_symbol_text (func_name, NULL,
  				      (struct objfile *) NULL);
        if (m)
  	sal.pc = SYMBOL_VALUE_ADDRESS (m);
***************
*** 3522,3527 ****
--- 3646,3653 ----
     if we do a longjmp().  When we hit that breakpoint, call
     set_longjmp_resume_breakpoint() to figure out where we are going. */
  
+ #ifdef GET_LONGJMP_TARGET
+ 
  void
  enable_longjmp_breakpoint ()
  {
***************
*** 3548,3559 ****
        check_duplicates (b->address, b->section);
      }
  }
  
  #ifdef SOLIB_ADD
  void
  remove_solib_event_breakpoints ()
  {
!   register struct breakpoint *b, *temp;
  
    ALL_BREAKPOINTS_SAFE (b, temp)
      if (b->type == bp_shlib_event)
--- 3674,3686 ----
        check_duplicates (b->address, b->section);
      }
  }
+ #endif /* GET_LONGJMP_TARGET */
  
  #ifdef SOLIB_ADD
  void
  remove_solib_event_breakpoints ()
  {
!   register struct breakpoint *b, *temp = NULL;
  
    ALL_BREAKPOINTS_SAFE (b, temp)
      if (b->type == bp_shlib_event)
***************
*** 3614,3639 ****
    }
  }
  
  /* Try to reenable any breakpoints in shared libraries.  */
  void
  re_enable_breakpoints_in_shlibs ()
  {
!   struct breakpoint *b;
  
    ALL_BREAKPOINTS (b)
      if (b->enable == shlib_disabled)
      {
        char buf[1];
  
!       /* Do not reenable the breakpoint if the shared library
!          is still not mapped in.  */
!       if (target_read_memory (b->address, buf, 1) == 0)
! 	b->enable = enabled;
      }
  }
  
  #endif
  
  static void
  solib_load_unload_1 (hookname, tempflag, dll_pathname, cond_string, bp_kind)
       char *hookname;
--- 3741,3963 ----
    }
  }
  
+ /* cover routine for parse_exp_1 */
+ int 
+ cover_parse_exp_1 (args)
+      args_for_parse_exp_1 *args;
+ {
+   args->result = parse_exp_1 (args->exp_string_p, args->block, 0);
+   return 1;
+ }
+ 
+ /* cover routine for decode_line_1 */
+ int 
+ cover_decode_line_1 (args)
+      args_for_decode_line_1 *args;
+ {
+   args->result = decode_line_1 (args->addr_string_p,
+ 				1,
+ 				(struct symtab *) NULL,
+ 				0,
+ 				args->canonical_p);
+   return 1;
+ }
+ 
  /* Try to reenable any breakpoints in shared libraries.  */
  void
  re_enable_breakpoints_in_shlibs ()
  {
!   struct breakpoint *b, *cur_bp;
!   struct symtabs_and_lines sals;
!   struct symtab_and_line sal;
!   char *addr_string, *addr_string2;
!   char *cond_string;
!   int i;
!   args_for_parse_exp_1 args;
!   args_for_decode_line_1 args2;
!   char **canonical = (char **) NULL;
  
    ALL_BREAKPOINTS (b)
      if (b->enable == shlib_disabled)
      {
        char buf[1];
  
!       if (!b->address)
! 	{
! 	  /* RM: see if the breakpoint location is now known */
! 	  sals.sals = NULL;
! 	  sals.nelts = 0;
! 
! 	  addr_string = b->addr_string;
! 	  addr_string2 = addr_string;
! 	  args2.result.nelts = 0;
! 	  args2.addr_string_p = &addr_string2;
! 	  canonical = 0;
! 	  args2.canonical_p = &canonical;
! 	  if (!catch_errors ((int (*)PARAMS ((char *)))
! 			     cover_decode_line_1,
! 			     (char *) &args2,
! 			     "",
! 			     RETURN_MASK_ALL))
! 	    continue;
! 
! 	  sals = args2.result;
! 
! 	  if (sals.nelts == 0)
! 	    continue;
! 
! 	  /* do we have hardware breakpoints available? */
! 	  if (b->type == bp_hardware_breakpoint)
! 	    {
! 	      int i, target_resources_ok;
! 
! 	      i = hw_breakpoint_used_count ();
! 	      target_resources_ok =
! 		TARGET_CAN_USE_HARDWARE_WATCHPOINT (bp_hardware_breakpoint,
! 						    i + sals.nelts, 0);
! 	      if (target_resources_ok <= 0)
! 		b->type = bp_breakpoint;
! 	    }
! 
! 
! 	  /* RM: if so, set the address field of the breakpoint */
! 	  /* might expand to more than one breakpoint. Just set a
! 	   * breakpoint on all instances. */
! 	  /* iterate over all instances */
! 	  for (i = 0; i < sals.nelts; i++)
! 	    {
! 	      sal = sals.sals[i];
! 	      catch_errors ((int (*)PARAMS ((char *)))
! 			    resolve_sal_pc,
! 			    (char *) &sal,
! 			    "",
! 			    RETURN_MASK_ALL);
! 	      if (!sal.pc)
! 		continue;
! 
! 	      /* first time around the loop, we use the existing breakpoint
! 	       * structure. Subsequent iterations require new breakpoint
! 	       * structures */
! 	      if (i)
! 		{
! 		  /* need more breakpoint structures */
! 		  cur_bp = set_raw_breakpoint (sal);
! 		  set_breakpoint_count (breakpoint_count + 1);
! 		  cur_bp->number = breakpoint_count;
! 		  cur_bp->type = b->type;
! 		  cur_bp->cond = NULL;
! 		  cur_bp->thread = b->thread;
! 		  if (canonical != (char **) NULL &&
! 		      canonical[i] != NULL)
! 		    cur_bp->addr_string = canonical[i];
! 		  else
! 		    cur_bp->addr_string = savestring (addr_string,
! 						      strlen (addr_string));
! 		  if (b->cond_string)
! 		    cur_bp->cond_string = savestring (b->cond_string,
! 						   strlen (b->cond_string));
! 		  cur_bp->enable = shlib_disabled;
! 		  cur_bp->disposition = b->disposition;
! 		}
! 	      else
! 		{
! 		  cur_bp = b;
! 		  if (canonical != (char **) NULL &&
! 		      canonical[i] != NULL)
! 		    cur_bp->addr_string = canonical[i];
! 		  else
! 		    cur_bp->addr_string = savestring (addr_string,
! 						      strlen (addr_string));
! 		}
! 
! 	      cur_bp->address = sal.pc;
! 	      if (sal.symtab == NULL)
! 		cur_bp->source_file = NULL;
! 	      else
! 		cur_bp->source_file =
! 		  savestring (sal.symtab->filename,
! 			      strlen (sal.symtab->filename));
! 	      cur_bp->line_number = sal.line;
! 
! 	      if (cur_bp->cond_string)
! 		{
! 		  cond_string = cur_bp->cond_string;
! 		  args.exp_string_p = &cond_string;
! 		  args.block = block_for_pc (sals.sals[i].pc);
! 		  args.result = 0;
! 		  if (!catch_errors ((int (*)PARAMS ((char *)))
! 				     cover_parse_exp_1,
! 				     (char *) &args,
! 				     "",
! 				     RETURN_MASK_ALL))
! 		    {
! 		      printf_filtered ("Error in parsing condition for "
! 				       "breakpoint %d. Converting to "
! 				       "unconditional \nbreakpoint.",
! 				       cur_bp->number);
! 		      safe_free (cur_bp->cond_string);
! 		      cur_bp->cond_string = 0;
! 		    }
! 
! 		  cur_bp->cond = args.result;
! 		}
! 
! 	      if (cur_bp->address &&
! 		  target_read_memory (cur_bp->address, buf, 1) == 0)
! 		cur_bp->enable = enabled;
! 	    }
! 
! 	  if (b->enable == enabled)
! 	    {
! 	      /* Since the breakpoint is effectively modified,
! 	         inform those that might want to know. */
! 	      if (modify_breakpoint_hook)
! 		modify_breakpoint_hook (b);
! 	      safe_free (addr_string);
! 	    }
! 	  check_duplicates (sal.pc, b->section);
! 	  breakpoints_changed ();
! 	}
!       else
! 	{
! 	  /* Do not reenable the breakpoint if the shared library
! 	     is still not mapped in.  */
! 	  if (target_read_memory (b->address, buf, 1) == 0)
! 	    b->enable = enabled;
! 	}
      }
  }
  
  #endif
  
+ void
+ remove_mmap_breakpoints ()
+ {
+   register struct breakpoint *b, *temp;
+ 
+   ALL_BREAKPOINTS_SAFE (b, temp)
+     if (b->type == bp_mmap)
+     delete_breakpoint (b);
+ }
+ 
+ struct breakpoint *
+ create_mmap_breakpoint (address)
+      CORE_ADDR address;
+ {
+   struct breakpoint *b;
+   struct symtab_and_line sal;
+ 
+   sal.pc = address;
+   sal.symtab = NULL;
+   sal.line = 0;
+   b = set_raw_breakpoint (sal);
+   b->number = internal_breakpoint_number--;
+   b->disposition = donttouch;
+   b->type = bp_mmap;
+ 
+   return b;
+ }
+ 
  static void
  solib_load_unload_1 (hookname, tempflag, dll_pathname, cond_string, bp_kind)
       char *hookname;
***************
*** 3687,3696 ****
      discard_cleanups (canonical_strings_chain);
  
    b = set_raw_breakpoint (sals.sals[0]);
    set_breakpoint_count (breakpoint_count + 1);
    b->number = breakpoint_count;
    b->cond = NULL;
!   b->cond_string = (cond_string == NULL) ? 
      NULL : savestring (cond_string, strlen (cond_string));
    b->thread = thread;
  
--- 4011,4021 ----
      discard_cleanups (canonical_strings_chain);
  
    b = set_raw_breakpoint (sals.sals[0]);
+ 
    set_breakpoint_count (breakpoint_count + 1);
    b->number = breakpoint_count;
    b->cond = NULL;
!   b->cond_string = (cond_string == NULL) ?
      NULL : savestring (cond_string, strlen (cond_string));
    b->thread = thread;
  
***************
*** 3712,3741 ****
    b->type = bp_kind;
  
    mention (b);
    do_cleanups (old_chain);
  }
  
  void
! create_solib_load_event_breakpoint (hookname, tempflag, 
  				    dll_pathname, cond_string)
       char *hookname;
       int tempflag;
       char *dll_pathname;
       char *cond_string;
  {
!   solib_load_unload_1 (hookname, tempflag, dll_pathname, 
! 		       cond_string, bp_catch_load);
  }
  
  void
! create_solib_unload_event_breakpoint (hookname, tempflag, 
  				      dll_pathname, cond_string)
       char *hookname;
       int tempflag;
       char *dll_pathname;
       char *cond_string;
  {
!   solib_load_unload_1 (hookname,tempflag, dll_pathname, 
  		       cond_string, bp_catch_unload);
  }
  
--- 4037,4067 ----
    b->type = bp_kind;
  
    mention (b);
+ 
    do_cleanups (old_chain);
  }
  
  void
! create_solib_load_event_breakpoint (hookname, tempflag,
  				    dll_pathname, cond_string)
       char *hookname;
       int tempflag;
       char *dll_pathname;
       char *cond_string;
  {
!   solib_load_unload_1 (hookname, tempflag, dll_pathname,
!                        cond_string, bp_catch_load);
  }
  
  void
! create_solib_unload_event_breakpoint (hookname, tempflag,
  				      dll_pathname, cond_string)
       char *hookname;
       int tempflag;
       char *dll_pathname;
       char *cond_string;
  {
!   solib_load_unload_1 (hookname, tempflag, dll_pathname,
  		       cond_string, bp_catch_unload);
  }
  
***************
*** 3758,3764 ****
    set_breakpoint_count (breakpoint_count + 1);
    b->number = breakpoint_count;
    b->cond = NULL;
!   b->cond_string = (cond_string == NULL) ? 
      NULL : savestring (cond_string, strlen (cond_string));
    b->thread = thread;
    b->addr_string = NULL;
--- 4084,4090 ----
    set_breakpoint_count (breakpoint_count + 1);
    b->number = breakpoint_count;
    b->cond = NULL;
!   b->cond_string = (cond_string == NULL) ?
      NULL : savestring (cond_string, strlen (cond_string));
    b->thread = thread;
    b->addr_string = NULL;
***************
*** 3857,3862 ****
--- 4183,4190 ----
    return i;
  }
  
+ #ifdef GET_LONGJMP_TARGET
+ 
  /* Call this after hitting the longjmp() breakpoint.  Use this to set
     a new breakpoint at the target of the jmp_buf.
  
***************
*** 3884,3889 ****
--- 4212,4219 ----
      }
  }
  
+ #endif /* GET_LONGJMP_TARGET */
+ 
  void
  disable_watchpoints_before_interactive_call_start ()
  {
***************
*** 3987,3993 ****
        print_expression (b->exp, gdb_stdout);
        break;
      case bp_access_watchpoint:
!       printf_filtered ("Hardware access (read/write) watchpoint %d: ", 
  		       b->number);
        print_expression (b->exp, gdb_stdout);
        break;
--- 4317,4323 ----
        print_expression (b->exp, gdb_stdout);
        break;
      case bp_access_watchpoint:
!       printf_filtered ("Hardware access (read/write) watchpoint %d: ",
  		       b->number);
        print_expression (b->exp, gdb_stdout);
        break;
***************
*** 4004,4010 ****
        printf_filtered ("Catchpoint %d (%s %s)",
  		       b->number,
  		       (b->type == bp_catch_load) ? "load" : "unload",
! 		       (b->dll_pathname != NULL) ? 
  		       b->dll_pathname : "<any library>");
        break;
      case bp_catch_fork:
--- 4334,4340 ----
        printf_filtered ("Catchpoint %d (%s %s)",
  		       b->number,
  		       (b->type == bp_catch_load) ? "load" : "unload",
! 		       (b->dll_pathname != NULL) ?
  		       b->dll_pathname : "<any library>");
        break;
      case bp_catch_fork:
***************
*** 4026,4039 ****
--- 4356,4373 ----
  
      case bp_until:
      case bp_finish:
+ #ifdef GET_LONGJMP_TARGET
      case bp_longjmp:
      case bp_longjmp_resume:
+ #endif /* GET_LONGJMP_TARGET */
      case bp_step_resume:
      case bp_through_sigtramp:
      case bp_call_dummy:
      case bp_watchpoint_scope:
      case bp_shlib_event:
        break;
+     default:
+       break;
      }
    if (say_where)
      {
***************
*** 4045,4055 ****
        if (b->source_file)
  	printf_filtered (": file %s, line %d.",
  			 b->source_file, b->line_number);
!       TUIDO (((TuiOpaqueFuncPtr) tui_vAllSetHasBreakAt, b, 1));
        TUIDO (((TuiOpaqueFuncPtr) tuiUpdateAllExecInfos));
      }
    printf_filtered ("\n");
  }
  
  
  /* Set a breakpoint according to ARG (function, linenum or *address)
--- 4379,4419 ----
        if (b->source_file)
  	printf_filtered (": file %s, line %d.",
  			 b->source_file, b->line_number);
!       /*  tuiAllSetHasBreakAt does no screen updates, so it doesn't
!          need a tuiDo() */
!       TUIDOWITHOUTTERMTRANSITION (((TuiOpaqueFuncPtr) tui_vAllSetHasBreakAt,
! 				   b, TRUE));
        TUIDO (((TuiOpaqueFuncPtr) tuiUpdateAllExecInfos));
      }
    printf_filtered ("\n");
  }
+ 
+ /* Make a copy of the expression at COND_PTR 
+    Called when there are multiple breakpoints being set with the same
+    condition; as with the command "break obj::foo if (a)".
+    Uses malloc to get the space.  Returns the address of the copy.
+  */
+ 
+ static struct expression *
+ save_breakpoint_condition (cond_ptr)
+      struct expression *cond_ptr;
+ {
+   register struct expression *p;
+   register int len;
+ 
+   if (cond_ptr == NULL)
+     return cond_ptr;
+ 
+   len =
+     sizeof (struct expression) + EXP_ELEM_TO_BYTES (cond_ptr->nelts);
+ 
+   p = (struct expression *) xmalloc (len);
+ 
+   /* Copy the original expression into temp.  */
+   memcpy (p, cond_ptr, len);
+ 
+   return p;
+ }
  
  
  /* Set a breakpoint according to ARG (function, linenum or *address)
***************
*** 4072,4079 ****
--- 4436,4445 ----
    char *cond_end = NULL;
    /* Pointers in arg to the start, and one past the end,
       of the address part.  */
+   char *addr_string = NULL;
    char *addr_start = NULL;
    char *addr_end = NULL;
+   char buf[12];			/* number of hex digits in an address + 4 */
    struct cleanup *old_chain;
    struct cleanup *canonical_strings_chain = NULL;
    char **canonical = (char **) NULL;
***************
*** 4103,4108 ****
--- 4469,4480 ----
  	  sal.section = find_pc_overlay (sal.pc);
  	  sals.sals[0] = sal;
  	  sals.nelts = 1;
+ 	  /* RM: set addr_start and addr_end, or this breakpoint won't
+ 	   * have an addr_string, and will get deleted when we do a re-run.
+ 	   */
+ 	  sprintf (buf, "*0x%08lx", default_breakpoint_address);
+ 	  addr_start = buf;
+ 	  addr_end = buf + sizeof (buf) - 1;
  	}
        else
  	error ("No default breakpoint address now.");
***************
*** 4127,4133 ****
      }
  
    if (!sals.nelts)
!     return;
  
    /* Make sure that all storage allocated in decode_line_1 gets freed
       in case the following `for' loop errors out.  */
--- 4499,4590 ----
      }
  
    if (!sals.nelts)
!     {
! #ifdef SOLIB_ADD
!       /* RM: location may be in a shared library. Print a warning
!        * message, and keep the breakpoint around.
!        */
!       char *tok, *end_tok;
!       int toklen;
! 
!       if (!addr_start)
! 	return;
! 
!       thread = -1;
!       while (addr_end && (addr_end > addr_start) &&
! 	     (*(addr_end - 1) == ' ' || *(addr_end - 1) == '\t'))
! 	addr_end--;
! 
!       addr_string = savestring (addr_start, addr_end - addr_start);
! 
!       /* RM: find the start and end of the condition string.  We'll
!        * need this when we finally enable the breakpoint. */
!       tok = arg;
! 
!       while (tok && *tok)
! 	{
! 	  while (*tok == ' ' || *tok == '\t')
! 	    tok++;
! 
! 	  end_tok = tok;
! 
! 	  while (*end_tok != ' ' && *end_tok != '\t' && *end_tok != '\000')
! 	    end_tok++;
! 
! 	  toklen = end_tok - tok;
! 
! 	  if (toklen >= 1 && strncmp (tok, "if", toklen) == 0)
! 	    {
! 	      tok = cond_start = end_tok + 1;
! 	      while (tok && *tok)
! 		tok++;
! 	      cond_end = tok;
! 	    }
! 	  else if (toklen >= 1 && strncmp (tok, "thread", toklen) == 0)
! 	    {
! 	      char *tmptok;
! 
! 	      tok = end_tok + 1;
! 	      tmptok = tok;
! 	      thread = strtol (tok, &tok, 0);
! 	      if (tok == tmptok)
! 		error ("Junk after thread keyword.");
! 	      if (!valid_thread_id (thread))
! 		error ("Unknown thread %d\n", thread);
! 	    }
! 	  else
! 	    error ("Junk at end of arguments.");
! 	}
! 
!       sal.symtab = NULL;
!       sal.end = sal.pc = sal.line = 0;
!       b = set_raw_breakpoint (sal);
!       set_breakpoint_count (breakpoint_count + 1);
!       b->number = breakpoint_count;
!       b->type = hardwareflag ? bp_hardware_breakpoint : bp_breakpoint;
!       b->cond = NULL;
!       b->thread = thread;
!       b->addr_string = addr_string;
!       if (cond_start)
! 	b->cond_string = savestring (cond_start, cond_end - cond_start);
!       b->enable = shlib_disabled;
!       b->disposition = tempflag ? del : donttouch;
! 
!       /* RM: All went okay, print message */
!       printf_filtered
! 	("Breakpoint %d (deferred) at \"%s\" (\"%s\" was not found).\n",
! 	 b->number,
! 	 addr_string,
! 	 addr_string);
!       printf_filtered
! 	("Breakpoint deferred until a shared library containing \"%s\" is loaded.\n",
! 	 addr_string);
!       /* This is typically called from mention, but we return early */
!       if (create_breakpoint_hook)
! 	create_breakpoint_hook (b);
! #endif
!       return;
!     }
  
    /* Make sure that all storage allocated in decode_line_1 gets freed
       in case the following `for' loop errors out.  */
***************
*** 4169,4175 ****
           try to make a breakpoint for it. */
        if (PC_REQUIRES_RUN_BEFORE_USE (sals.sals[i].pc))
  	{
! 	  error ("Cannot break on %s without a running program.", 
  		 addr_start);
  	}
  
--- 4626,4632 ----
           try to make a breakpoint for it. */
        if (PC_REQUIRES_RUN_BEFORE_USE (sals.sals[i].pc))
  	{
! 	  error ("Cannot break on %s without a running program.",
  		 addr_start);
  	}
  
***************
*** 4214,4221 ****
        int i, target_resources_ok;
  
        i = hw_breakpoint_used_count ();
!       target_resources_ok = 
! 	TARGET_CAN_USE_HARDWARE_WATCHPOINT (bp_hardware_breakpoint, 
  					    i + sals.nelts, 0);
        if (target_resources_ok == 0)
  	error ("No hardware breakpoint support in the target.");
--- 4671,4678 ----
        int i, target_resources_ok;
  
        i = hw_breakpoint_used_count ();
!       target_resources_ok =
! 	TARGET_CAN_USE_HARDWARE_WATCHPOINT (bp_hardware_breakpoint,
  					    i + sals.nelts, 0);
        if (target_resources_ok == 0)
  	error ("No hardware breakpoint support in the target.");
***************
*** 4239,4245 ****
        set_breakpoint_count (breakpoint_count + 1);
        b->number = breakpoint_count;
        b->type = hardwareflag ? bp_hardware_breakpoint : bp_breakpoint;
!       b->cond = cond;
        b->thread = thread;
  
        /* If a canonical line spec is needed use that instead of the
--- 4696,4705 ----
        set_breakpoint_count (breakpoint_count + 1);
        b->number = breakpoint_count;
        b->type = hardwareflag ? bp_hardware_breakpoint : bp_breakpoint;
!       if (i > 0)
! 	b->cond = save_breakpoint_condition (cond);
!       else
! 	b->cond = cond;
        b->thread = thread;
  
        /* If a canonical line spec is needed use that instead of the
***************
*** 4270,4276 ****
       int flag;
       int from_tty;
  {
!   struct frame_info *frame;
    CORE_ADDR low, high, selected_pc = 0;
    char *extra_args, *level_arg, *addr_string;
    int extra_args_len = 0, if_arg = 0;
--- 4730,4736 ----
       int flag;
       int from_tty;
  {
!   struct frame_info *frame = NULL;
    CORE_ADDR low, high, selected_pc = 0;
    char *extra_args, *level_arg, *addr_string;
    int extra_args_len = 0, if_arg = 0;
***************
*** 4348,4353 ****
--- 4808,4814 ----
       int flag;
       int from_tty;
  {
+   char *symbol = arg;
    char *addr_string, *break_string, *beg_addr_string;
    CORE_ADDR low, high;
    struct symtabs_and_lines sals;
***************
*** 4364,4370 ****
  	{
  	  if (selected_frame)
  	    {
! 	      addr_string = (char *) xmalloc (15);
  	      sprintf (addr_string, "*0x%s", paddr_nz (selected_frame->pc));
  	      if (arg)
  		if_arg = 1;
--- 4825,4832 ----
  	{
  	  if (selected_frame)
  	    {
! 	      addr_string = (char *) xmalloc (strlen ("*0x")
! 					   + 16 /* 64-bit hex addr */  + 1);
  	      sprintf (addr_string, "*0x%s", paddr_nz (selected_frame->pc));
  	      if (arg)
  		if_arg = 1;
***************
*** 4405,4416 ****
--- 4867,4891 ----
  			(char ***) NULL);
  
    free (beg_addr_string);
+ 
    old_chain = make_cleanup (free, sals.sals);
    for (i = 0; (i < sals.nelts); i++)
      {
        sal = sals.sals[i];
        if (find_pc_partial_function (sal.pc, (char **) NULL, &low, &high))
  	{
+ 	  /* See JAGaa80623.  This subracted 4 from high if there was no
+ 	     symtab.  It turns out that we want to set the breakpoint
+ 	     at high - INSTRUCTION_SIZE in any case, because high
+ 	     is the first address past the end of the function.  This
+ 	     is working on HPPA because there is a nop after the bv at
+ 	     the end of the function, but we really should break on the
+ 	     bv.  This is critical on architectures like IA64 which don't
+ 	     have a delay slot.
+ 	   */
+ #ifdef INSTRUCTION_SIZE
+ 	  high -= INSTRUCTION_SIZE;
+ #endif
  	  break_string = (char *) xmalloc (extra_args_len + 26);
  	  if (extra_args_len)
  	    sprintf (break_string, "*0x%s %s", paddr_nz (high), extra_args);
***************
*** 4618,4625 ****
  
  /* ARGSUSED */
  /* accessflag:  hw_write:  watch write, 
!                 hw_read:   watch read, 
! 		hw_access: watch access (read or write) */
  static void
  watch_command_1 (arg, accessflag, from_tty)
       char *arg;
--- 5093,5100 ----
  
  /* ARGSUSED */
  /* accessflag:  hw_write:  watch write, 
!    hw_read:   watch read, 
!    hw_access: watch access (read or write) */
  static void
  watch_command_1 (arg, accessflag, from_tty)
       char *arg;
***************
*** 4689,4696 ****
    if (mem_cnt != 0)
      {
        i = hw_watchpoint_used_count (bp_type, &other_type_used);
!       target_resources_ok = 
! 	TARGET_CAN_USE_HARDWARE_WATCHPOINT (bp_type, i + mem_cnt, 
  					    other_type_used);
        if (target_resources_ok == 0 && bp_type != bp_hardware_watchpoint)
  	error ("Target does not support this type of hardware watchpoint.");
--- 5164,5171 ----
    if (mem_cnt != 0)
      {
        i = hw_watchpoint_used_count (bp_type, &other_type_used);
!       target_resources_ok =
! 	TARGET_CAN_USE_HARDWARE_WATCHPOINT (bp_type, i + mem_cnt,
  					    other_type_used);
        if (target_resources_ok == 0 && bp_type != bp_hardware_watchpoint)
  	error ("Target does not support this type of hardware watchpoint.");
***************
*** 4745,4751 ****
    else
      b->watchpoint_frame = (CORE_ADDR) 0;
  
!   if (mem_cnt && target_resources_ok > 0)
      b->type = bp_type;
    else
      b->type = bp_watchpoint;
--- 5220,5236 ----
    else
      b->watchpoint_frame = (CORE_ADDR) 0;
  
!   /* RM: It's not useful to use hardware watchpoints for "local"
!      expressions, since local variables are on the stack, and we
!      write to the stack all the time. */
!   /* FIXME: ifdef'd to HPPA only for now ...
!      commands.exp/'continue with watch' fails on Linux.
!      - guo, 19991110 */
!   if ((mem_cnt && target_resources_ok > 0)
! #ifdef GDB_TARGET_IS_HPPA
!       && (!frame)
! #endif
!       )
      b->type = bp_type;
    else
      b->type = bp_watchpoint;
***************
*** 4844,4852 ****
  	  else
  	    {
  	      /* Ahh, memory we actually used!  Check if we can cover
!                  it with hardware watchpoints.  */
  	      CORE_ADDR vaddr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
! 	      int       len   = TYPE_LENGTH (VALUE_TYPE (v));
  
  	      if (!TARGET_REGION_OK_FOR_HW_WATCHPOINT (vaddr, len))
  		return 0;
--- 5329,5337 ----
  	  else
  	    {
  	      /* Ahh, memory we actually used!  Check if we can cover
! 	         it with hardware watchpoints.  */
  	      CORE_ADDR vaddr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
! 	      int len = TYPE_LENGTH (VALUE_TYPE (v));
  
  	      if (!TARGET_REGION_OK_FOR_HW_WATCHPOINT (vaddr, len))
  		return 0;
***************
*** 4855,4863 ****
  	    }
  	}
        else if (v->lval != not_lval && v->modifiable == 0)
! 	return 0;	/* ??? What does this represent? */
        else if (v->lval == lval_register)
! 	return 0;	/* cannot watch a register with a HW watchpoint */
      }
  
    /* The expression itself looks suitable for using a hardware
--- 5340,5348 ----
  	    }
  	}
        else if (v->lval != not_lval && v->modifiable == 0)
! 	return 0;		/* ??? What does this represent? */
        else if (v->lval == lval_register)
! 	return 0;		/* cannot watch a register with a HW watchpoint */
      }
  
    /* The expression itself looks suitable for using a hardware
***************
*** 4927,4933 ****
      sals = decode_line_1 (&arg, 1, default_breakpoint_symtab,
  			  default_breakpoint_line, (char ***) NULL);
    else
!     sals = decode_line_1 (&arg, 1, (struct symtab *) NULL, 
  			  0, (char ***) NULL);
  
    if (sals.nelts != 1)
--- 5412,5418 ----
      sals = decode_line_1 (&arg, 1, default_breakpoint_symtab,
  			  default_breakpoint_line, (char ***) NULL);
    else
!     sals = decode_line_1 (&arg, 1, (struct symtab *) NULL,
  			  0, (char ***) NULL);
  
    if (sals.nelts != 1)
***************
*** 4944,4950 ****
    breakpoint = set_momentary_breakpoint (sal, selected_frame, bp_until);
  
    if (!event_loop_p || !target_can_async_p ())
!     old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint, 
  			      breakpoint);
    else
      make_exec_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
--- 5429,5435 ----
    breakpoint = set_momentary_breakpoint (sal, selected_frame, bp_until);
  
    if (!event_loop_p || !target_can_async_p ())
!     old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint,
  			      breakpoint);
    else
      make_exec_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
***************
*** 5157,5163 ****
  		      struct sal_chain *next = (struct sal_chain *)
  		      alloca (sizeof (struct sal_chain));
  		      next->next = sal_chain;
! 		      next->sal = find_pc_line (SYMBOL_VALUE_ADDRESS (sym), 
  						0);
  		      sal_chain = next;
  		    }
--- 5642,5648 ----
  		      struct sal_chain *next = (struct sal_chain *)
  		      alloca (sizeof (struct sal_chain));
  		      next->next = sal_chain;
! 		      next->sal = find_pc_line (SYMBOL_VALUE_ADDRESS (sym),
  						0);
  		      sal_chain = next;
  		    }
***************
*** 5317,5325 ****
  catch_fork_kind;
  
  #if defined(CHILD_INSERT_FORK_CATCHPOINT) || defined(CHILD_INSERT_VFORK_CATCHPOINT)
! static void catch_fork_command_1 PARAMS ((catch_fork_kind fork_kind, 
! 					  char *arg, 
! 					  int tempflag, 
  					  int from_tty));
  
  static void
--- 5802,5810 ----
  catch_fork_kind;
  
  #if defined(CHILD_INSERT_FORK_CATCHPOINT) || defined(CHILD_INSERT_VFORK_CATCHPOINT)
! static void catch_fork_command_1 PARAMS ((catch_fork_kind fork_kind,
! 					  char *arg,
! 					  int tempflag,
  					  int from_tty));
  
  static void
***************
*** 5429,5435 ****
    /* Create a load breakpoint that only triggers when a load of
       the specified dll (or any dll, if no pathname was specified)
       occurs. */
!   SOLIB_CREATE_CATCH_LOAD_HOOK (inferior_pid, tempflag, 
  				dll_pathname, cond_string);
  }
  
--- 5914,5920 ----
    /* Create a load breakpoint that only triggers when a load of
       the specified dll (or any dll, if no pathname was specified)
       occurs. */
!   SOLIB_CREATE_CATCH_LOAD_HOOK (inferior_pid, tempflag,
  				dll_pathname, cond_string);
  }
  
***************
*** 5474,5480 ****
    /* Create an unload breakpoint that only triggers when an unload of
       the specified dll (or any dll, if no pathname was specified)
       occurs. */
!   SOLIB_CREATE_CATCH_UNLOAD_HOOK (inferior_pid, tempflag, 
  				  dll_pathname, cond_string);
  }
  #endif /* SOLIB_ADD */
--- 5959,5965 ----
    /* Create an unload breakpoint that only triggers when an unload of
       the specified dll (or any dll, if no pathname was specified)
       occurs. */
!   SOLIB_CREATE_CATCH_UNLOAD_HOOK (inferior_pid, tempflag,
  				  dll_pathname, cond_string);
  }
  #endif /* SOLIB_ADD */
***************
*** 5501,5507 ****
    set_breakpoint_count (breakpoint_count + 1);
    b->number = breakpoint_count;
    b->cond = NULL;
!   b->cond_string = (cond_string == NULL) ? 
      NULL : savestring (cond_string, strlen (cond_string));
    b->thread = thread;
    b->addr_string = NULL;
--- 5986,5992 ----
    set_breakpoint_count (breakpoint_count + 1);
    b->number = breakpoint_count;
    b->cond = NULL;
!   b->cond_string = (cond_string == NULL) ?
      NULL : savestring (cond_string, strlen (cond_string));
    b->thread = thread;
    b->addr_string = NULL;
***************
*** 5556,5562 ****
        if (sal != (struct symtab_and_line *) -1)
  	create_exception_catchpoint (tempflag, cond_string, ex_event, sal);
        else
! 	return;		/* something went wrong with setting up callbacks */
      }
    else
      {
--- 6041,6047 ----
        if (sal != (struct symtab_and_line *) -1)
  	create_exception_catchpoint (tempflag, cond_string, ex_event, sal);
        else
! 	return;			/* something went wrong with setting up callbacks */
      }
    else
      {
***************
*** 5684,5694 ****
        b->number = breakpoint_count;
  
        /* Important -- this is an ordinary breakpoint.  For platforms
! 	 with callback support for exceptions,
! 	 create_exception_catchpoint() will create special bp types
! 	 (bp_catch_catch and bp_catch_throw), and there is code in
! 	 insert_breakpoints() and elsewhere that depends on that. */
!       b->type = bp_breakpoint;	
  
        b->cond = cond;
        b->enable = enabled;
--- 6169,6179 ----
        b->number = breakpoint_count;
  
        /* Important -- this is an ordinary breakpoint.  For platforms
!          with callback support for exceptions,
!          create_exception_catchpoint() will create special bp types
!          (bp_catch_catch and bp_catch_throw), and there is code in
!          insert_breakpoints() and elsewhere that depends on that. */
!       b->type = bp_breakpoint;
  
        b->cond = cond;
        b->enable = enabled;
***************
*** 5771,5782 ****
      }
    else if (strncmp (arg1_start, "catch", arg1_length) == 0)
      {
!       catch_exception_command_1 (EX_EVENT_CATCH, arg1_end + 1, 
  				 tempflag, from_tty);
      }
    else if (strncmp (arg1_start, "throw", arg1_length) == 0)
      {
!       catch_exception_command_1 (EX_EVENT_THROW, arg1_end + 1, 
  				 tempflag, from_tty);
      }
    else if (strncmp (arg1_start, "thread_start", arg1_length) == 0)
--- 6256,6267 ----
      }
    else if (strncmp (arg1_start, "catch", arg1_length) == 0)
      {
!       catch_exception_command_1 (EX_EVENT_CATCH, arg1_end + 1,
  				 tempflag, from_tty);
      }
    else if (strncmp (arg1_start, "throw", arg1_length) == 0)
      {
!       catch_exception_command_1 (EX_EVENT_THROW, arg1_end + 1,
  				 tempflag, from_tty);
      }
    else if (strncmp (arg1_start, "thread_start", arg1_length) == 0)
***************
*** 5933,5938 ****
--- 6418,6424 ----
    if (arg)
      {
        sals = decode_line_spec (arg, 1);
+ 
        default_match = 0;
      }
    else
***************
*** 6130,6136 ****
  
        /* Format possible error msg */
        sprintf (message, message1, bpt->number);
!       args.kind = bpt->type == bp_catch_catch ? 
  	EX_EVENT_CATCH : EX_EVENT_THROW;
        args.enable = 0;
        catch_errors (cover_target_enable_exception_callback, &args,
--- 6616,6622 ----
  
        /* Format possible error msg */
        sprintf (message, message1, bpt->number);
!       args.kind = bpt->type == bp_catch_catch ?
  	EX_EVENT_CATCH : EX_EVENT_THROW;
        args.enable = 0;
        catch_errors (cover_target_enable_exception_callback, &args,
***************
*** 6149,6155 ****
       there are no other bps at the same address. */
    if (tui_version)
      {
!       int clearIt;
  
        ALL_BREAKPOINTS (b)
        {
--- 6635,6641 ----
       there are no other bps at the same address. */
    if (tui_version)
      {
!       int clearIt = 1;
  
        ALL_BREAKPOINTS (b)
        {
***************
*** 6160,6166 ****
  
        if (clearIt)
  	{
! 	  TUIDO (((TuiOpaqueFuncPtr) tui_vAllSetHasBreakAt, bpt, 0));
  	  TUIDO (((TuiOpaqueFuncPtr) tuiUpdateAllExecInfos));
  	}
      }
--- 6646,6653 ----
  
        if (clearIt)
  	{
! 	  TUIDOWITHOUTTERMTRANSITION (((TuiOpaqueFuncPtr) tui_vAllSetHasBreakAt,
! 				       bpt, FALSE));
  	  TUIDO (((TuiOpaqueFuncPtr) tuiUpdateAllExecInfos));
  	}
      }
***************
*** 6309,6314 ****
--- 6796,6802 ----
    struct symtabs_and_lines sals;
    char *s;
    enum enable save_enable;
+   char *symbol;
  
    switch (b->type)
      {
***************
*** 6326,6331 ****
--- 6814,6826 ----
  	  delete_breakpoint (b);
  	  return 0;
  	}
+ 
+       /* RM: no point in trying to reset shlib_disabled breakpoints, they
+        * haven't yet been mapped in.
+        */
+       if (!b->address && b->enable == shlib_disabled)
+ 	break;
+ 
        /* In case we have a problem, disable this breakpoint.  We'll restore
           its status if we succeed.  */
        save_enable = b->enable;
***************
*** 6334,6339 ****
--- 6829,6835 ----
        set_language (b->language);
        input_radix = b->input_radix;
        s = b->addr_string;
+       symbol = s;		/* preserve original as decode_line_1 will advance pointer */
        sals = decode_line_1 (&s, 1, (struct symtab *) NULL, 0, (char ***) NULL);
        for (i = 0; i < sals.nelts; i++)
  	{
***************
*** 6378,6388 ****
  	         cause trouble, as it doesn't check for disable
  	         breakpoints. */
  
! 	      mention (b);
  
! 	      /* Might be better to do this just once per breakpoint_re_set,
! 	         rather than once for every breakpoint.  */
! 	      breakpoints_changed ();
  	    }
  	  b->section = sals.sals[i].section;
  	  b->enable = save_enable;	/* Restore it, this worked. */
--- 6874,6893 ----
  	         cause trouble, as it doesn't check for disable
  	         breakpoints. */
  
! 	      /* srikanth, if the breakpoint is disabled we don't want
! 	         to mention it nor emit any annotations : suffices to
! 	         update the notion of address and spos, so it could be
! 	         re-enabled later if the user wishes.
! 	       */
! 
! 	      if (save_enable != disabled && save_enable != shlib_disabled)
! 		{
! 		  mention (b);
  
! 		  /* Might be better to do this just once per breakpoint_re_set,
! 		     rather than once for every breakpoint.  */
! 		  breakpoints_changed ();
! 		}
  	    }
  	  b->section = sals.sals[i].section;
  	  b->enable = save_enable;	/* Restore it, this worked. */
***************
*** 6393,6399 ****
  	  check_duplicates (b->address, b->section);
  
  	}
!       free ((PTR) sals.sals);
        break;
  
      case bp_watchpoint:
--- 6898,6921 ----
  	  check_duplicates (b->address, b->section);
  
  	}
! 
!       /* srikanth, if we fail to find the breakpoint location, it could be
!          that the corresponding shared library is not mapped in or that the
!          debuggee program is not the same (via fork/exec or file new-file)
!          or perhaps because, the function is no longer a part of the program.
!          If the original enable status indicates that the bp is from a shlib
!          make it shlib_disabled. Otherwise, simply disable the breakpoint.
!        */
! 
!       if (sals.nelts == 0)
! 	{
! 	  if (save_enable == shlib_disabled)
! 	    b->enable = shlib_disabled;
! 	  else
! 	    b->enable = disabled;
! 	}
!       else
! 	free ((PTR) sals.sals);
        break;
  
      case bp_watchpoint:
***************
*** 6435,6440 ****
--- 6957,6963 ----
        break;
      case bp_catch_catch:
      case bp_catch_throw:
+     case bp_mmap:
        break;
        /* We needn't really do anything to reset these, since the mask
           that requests them is unaffected by e.g., new libraries being
***************
*** 6449,6458 ****
--- 6972,6983 ----
        /* fall through */
        /* Delete longjmp breakpoints, they will be reset later by
           breakpoint_re_set.  */
+ #ifdef GET_LONGJMP_TARGET
      case bp_longjmp:
      case bp_longjmp_resume:
        delete_breakpoint (b);
        break;
+ #endif /* GET_LONGJMP_TARGET */
  
        /* This breakpoint is special, it's set up when the inferior
           starts and we really don't want to touch it.  */
***************
*** 6477,6483 ****
  void
  breakpoint_re_set ()
  {
!   struct breakpoint *b, *temp;
    enum language save_language;
    int save_input_radix;
    static char message1[] = "Error in re-setting breakpoint %d:\n";
--- 7002,7008 ----
  void
  breakpoint_re_set ()
  {
!   struct breakpoint *b, *temp = NULL;
    enum language save_language;
    int save_input_radix;
    static char message1[] = "Error in re-setting breakpoint %d:\n";
***************
*** 6627,6640 ****
  	{
  	  ALL_BREAKPOINTS_SAFE (b, tmp)
  	    if (b->number == num)
! 	      {
! 		struct breakpoint *related_breakpoint = b->related_breakpoint;
! 		match = 1;
! 		function (b);
! 		if (related_breakpoint)
! 		  function (related_breakpoint);
! 		break;
! 	      }
  	  if (match == 0)
  	    printf_unfiltered ("No breakpoint number %d.\n", num);
  	}
--- 7152,7165 ----
  	{
  	  ALL_BREAKPOINTS_SAFE (b, tmp)
  	    if (b->number == num)
! 	    {
! 	      struct breakpoint *related_breakpoint = b->related_breakpoint;
! 	      match = 1;
! 	      function (b);
! 	      if (related_breakpoint)
! 		function (related_breakpoint);
! 	      break;
! 	    }
  	  if (match == 0)
  	    printf_unfiltered ("No breakpoint number %d.\n", num);
  	}
***************
*** 6652,6657 ****
--- 7177,7186 ----
    if (bpt->type == bp_watchpoint_scope)
      return;
  
+   /* Never disable a deferred breakpoint */
+   if (bpt->enable == shlib_disabled)
+     return;
+ 
    /* You can't disable permanent breakpoints.  */
    if (bpt->enable == permanent)
      return;
***************
*** 6711,6722 ****
    int target_resources_ok, other_type_used;
    struct value *mark;
  
    if (bpt->type == bp_hardware_breakpoint)
      {
        int i;
        i = hw_breakpoint_used_count ();
!       target_resources_ok = 
! 	TARGET_CAN_USE_HARDWARE_WATCHPOINT (bp_hardware_breakpoint, 
  					    i + 1, 0);
        if (target_resources_ok == 0)
  	error ("No hardware breakpoint support in the target.");
--- 7240,7255 ----
    int target_resources_ok, other_type_used;
    struct value *mark;
  
+   /* Don't let any enable action occur on a deferred breakpoint */
+   if (bpt->enable == shlib_disabled)
+     return;
+ 
    if (bpt->type == bp_hardware_breakpoint)
      {
        int i;
        i = hw_breakpoint_used_count ();
!       target_resources_ok =
! 	TARGET_CAN_USE_HARDWARE_WATCHPOINT (bp_hardware_breakpoint,
  					    i + 1, 0);
        if (target_resources_ok == 0)
  	error ("No hardware breakpoint support in the target.");
***************
*** 6730,6738 ****
    check_duplicates (bpt->address, bpt->section);
    breakpoints_changed ();
  
!   if (bpt->type == bp_watchpoint || 
        bpt->type == bp_hardware_watchpoint ||
!       bpt->type == bp_read_watchpoint || 
        bpt->type == bp_access_watchpoint)
      {
        if (bpt->exp_valid_block != NULL)
--- 7263,7271 ----
    check_duplicates (bpt->address, bpt->section);
    breakpoints_changed ();
  
!   if (bpt->type == bp_watchpoint ||
        bpt->type == bp_hardware_watchpoint ||
!       bpt->type == bp_read_watchpoint ||
        bpt->type == bp_access_watchpoint)
      {
        if (bpt->exp_valid_block != NULL)
Index: gdb/breakpoint.h
/opt/gnu/bin/diff -r -c -N  /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/breakpoint.h gdb/breakpoint.h
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/breakpoint.h	Tue Nov  9 15:58:15 1999
--- gdb/breakpoint.h	Tue Nov  9 15:59:08 1999
***************
*** 115,123 ****
      /* These are catchpoints to implement "catch catch" and "catch throw"
         commands for C++ exception handling. */
      bp_catch_catch,
!     bp_catch_throw
! 
! 
    };
  
  /* States of enablement of breakpoint. */
--- 115,124 ----
      /* These are catchpoints to implement "catch catch" and "catch throw"
         commands for C++ exception handling. */
      bp_catch_catch,
!     bp_catch_throw,
!     /* RM: The following breakpoints are used to detect where dld.sl
!        gets mapped */
!     bp_mmap  
    };
  
  /* States of enablement of breakpoint. */
Index: gdb/defs.h
/opt/gnu/bin/diff -r -c -N  /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/defs.h gdb/defs.h
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/defs.h	Tue Nov  9 11:55:36 1999
--- gdb/defs.h	Tue Nov  9 17:16:25 1999
***************
*** 68,73 ****
--- 68,90 ----
  /* For BFD64 and bfd_vma.  */
  #include "bfd.h"
  
+ /* Calls to the fundamental free () can be dangerous.  Consider the
+    code fragment below:
+ 
+      free (p);
+      p = new_p ();
+ 
+    If "new_p" calls error (), then "p" is left as a dangling pointer
+    to freed storage.
+ 
+    Instead, calls to safe_free () should be made.
+    */
+ #define safe_free(val) \
+   do { \
+     free ((PTR)(val)); \
+     (val) = NULL; \
+   } while (0)
+ 
  /* An address in the program being debugged.  Host byte order.  Rather
     than duplicate all the logic in BFD which figures out what type
     this is (long, long long, etc.) and whether it needs to be 64
***************
*** 137,144 ****
--- 154,163 ----
  #if defined(TUI)
  /* all invocations of TUIDO should have two sets of parens */
  #define TUIDO(x)	tuiDo x
+ #define TUIDOWITHOUTTERMTRANSITION(x) tuiDoWithoutTermTransition x
  #else
  #define TUIDO(x)
+ #define TUIDOWITHOUTTERMTRANSITION(x)
  #endif
  
  /* enable xdb commands if set */
Index: gdb/infrun.c
/opt/gnu/bin/diff -r -c -N  /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/infrun.c gdb/infrun.c
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/infrun.c	Tue Nov  9 11:58:46 1999
--- gdb/infrun.c	Tue Nov  9 17:29:25 1999
***************
*** 138,152 ****
  
  static int use_thread_step_needed = USE_THREAD_STEP_NEEDED;
  
- /* GET_LONGJMP_TARGET returns the PC at which longjmp() will resume the
-    program.  It needs to examine the jmp_buf argument and extract the PC
-    from it.  The return value is non-zero on success, zero otherwise. */
- 
- #ifndef GET_LONGJMP_TARGET
- #define GET_LONGJMP_TARGET(PC_ADDR) 0
- #endif
- 
- 
  /* Some machines have trampoline code that sits between function callers
     and the actual functions themselves.  If this machine doesn't have
     such things, disable their processing.  */
--- 138,143 ----
***************
*** 2237,2243 ****
--- 2228,2236 ----
  
      /* Handle cases caused by hitting a breakpoint.  */
      {
+ #ifdef GET_LONGJMP_TARGET
        CORE_ADDR jmp_buf_pc;
+ #endif
        struct bpstat_what what;
  
        what = bpstat_what (stop_bpstat);
***************
*** 2252,2257 ****
--- 2245,2251 ----
  
        switch (what.main_action)
  	{
+ #ifdef GET_LONGJMP_TARGET
  	case BPSTAT_WHAT_SET_LONGJMP_RESUME:
  	  /* If we hit the breakpoint at longjmp, disable it for the
  	     duration of this command.  Then, install a temporary
***************
*** 2312,2317 ****
--- 2306,2312 ----
  	  if (what.main_action == BPSTAT_WHAT_CLEAR_LONGJMP_RESUME)
  	    break;
  	  /* else fallthrough */
+ #endif /* GET_LONGJMP_TARGET */
  
  	case BPSTAT_WHAT_SINGLE:
  	  if (breakpoints_inserted)
Index: gdb/infcmd.c
/opt/gnu/bin/diff -r -c -N  /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/infcmd.c gdb/infcmd.c
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/infcmd.c	Tue Nov  9 17:26:40 1999
--- gdb/infcmd.c	Tue Nov  9 17:31:06 1999
***************
*** 446,452 ****
--- 446,454 ----
  {
    register int count = 1;
    struct frame_info *frame;
+ #ifdef GET_LONGJMP_TARGET
    struct cleanup *cleanups = 0;
+ #endif
    int async_exec = 0;
  
    ERROR_NO_INFERIOR;
***************
*** 471,479 ****
--- 473,483 ----
  
    if (!single_inst || skip_subroutines)		/* leave si command alone */
      {
+ #ifdef GET_LONGJMP_TARGET
        enable_longjmp_breakpoint ();
        cleanups = make_cleanup ((make_cleanup_func) disable_longjmp_breakpoint,
  			       0);
+ #endif
      }
  
    for (; count > 0; count--)
***************
*** 529,536 ****
--- 533,542 ----
  #endif
      }
  
+ #ifdef GET_LONGJMP_TARGET
    if (!single_inst || skip_subroutines)
      do_cleanups (cleanups);
+ #endif
  }
  
  /* Continue program at specified address.  */
Index: gdb/configure.tgt
/opt/gnu/bin/diff -r -c -N  /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/configure.tgt gdb/configure.tgt
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/configure.tgt	Tue Nov  9 16:41:32 1999
--- gdb/configure.tgt	Tue Nov  9 16:43:15 1999
***************
*** 68,74 ****
  
  hppa*-*-bsd*)		gdb_target=hppabsd ;;
  hppa*-*-pro*)		gdb_target=hppapro ;;
! hppa2.0w-*-hpux11*)	gdb_target=hppa64 ;;
  hppa*-*-hpux*)		gdb_target=hppahpux ;;
  hppa*-*-hiux*)		gdb_target=hppahpux ;;
  hppa*-*-osf*)		gdb_target=hppaosf ;;
--- 68,76 ----
  
  hppa*-*-bsd*)		gdb_target=hppabsd ;;
  hppa*-*-pro*)		gdb_target=hppapro ;;
! hppa*-*-hpux1020)	gdb_target=hpux1020 ;;
! hppa2.0w-*-hpux11*)	gdb_target=hpux11w ;;
! hppa*-*-hpux11*)	gdb_target=hpux11 ;;
  hppa*-*-hpux*)		gdb_target=hppahpux ;;
  hppa*-*-hiux*)		gdb_target=hppahpux ;;
  hppa*-*-osf*)		gdb_target=hppaosf ;;
Index: gdb/config/pa
/opt/gnu/bin/diff -r -c -N  /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa gdb/config/pa
diff -r -c -N /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/hppa64.mt gdb/config/pa/hppa64.mt
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/hppa64.mt	Thu Aug 26 01:20:38 1999
--- gdb/config/pa/hppa64.mt	Wed Dec 31 16:00:00 1969
***************
*** 1,4 ****
- # Target: HP PA-RISC 2.0 running HPUX 11.00 in wide mode
- TDEPFILES= hppa-tdep.o
- TM_FILE= tm-hppa64.h
- TM_CLIBS=
--- 0 ----
diff -r -c -N /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/hpux1020.mt gdb/config/pa/hpux1020.mt
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/hpux1020.mt	Tue Nov  9 16:33:26 1999
--- gdb/config/pa/hpux1020.mt	Tue Nov  9 16:34:25 1999
***************
*** 1,3 ****
  # Target: HP PA-RISC running hpux
! TDEPFILES= hppa-tdep.o remote-pa.o somsolib.o corelow.o
! TM_FILE= tm-hppah.h
--- 1,3 ----
  # Target: HP PA-RISC running hpux
! TDEPFILES= corelow.o hppa-tdep.o somread.o somsolib.o
! TM_FILE= tm-hppa1020.h
diff -r -c -N /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/hpux11.mt gdb/config/pa/hpux11.mt
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/hpux11.mt	Tue Nov  9 16:38:23 1999
--- gdb/config/pa/hpux11.mt	Tue Nov  9 16:38:45 1999
***************
*** 1,3 ****
  # Target: HP PA-RISC running HPUX 11.00
! TDEPFILES= hppa-tdep.o remote-pa.o somsolib.o
! TM_FILE= tm-hppah.h
--- 1,3 ----
  # Target: HP PA-RISC running HPUX 11.00
! TDEPFILES= hppa-tdep.o somread.o somsolib.o
! TM_FILE= tm-hppa11.h
diff -r -c -N /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/hpux11w.mt gdb/config/pa/hpux11w.mt
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/hpux11w.mt	Tue Nov  9 16:59:18 1999
--- gdb/config/pa/hpux11w.mt	Tue Nov  9 16:59:47 1999
***************
*** 1,3 ****
! # Target: HP PA-RISC running HPUX 11.00
! TDEPFILES= hppa-tdep.o remote-pa.o
! TM_FILE= tm-hppah.h
--- 1,4 ----
! # Target: HP PA-RISC 2.0 running HPUX 11.00 in wide mode
! TDEPFILES= hppa-tdep.o
! TM_FILE= tm-hppa11w.h
! TM_CLIBS=
diff -r -c -N /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/tm-hppa1020.h gdb/config/pa/tm-hppa1020.h
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/tm-hppa1020.h	Wed Dec 31 16:00:00 1969
--- gdb/config/pa/tm-hppa1020.h	Tue Nov  9 16:50:22 1999
***************
*** 0 ****
--- 1,9 ----
+ #ifndef TM_HPPA1020
+ #define TM_HPPA1020
+ 
+ #define HPUX_1020 1
+ 
+ #include "pa/tm-hppah.h"
+ #include "pa/tm-hppa32.h"
+ 
+ #endif /* TM_HPPA1020 */
diff -r -c -N /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/tm-hppa1100.h gdb/config/pa/tm-hppa1100.h
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/tm-hppa1100.h	Wed Dec 31 16:00:00 1969
--- gdb/config/pa/tm-hppa1100.h	Tue Nov  9 16:37:46 1999
***************
*** 0 ****
--- 1,9 ----
+ #ifndef TM_HPPA1100
+ #define TM_HPPA1100
+ 
+ #define HPUX_1100 1
+ 
+ #include "pa/tm-hppah.h"
+ #include "pa/tm-hppa32.h"
+ 
+ #endif /* TM_HPPA1100 */
diff -r -c -N /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/tm-hppa1100w.h gdb/config/pa/tm-hppa1100w.h
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/tm-hppa1100w.h	Wed Dec 31 16:00:00 1969
--- gdb/config/pa/tm-hppa1100w.h	Tue Nov  9 16:57:37 1999
***************
*** 0 ****
--- 1,9 ----
+ #ifndef TM_HPPA1100W
+ #define TM_HPPA1100W
+ 
+ #define HPUX_1100W 1
+ 
+ #include "pa/tm-hppah.h"
+ #include "pa/tm-hppa64.h"
+ 
+ #endif /* TM_HPPA1100W */
diff -r -c -N /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/tm-hppa32.h gdb/config/pa/tm-hppa32.h
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/tm-hppa32.h	Wed Dec 31 16:00:00 1969
--- gdb/config/pa/tm-hppa32.h	Tue Nov  9 16:49:54 1999
***************
*** 0 ****
--- 1,35 ----
+ /* Parameters for execution on any Hewlett-Packard PA-RISC machine.
+    Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1995, 1996, 1997,
+    1998, 1999
+    Free Software Foundation, Inc. 
+ 
+    Contributed by the Center for Software Science at the
+    University of Utah (pa-gdb-bugs@cs.utah.edu).
+ 
+ This file is part of GDB.
+ 
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ 
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+ 
+ /* tm-hppa32.h Target specific declarations common to all of the HPPA-32
+    targets.
+  */
+ #ifndef TM_HPPA32
+ #define TM_HPPA32
+ 
+ /* srikanth, 980830, CLLbs14756 dld32 does not invoke the callbacks
+    for implictly loaded libraries */
+ #define IMPLICIT_SHLIB_EVENT_NOTIFICATION_LACKING
+ 
+ #endif /* TM_HPPA32 */
diff -r -c -N /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/tm-hppa64.h gdb/config/pa/tm-hppa64.h
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/tm-hppa64.h	Tue Nov  9 16:50:48 1999
--- gdb/config/pa/tm-hppa64.h	Tue Nov  9 16:52:19 1999
***************
*** 23,37 ****
  
  /* PA 64-bit specific definitions.  Override those which are in
     tm-hppa.h */
  
  /* jimb: this must go.  I'm just using it to disable code I haven't
     gotten working yet.  */
  #define GDB_TARGET_IS_HPPA_20W
  
- #include "pa/tm-hppah.h"
- 
- #define HPUX_1100 1
- 
  /* The low two bits of the IA are the privilege level of the instruction.  */
  #define ADDR_BITS_REMOVE(addr) ((CORE_ADDR)addr & (CORE_ADDR)~3)
  
--- 23,35 ----
  
  /* PA 64-bit specific definitions.  Override those which are in
     tm-hppa.h */
+ #ifndef TM_HPPA64
+ #define TM_HPPA64
  
  /* jimb: this must go.  I'm just using it to disable code I haven't
     gotten working yet.  */
  #define GDB_TARGET_IS_HPPA_20W
  
  /* The low two bits of the IA are the privilege level of the instruction.  */
  #define ADDR_BITS_REMOVE(addr) ((CORE_ADDR)addr & (CORE_ADDR)~3)
  
***************
*** 331,333 ****
--- 329,332 ----
  }
  
  /* jimb: omitted purify call support */
+ #endif /* TM_HPPA64 */
diff -r -c -N /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/tm-hppah.h gdb/config/pa/tm-hppah.h
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/config/pa/tm-hppah.h	Tue Nov  9 16:45:48 1999
--- gdb/config/pa/tm-hppah.h	Tue Nov  9 16:49:01 1999
***************
*** 21,38 ****
     Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
! #define HPUX_SNAP1
! #define HPUX_SNAP2
  
  /* The solib hooks are not really designed to have a list of hook
     and handler routines.  So until we clean up those interfaces you
     either get SOM shared libraries or HP's unusual PA64 ELF shared
     libraries, but not both.  */
! #ifdef GDB_TARGET_IS_HPPA_20W
  #include "pa64solib.h"
! #endif
! 
! #ifndef GDB_TARGET_IS_HPPA_20W
  #include "somsolib.h"
  #endif
  
--- 21,36 ----
     Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
! #ifndef TM_HPPAH
! #define TM_HPPAH
  
  /* The solib hooks are not really designed to have a list of hook
     and handler routines.  So until we clean up those interfaces you
     either get SOM shared libraries or HP's unusual PA64 ELF shared
     libraries, but not both.  */
! #ifdef HPUX_1100W
  #include "pa64solib.h"
! #else
  #include "somsolib.h"
  #endif
  
***************
*** 88,90 ****
--- 86,90 ----
  
  /* Mostly it's common to all HPPA's.  */
  #include "pa/tm-hppa.h"
+ 
+ #endif /* TM_HPPAH */


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