Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [RFA] fix child_xfer_memory in hppah-nat.c
       [not found] <200102040619.WAA29062@bosch.cygnus.com>
@ 2001-02-04 11:48 ` Christopher Faylor
  2001-02-04 13:37   ` Andrew Cagney
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Faylor @ 2001-02-04 11:48 UTC (permalink / raw)
  To: gdb-patches

On Sat, Feb 03, 2001 at 10:19:21PM -0800, Michael Elizabeth Chastain wrote:
>This patch fixes hppah-nat.c:xfer_child_memory to declare the new
>'struct mem_attrib *' argument.
>
>This patch is needed to build sourceware gdb on hpux 10.20.
>
>Jeff Law is the maintainer of "hpux, hp pa native", but Jeff is on
>vacation right now.  So I appeal to one of the blanket write maintainers
>for approval.
>
>I tested this patch by building on an hpux 10.20 machine.
>
>This patch does not make hpux gdb actually work.  When I run a child
>process, gdb goes catatonic.  This is the same behavior that sourceware
>gdb had in the 2001-01-22 version (a day before the interface change to
>child_xfer_memory).  By using an older gdb to debug both the 2001-01-22
>gdb and today's gdb with my patch applied, I saw that neither of them
>got as far as child_xfer_memory.
>
>OK to commit?

You might want to add an ATTRIBUTE_UNUSED to 'struct mem_attrib *mem' to
stop a potential compiler warning.

cgf

>Michael Elizabeth Chastain
><chastain@redhat.com>
>"love without fear"
>
>===
>
>2001-02-03  Michael Chastain  <chastain@redhat.com>
>
>	* hppah-nat.c (xfer_child_memory): Add parameter 'struct mem_attrib *'
>	to conform with interface change.
>
>====
>
>Index: gdb/hppah-nat.c
>===================================================================
>RCS file: /cvs/src/src/gdb/hppah-nat.c,v
>retrieving revision 1.6
>diff -c -3 -p -r1.6 hppah-nat.c
>*** gdb/hppah-nat.c	2000/12/15 01:01:47	1.6
>--- gdb/hppah-nat.c	2001/02/03 20:32:50
>*************** fetch_register (int regno)
>*** 266,271 ****
>--- 266,272 ----
>  
>  int
>  child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
>+ 		   struct mem_attrib *mem,
>  		   struct target_ops *target)
>  {
>    register int i;

-- 
cgf@cygnus.com                        Red Hat, Inc.
http://sources.redhat.com/            http://www.redhat.com/
From chastain@cygnus.com Sun Feb 04 12:00:00 2001
From: Michael Elizabeth Chastain <chastain@cygnus.com>
To: cgf@redhat.com, gdb-patches@sources.redhat.com
Subject: Re: [RFA] fix child_xfer_memory in hppah-nat.c
Date: Sun, 04 Feb 2001 12:00:00 -0000
Message-id: <200102042000.MAA02222@bosch.cygnus.com>
X-SW-Source: 2001-02/msg00041.html
Content-length: 421

Chris Faylor writes:
> You might want to add an ATTRIBUTE_UNUSED to 'struct mem_attrib *mem' to
> stop a potential compiler warning.

I thought about that.  There are no other ATTRIBUTE_UNUSED in hppah-nat.c.
The specific function child_xfer_memory already has one unused parameter,
"struct target_ops *target", and it is not marked ATTRIBUTE_UNUSED.

Michael Elizabeth Chastain
<chastain@redhat.com>
"love without fear"
From philb@gnu.org Sun Feb 04 13:06:00 2001
From: Philip Blundell <philb@gnu.org>
To: gdb-patches@sources.redhat.com
Subject: patch for ARM GNU/Linux
Date: Sun, 04 Feb 2001 13:06:00 -0000
Message-id: <E14PWEF-0006Yz-00@kings-cross.london.uk.eu.org>
X-SW-Source: 2001-02/msg00042.html
Content-length: 3424

I needed this patch to build the current code on an arm-linux machine.

p.

2001-02-04  Philip Blundell  <philb@gnu.org>

	* config/arm/linux.mh (NATDEPFILES): Add proc-service.o,
	thread-db.o, lin-lwp.o; remove lin-thread.o, linux-thread.o.
	* config/arm/nm-linux (PREPARE_TO_PROCEED, ATTACH_LWP,
	GET_THREAD_SIGNALS): Define.
	* arm-linux-nat.c (fill_gregset): Correct type of argument.
	(supply_gregset): Likewise.
	(fill_fpregset): Likewise.
	(supply_fpregset): Likewise.

Index: arm-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-linux-nat.c,v
retrieving revision 1.7
diff -u -p -u -p -r1.7 arm-linux-nat.c
--- arm-linux-nat.c	2000/05/26 23:22:40	1.7
+++ arm-linux-nat.c	2001/02/04 20:47:02
@@ -575,7 +575,7 @@ store_inferior_registers (int regno)
    If regno is -1, do this for all registers.  */
 
 void
-fill_gregset (gregset_t *gregsetp, int regno)
+fill_gregset (gdb_gregset_t *gregsetp, int regno)
 {
   if (-1 == regno)
     {
@@ -607,7 +607,7 @@ fill_gregset (gregset_t *gregsetp, int r
    in *gregsetp.  */
 
 void
-supply_gregset (gregset_t *gregsetp)
+supply_gregset (gdb_gregset_t *gregsetp)
 {
   int regno, reg_pc;
 
@@ -628,7 +628,7 @@ supply_gregset (gregset_t *gregsetp)
    If regno is -1, do this for all registers.  */
 
 void
-fill_fpregset (fpregset_t *fpregsetp, int regno)
+fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
 {
   FPA11 *fp = (FPA11 *) fpregsetp;
   
@@ -654,7 +654,7 @@ fill_fpregset (fpregset_t *fpregsetp, in
    in *fpregsetp.  */
 
 void
-supply_fpregset (fpregset_t *fpregsetp)
+supply_fpregset (gdb_fpregset_t *fpregsetp)
 {
   int regno;
   FPA11 *fp = (FPA11 *) fpregsetp;
Index: config/arm/linux.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/arm/linux.mh,v
retrieving revision 1.6
diff -u -p -u -p -r1.6 linux.mh
--- linux.mh	2000/10/30 22:35:46	1.6
+++ linux.mh	2001/02/04 20:47:02
@@ -4,8 +4,9 @@ XM_FILE= xm-linux.h
 XDEPFILES=
 
 NAT_FILE= nm-linux.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o \
-	     core-regset.o arm-linux-nat.o linux-thread.o lin-thread.o
+NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o	\
+	core-regset.o arm-linux-nat.o				\
+	proc-service.o thread-db.o lin-lwp.o
 
 LOADLIBES= -ldl -rdynamic
 
Index: config/arm/nm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arm/nm-linux.h,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 nm-linux.h
--- nm-linux.h	2000/04/20 21:13:19	1.2
+++ nm-linux.h	2001/02/04 20:47:02
@@ -30,4 +30,20 @@ extern int kernel_u_size (void);
 /* Override copies of {fetch,store}_inferior_registers in infptrace.c.  */
 #define FETCH_INFERIOR_REGISTERS
 
+/* FIXME: kettenis/2000-09-03: This should be moved to ../nm-linux.h
+   once we have converted all Linux targets to use the new threads
+   stuff (without the #undef of course).  */
+
+extern int lin_lwp_prepare_to_proceed (void);
+#undef PREPARE_TO_PROCEED
+#define PREPARE_TO_PROCEED(select_it) lin_lwp_prepare_to_proceed ()
+
+extern void lin_lwp_attach_lwp (int pid, int verbose);
+#define ATTACH_LWP(pid, verbose) lin_lwp_attach_lwp ((pid), (verbose))
+
+#include <signal.h>
+
+extern void lin_thread_get_thread_signals (sigset_t *mask);
+#define GET_THREAD_SIGNALS(mask) lin_thread_get_thread_signals (mask)
+
 #endif /* NM_ARMLINUX_H */



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] fix child_xfer_memory in hppah-nat.c
  2001-02-04 11:48 ` [RFA] fix child_xfer_memory in hppah-nat.c Christopher Faylor
@ 2001-02-04 13:37   ` Andrew Cagney
       [not found]     ` <Pine.SUN.3.91.1010205110800.5862G-100000@is>
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cagney @ 2001-02-04 13:37 UTC (permalink / raw)
  To: Christopher Faylor; +Cc: gdb-patches

Christopher Faylor wrote:

> You might want to add an ATTRIBUTE_UNUSED to 'struct mem_attrib *mem' to
> stop a potential compiler warning.

No.  GDB doesn't use that ATTRIBUTE_UNUSED hack.  Check the archives and
configure.in for the relevant discussion.

	Andrew
From ac131313@cygnus.com Sun Feb 04 14:30:00 2001
From: Andrew Cagney <ac131313@cygnus.com>
To: Michael Snyder <msnyder@cygnus.com>
Cc: Hilfinger@cs.berkeley.edu, gdb-patches@sourceware.cygnus.com
Subject: Re: RFC: Patch to allow compilation by Sun cc
Date: Sun, 04 Feb 2001 14:30:00 -0000
Message-id: <3A7DD73F.D73A0CC8@cygnus.com>
References: <200102011905.LAA21374@tully.CS.Berkeley.EDU> <3A79B50E.6F40844E@cygnus.com> <3A7A0740.8252269A@cygnus.com>
X-SW-Source: 2001-02/msg00044.html
Content-length: 442

Michael Snyder wrote:

> Paul, Andrew,
> 
> Would you both find this modification of the patch acceptable?
> I've made the following two changes:
> 
>     1) Made all three versions of software_single_step use unsigned int
>        as the first parameter (and included Paul's cast to unsigned int
>        in the #define in all three cases).

Michael, just omit anthing to do with software_single_step.  My patch
will fix it anyway.

	Andrew
From ac131313@cygnus.com Sun Feb 04 19:02:00 2001
From: Andrew Cagney <ac131313@cygnus.com>
To: GDB Patches <gdb-patches@sourceware.cygnus.com>
Subject: Re: [rfa:sparc/rfc] multi-arch SOFTWARE_SINGLE_STEP et.al.
Date: Sun, 04 Feb 2001 19:02:00 -0000
Message-id: <3A7E1712.E947C76F@cygnus.com>
References: <3A6A1DF4.C6760CEF@cygnus.com>
X-SW-Source: 2001-02/msg00045.html
Content-length: 836

Andrew Cagney wrote:
> 
> Hello,
> 
> (I now remember why I kept avoiding  this one :-)
> 
> The attatched multi-arches SOFTWARE_SINGLE_STEP /
> SOFTWARE_SINGLE_STEP_P.  It also does a few other things so watch
> carefully :-)
> 
> For the sparc64 this multi-arches software_single_step.  Maintainer?
> Test on a solaris N+1 machine?

And sure enough it broke something :-/

For the sparc64 native, it was selecting software single-step but the
previous configuration wasn't.

So, for the maintainer.  What is correct for these cases?

	o	sparc32 cross
		was software single step

	o	sparc64 cross
		was software single step

	o	sparc64 (sol2) native
		was ptrace (hardware) single step

	o	sparc32 (sol2) native
		was ptrace (hardware) single step

This kind of highlights the current problems with software_single_step_p
:-)

	Andrew
From chastain@cygnus.com Sun Feb 04 20:18:00 2001
From: Michael Elizabeth Chastain <chastain@cygnus.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] testsuite/gdb.c++/cplusfuncs.{exp,cc}: work with either g++ demangler
Date: Sun, 04 Feb 2001 20:18:00 -0000
Message-id: <200102050418.UAA29343@bosch.cygnus.com>
X-SW-Source: 2001-02/msg00046.html
Content-length: 31156

This is Sunday Sourceware patch #2.

gdb has two g++ demanglers.  This patch enhances
testsuite/gdb.c++/cplusfuncs.{cc,exp} to work with either demangler.
Currently, this test script works okay on the v2 demangler, but gives
83 FAILs with the v3 demangler.

The bulk of the change is handling formatting differences:

  old demangler         new demangler
  --- ---------		--- ---------
  "operator, "          "operator,"
  "char *"              "char*"
  "int *"               "int*"
  "long *"              "long*"
  "void *"              "void*"
  "foo &"               "foo&"
  "unsigned int"        "unsigned"
  "void"                ""

While working on this test script, I discovered two bugs in gdb.
I have filed bug reports in gnats:

  gdb/18  gdb can't parse "info func operator*" or "info func operator\*"
  gdb/19  gdb v3 demangler fails on hairyfunc5 hairyfunc6 hairyfunc7

gdb/18 occurs with both demanglers (it is not a demangler bug).  The test
script used to XFAIL some tests and had strange code in other tests to
accomodate the bug.  That's not how a gdb test script is supposed to deal
with gdb bugs!  I changed the script to issue the correct commands and
FAIL if they don't work.  This causes 5 new FAILs with either demangler.

The new FAILs caused by the bug in gdb/18 are:

  FAIL: gdb.c++/cplusfuncs.exp: info function for "operator*("
  FAIL: gdb.c++/cplusfuncs.exp: info function for "operator*=("
  FAIL: gdb.c++/cplusfuncs.exp: info function for "operator->*("
  FAIL: gdb.c++/cplusfuncs.exp: info function for "operator[]("
  FAIL: gdb.c++/cplusfuncs.exp: info function for "operator char *("

gdb/19 is a bug in the v3 demangler.  If the v3 demangler is used, there
are 3 new FAILs.  If the v2 demangler is used, there are no new FAILs.

The new FAILs caused by the bug in gdb/19 are:

  FAIL: gdb.c++/cplusfuncs.exp: print &'hairyfunc5'
  FAIL: gdb.c++/cplusfuncs.exp: print &'hairyfunc6'
  FAIL: gdb.c++/cplusfuncs.exp: print &'hairyfunc7'

Testing: I tested on Red Hat Linux 7 native and Solaris 2.6 native.
On each platform, I ran before-and-after tests with both the v2 demangler
(using an older compiler) and the v3 demangler (using the sourceware cvs
gcc compiler).

OK to apply?

Michael Elizabeth Chastain
<chastain@redhat.com>
"love without fear"

===

2001-02-04  Michael Chastain  <chastain@redhat.com>

	* gdb.c++/cplusfuncs.cc (dm_type_char_star): New function
	helps the test script figure out which demangler is in use.
	(dm_type_foo_ref): Ditto.
	(dm_type_int_star): Ditto.
	(dm_type_long_star): Ditto.
	(dm_type_unsigned_int): Ditto.
	(dm_type_void): Ditto.
	(dm_type_void_star): Ditto.
	* gdb.base/cplusfuncs.exp (probe_demangler): New function.
	Probe the gdb demangler and set variables to accommodate
	formatting differences.
	(info_func_regexp): New function.  Same as info_func, but
	matches against a regexp.
	(info_func): Match against a literal string.
	(print_addr_2): New function.  Match against a literal string,
	which can be different from the input to gdb.
	(print_addr): Simply call print_addr_2 with the same argument twice.
	(test_lookup_operator_functions): Use demangler formatting variables.
	Blow away the xfails and workarounds for gnats gdb bug gdb/18.  Sort
	the tests in the same order as the C++ class declaration.
	(test_paddr_operator_functions): Ditto.
	(test_paddr_overloaded_functions): Ditto.
	(test_paddr_hairy_functions): Use demangler formatting variables.
	Note that some tests currently fail due to gnats gdb bug gdb/19.
	(do_tests): Call probe_demangler.

===

Index: gdb/testsuite/gdb.c++/cplusfuncs.cc
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/cplusfuncs.cc,v
retrieving revision 1.1.1.3
diff -c -3 -p -r1.1.1.3 cplusfuncs.cc
*** gdb/testsuite/gdb.c++/cplusfuncs.cc	1999/08/02 23:46:53	1.1.1.3
--- gdb/testsuite/gdb.c++/cplusfuncs.cc	2001/02/05 03:29:48
*************** int	  hairyfunc4 (PFPFPc_s_i arg)		{ arg
*** 183,185 ****
--- 183,196 ----
  int	  hairyfunc5 (PFPc_PFl_i arg)		{ arg = 0; return 0; }
  int	  hairyfunc6 (PFPi_PFl_i arg)		{ arg = 0; return 0; }
  int	  hairyfunc7 (PFPFPc_i_PFl_i arg)	{ arg = 0; return 0; }
+ 
+ /* gdb has two demanglers (one for g++ 2.95, one for g++ 3).
+    These marker functions help me figure out which demangler is in use. */
+ 
+ int	dm_type_char_star (char * p)		{ return (int) p; }
+ int	dm_type_foo_ref (foo & foo)		{ return foo.ifoo; }
+ int	dm_type_int_star (int * p)		{ return (int) p; }
+ int	dm_type_long_star (long * p)		{ return (int) p; }
+ int	dm_type_unsigned_int (unsigned int i)	{ return i; }
+ int	dm_type_void (void)			{ return 0; }
+ int	dm_type_void_star (void * p)		{ return (int) p; }
Index: gdb/testsuite/gdb.c++/cplusfuncs.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/cplusfuncs.exp,v
retrieving revision 1.1.1.3
diff -c -3 -p -r1.1.1.3 cplusfuncs.exp
*** gdb/testsuite/gdb.c++/cplusfuncs.exp	1999/09/09 00:00:27	1.1.1.3
--- gdb/testsuite/gdb.c++/cplusfuncs.exp	2001/02/05 03:29:49
***************
*** 1,4 ****
! # Copyright (C) 1992, 1997, 1999 Free Software Foundation, Inc.
  
  # 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
--- 1,4 ----
! # Copyright (C) 1992, 1997, 1999, 2001 Free Software Foundation, Inc.
  
  # 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
***************
*** 18,23 ****
--- 18,24 ----
  # bug-gdb@prep.ai.mit.edu
  
  # This file was written by Fred Fish. (fnf@cygnus.com)
+ # Adapted for g++ 3.0 ABI by Michael Chastain. (chastain@redhat.com)
  
  if $tracelevel then {
  	strace $tracelevel
*************** if  { [gdb_compile "${srcdir}/${subdir}/
*** 38,100 ****
  }
  
  #
! #  Cause gdb to lookup a specific C++ function and print the demangled
! #  form.
  #
  
! proc info_func { regex demangled } {
      global gdb_prompt
  
!     send_gdb "info function $regex\n"
      gdb_expect {
! 	-re "File .*:\r\n$demangled\r\n.*$gdb_prompt $" {
! 	    pass "info function for \"$regex\""
  	}
! 	-re "File .*:\r\nclass $demangled\r\n.*$gdb_prompt $" {
! 	    pass "info function for \"$regex\""
  	}
  	-re ".*$gdb_prompt $" {
! 	    fail "info function for \"$regex\""
  	}
  	timeout {
! 	    fail "info function for \"$regex\" (timeout)"
  	}
      }
  }
  
  #
! #  Run print &'$arg' on the input arg and verify that we can correctly
! #  lookup the fully qualified C++ function.
! #  We ignore the return type of the function since we are only interested
! #  in the rootname and arguments part.
  #
  
! proc print_addr_of { arg } {
      global gdb_prompt
      global hex
  
!     set pattern [string_to_regexp $arg]
!     send_gdb "print &'$arg'\n"
      gdb_expect {
! 	-re ".* = .* $hex <$pattern>\r\n$gdb_prompt $" { pass "print &'$arg'" }
  	-re ".*$gdb_prompt $" {
! 	    fail "print &'$arg'"
  	}
  	timeout {
! 	    fail "print &'$arg' (timeout)"
  	}
      }
  }
  
  #
  # Test name demangling for operators.
  #
  # The '(' at the end of each regex input pattern is so that we match only
  # the one we are looking for.  I.E. "operator&" would match both
  # "operator&(foo &)" and "operator&&(foo &)".
  #
  
  proc test_lookup_operator_functions {} {
  
      # These tests don't work for COFF targets; don't even try them
      if [istarget "a29k-*-udi"] then {
--- 39,309 ----
  }
  
  #
! # g++ changed its ABI between 2.95 and 3.0.  gdb has two demanglers
! # for the two different styles.  The two demanglers have some subtle
! # discrepancies in their output.
  #
+ # I probe for the forms in use.
+ # The defaults are for the v3 demangler.
+ #
+ 
+ set dm_operator_comma		","
+ set dm_type_char_star		"char*"
+ set dm_type_foo_ref 		"foo&"
+ set dm_type_int_star		"int*"
+ set dm_type_long_star		"long*"
+ set dm_type_unsigned_int	"unsigned"
+ set dm_type_void		""
+ set dm_type_void_star		"void*"
  
! proc probe_demangler { } {
      global gdb_prompt
+     global dm_operator_comma
+     global dm_type_char_star
+     global dm_type_foo_ref
+     global dm_type_int_star
+     global dm_type_long_star
+     global dm_type_unsigned_int
+     global dm_type_void
+     global dm_type_void_star
+ 
+     send_gdb "print &'foo::operator,(foo&)'\n"
+     gdb_expect {
+ 	-re ".*foo::operator, \\(.*foo.*&.*\\).*\r\n$gdb_prompt $" {
+ 	    # v2 demangler
+ 	    set dm_operator_comma ", "
+ 	    pass "detect dm_operator_comma"
+ 	}
+ 	-re ".*foo::operator,\\(.*foo.*&.*\\).*\r\n$gdb_prompt $" {
+ 	    # v3 demangler
+ 	    pass "detect dm_operator_comma"
+ 	}
+ 	-re ".*$gdb_prompt $" {
+ 	    fail "detect dm_operator_comma"
+ 	}
+ 	timeout {
+ 	    fail "detect dm_operator_comma"
+ 	}
+     }
+ 
+     send_gdb "print &'dm_type_char_star'\n"
+     gdb_expect {
+ 	-re ".*dm_type_char_star\\(char \\*\\).*\r\n$gdb_prompt $" {
+ 	    # v2 demangler
+ 	    set dm_type_char_star "char *"
+ 	    pass "detect dm_type_char_star"
+ 	}
+ 	-re ".*dm_type_char_star\\(char\\*\\).*\r\n$gdb_prompt $" {
+ 	    # v3 demangler
+ 	    pass "detect dm_type_char_star"
+ 	}
+ 	-re ".*$gdb_prompt $" {
+ 	    fail "detect dm_type_char_star"
+ 	}
+ 	timeout {
+ 	    fail "detect dm_type_char_star (timeout)"
+ 	}
+     }
  
!     send_gdb "print &'dm_type_foo_ref'\n"
      gdb_expect {
! 	-re ".*dm_type_foo_ref\\(foo &\\).*\r\n$gdb_prompt $" {
! 	    # v2 demangler
! 	    set dm_type_foo_ref "foo &"
! 	    pass "detect dm_type_foo_ref"
  	}
! 	-re ".*dm_type_foo_ref\\(foo&\\).*\r\n$gdb_prompt $" {
! 	    # v3 demangler
! 	    pass "detect dm_type_foo_ref"
  	}
  	-re ".*$gdb_prompt $" {
! 	    fail "detect dm_type_foo_ref"
  	}
  	timeout {
! 	    fail "detect dm_type_foo_ref (timeout)"
  	}
      }
+ 
+     send_gdb "print &'dm_type_int_star'\n"
+     gdb_expect {
+ 	-re ".*dm_type_int_star\\(int \\*\\).*\r\n$gdb_prompt $" {
+ 	    # v2 demangler
+ 	    set dm_type_int_star "int *"
+ 	    pass "detect dm_type_int_star"
+ 	}
+ 	-re ".*dm_type_int_star\\(int\\*\\).*\r\n$gdb_prompt $" {
+ 	    # v3 demangler
+ 	    pass "detect dm_type_int_star"
+ 	}
+ 	-re ".*$gdb_prompt $" {
+ 	    fail "detect dm_type_int_star"
+ 	}
+ 	timeout {
+ 	    fail "detect dm_type_int_star (timeout)"
+ 	}
+     }
+ 
+     send_gdb "print &'dm_type_long_star'\n"
+     gdb_expect {
+ 	-re ".*dm_type_long_star\\(long \\*\\).*\r\n$gdb_prompt $" {
+ 	    # v2 demangler
+ 	    set dm_type_long_star "long *"
+ 	    pass "detect dm_type_long_star"
+ 	}
+ 	-re ".*dm_type_long_star\\(long\\*\\).*\r\n$gdb_prompt $" {
+ 	    # v3 demangler
+ 	    pass "detect dm_type_long_star"
+ 	}
+ 	-re ".*$gdb_prompt $" {
+ 	    fail "detect dm_type_long_star"
+ 	}
+ 	timeout {
+ 	    fail "detect dm_type_long_star (timeout)"
+ 	}
+     }
+ 
+     send_gdb "print &'dm_type_unsigned_int'\n"
+     gdb_expect {
+ 	-re ".*dm_type_unsigned_int\\(unsigned int\\).*\r\n$gdb_prompt $" {
+ 	    # v2 demangler
+ 	    set dm_type_unsigned_int "unsigned int"
+ 	    pass "detect dm_type_unsigned_int"
+ 	}
+ 	-re ".*dm_type_unsigned_int\\(unsigned\\).*\r\n$gdb_prompt $" {
+ 	    # v3 demangler
+ 	    pass "detect dm_type_unsigned_int"
+ 	}
+ 	-re ".*$gdb_prompt $" {
+ 	    fail "detect dm_type_unsigned_int"
+ 	}
+ 	timeout {
+ 	    fail "detect dm_unsigned int (timeout)"
+ 	}
+     }
+ 
+     send_gdb "print &'dm_type_void'\n"
+     gdb_expect {
+ 	-re ".*dm_type_void\\(void\\).*\r\n$gdb_prompt $" {
+ 	    # v2 demangler
+ 	    set dm_type_void "void"
+ 	    pass "detect dm_type_void"
+ 	}
+ 	-re ".*dm_type_void\\(\\).*\r\n$gdb_prompt $" {
+ 	    # v3 demangler
+ 	    pass "detect dm_type_void"
+ 	}
+ 	-re ".*$gdb_prompt $" {
+ 	    fail "detect dm_type_void"
+ 	}
+ 	timeout {
+ 	    fail "detect dm_type_void (timeout)"
+ 	}
+     }
+ 
+     send_gdb "print &'dm_type_void_star'\n"
+     gdb_expect {
+ 	-re ".*dm_type_void_star\\(void \\*\\).*\r\n$gdb_prompt $" {
+ 	    # v2 demangler
+ 	    set dm_type_void_star "void *"
+ 	    pass "detect dm_type_void_star"
+ 	}
+ 	-re ".*dm_type_void_star\\(void\\*\\).*\r\n$gdb_prompt $" {
+ 	    # v3 demangler
+ 	    pass "detect dm_type_void_star"
+ 	}
+ 	-re ".*$gdb_prompt $" {
+ 	    fail "detect dm_type_void_star"
+ 	}
+ 	timeout {
+ 	    fail "detect dm_type_void_star (timeout)"
+ 	}
+     }
+ }
+ 
+ #
+ #  Lookup a specific C++ function and print the demangled type.
+ #  This form accepts the demangled type as a regexp.
+ #
+ 
+ proc info_func_regexp { name demangled } {
+     global gdb_prompt
+ 
+     send_gdb "info function $name\n"
+     gdb_expect {
+ 	-re ".*File .*:\r\n(class |)$demangled\r\n.*$gdb_prompt $" {
+ 	    pass "info function for \"$name\""
+ 	}
+ 	-re ".*$gdb_prompt $" {
+ 	    fail "info function for \"$name\""
+ 	}
+ 	timeout {
+ 	    fail "info function for \"$name\" (timeout)"
+ 	}
+     }
  }
  
  #
! #  Lookup a specific C++ function and print the demangled type.
! #  This form accepts the demangled type as a literal string.
  #
  
! proc info_func { name demangled } {
!     info_func_regexp "$name" [string_to_regexp "$demangled"]
! }
! 
! #
! # Print the address of a function.
! # This checks that I can lookup a fully qualified C++ function.
! # This also checks the argument types on the return string.
! #
! 
! proc print_addr_2 { name good } {
      global gdb_prompt
      global hex
+ 
+     set good_pattern [string_to_regexp $good]
  
!     send_gdb "print &'$name'\n"
      gdb_expect {
! 	-re ".* = .* $hex <$good_pattern>\r\n$gdb_prompt $" {
! 	    pass "print &'$name'"
! 	}
  	-re ".*$gdb_prompt $" {
! 	    fail "print &'$name'"
  	}
  	timeout {
! 	    fail "print &'$name' (timeout)"
  	}
      }
  }
  
  #
+ #  Simple interfaces to print_addr_2.
+ #
+ 
+ proc print_addr { name } {
+     print_addr_2 "$name" "$name"
+ }
+ 
+ #
  # Test name demangling for operators.
  #
  # The '(' at the end of each regex input pattern is so that we match only
  # the one we are looking for.  I.E. "operator&" would match both
  # "operator&(foo &)" and "operator&&(foo &)".
  #
+ # gdb-gnats bug gdb/18:
+ #  "gdb can't parse "info func operator*" or "info func operator\*".
+ #  The star in "operator*" is interpreted as a regexp, but the "\*"
+ #  in  "operator\*" is not a legal operator.
+ #
  
  proc test_lookup_operator_functions {} {
+     global dm_operator_comma
+     global dm_type_char_star
+     global dm_type_foo_ref
+     global dm_type_void
+     global dm_type_void_star
  
      # These tests don't work for COFF targets; don't even try them
      if [istarget "a29k-*-udi"] then {
*************** proc test_lookup_operator_functions {} {
*** 103,229 ****
  	return
      }
  
!     info_func "operator&&("  "void foo::operator&&\\(foo &\\);"
!     info_func "operator&=("  "void foo::operator&=\\(foo &\\);"
!     info_func "operator&("  "void foo::operator&\\(foo &\\);"
!     info_func "operator/=("  "void foo::operator/=\\(foo &\\);"
!     info_func "operator^=("  "void foo::operator.=\\(foo &\\);"
!     info_func "operator<<=("  "void foo::operator<<=\\(foo &\\);"
!     info_func "operator%=("  "void foo::operator%=\\(foo &\\);"
!     info_func "operator-=("  "void foo::operator-=\\(foo &\\);"
! 
!     # There doesn't appear to be any way to get GDB to treat '*' as a
!     # character to match, rather than as a regex special character.
!     setup_xfail "*-*-*"
!     info_func "operator\*=("  "void foo::operator\\*=\\(foo &\\);"
! 
!     info_func "operator|=("  "void foo::operator\\|=\\(foo &\\);"
!     info_func "operator+=("  "void foo::operator.=\\(foo &\\);"
!     info_func "operator>>=("  "void foo::operator\>\>=\\(foo &\\);"
!     info_func "operator=("  "void foo::operator=\\(foo &\\);"
!     info_func "operator()("  "void foo::operator\\(\\)\\(foo &\\);"
! 
!     # The function should be "operator," not "operator, ".  (note space)
!     # This test will work; I've commented it out because it should not
!     # count as a pass, since it is incorrect.  Ian Taylor.
!     # info_func "operator, ("  "void foo::operator, \\(foo &\\);"
!     setup_xfail "*-*-*"
!     info_func "operator,("  "void foo::operator,\\(foo &\\);"
! 
!     info_func "operator~("  "void foo::operator~\\(void\\);"
!     info_func "operator delete("  "void foo::operator delete\\(void \\*\\)(| static);"
!     info_func "operator/("  "void foo::operator/\\(foo &\\);"
!     info_func "operator==("  "void foo::operator==\\(foo &\\);"
!     info_func "operator^("  "void foo::operator\\^\\(foo &\\);"
! 
!     info_func "operator>=("  "void foo::operator>=\\(foo &\\);"
!     info_func "operator>("  "void foo::operator>\\(foo &\\);"
!     info_func "operator<=("  "void foo::operator<=\\(foo &\\);"
!     info_func "operator<<("  "void foo::operator<<\\(foo &\\);"
!     info_func "operator<("  "void foo::operator<\\(foo &\\);"
!     info_func "operator%("  "void foo::operator%\\(foo &\\);"
!     info_func "operator-("  "void foo::operator-\\(foo &\\);"
! 
!     # There doesn't appear to be anyway to get '*' treated as a character
!     # to match, rather than as a regex special character.
!     setup_xfail "*-*-*"
!     info_func "operator\*("  "void foo::operator\\*\\(foo &\\);"
! 
!     info_func "operator--("  "void foo::operator--\\(int\\);"
!     info_func "operator!=("  "void foo::operator!=\\(foo &\\);"
!     info_func "operator!("  "void foo::operator!\\(void\\);"
!     info_func "operator new("  "void \\*foo::operator new\\(.*\\)(| static);"
!     info_func "operator||("  "void foo::operator\\|\\|\\(foo &\\);"
!     info_func "operator char \\*("  "char \\*foo::operator char \\*\\(void\\);"
!     info_func "operator int("  "int foo::operator int\\(void\\);"
!     info_func "operator|("  "void foo::operator\\|\\(foo &\\);"
!     info_func "operator+("  "void foo::operator\\+\\(foo &\\);"
!     info_func "operator++("  "void foo::operator\\+\\+\\(int\\);"
!     info_func "operator->("  "foo \\*foo::operator->\\(void\\);"
!     info_func "operator->\\*("  "void foo::operator->\\*\\(foo &\\);"
!     info_func "operator>>("  "void foo::operator\>\>\\(foo &\\);"
! 
!     # GDB says "`operator \[\](' not supported".  I don't know why.
!     setup_xfail "*-*-*"
!     info_func "operator\\\[\\\](" "void foo::operator\\\[\\\]\\(foo &\\);"
!     # But this works, for some reason.
!     info_func ".perator\\\[\\\](" "void foo::operator\\\[\\\]\\(foo &\\);"
  }
  
  
  proc test_paddr_operator_functions {} {
      global hex
      global hp_aCC_compiler
  
!     print_addr_of "foo::operator&&(foo &)"
!     print_addr_of "foo::operator&=(foo &)"
!     print_addr_of "foo::operator&(foo &)"
!     print_addr_of "foo::operator/=(foo &)"
!     print_addr_of "foo::operator^=(foo &)"
!     print_addr_of "foo::operator<<=(foo &)"
!     print_addr_of "foo::operator%=(foo &)"
!     print_addr_of "foo::operator-=(foo &)"
!     print_addr_of "foo::operator*=(foo &)"
!     print_addr_of "foo::operator|=(foo &)"
!     print_addr_of "foo::operator+=(foo &)"
!     print_addr_of "foo::operator>>=(foo &)"
!     print_addr_of "foo::operator=(foo &)"
!     print_addr_of "foo::operator()(foo &)"
!     print_addr_of "foo::operator, (foo &)"
!     print_addr_of "foo::operator~(void)"
      if { !$hp_aCC_compiler } {
! 	print_addr_of "foo::operator delete(void *)"
      } else {
! 	gdb_test "print &'foo::operator delete(void *) static'" \
  	    " = .*(0x\[0-9a-f\]+|) <foo::operator delete.*>"
      }
!     print_addr_of "foo::operator/(foo &)"
!     print_addr_of "foo::operator==(foo &)"
!     print_addr_of "foo::operator^(foo &)"
!     print_addr_of "foo::operator>=(foo &)"
!     print_addr_of "foo::operator>(foo &)"
!     print_addr_of "foo::operator<=(foo &)"
!     print_addr_of "foo::operator<<(foo &)"
!     print_addr_of "foo::operator<(foo &)"
!     print_addr_of "foo::operator%(foo &)"
!     print_addr_of "foo::operator-(foo &)"
!     print_addr_of "foo::operator*(foo &)"
!     print_addr_of "foo::operator--(int)"
!     print_addr_of "foo::operator!=(foo &)"
!     print_addr_of "foo::operator!(void)"
!     gdb_test "print &'foo::operator new'" \
! 	" = .* $hex <foo::operator new\\(.*\\)(| static)>"
!     print_addr_of "foo::operator||(foo &)"
!     print_addr_of "foo::operator char *(void)"
!     print_addr_of "foo::operator int(void)"
!     print_addr_of "foo::operator|(foo &)"
!     print_addr_of "foo::operator+(foo &)"
!     print_addr_of "foo::operator++(int)"
!     print_addr_of "foo::operator->(void)"
!     print_addr_of "foo::operator->*(foo &)"
!     print_addr_of "foo::operator>>(foo &)"
!     gdb_test "print &'foo::operator\[\](foo &)'" \
! 	" = .*0x\[0-9a-f\]+ <foo::operator\\\[\\\]\\(foo &\\)>"
  }
  
  #
--- 312,432 ----
  	return
      }
  
!     info_func "operator*("	"void foo::operator*($dm_type_foo_ref);"
!     info_func "operator%("	"void foo::operator%($dm_type_foo_ref);"
!     info_func "operator-("	"void foo::operator-($dm_type_foo_ref);"
!     info_func "operator>>("	"void foo::operator>>($dm_type_foo_ref);"
!     info_func "operator!=("	"void foo::operator!=($dm_type_foo_ref);"
!     info_func "operator>("	"void foo::operator>($dm_type_foo_ref);"
!     info_func "operator>=("	"void foo::operator>=($dm_type_foo_ref);"
!     info_func "operator|("	"void foo::operator|($dm_type_foo_ref);"
!     info_func "operator&&("	"void foo::operator&&($dm_type_foo_ref);"
!     info_func "operator!("	"void foo::operator!($dm_type_void);"
!     info_func "operator++("	"void foo::operator++(int);"
!     info_func "operator=("	"void foo::operator=($dm_type_foo_ref);"
!     info_func "operator+=("	"void foo::operator+=($dm_type_foo_ref);"
!     info_func "operator*=("	"void foo::operator*=($dm_type_foo_ref);"
!     info_func "operator%=("	"void foo::operator%=($dm_type_foo_ref);"
!     info_func "operator>>=("	"void foo::operator>>=($dm_type_foo_ref);"
!     info_func "operator|=("	"void foo::operator|=($dm_type_foo_ref);"
!     info_func "operator$dm_operator_comma\("	\
!     				"void foo::operator$dm_operator_comma\($dm_type_foo_ref);"
!     info_func "operator/("	"void foo::operator/($dm_type_foo_ref);"
!     info_func "operator+("	"void foo::operator+($dm_type_foo_ref);"
!     info_func "operator<<("	"void foo::operator<<($dm_type_foo_ref);"
!     info_func "operator==("	"void foo::operator==($dm_type_foo_ref);"
!     info_func "operator<("	"void foo::operator<($dm_type_foo_ref);"
!     info_func "operator<=("	"void foo::operator<=($dm_type_foo_ref);"
!     info_func "operator&("	"void foo::operator&($dm_type_foo_ref);"
!     info_func "operator^("	"void foo::operator^($dm_type_foo_ref);"
!     info_func "operator||("	"void foo::operator||($dm_type_foo_ref);"
!     info_func "operator~("	"void foo::operator~($dm_type_void);"
!     info_func "operator--("	"void foo::operator--(int);"
!     info_func "operator->("	"foo *foo::operator->($dm_type_void);"
!     info_func "operator-=("	"void foo::operator-=($dm_type_foo_ref);"
!     info_func "operator/=("	"void foo::operator/=($dm_type_foo_ref);"
!     info_func "operator<<=("	"void foo::operator<<=($dm_type_foo_ref);"
!     info_func "operator&=("	"void foo::operator&=($dm_type_foo_ref);"
!     info_func "operator^=("	"void foo::operator^=($dm_type_foo_ref);"
!     info_func "operator->*("	"void foo::operator->*($dm_type_foo_ref);"
! 
!     # operator[] needs backslashes to protect against TCL evaluation.
!     info_func "operator\[\]("	"void foo::operator\[\]($dm_type_foo_ref);"
! 
!     # These are gnarly because they might end with 'static'.
!     set dm_type_void_star_regexp [string_to_regexp $dm_type_void_star]
!     info_func_regexp "operator new("     "void \\*foo::operator new\\(.*\\)(| static);"
!     info_func_regexp "operator delete("  "void foo::operator delete\\($dm_type_void_star_regexp\\)(| static);"
! 
!     info_func "operator int("	"int foo::operator int($dm_type_void);"
!     info_func "operator()("	"void foo::operator()($dm_type_foo_ref);"
!     info_func "operator $dm_type_char_star\(" \
! 				"char *foo::operator $dm_type_char_star\($dm_type_void);"
! 
  }
  
  
  proc test_paddr_operator_functions {} {
      global hex
      global hp_aCC_compiler
+     global dm_operator_comma
+     global dm_type_char_star
+     global dm_type_foo_ref
+     global dm_type_long_star
+     global dm_type_unsigned_int
+     global dm_type_void
+     global dm_type_void_star
+ 
+     print_addr "foo::operator*($dm_type_foo_ref)"
+     print_addr "foo::operator%($dm_type_foo_ref)"
+     print_addr "foo::operator-($dm_type_foo_ref)"
+     print_addr "foo::operator>>($dm_type_foo_ref)"
+     print_addr "foo::operator!=($dm_type_foo_ref)"
+     print_addr "foo::operator>($dm_type_foo_ref)"
+     print_addr "foo::operator>=($dm_type_foo_ref)"
+     print_addr "foo::operator|($dm_type_foo_ref)"
+     print_addr "foo::operator&&($dm_type_foo_ref)"
+     print_addr "foo::operator!($dm_type_void)"
+     print_addr "foo::operator++(int)"
+     print_addr "foo::operator=($dm_type_foo_ref)"
+     print_addr "foo::operator+=($dm_type_foo_ref)"
+     print_addr "foo::operator*=($dm_type_foo_ref)"
+     print_addr "foo::operator%=($dm_type_foo_ref)"
+     print_addr "foo::operator>>=($dm_type_foo_ref)"
+     print_addr "foo::operator|=($dm_type_foo_ref)"
+     print_addr "foo::operator$dm_operator_comma\($dm_type_foo_ref)"
+     print_addr "foo::operator/($dm_type_foo_ref)"
+     print_addr "foo::operator+($dm_type_foo_ref)"
+     print_addr "foo::operator<<($dm_type_foo_ref)"
+     print_addr "foo::operator==($dm_type_foo_ref)"
+     print_addr "foo::operator<($dm_type_foo_ref)"
+     print_addr "foo::operator<=($dm_type_foo_ref)"
+     print_addr "foo::operator&($dm_type_foo_ref)"
+     print_addr "foo::operator^($dm_type_foo_ref)"
+     print_addr "foo::operator||($dm_type_foo_ref)"
+     print_addr "foo::operator~($dm_type_void)"
+     print_addr "foo::operator--(int)"
+     print_addr "foo::operator->($dm_type_void)"
+     print_addr "foo::operator-=($dm_type_foo_ref)"
+     print_addr "foo::operator/=($dm_type_foo_ref)"
+     print_addr "foo::operator<<=($dm_type_foo_ref)"
+     print_addr "foo::operator&=($dm_type_foo_ref)"
+     print_addr "foo::operator^=($dm_type_foo_ref)"
+     print_addr "foo::operator->*($dm_type_foo_ref)"
+     print_addr "foo::operator\[\]($dm_type_foo_ref)"
+     print_addr "foo::operator()($dm_type_foo_ref)"
  
!     gdb_test "print &'foo::operator new'" \
! 	" = .* $hex <foo::operator new\\(.*\\)(| static)>"
      if { !$hp_aCC_compiler } {
! 	print_addr "foo::operator delete($dm_type_void_star)"
      } else {
! 	gdb_test "print &'foo::operator delete($dm_type_void_star) static'" \
  	    " = .*(0x\[0-9a-f\]+|) <foo::operator delete.*>"
      }
! 
!     print_addr "foo::operator int($dm_type_void)"
!     print_addr "foo::operator $dm_type_char_star\($dm_type_void)"
  }
  
  #
*************** proc test_paddr_operator_functions {} {
*** 231,269 ****
  #
  
  proc test_paddr_overloaded_functions {} {
!     print_addr_of "overload1arg(signed char)"
!     print_addr_of "overload1arg(unsigned char)"
!     print_addr_of "overload1arg(unsigned int)"
!     print_addr_of "overload1arg(unsigned long)"
!     print_addr_of "overload1arg(unsigned short)"
!     print_addr_of "overload1arg(char)"
!     print_addr_of "overload1arg(double)"
!     print_addr_of "overload1arg(float)"
!     print_addr_of "overload1arg(int)"
!     print_addr_of "overload1arg(long)"
!     print_addr_of "overload1arg(short)"
!     print_addr_of "overload1arg(void)"
!     print_addr_of "overloadargs(int)"
!     print_addr_of "overloadargs(int, int)"
!     print_addr_of "overloadargs(int, int, int)"
!     print_addr_of "overloadargs(int, int, int, int)"
!     print_addr_of "overloadargs(int, int, int, int, int)"
!     print_addr_of "overloadargs(int, int, int, int, int, int)"
!     print_addr_of "overloadargs(int, int, int, int, int, int, int)"
!     print_addr_of "overloadargs(int, int, int, int, int, int, int, int)"
!     print_addr_of "overloadargs(int, int, int, int, int, int, int, int, int)"
!     print_addr_of "overloadargs(int, int, int, int, int, int, int, int, int, int)"
!     print_addr_of "overloadargs(int, int, int, int, int, int, int, int, int, int, int)"
  }
  
  proc test_paddr_hairy_functions {} {
!     print_addr_of "hairyfunc1(int)"
!     print_addr_of "hairyfunc2(int (*)(char *))"
!     print_addr_of "hairyfunc3(int (*)(short (*)(long *)))"
!     print_addr_of "hairyfunc4(int (*)(short (*)(char *)))"
!     print_addr_of "hairyfunc5(int (*(*)(char *))(long))"
!     print_addr_of "hairyfunc6(int (*(*)(int *))(long))"
!     print_addr_of "hairyfunc7(int (*(*)(int (*)(char *)))(long))"
  }
  
  proc do_tests {} {
--- 434,485 ----
  #
  
  proc test_paddr_overloaded_functions {} {
!     global dm_type_unsigned_int
!     global dm_type_void
! 
!     print_addr "overload1arg($dm_type_void)"
!     print_addr "overload1arg(char)"
!     print_addr "overload1arg(signed char)"
!     print_addr "overload1arg(unsigned char)"
!     print_addr "overload1arg(short)"
!     print_addr "overload1arg(unsigned short)"
!     print_addr "overload1arg(int)"
!     print_addr "overload1arg($dm_type_unsigned_int)"
!     print_addr "overload1arg(long)"
!     print_addr "overload1arg(unsigned long)"
!     print_addr "overload1arg(float)"
!     print_addr "overload1arg(double)"
! 
!     print_addr "overloadargs(int)"
!     print_addr "overloadargs(int, int)"
!     print_addr "overloadargs(int, int, int)"
!     print_addr "overloadargs(int, int, int, int)"
!     print_addr "overloadargs(int, int, int, int, int)"
!     print_addr "overloadargs(int, int, int, int, int, int)"
!     print_addr "overloadargs(int, int, int, int, int, int, int)"
!     print_addr "overloadargs(int, int, int, int, int, int, int, int)"
!     print_addr "overloadargs(int, int, int, int, int, int, int, int, int)"
!     print_addr "overloadargs(int, int, int, int, int, int, int, int, int, int)"
!     print_addr "overloadargs(int, int, int, int, int, int, int, int, int, int, int)"
  }
  
  proc test_paddr_hairy_functions {} {
!     global gdb_prompt
!     global hex
!     global dm_type_char_star
!     global dm_type_int_star
!     global dm_type_long_star
! 
!     print_addr_2 "hairyfunc1" "hairyfunc1(int)"
!     print_addr_2 "hairyfunc2" "hairyfunc2(int (*)($dm_type_char_star))"
!     print_addr_2 "hairyfunc3" "hairyfunc3(int (*)(short (*)($dm_type_long_star)))"
!     print_addr_2 "hairyfunc4" "hairyfunc4(int (*)(short (*)($dm_type_char_star)))"
! 
!     # gdb-gnats bug gdb/19:
!     # "gdb v3 demangler fails on hairyfunc5 hairyfunc6 hairyfunc7"
!     print_addr_2 "hairyfunc5" "hairyfunc5(int (*(*)($dm_type_char_star))(long))"
!     print_addr_2 "hairyfunc6" "hairyfunc6(int (*(*)($dm_type_int_star))(long))"
!     print_addr_2 "hairyfunc7" "hairyfunc7(int (*(*)(int (*)(char *)))(long))"
  }
  
  proc do_tests {} {
*************** proc do_tests {} {
*** 303,308 ****
--- 519,525 ----
  	clear_xfail "*-*-*"
      }
  
+     probe_demangler
      test_paddr_overloaded_functions
      test_paddr_operator_functions
      test_paddr_hairy_functions
From eliz@is.elta.co.il Mon Feb 05 01:13:00 2001
From: Eli Zaretskii <eliz@is.elta.co.il>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: Christopher Faylor <cgf@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFA] fix child_xfer_memory in hppah-nat.c
Date: Mon, 05 Feb 2001 01:13:00 -0000
Message-id: <Pine.SUN.3.91.1010205110800.5862G-100000@is>
References: <3A7DCAB6.333C1DE0@cygnus.com>
X-SW-Source: 2001-02/msg00047.html
Content-length: 646

On Sun, 4 Feb 2001, Andrew Cagney wrote:

> Christopher Faylor wrote:
> 
> > You might want to add an ATTRIBUTE_UNUSED to 'struct mem_attrib *mem' to
> > stop a potential compiler warning.
> 
> No.  GDB doesn't use that ATTRIBUTE_UNUSED hack.  Check the archives and
> configure.in for the relevant discussion.

Could you please point to that discussion, and also identify the place in 
configure.in that's relevant to this?  I cannot find those (but I'm not 
sure I know what to look for).

Several files in the CVS use ATTRIBUTE_UNUSED (not surprisingly, 
go32-nat.c is one of them ;-).  So I wonder what is the current say-so 
on this matter.
From taylor@cygnus.com Mon Feb 05 07:39:00 2001
From: David Taylor <taylor@cygnus.com>
To: gdb-patches@sources.redhat.com
Subject: [PATCH] gdb/valops.c
Date: Mon, 05 Feb 2001 07:39:00 -0000
Message-id: <200102051538.KAA02881@texas.cygnus.com>
X-SW-Source: 2001-02/msg00048.html
Content-length: 2351

[The following is motivated by a port of gdb to target a new Harvard
architecture processor; for this port, pointers are 2 bytes long, but
addresses are 4 bytes long.  For most targets, addresses and pointers
are identical and for them this change is a no-op.]

I will shortly be committing the following patch to gdb/valops.c:

ChangeLog entry:

	* valops.c (value_cast): If casting a scalar (int, enum, range) to
 	"a pointer", do not truncate it to the length of a pointer, but
 	rather to the length of an address as we are dealing here with
 	gdb's representation, not the target's representation.  That is,
 	we are really dealing with addresses, not pointers.  This allows
 	things like "print *(int *)0x01000234" to work when dealing with
 	a target having two byte pointers and four byte addresses.

Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.29
diff -c -r1.29 valops.c
*** valops.c	2001/01/04 19:58:31	1.29
--- valops.c	2001/02/05 15:32:15
***************
*** 287,298 ****
  				      code2 == TYPE_CODE_ENUM ||
  				      code2 == TYPE_CODE_RANGE))
      {
!       int ptr_bit = HOST_CHAR_BIT * TYPE_LENGTH (type);
        LONGEST longest = value_as_long (arg2);
!       if (ptr_bit < sizeof (LONGEST) * HOST_CHAR_BIT)
  	{
! 	  if (longest >= ((LONGEST) 1 << ptr_bit)
! 	      || longest <= -((LONGEST) 1 << ptr_bit))
  	    warning ("value truncated");
  	}
        return value_from_longest (type, longest);
--- 287,305 ----
  				      code2 == TYPE_CODE_ENUM ||
  				      code2 == TYPE_CODE_RANGE))
      {
!       /* TYPE_LENGTH (type) is the length of a pointer, but we really
! 	 want the length of an address! -- we are really dealing with
! 	 addresses (i.e., gdb representations) not pointers (i.e.,
! 	 target representations) here.  This allows things like "print
! 	 *(int *)0x01000234" to work when dealing with a target having
! 	 two byte pointers and four byte addresses.  */
!       int addr_bit = TARGET_ADDR_BIT;
! 
        LONGEST longest = value_as_long (arg2);
!       if (addr_bit < sizeof (LONGEST) * HOST_CHAR_BIT)
  	{
! 	  if (longest >= ((LONGEST) 1 << addr_bit)
! 	      || longest <= -((LONGEST) 1 << addr_bit))
  	    warning ("value truncated");
  	}
        return value_from_longest (type, longest);
From cgf@redhat.com Mon Feb 05 10:17:00 2001
From: Christopher Faylor <cgf@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFA] fix child_xfer_memory in hppah-nat.c
Date: Mon, 05 Feb 2001 10:17:00 -0000
Message-id: <20010205131813.A734@redhat.com>
References: <3A7DCAB6.333C1DE0@cygnus.com> <Pine.SUN.3.91.1010205110800.5862G-100000@is>
X-SW-Source: 2001-02/msg00049.html
Content-length: 1779

On Mon, Feb 05, 2001 at 11:11:05AM +0200, Eli Zaretskii wrote:
>
>On Sun, 4 Feb 2001, Andrew Cagney wrote:
>
>> Christopher Faylor wrote:
>> 
>> > You might want to add an ATTRIBUTE_UNUSED to 'struct mem_attrib *mem' to
>> > stop a potential compiler warning.
>> 
>> No.  GDB doesn't use that ATTRIBUTE_UNUSED hack.  Check the archives and
>> configure.in for the relevant discussion.
>
>Could you please point to that discussion, and also identify the place in 
>configure.in that's relevant to this?  I cannot find those (but I'm not 
>sure I know what to look for).

Here are the lines from configure.in:

    # NOTE: Don't add -Wall or -Wunused, they both include
    # -Wunused-parameter which reports bogus warnings.

The TODO has some words, too:

    Frequently requested but not approved requests.

    --

    Eliminate unused argument warnings using ATTRIBUTE_UNUSED.

    The benefits on this one are thought to be marginal - GDBs design
    means that unused parameters are very common.  GCC 3.0 will also
    include the option -Wno-unused-parameter which means that ``-Wall
    -Wno-unused-parameters -Werror'' can be specified.


>Several files in the CVS use ATTRIBUTE_UNUSED (not surprisingly, 
>go32-nat.c is one of them ;-).  So I wonder what is the current say-so 
>on this matter.

I specifically added some of these to win32-nat.c, too, not too long ago.
I do remember the discussion now.  I can't say that I agree with it,
but I remember it.

It looks like at least one discussion is here:

http://sources.redhat.com/ml/gdb/2000-q1/msg00826.html

I found this yesterday by searching for "unused" but it doesn't work
today.  Apparently the htdig stuff is screwed up.

There was some more discussion on this in March, 2000 in both gdb
and gdb-patches.

cgf
From ac131313@cygnus.com Mon Feb 05 10:43:00 2001
From: Andrew Cagney <ac131313@cygnus.com>
To: GDB Patches <gdb-patches@sourceware.cygnus.com>
Subject: Re: [rfa:sparc/rfc] multi-arch SOFTWARE_SINGLE_STEP v2.0
Date: Mon, 05 Feb 2001 10:43:00 -0000
Message-id: <3A7EF38D.96D16D8B@cygnus.com>
References: <3A6A1DF4.C6760CEF@cygnus.com>
X-SW-Source: 2001-02/msg00050.html
Content-length: 29357

Hello,

Attatched is a revised SOFTWARE_SINGLE_STEP patch.  I believe that it
preserves the existing behavour vis:

        o       sparc32 cross
                was software single step

        o       sparc64 cross
                was software single step

        o       sparc64 (sol2) native
                was ptrace (hardware) single step

        o       sparc32 (sol2) native
                was ptrace (hardware) single step

I've eliminated the regressions on sol2sparc64 and am now re-testing the
other configurations.

	Andrew
Mon Feb  5 10:33:15 2001  Andrew Cagney  <cagney@redhat.com>

	* config/sparc/tm-sp64.h (GDB_MULTI_ARCH): Change to 1 from two.
  	Problems with SOFTWARE_SINGLE_STEP.

	* target.h (enum target_signal): Move from here.
	* defs.h (enum target_signal): To here.  Work around problem with
 	forward enum declarations.

	* gdbarch.sh (SOFTWARE_SINGLE_STEP): Add.
	* gdbarch.h, gdbarch.c: Re-generate.

	* target.h (SOFTWARE_SINGLE_STEP_P)
	(SOFTWARE_SINGLE_STEP): Delete macro definitions.

	* mips-tdep.c (mips_dump_tdep): Do not dump SOFTWARE_SINGLE_STEP
 	or SOFTWARE_SINGLE_STEP_P.
	* infrun.c (resume): Change SOFTWARE_SINGLE_STEP_P to a function.
	(handle_inferior_event): Ditto.
	* infptrace.c (child_resume): Ditto.
	* breakpoint.c (bpstat_stop_status): Ditto.

	* config/powerpc/tm-linux.h (SOFTWARE_SINGLE_STEP_P): Delete.
	* config/powerpc/tm-ppc-eabi.h (SOFTWARE_SINGLE_STEP_P): Ditto.
	* config/rs6000/tm-rs6000.h (SOFTWARE_SINGLE_STEP_P):  Ditto.
	* config/sparc/tm-sparc.h (SOFTWARE_SINGLE_STEP_P):  Ditto.
	* config/sh/tm-wince.h (SOFTWARE_SINGLE_STEP_P):  Ditto.
	* config/mips/tm-wince.h (SOFTWARE_SINGLE_STEP_P):  Ditto.
	* config/arm/tm-wince.h (SOFTWARE_SINGLE_STEP_P): Delete.
	* config/arc/tm-arc.h (SOFTWARE_SINGLE_STEP_P): Delete.
	* config/sparc/tm-sun4sol2.h (SOFTWARE_SINGLE_STEP_P): Delete.

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.24
diff -p -r1.24 breakpoint.c
*** breakpoint.c	2001/01/31 01:24:00	1.24
--- breakpoint.c	2001/02/05 18:33:54
*************** bpstat_stop_status (CORE_ADDR *pc, int n
*** 2399,2405 ****
    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)
--- 2399,2405 ----
    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)
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.36
diff -p -r1.36 defs.h
*** defs.h	2001/01/31 03:46:23	1.36
--- defs.h	2001/02/05 18:33:54
*************** enum precision_type
*** 226,231 ****
--- 226,377 ----
      unspecified_precision
    };
  
+ /* The numbering of these signals is chosen to match traditional unix
+    signals (insofar as various unices use the same numbers, anyway).
+    It is also the numbering of the GDB remote protocol.  Other remote
+    protocols, if they use a different numbering, should make sure to
+    translate appropriately.
+ 
+    Since these numbers have actually made it out into other software
+    (stubs, etc.), you mustn't disturb the assigned numbering.  If you
+    need to add new signals here, add them to the end of the explicitly
+    numbered signals.
+ 
+    This is based strongly on Unix/POSIX signals for several reasons:
+    (1) This set of signals represents a widely-accepted attempt to
+    represent events of this sort in a portable fashion, (2) we want a
+    signal to make it from wait to child_wait to the user intact, (3) many
+    remote protocols use a similar encoding.  However, it is
+    recognized that this set of signals has limitations (such as not
+    distinguishing between various kinds of SIGSEGV, or not
+    distinguishing hitting a breakpoint from finishing a single step).
+    So in the future we may get around this either by adding additional
+    signals for breakpoint, single-step, etc., or by adding signal
+    codes; the latter seems more in the spirit of what BSD, System V,
+    etc. are doing to address these issues.  */
+ 
+ /* For an explanation of what each signal means, see
+    target_signal_to_string.  */
+ 
+ /* This should probably be in target.h but isn't due to forward
+    declaration problems. */
+ 
+ enum target_signal
+   {
+     /* Used some places (e.g. stop_signal) to record the concept that
+        there is no signal.  */
+     TARGET_SIGNAL_0 = 0,
+     TARGET_SIGNAL_FIRST = 0,
+     TARGET_SIGNAL_HUP = 1,
+     TARGET_SIGNAL_INT = 2,
+     TARGET_SIGNAL_QUIT = 3,
+     TARGET_SIGNAL_ILL = 4,
+     TARGET_SIGNAL_TRAP = 5,
+     TARGET_SIGNAL_ABRT = 6,
+     TARGET_SIGNAL_EMT = 7,
+     TARGET_SIGNAL_FPE = 8,
+     TARGET_SIGNAL_KILL = 9,
+     TARGET_SIGNAL_BUS = 10,
+     TARGET_SIGNAL_SEGV = 11,
+     TARGET_SIGNAL_SYS = 12,
+     TARGET_SIGNAL_PIPE = 13,
+     TARGET_SIGNAL_ALRM = 14,
+     TARGET_SIGNAL_TERM = 15,
+     TARGET_SIGNAL_URG = 16,
+     TARGET_SIGNAL_STOP = 17,
+     TARGET_SIGNAL_TSTP = 18,
+     TARGET_SIGNAL_CONT = 19,
+     TARGET_SIGNAL_CHLD = 20,
+     TARGET_SIGNAL_TTIN = 21,
+     TARGET_SIGNAL_TTOU = 22,
+     TARGET_SIGNAL_IO = 23,
+     TARGET_SIGNAL_XCPU = 24,
+     TARGET_SIGNAL_XFSZ = 25,
+     TARGET_SIGNAL_VTALRM = 26,
+     TARGET_SIGNAL_PROF = 27,
+     TARGET_SIGNAL_WINCH = 28,
+     TARGET_SIGNAL_LOST = 29,
+     TARGET_SIGNAL_USR1 = 30,
+     TARGET_SIGNAL_USR2 = 31,
+     TARGET_SIGNAL_PWR = 32,
+     /* Similar to SIGIO.  Perhaps they should have the same number.  */
+     TARGET_SIGNAL_POLL = 33,
+     TARGET_SIGNAL_WIND = 34,
+     TARGET_SIGNAL_PHONE = 35,
+     TARGET_SIGNAL_WAITING = 36,
+     TARGET_SIGNAL_LWP = 37,
+     TARGET_SIGNAL_DANGER = 38,
+     TARGET_SIGNAL_GRANT = 39,
+     TARGET_SIGNAL_RETRACT = 40,
+     TARGET_SIGNAL_MSG = 41,
+     TARGET_SIGNAL_SOUND = 42,
+     TARGET_SIGNAL_SAK = 43,
+     TARGET_SIGNAL_PRIO = 44,
+     TARGET_SIGNAL_REALTIME_33 = 45,
+     TARGET_SIGNAL_REALTIME_34 = 46,
+     TARGET_SIGNAL_REALTIME_35 = 47,
+     TARGET_SIGNAL_REALTIME_36 = 48,
+     TARGET_SIGNAL_REALTIME_37 = 49,
+     TARGET_SIGNAL_REALTIME_38 = 50,
+     TARGET_SIGNAL_REALTIME_39 = 51,
+     TARGET_SIGNAL_REALTIME_40 = 52,
+     TARGET_SIGNAL_REALTIME_41 = 53,
+     TARGET_SIGNAL_REALTIME_42 = 54,
+     TARGET_SIGNAL_REALTIME_43 = 55,
+     TARGET_SIGNAL_REALTIME_44 = 56,
+     TARGET_SIGNAL_REALTIME_45 = 57,
+     TARGET_SIGNAL_REALTIME_46 = 58,
+     TARGET_SIGNAL_REALTIME_47 = 59,
+     TARGET_SIGNAL_REALTIME_48 = 60,
+     TARGET_SIGNAL_REALTIME_49 = 61,
+     TARGET_SIGNAL_REALTIME_50 = 62,
+     TARGET_SIGNAL_REALTIME_51 = 63,
+     TARGET_SIGNAL_REALTIME_52 = 64,
+     TARGET_SIGNAL_REALTIME_53 = 65,
+     TARGET_SIGNAL_REALTIME_54 = 66,
+     TARGET_SIGNAL_REALTIME_55 = 67,
+     TARGET_SIGNAL_REALTIME_56 = 68,
+     TARGET_SIGNAL_REALTIME_57 = 69,
+     TARGET_SIGNAL_REALTIME_58 = 70,
+     TARGET_SIGNAL_REALTIME_59 = 71,
+     TARGET_SIGNAL_REALTIME_60 = 72,
+     TARGET_SIGNAL_REALTIME_61 = 73,
+     TARGET_SIGNAL_REALTIME_62 = 74,
+     TARGET_SIGNAL_REALTIME_63 = 75,
+ 
+     /* Used internally by Solaris threads.  See signal(5) on Solaris.  */
+     TARGET_SIGNAL_CANCEL = 76,
+ 
+     /* Yes, this pains me, too.  But LynxOS didn't have SIG32, and now
+        Linux does, and we can't disturb the numbering, since it's part
+        of the protocol.  Note that in some GDB's TARGET_SIGNAL_REALTIME_32
+        is number 76.  */
+     TARGET_SIGNAL_REALTIME_32,
+     /* Yet another pain, IRIX 6 has SIG64.  */
+     TARGET_SIGNAL_REALTIME_64,
+ 
+ #if defined(MACH) || defined(__MACH__)
+     /* Mach exceptions */
+     TARGET_EXC_BAD_ACCESS,
+     TARGET_EXC_BAD_INSTRUCTION,
+     TARGET_EXC_ARITHMETIC,
+     TARGET_EXC_EMULATION,
+     TARGET_EXC_SOFTWARE,
+     TARGET_EXC_BREAKPOINT,
+ #endif
+     TARGET_SIGNAL_INFO,
+ 
+     /* Some signal we don't know about.  */
+     TARGET_SIGNAL_UNKNOWN,
+ 
+     /* Use whatever signal we use when one is not specifically specified
+        (for passing to proceed and so on).  */
+     TARGET_SIGNAL_DEFAULT,
+ 
+     /* Last and unused enum value, for sizing arrays, etc.  */
+     TARGET_SIGNAL_LAST
+   };
+ 
  /* the cleanup list records things that have to be undone
     if an error happens (descriptors to be closed, memory to be freed, etc.)
     Each link in the chain records a function to call and an
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.52
diff -p -r1.52 gdbarch.sh
*** gdbarch.sh	2001/02/02 20:01:16	1.52
--- gdbarch.sh	2001/02/05 18:33:54
*************** v:2:TARGET_FLOAT_FORMAT:const struct flo
*** 486,491 ****
--- 486,500 ----
  v:2:TARGET_DOUBLE_FORMAT:const struct floatformat *:double_format::::::default_double_format (gdbarch)
  v:2:TARGET_LONG_DOUBLE_FORMAT:const struct floatformat *:long_double_format::::::&floatformat_unknown
  f:2:CONVERT_FROM_FUNC_PTR_ADDR:CORE_ADDR:convert_from_func_ptr_addr:CORE_ADDR addr:addr:::default_convert_from_func_ptr_addr::0
+ # FIXME/cagney/2001-01-18: This should be split in two.  A target method that indicates if
+ # the target needs software single step.  An ISA method to implement it.
+ #
+ # FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints
+ # using the breakpoint system instead of blatting memory directly (as with rs6000).
+ #
+ # FIXME/cagney/2001-01-18: The logic is backwards.  It should be asking if the target can
+ # single step.  If not, then implement single step using breakpoints.
+ F:2:SOFTWARE_SINGLE_STEP:void:software_single_step:enum target_signal sig, int insert_breakpoints_p:sig, insert_breakpoints_p::0:0
  EOF
  }
  
Index: infptrace.c
===================================================================
RCS file: /cvs/src/src/gdb/infptrace.c,v
retrieving revision 1.7
diff -p -r1.7 infptrace.c
*** infptrace.c	2001/01/23 22:48:55	1.7
--- infptrace.c	2001/02/05 18:33:55
*************** child_resume (int pid, int step, enum ta
*** 271,277 ****
  
    if (step)
      {
!       if (SOFTWARE_SINGLE_STEP_P)
  	abort ();		/* Make sure this doesn't happen. */
        else
  	ptrace (PT_STEP, pid, (PTRACE_ARG3_TYPE) 1,
--- 271,277 ----
  
    if (step)
      {
!       if (SOFTWARE_SINGLE_STEP_P ())
  	abort ();		/* Make sure this doesn't happen. */
        else
  	ptrace (PT_STEP, pid, (PTRACE_ARG3_TYPE) 1,
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.24
diff -p -r1.24 infrun.c
*** infrun.c	2001/01/27 00:43:25	1.24
--- infrun.c	2001/02/05 18:33:55
*************** resume (int step, enum target_signal sig
*** 835,841 ****
    if (breakpoint_here_p (read_pc ()) == permanent_breakpoint_here)
      SKIP_PERMANENT_BREAKPOINT ();
  
!   if (SOFTWARE_SINGLE_STEP_P && step)
      {
        /* Do it the hard way, w/temp breakpoints */
        SOFTWARE_SINGLE_STEP (sig, 1 /*insert-breakpoints */ );
--- 835,841 ----
    if (breakpoint_here_p (read_pc ()) == permanent_breakpoint_here)
      SKIP_PERMANENT_BREAKPOINT ();
  
!   if (SOFTWARE_SINGLE_STEP_P () && step)
      {
        /* Do it the hard way, w/temp breakpoints */
        SOFTWARE_SINGLE_STEP (sig, 1 /*insert-breakpoints */ );
*************** handle_inferior_event (struct execution_
*** 1818,1824 ****
  
      if (stop_signal == TARGET_SIGNAL_TRAP)
        {
! 	if (SOFTWARE_SINGLE_STEP_P && singlestep_breakpoints_inserted_p)
  	  ecs->random_signal = 0;
  	else if (breakpoints_inserted
  		 && breakpoint_here_p (stop_pc - DECR_PC_AFTER_BREAK))
--- 1818,1824 ----
  
      if (stop_signal == TARGET_SIGNAL_TRAP)
        {
! 	if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
  	  ecs->random_signal = 0;
  	else if (breakpoints_inserted
  		 && breakpoint_here_p (stop_pc - DECR_PC_AFTER_BREAK))
*************** handle_inferior_event (struct execution_
*** 1981,1987 ****
  	flush_cached_frames ();
        }
  
!     if (SOFTWARE_SINGLE_STEP_P && singlestep_breakpoints_inserted_p)
        {
  	/* Pull the single step breakpoints out of the target. */
  	SOFTWARE_SINGLE_STEP (0, 0);
--- 1981,1987 ----
  	flush_cached_frames ();
        }
  
!     if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
        {
  	/* Pull the single step breakpoints out of the target. */
  	SOFTWARE_SINGLE_STEP (0, 0);
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.39
diff -p -r1.39 mips-tdep.c
*** mips-tdep.c	2001/01/31 01:24:01	1.39
--- mips-tdep.c	2001/02/05 18:33:55
*************** mips_dump_tdep (struct gdbarch *current_
*** 4436,4450 ****
  		      "mips_dump_tdep: SKIP_TRAMPOLINE_CODE # %s\n",
  		      XSTRING (SKIP_TRAMPOLINE_CODE (PC)));
    fprintf_unfiltered (file,
- 		      "mips_dump_tdep: SOFTWARE_SINGLE_STEP # %s\n",
- 		      XSTRING (SOFTWARE_SINGLE_STEP (SIG, BP_P)));
-   fprintf_unfiltered (file,
- 		      "mips_dump_tdep: SOFTWARE_SINGLE_STEP_P = %d\n",
- 		      SOFTWARE_SINGLE_STEP_P);
-   fprintf_unfiltered (file,
- 		      "mips_dump_tdep: SOFTWARE_SINGLE_STEP_P = %d\n",
- 		      SOFTWARE_SINGLE_STEP_P);
-   fprintf_unfiltered (file,
  		      "mips_dump_tdep: STAB_REG_TO_REGNUM # %s\n",
  		      XSTRING (STAB_REG_TO_REGNUM (REGNUM)));
  #ifdef STACK_END_ADDR
--- 4436,4441 ----
Index: target.h
===================================================================
RCS file: /cvs/src/src/gdb/target.h,v
retrieving revision 1.11
diff -p -r1.11 target.h
*** target.h	2001/01/23 22:48:56	1.11
--- target.h	2001/02/05 18:33:56
*************** enum target_waitkind
*** 123,271 ****
      TARGET_WAITKIND_IGNORE
    };
  
- /* The numbering of these signals is chosen to match traditional unix
-    signals (insofar as various unices use the same numbers, anyway).
-    It is also the numbering of the GDB remote protocol.  Other remote
-    protocols, if they use a different numbering, should make sure to
-    translate appropriately.
- 
-    Since these numbers have actually made it out into other software
-    (stubs, etc.), you mustn't disturb the assigned numbering.  If you
-    need to add new signals here, add them to the end of the explicitly
-    numbered signals.
- 
-    This is based strongly on Unix/POSIX signals for several reasons:
-    (1) This set of signals represents a widely-accepted attempt to
-    represent events of this sort in a portable fashion, (2) we want a
-    signal to make it from wait to child_wait to the user intact, (3) many
-    remote protocols use a similar encoding.  However, it is
-    recognized that this set of signals has limitations (such as not
-    distinguishing between various kinds of SIGSEGV, or not
-    distinguishing hitting a breakpoint from finishing a single step).
-    So in the future we may get around this either by adding additional
-    signals for breakpoint, single-step, etc., or by adding signal
-    codes; the latter seems more in the spirit of what BSD, System V,
-    etc. are doing to address these issues.  */
- 
- /* For an explanation of what each signal means, see
-    target_signal_to_string.  */
- 
- enum target_signal
-   {
-     /* Used some places (e.g. stop_signal) to record the concept that
-        there is no signal.  */
-     TARGET_SIGNAL_0 = 0,
-     TARGET_SIGNAL_FIRST = 0,
-     TARGET_SIGNAL_HUP = 1,
-     TARGET_SIGNAL_INT = 2,
-     TARGET_SIGNAL_QUIT = 3,
-     TARGET_SIGNAL_ILL = 4,
-     TARGET_SIGNAL_TRAP = 5,
-     TARGET_SIGNAL_ABRT = 6,
-     TARGET_SIGNAL_EMT = 7,
-     TARGET_SIGNAL_FPE = 8,
-     TARGET_SIGNAL_KILL = 9,
-     TARGET_SIGNAL_BUS = 10,
-     TARGET_SIGNAL_SEGV = 11,
-     TARGET_SIGNAL_SYS = 12,
-     TARGET_SIGNAL_PIPE = 13,
-     TARGET_SIGNAL_ALRM = 14,
-     TARGET_SIGNAL_TERM = 15,
-     TARGET_SIGNAL_URG = 16,
-     TARGET_SIGNAL_STOP = 17,
-     TARGET_SIGNAL_TSTP = 18,
-     TARGET_SIGNAL_CONT = 19,
-     TARGET_SIGNAL_CHLD = 20,
-     TARGET_SIGNAL_TTIN = 21,
-     TARGET_SIGNAL_TTOU = 22,
-     TARGET_SIGNAL_IO = 23,
-     TARGET_SIGNAL_XCPU = 24,
-     TARGET_SIGNAL_XFSZ = 25,
-     TARGET_SIGNAL_VTALRM = 26,
-     TARGET_SIGNAL_PROF = 27,
-     TARGET_SIGNAL_WINCH = 28,
-     TARGET_SIGNAL_LOST = 29,
-     TARGET_SIGNAL_USR1 = 30,
-     TARGET_SIGNAL_USR2 = 31,
-     TARGET_SIGNAL_PWR = 32,
-     /* Similar to SIGIO.  Perhaps they should have the same number.  */
-     TARGET_SIGNAL_POLL = 33,
-     TARGET_SIGNAL_WIND = 34,
-     TARGET_SIGNAL_PHONE = 35,
-     TARGET_SIGNAL_WAITING = 36,
-     TARGET_SIGNAL_LWP = 37,
-     TARGET_SIGNAL_DANGER = 38,
-     TARGET_SIGNAL_GRANT = 39,
-     TARGET_SIGNAL_RETRACT = 40,
-     TARGET_SIGNAL_MSG = 41,
-     TARGET_SIGNAL_SOUND = 42,
-     TARGET_SIGNAL_SAK = 43,
-     TARGET_SIGNAL_PRIO = 44,
-     TARGET_SIGNAL_REALTIME_33 = 45,
-     TARGET_SIGNAL_REALTIME_34 = 46,
-     TARGET_SIGNAL_REALTIME_35 = 47,
-     TARGET_SIGNAL_REALTIME_36 = 48,
-     TARGET_SIGNAL_REALTIME_37 = 49,
-     TARGET_SIGNAL_REALTIME_38 = 50,
-     TARGET_SIGNAL_REALTIME_39 = 51,
-     TARGET_SIGNAL_REALTIME_40 = 52,
-     TARGET_SIGNAL_REALTIME_41 = 53,
-     TARGET_SIGNAL_REALTIME_42 = 54,
-     TARGET_SIGNAL_REALTIME_43 = 55,
-     TARGET_SIGNAL_REALTIME_44 = 56,
-     TARGET_SIGNAL_REALTIME_45 = 57,
-     TARGET_SIGNAL_REALTIME_46 = 58,
-     TARGET_SIGNAL_REALTIME_47 = 59,
-     TARGET_SIGNAL_REALTIME_48 = 60,
-     TARGET_SIGNAL_REALTIME_49 = 61,
-     TARGET_SIGNAL_REALTIME_50 = 62,
-     TARGET_SIGNAL_REALTIME_51 = 63,
-     TARGET_SIGNAL_REALTIME_52 = 64,
-     TARGET_SIGNAL_REALTIME_53 = 65,
-     TARGET_SIGNAL_REALTIME_54 = 66,
-     TARGET_SIGNAL_REALTIME_55 = 67,
-     TARGET_SIGNAL_REALTIME_56 = 68,
-     TARGET_SIGNAL_REALTIME_57 = 69,
-     TARGET_SIGNAL_REALTIME_58 = 70,
-     TARGET_SIGNAL_REALTIME_59 = 71,
-     TARGET_SIGNAL_REALTIME_60 = 72,
-     TARGET_SIGNAL_REALTIME_61 = 73,
-     TARGET_SIGNAL_REALTIME_62 = 74,
-     TARGET_SIGNAL_REALTIME_63 = 75,
- 
-     /* Used internally by Solaris threads.  See signal(5) on Solaris.  */
-     TARGET_SIGNAL_CANCEL = 76,
- 
-     /* Yes, this pains me, too.  But LynxOS didn't have SIG32, and now
-        Linux does, and we can't disturb the numbering, since it's part
-        of the protocol.  Note that in some GDB's TARGET_SIGNAL_REALTIME_32
-        is number 76.  */
-     TARGET_SIGNAL_REALTIME_32,
-     /* Yet another pain, IRIX 6 has SIG64.  */
-     TARGET_SIGNAL_REALTIME_64,
- 
- #if defined(MACH) || defined(__MACH__)
-     /* Mach exceptions */
-     TARGET_EXC_BAD_ACCESS,
-     TARGET_EXC_BAD_INSTRUCTION,
-     TARGET_EXC_ARITHMETIC,
-     TARGET_EXC_EMULATION,
-     TARGET_EXC_SOFTWARE,
-     TARGET_EXC_BREAKPOINT,
- #endif
-     TARGET_SIGNAL_INFO,
- 
-     /* Some signal we don't know about.  */
-     TARGET_SIGNAL_UNKNOWN,
- 
-     /* Use whatever signal we use when one is not specifically specified
-        (for passing to proceed and so on).  */
-     TARGET_SIGNAL_DEFAULT,
- 
-     /* Last and unused enum value, for sizing arrays, etc.  */
-     TARGET_SIGNAL_LAST
-   };
- 
  struct target_waitstatus
    {
      enum target_waitkind kind;
--- 123,128 ----
*************** extern enum target_signal target_signal_
*** 1392,1403 ****
  extern void push_remote_target (char *name, int from_tty);
  \f
  /* Imported from machine dependent code */
- 
- #ifndef SOFTWARE_SINGLE_STEP_P
- #define SOFTWARE_SINGLE_STEP_P 0
- #define SOFTWARE_SINGLE_STEP(sig,bp_p)	\
-      (internal_error ("SOFTWARE_SINGLE_STEP"), 0)
- #endif /* SOFTWARE_SINGLE_STEP_P */
  
  /* Blank target vector entries are initialized to target_ignore. */
  void target_ignore (void);
--- 1249,1254 ----
Index: config/arc/tm-arc.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arc/tm-arc.h,v
retrieving revision 1.3
diff -p -r1.3 tm-arc.h
*** tm-arc.h	2000/05/28 01:12:34	1.3
--- tm-arc.h	2001/02/05 18:33:56
*************** extern CORE_ADDR arc_skip_prologue (CORE
*** 61,67 ****
  
  /* We don't have a reliable single step facility.
     ??? We do have a cycle single step facility, but that won't work.  */
- #define SOFTWARE_SINGLE_STEP_P 1
  extern void arc_software_single_step (unsigned int, int);
  #define SOFTWARE_SINGLE_STEP(sig,bp_p) arc_software_single_step (sig, bp_p)
  
--- 61,66 ----
Index: config/arm/tm-wince.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arm/tm-wince.h,v
retrieving revision 1.2
diff -p -r1.2 tm-wince.h
*** tm-wince.h	2000/04/07 22:26:11	1.2
--- tm-wince.h	2001/02/05 18:33:56
***************
*** 23,31 ****
  
  #include "arm/tm-arm.h"
  
- #undef SOFTWARE_SINGLE_STEP_P
- #define SOFTWARE_SINGLE_STEP_P 1
- 
  #undef SOFTWARE_SINGLE_STEP
  #define SOFTWARE_SINGLE_STEP(sig, bp_p) wince_software_single_step (sig, bp_p)
  
--- 23,28 ----
Index: config/mips/tm-wince.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-wince.h,v
retrieving revision 1.2
diff -p -r1.2 tm-wince.h
*** tm-wince.h	2000/03/25 03:37:35	1.2
--- tm-wince.h	2001/02/05 18:33:56
***************
*** 24,31 ****
  
  #include "mips/tm-mips.h"
  
! #undef SOFTWARE_SINGLE_STEP_P
! #define SOFTWARE_SINGLE_STEP_P 1
  #define SOFTWARE_SINGLE_STEP(sig, bp_p) wince_software_single_step (sig, bp_p)
  
  void wince_software_single_step (unsigned int, int);
--- 24,30 ----
  
  #include "mips/tm-mips.h"
  
! #undef SOFTWARE_SINGLE_STEP
  #define SOFTWARE_SINGLE_STEP(sig, bp_p) wince_software_single_step (sig, bp_p)
  
  void wince_software_single_step (unsigned int, int);
Index: config/powerpc/tm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/powerpc/tm-linux.h,v
retrieving revision 1.6
diff -p -r1.6 tm-linux.h
*** tm-linux.h	2000/10/26 07:41:25	1.6
--- tm-linux.h	2001/02/05 18:33:56
*************** Foundation, Inc., 59 Temple Place - Suit
*** 27,35 ****
  
  /* We can single step on linux */
  #undef  SOFTWARE_SINGLE_STEP
- #define SOFTWARE_SINGLE_STEP(p,q) abort() /* Will never execute! */
- #undef  SOFTWARE_SINGLE_STEP_P
- #define SOFTWARE_SINGLE_STEP_P 0
  
  /* Make sure nexti gets the help it needs for debugging assembly code
     without symbols */
--- 27,32 ----
Index: config/powerpc/tm-ppc-eabi.h
===================================================================
RCS file: /cvs/src/src/gdb/config/powerpc/tm-ppc-eabi.h,v
retrieving revision 1.4
diff -p -r1.4 tm-ppc-eabi.h
*** tm-ppc-eabi.h	2000/11/09 09:49:00	1.4
--- tm-ppc-eabi.h	2001/02/05 18:33:56
***************
*** 24,31 ****
  /* Use generic RS6000 definitions. */
  #include "rs6000/tm-rs6000.h"
  /* except we want to allow single stepping */
! #undef SOFTWARE_SINGLE_STEP_P
! #define SOFTWARE_SINGLE_STEP_P 0
  
  #undef	DEFAULT_LR_SAVE
  #define	DEFAULT_LR_SAVE 4	/* eabi saves LR at 4 off of SP */
--- 24,30 ----
  /* Use generic RS6000 definitions. */
  #include "rs6000/tm-rs6000.h"
  /* except we want to allow single stepping */
! #undef SOFTWARE_SINGLE_STEP
  
  #undef	DEFAULT_LR_SAVE
  #define	DEFAULT_LR_SAVE 4	/* eabi saves LR at 4 off of SP */
Index: config/rs6000/tm-rs6000.h
===================================================================
RCS file: /cvs/src/src/gdb/config/rs6000/tm-rs6000.h,v
retrieving revision 1.9
diff -p -r1.9 tm-rs6000.h
*** tm-rs6000.h	2000/11/09 09:49:00	1.9
--- tm-rs6000.h	2001/02/05 18:33:56
*************** extern void aix_process_linenos (void);
*** 97,104 ****
  
  /* RS6000/AIX does not support PT_STEP.  Has to be simulated.  */
  
- #define SOFTWARE_SINGLE_STEP_P 1
  extern void rs6000_software_single_step (unsigned int, int);
  #define SOFTWARE_SINGLE_STEP(sig,bp_p) rs6000_software_single_step (sig, bp_p)
  
  /* Notice when a new child process is started. */
--- 97,104 ----
  
  /* RS6000/AIX does not support PT_STEP.  Has to be simulated.  */
  
  extern void rs6000_software_single_step (unsigned int, int);
+ #undef SOFTWARE_SINGLE_STEP
  #define SOFTWARE_SINGLE_STEP(sig,bp_p) rs6000_software_single_step (sig, bp_p)
  
  /* Notice when a new child process is started. */
Index: config/sh/tm-wince.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sh/tm-wince.h,v
retrieving revision 1.2
diff -p -r1.2 tm-wince.h
*** tm-wince.h	2000/04/21 03:04:35	1.2
--- tm-wince.h	2001/02/05 18:33:56
***************
*** 22,29 ****
  #define TM_WINCE_H 1
  
  #include "sh/tm-sh.h"
- #undef SOFTWARE_SINGLE_STEP_P
- #define SOFTWARE_SINGLE_STEP_P 1
  
  #undef SOFTWARE_SINGLE_STEP
  #define SOFTWARE_SINGLE_STEP(sig, bp_p) wince_software_single_step (sig, bp_p)
--- 22,27 ----
Index: config/sparc/tm-sp64.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/tm-sp64.h,v
retrieving revision 1.3
diff -p -r1.3 tm-sp64.h
*** tm-sp64.h	2000/05/28 01:12:41	1.3
--- tm-sp64.h	2001/02/05 18:33:56
***************
*** 22,28 ****
     Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
! #define GDB_MULTI_ARCH 2
  
  #ifndef GDB_TARGET_IS_SPARC64
  #define GDB_TARGET_IS_SPARC64 1
--- 22,28 ----
     Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
! #define GDB_MULTI_ARCH 1
  
  #ifndef GDB_TARGET_IS_SPARC64
  #define GDB_TARGET_IS_SPARC64 1
Index: config/sparc/tm-sparc.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/tm-sparc.h,v
retrieving revision 1.5
diff -p -r1.5 tm-sparc.h
*** tm-sparc.h	2000/05/28 01:12:41	1.5
--- tm-sparc.h	2001/02/05 18:33:56
*************** extern void sparc32_extract_return_value
*** 736,744 ****
  \f
  /* Sparc has no reliable single step ptrace call */
  
! #define SOFTWARE_SINGLE_STEP_P 1
! extern void sparc_software_single_step (unsigned int, int);
! #define SOFTWARE_SINGLE_STEP(sig,bp_p) sparc_software_single_step (sig,bp_p)
  
  /* We need more arguments in a frame specification for the
     "frame" or "info frame" command.  */
--- 736,745 ----
  \f
  /* Sparc has no reliable single step ptrace call */
  
! extern void sparc_software_single_step (enum target_signal ignore, int);
! /* NOTE: This is overriden in tm-sun4sol2.h. */
! #undef SOFTWARE_SINGLE_STEP
! #define SOFTWARE_SINGLE_STEP(sig,bp_p) sparc_software_single_step (sig, bp_p)
  
  /* We need more arguments in a frame specification for the
     "frame" or "info frame" command.  */
Index: config/sparc/tm-sun4sol2.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/tm-sun4sol2.h,v
retrieving revision 1.5
diff -p -r1.5 tm-sun4sol2.h
*** tm-sun4sol2.h	2000/05/28 01:12:41	1.5
--- tm-sun4sol2.h	2001/02/05 18:33:56
***************
*** 27,33 ****
  /* With Sol2 it is no longer necessary to enable software single-step,
     since the /proc interface can take care of it for us in hardware.  */
  #undef SOFTWARE_SINGLE_STEP
- #undef SOFTWARE_SINGLE_STEP_P
  
  /* There are two different signal handler trampolines in Solaris2.  */
  #define IN_SIGTRAMP(pc, name) \
--- 27,32 ----
Index: testsuite/gdb.threads/pthreads.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/pthreads.exp,v
retrieving revision 1.2
diff -p -r1.2 pthreads.exp
*** pthreads.exp	2000/04/07 01:14:10	1.2
--- pthreads.exp	2001/02/05 18:33:56
*************** proc check_backtraces {} {
*** 293,298 ****
--- 293,299 ----
      send_gdb "continue\n"
      gdb_expect {
  	-re "Breakpoint .* common_routine \\(arg=2\\).*" {
+ 	    pass "continue to bkpt at common_routine in thread 2"
  	    send_gdb "backtrace\n"
  	    gdb_expect {
  		-re "#0.*common_routine \\(arg=2\\).*#1.*thread2.*" {
*************** proc check_backtraces {} {
*** 307,322 ****
  	    }
  	}
  	-re "Breakpoint .* common_routine \\(arg=0\\).*" {
! 	    fail "stopped in main thread at breakpoint for thread 2"
  	}
  	-re "Breakpoint .* common_routine \\(arg=1\\).*" {
! 	    fail "stopped in main thread at breakpoint for thread 1"
  	}
  	-re ".*$gdb_prompt" {
  	    fail "continue to bkpt at common_routine in thread 2"
  	}
  	default {
! 	    fail "continue to bkpt at common_routine in thread 2"
  	}
  	timeout {
  	    fail "continue to bkpt at common_routine in thread 2 (timeout)"
--- 308,323 ----
  	    }
  	}
  	-re "Breakpoint .* common_routine \\(arg=0\\).*" {
! 	    fail "continue to bkpt at common_routine in thread 2 (arg=0)"
  	}
  	-re "Breakpoint .* common_routine \\(arg=1\\).*" {
! 	    fail "continue to bkpt at common_routine in thread 2 (arg=1)"
  	}
  	-re ".*$gdb_prompt" {
  	    fail "continue to bkpt at common_routine in thread 2"
  	}
  	default {
! 	    fail "continue to bkpt at common_routine in thread 2 (default)"
  	}
  	timeout {
  	    fail "continue to bkpt at common_routine in thread 2 (timeout)"
From ac131313@cygnus.com Mon Feb 05 10:51:00 2001
From: Andrew Cagney <ac131313@cygnus.com>
To: Michael Elizabeth Chastain <chastain@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] testsuite/gdb.c++/cplusfuncs.{exp,cc}: work with either g++ demangler
Date: Mon, 05 Feb 2001 10:51:00 -0000
Message-id: <3A7EF56D.3CD59C36@cygnus.com>
References: <200102050418.UAA29343@bosch.cygnus.com>
X-SW-Source: 2001-02/msg00051.html
Content-length: 355

Michael Elizabeth Chastain wrote:

> 2001-02-04  Michael Chastain  <chastain@redhat.com>

>         Note that some tests currently fail due to gnats gdb bug gdb/19.
>         (do_tests): Call probe_demangler.

Michael, just FYI, Notes like this should go in the dejagnu testsuite
(where people might see/read them :-) and not into the ChangeLog.

	Andrew
From chastain@cygnus.com Mon Feb 05 11:06:00 2001
From: Michael Elizabeth Chastain <chastain@cygnus.com>
To: ac131313@cygnus.com, chastain@cygnus.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] testsuite/gdb.c++/cplusfuncs.{exp,cc}: work with either g++ demangler
Date: Mon, 05 Feb 2001 11:06:00 -0000
Message-id: <200102051905.LAA32545@bosch.cygnus.com>
X-SW-Source: 2001-02/msg00052.html
Content-length: 664

After my patch, gdb.c++/cplusfuncs.exp contains the lines:

    # gdb-gnats bug gdb/19:
    # "gdb v3 demangler fails on hairyfunc5 hairyfunc6 hairyfunc7"
    print_addr_2 "hairyfunc5" "hairyfunc5(int (*(*)($dm_type_char_star))(long))"
    print_addr_2 "hairyfunc6" "hairyfunc6(int (*(*)($dm_type_int_star))(long))"
    print_addr_2 "hairyfunc7" "hairyfunc7(int (*(*)(int (*)(char *)))(long))"

The ChangeLog entry says that I added this note to gdb.c++/cplusfuncs.exp.
In the ChangeLog I could say: "added note that ..." because of the ambiguity
in saying "note that".

Hmmm, and that line hairyfunc7 should say "$dm_type_char_star" instead of
"char *".

Michael
From msnyder@cygnus.com Mon Feb 05 12:01:00 2001
From: Michael Snyder <msnyder@cygnus.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: Hilfinger@cs.berkeley.edu, gdb-patches@sourceware.cygnus.com
Subject: Re: RFC: Patch to allow compilation by Sun cc
Date: Mon, 05 Feb 2001 12:01:00 -0000
Message-id: <3A7F06AA.CE727800@cygnus.com>
References: <200102011905.LAA21374@tully.CS.Berkeley.EDU> <3A79B50E.6F40844E@cygnus.com> <3A7A0740.8252269A@cygnus.com> <3A7DD73F.D73A0CC8@cygnus.com>
X-SW-Source: 2001-02/msg00053.html
Content-length: 582

Andrew Cagney wrote:
> 
> Michael Snyder wrote:
> 
> > Paul, Andrew,
> >
> > Would you both find this modification of the patch acceptable?
> > I've made the following two changes:
> >
> >     1) Made all three versions of software_single_step use unsigned int
> >        as the first parameter (and included Paul's cast to unsigned int
> >        in the #define in all three cases).
> 
> Michael, just omit anthing to do with software_single_step.  My patch
> will fix it anyway.

Yeah, but your patch isn't ready, and this one is.
Any harm in checking this one in in the interim?
From msnyder@cygnus.com Mon Feb 05 12:09:00 2001
From: Michael Snyder <msnyder@cygnus.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: GDB Patches <gdb-patches@sourceware.cygnus.com>
Subject: Re: [rfa:sparc/rfc] multi-arch SOFTWARE_SINGLE_STEP et.al.
Date: Mon, 05 Feb 2001 12:09:00 -0000
Message-id: <3A7F0883.43B0208@cygnus.com>
References: <3A6A1DF4.C6760CEF@cygnus.com> <3A7E1712.E947C76F@cygnus.com>
X-SW-Source: 2001-02/msg00054.html
Content-length: 1372

Andrew Cagney wrote:
> 
> Andrew Cagney wrote:
> >
> > Hello,
> >
> > (I now remember why I kept avoiding  this one :-)
> >
> > The attatched multi-arches SOFTWARE_SINGLE_STEP /
> > SOFTWARE_SINGLE_STEP_P.  It also does a few other things so watch
> > carefully :-)
> >
> > For the sparc64 this multi-arches software_single_step.  Maintainer?
> > Test on a solaris N+1 machine?
> 
> And sure enough it broke something :-/
> 
> For the sparc64 native, it was selecting software single-step but the
> previous configuration wasn't.
> 
> So, for the maintainer.  What is correct for these cases?
> 
>         o       sparc32 cross
>                 was software single step

Should be software single-step.

>         o       sparc64 cross
>                 was software single step

Should be software single-step.

>         o       sparc64 (sol2) native
>                 was ptrace (hardware) single step

Should NOT be software single-step.
(correction -- procfs, not ptrace.  And it's still not really hardware, just OS)
 
>         o       sparc32 (sol2) native
>                 was ptrace (hardware) single step

Should NOT be software single-step.

> 
> This kind of highlights the current problems with software_single_step_p
> :-)

Well, but your patch will fix all that, right?  ;-)
By the way, Sparc32 must still use software-single-step for Sunos 4 and below.
From msnyder@cygnus.com Mon Feb 05 12:18:00 2001
From: Michael Snyder <msnyder@cygnus.com>
To: Michael Elizabeth Chastain <chastain@cygnus.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [RFA] fix child_xfer_memory in hppah-nat.c
Date: Mon, 05 Feb 2001 12:18:00 -0000
Message-id: <3A7F0A9E.6BD8C28A@cygnus.com>
References: <200102040619.WAA29062@bosch.cygnus.com>
X-SW-Source: 2001-02/msg00055.html
Content-length: 1810

Michael Elizabeth Chastain wrote:
> 
> This patch fixes hppah-nat.c:xfer_child_memory to declare the new
> 'struct mem_attrib *' argument.
> 
> This patch is needed to build sourceware gdb on hpux 10.20.
> 
> Jeff Law is the maintainer of "hpux, hp pa native", but Jeff is on
> vacation right now.  So I appeal to one of the blanket write maintainers
> for approval.

<heavenly choir>
Good Pilgrim -- Your Appeal Has Been Granted!
</heavenly choir>


> 
> I tested this patch by building on an hpux 10.20 machine.
> 
> This patch does not make hpux gdb actually work.  When I run a child
> process, gdb goes catatonic.  This is the same behavior that sourceware
> gdb had in the 2001-01-22 version (a day before the interface change to
> child_xfer_memory).  By using an older gdb to debug both the 2001-01-22
> gdb and today's gdb with my patch applied, I saw that neither of them
> got as far as child_xfer_memory.
> 
> OK to commit?
> 
> Michael Elizabeth Chastain
> <chastain@redhat.com>
> "love without fear"
> 
> ===
> 
> 2001-02-03  Michael Chastain  <chastain@redhat.com>
> 
>         * hppah-nat.c (xfer_child_memory): Add parameter 'struct mem_attrib *'
>         to conform with interface change.
> 
> ====
> 
> Index: gdb/hppah-nat.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/hppah-nat.c,v
> retrieving revision 1.6
> diff -c -3 -p -r1.6 hppah-nat.c
> *** gdb/hppah-nat.c     2000/12/15 01:01:47     1.6
> --- gdb/hppah-nat.c     2001/02/03 20:32:50
> *************** fetch_register (int regno)
> *** 266,271 ****
> --- 266,272 ----
> 
>   int
>   child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
> +                  struct mem_attrib *mem,
>                    struct target_ops *target)
>   {
>     register int i;
From msnyder@cygnus.com Mon Feb 05 12:20:00 2001
From: Michael Snyder <msnyder@cygnus.com>
To: Philip Blundell <philb@gnu.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: patch for ARM GNU/Linux
Date: Mon, 05 Feb 2001 12:20:00 -0000
Message-id: <3A7F0B3A.1D1B33B3@cygnus.com>
References: <E14PWEF-0006Yz-00@kings-cross.london.uk.eu.org>
X-SW-Source: 2001-02/msg00056.html
Content-length: 3836

Philip Blundell wrote:
> 
> I needed this patch to build the current code on an arm-linux machine.

Mark Kettinis should bless this, but it looks ok to me...

> 
> p.
> 
> 2001-02-04  Philip Blundell  <philb@gnu.org>
> 
>         * config/arm/linux.mh (NATDEPFILES): Add proc-service.o,
>         thread-db.o, lin-lwp.o; remove lin-thread.o, linux-thread.o.
>         * config/arm/nm-linux (PREPARE_TO_PROCEED, ATTACH_LWP,
>         GET_THREAD_SIGNALS): Define.
>         * arm-linux-nat.c (fill_gregset): Correct type of argument.
>         (supply_gregset): Likewise.
>         (fill_fpregset): Likewise.
>         (supply_fpregset): Likewise.
> 
> Index: arm-linux-nat.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/arm-linux-nat.c,v
> retrieving revision 1.7
> diff -u -p -u -p -r1.7 arm-linux-nat.c
> --- arm-linux-nat.c     2000/05/26 23:22:40     1.7
> +++ arm-linux-nat.c     2001/02/04 20:47:02
> @@ -575,7 +575,7 @@ store_inferior_registers (int regno)
>     If regno is -1, do this for all registers.  */
> 
>  void
> -fill_gregset (gregset_t *gregsetp, int regno)
> +fill_gregset (gdb_gregset_t *gregsetp, int regno)
>  {
>    if (-1 == regno)
>      {
> @@ -607,7 +607,7 @@ fill_gregset (gregset_t *gregsetp, int r
>     in *gregsetp.  */
> 
>  void
> -supply_gregset (gregset_t *gregsetp)
> +supply_gregset (gdb_gregset_t *gregsetp)
>  {
>    int regno, reg_pc;
> 
> @@ -628,7 +628,7 @@ supply_gregset (gregset_t *gregsetp)
>     If regno is -1, do this for all registers.  */
> 
>  void
> -fill_fpregset (fpregset_t *fpregsetp, int regno)
> +fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
>  {
>    FPA11 *fp = (FPA11 *) fpregsetp;
> 
> @@ -654,7 +654,7 @@ fill_fpregset (fpregset_t *fpregsetp, in
>     in *fpregsetp.  */
> 
>  void
> -supply_fpregset (fpregset_t *fpregsetp)
> +supply_fpregset (gdb_fpregset_t *fpregsetp)
>  {
>    int regno;
>    FPA11 *fp = (FPA11 *) fpregsetp;
> Index: config/arm/linux.mh
> ===================================================================
> RCS file: /cvs/src/src/gdb/config/arm/linux.mh,v
> retrieving revision 1.6
> diff -u -p -u -p -r1.6 linux.mh
> --- linux.mh    2000/10/30 22:35:46     1.6
> +++ linux.mh    2001/02/04 20:47:02
> @@ -4,8 +4,9 @@ XM_FILE= xm-linux.h
>  XDEPFILES=
> 
>  NAT_FILE= nm-linux.h
> -NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o \
> -            core-regset.o arm-linux-nat.o linux-thread.o lin-thread.o
> +NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o      \
> +       core-regset.o arm-linux-nat.o                           \
> +       proc-service.o thread-db.o lin-lwp.o
> 
>  LOADLIBES= -ldl -rdynamic
> 
> Index: config/arm/nm-linux.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/config/arm/nm-linux.h,v
> retrieving revision 1.2
> diff -u -p -u -p -r1.2 nm-linux.h
> --- nm-linux.h  2000/04/20 21:13:19     1.2
> +++ nm-linux.h  2001/02/04 20:47:02
> @@ -30,4 +30,20 @@ extern int kernel_u_size (void);
>  /* Override copies of {fetch,store}_inferior_registers in infptrace.c.  */
>  #define FETCH_INFERIOR_REGISTERS
> 
> +/* FIXME: kettenis/2000-09-03: This should be moved to ../nm-linux.h
> +   once we have converted all Linux targets to use the new threads
> +   stuff (without the #undef of course).  */
> +
> +extern int lin_lwp_prepare_to_proceed (void);
> +#undef PREPARE_TO_PROCEED
> +#define PREPARE_TO_PROCEED(select_it) lin_lwp_prepare_to_proceed ()
> +
> +extern void lin_lwp_attach_lwp (int pid, int verbose);
> +#define ATTACH_LWP(pid, verbose) lin_lwp_attach_lwp ((pid), (verbose))
> +
> +#include <signal.h>
> +
> +extern void lin_thread_get_thread_signals (sigset_t *mask);
> +#define GET_THREAD_SIGNALS(mask) lin_thread_get_thread_signals (mask)
> +
>  #endif /* NM_ARMLINUX_H */
From kettenis@wins.uva.nl Mon Feb 05 12:51:00 2001
From: Mark Kettenis <kettenis@wins.uva.nl>
To: Michael Snyder <msnyder@cygnus.com>
Cc: Philip Blundell <philb@gnu.org>, gdb-patches@sources.redhat.com
Subject: Re: patch for ARM GNU/Linux
Date: Mon, 05 Feb 2001 12:51:00 -0000
Message-id: <s3in1c07swk.fsf@soliton.wins.uva.nl>
References: <E14PWEF-0006Yz-00@kings-cross.london.uk.eu.org> <3A7F0B3A.1D1B33B3@cygnus.com>
X-SW-Source: 2001-02/msg00057.html
Content-length: 345

Michael Snyder <msnyder@cygnus.com> writes:

> Philip Blundell wrote:
> > 
> > I needed this patch to build the current code on an arm-linux machine.
> 
> Mark Kettinis should bless this, but it looks ok to me...

Hmm.  Looks like the right thing to me, but Scott Bambrough is listed
as the GNU/Linux ARM native maintainer in MAINTAINERS.

Mark
From luick@cray.com Mon Feb 05 14:58:00 2001
From: Dean Luick <luick@cray.com>
To: gdb-patches@sources.redhat.com
Subject: patch: remove duplicated global variables
Date: Mon, 05 Feb 2001 14:58:00 -0000
Message-id: <20010205165838.A52444@zero.mw.cray.com>
X-SW-Source: 2001-02/msg00058.html
Content-length: 1674

Hi,

Here is a fix for what looks like two code mistakes.  I ran into them
when not using gcc to compile gdb.

Dean


2001-02-02  Dean Luick  <luick@cray.com>

	Remove two cases of a variable being declared in a header that is
	included by multiple files.
	* defs.h: remove unused global variable "continuation".
	* inferior.h: replace global declaration of "step_over_calls" with
	an extern.



Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.36
diff -c -3 -p -r1.36 defs.h
*** defs.h	2001/01/31 03:46:23	1.36
--- defs.h	2001/02/05 22:08:24
*************** struct continuation
*** 673,679 ****
      struct continuation_arg *arg_list;
      struct continuation *next;
    };
- struct continuation continuation;
  
  /* In infrun.c. */
  extern struct continuation *cmd_continuation;
--- 673,678 ----
Index: inferior.h
===================================================================
RCS file: /cvs/src/src/gdb/inferior.h,v
retrieving revision 1.13
diff -c -3 -p -r1.13 inferior.h
*** inferior.h	2001/01/24 16:28:20	1.13
--- inferior.h	2001/02/05 22:08:25
*************** enum step_over_calls_kind
*** 348,355 ****
    {
      STEP_OVER_NONE,
      STEP_OVER_ALL,
!     STEP_OVER_UNDEBUGGABLE,
!   } step_over_calls;
  
  /* If stepping, nonzero means step count is > 1
     so don't print frame next time inferior stops
--- 348,356 ----
    {
      STEP_OVER_NONE,
      STEP_OVER_ALL,
!     STEP_OVER_UNDEBUGGABLE
!   };
! extern enum step_over_calls_kind step_over_calls;
  
  /* If stepping, nonzero means step count is > 1
     so don't print frame next time inferior stops
From kevinb@cygnus.com Mon Feb 05 15:19:00 2001
From: Kevin Buettner <kevinb@cygnus.com>
To: Dean Luick <luick@cray.com>, gdb-patches@sources.redhat.com
Subject: Re: patch: remove duplicated global variables
Date: Mon, 05 Feb 2001 15:19:00 -0000
Message-id: <1010205231907.ZM13595@ocotillo.lan>
References: <20010205165838.A52444@zero.mw.cray.com> <luick@cray.com>
X-SW-Source: 2001-02/msg00059.html
Content-length: 1990

FWIW, Dean's changes to defs.h and inferior.h look right to me.

On Feb 5,  4:58pm, Dean Luick wrote:
> Subject: patch: remove duplicated global variables
> Hi,
> 
> Here is a fix for what looks like two code mistakes.  I ran into them
> when not using gcc to compile gdb.
> 
> Dean
> 
> 
> 2001-02-02  Dean Luick  <luick@cray.com>
> 
> 	Remove two cases of a variable being declared in a header that is
> 	included by multiple files.
> 	* defs.h: remove unused global variable "continuation".
> 	* inferior.h: replace global declaration of "step_over_calls" with
> 	an extern.
> 
> 
> 
> Index: defs.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/defs.h,v
> retrieving revision 1.36
> diff -c -3 -p -r1.36 defs.h
> *** defs.h	2001/01/31 03:46:23	1.36
> --- defs.h	2001/02/05 22:08:24
> *************** struct continuation
> *** 673,679 ****
>       struct continuation_arg *arg_list;
>       struct continuation *next;
>     };
> - struct continuation continuation;
>   
>   /* In infrun.c. */
>   extern struct continuation *cmd_continuation;
> --- 673,678 ----
> Index: inferior.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/inferior.h,v
> retrieving revision 1.13
> diff -c -3 -p -r1.13 inferior.h
> *** inferior.h	2001/01/24 16:28:20	1.13
> --- inferior.h	2001/02/05 22:08:25
> *************** enum step_over_calls_kind
> *** 348,355 ****
>     {
>       STEP_OVER_NONE,
>       STEP_OVER_ALL,
> !     STEP_OVER_UNDEBUGGABLE,
> !   } step_over_calls;
>   
>   /* If stepping, nonzero means step count is > 1
>      so don't print frame next time inferior stops
> --- 348,356 ----
>     {
>       STEP_OVER_NONE,
>       STEP_OVER_ALL,
> !     STEP_OVER_UNDEBUGGABLE
> !   };
> ! extern enum step_over_calls_kind step_over_calls;
>   
>   /* If stepping, nonzero means step count is > 1
>      so don't print frame next time inferior stops
>-- End of excerpt from Dean Luick



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] fix child_xfer_memory in hppah-nat.c
       [not found]       ` <20010205131813.A734@redhat.com>
@ 2001-02-06  8:37         ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2001-02-06  8:37 UTC (permalink / raw)
  To: cgf; +Cc: gdb-patches

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 25398 bytes --]

> Date: Mon, 5 Feb 2001 13:18:14 -0500
> From: Christopher Faylor <cgf@redhat.com>
> 
> Here are the lines from configure.in:
> 
>     # NOTE: Don't add -Wall or -Wunused, they both include
>     # -Wunused-parameter which reports bogus warnings.
> 
> The TODO has some words, too:
> 
>     Frequently requested but not approved requests.
> 
>     --
> 
>     Eliminate unused argument warnings using ATTRIBUTE_UNUSED.
> 
>     The benefits on this one are thought to be marginal - GDBs design
>     means that unused parameters are very common.  GCC 3.0 will also
>     include the option -Wno-unused-parameter which means that ``-Wall
>     -Wno-unused-parameters -Werror'' can be specified.
> 
> 
> >Several files in the CVS use ATTRIBUTE_UNUSED (not surprisingly, 
> >go32-nat.c is one of them ;-).  So I wonder what is the current say-so 
> >on this matter.
> 
> I specifically added some of these to win32-nat.c, too, not too long ago.
> I do remember the discussion now.  I can't say that I agree with it,
> but I remember it.
> 
> It looks like at least one discussion is here:
> 
> http://sources.redhat.com/ml/gdb/2000-q1/msg00826.html

Thanks for the pointers.

However, after reading those, I'm still unsure what, if anything,
should I do with ATTRIBUTE_UNUSED in files I'm responsible for.

The TODO snippet seems to say that ATTRIBUTE_UNUSED should be deleted,
and we should endure the warnings until GCC 3.0 conquers the face of
Earth.  The discussion you pointed to seems to say the same, albeit
differently: it tells that GCC options should be changed to avoid
triggering the warnings which require ATTRIBUTE_UNUSED.

I remember that I added ATTRIBUTE_UNUSED to stop those warnings from
popping up and obscuring the real warnings (such as the one about the
missing mem_attrib parameter in go32_xfer_memory that I fixed the
other day).  I also set up a special set of compiler switches (in
gdb/config/djgpp/djconfig.sh) to make sure these warnings don't
return.  But to remove ATTRIBUTE_UNUSED from the sources we need a
more safe assumption to bet on...

Andrew?
From eliz@delorie.com Tue Feb 06 08:38:00 2001
From: Eli Zaretskii <eliz@delorie.com>
To: ac131313@cygnus.com
Cc: gdb-patches@sourceware.cygnus.com, fpastor.etra-id@etra.es
Subject: Re: [PATCH]: Fix ser-go32.c for UARTs with FIFOs.
Date: Tue, 06 Feb 2001 08:38:00 -0000
Message-id: <200102061638.LAA08744@indy.delorie.com>
References: <Pine.SUN.3.91.1010204094707.20547Q-100000@is> <3A7F6BCF.605B1D7F@cygnus.com>
X-SW-Source: 2001-02/msg00076.html
Content-length: 1082

> Date: Mon, 05 Feb 2001 19:13:19 -0800
> From: Andrew Cagney <ac131313@cygnus.com>
> 
> Eli Zaretskii wrote:
> > 
> > FYI: I committed today the following patch:
> > 
> > 2001-02-04  Eli Zaretskii  <eliz@is.elta.co.il>
> > 
> >         * ser-go32.c (dos_write) [UART_FIFO_WORKS]: Use outportsb only if
> >         UART_FIFO_WORKS is defined.  Otherwise use outportb.
> >         From Francisco Pastor <fpastor.etra-id@etra.es>
> 
> Eli, would it be better to make this a run-time option?

You mean, introduce a new interactive command, or an option for an
existing command?

If you think this would be a good idea, I'll put that on my todo (I
have a few much more important issues to deal with, such as the
unified handling of hardware-assisted watchpoints and breakpoints for
x86, which I promised a long time ago, as well as a few bugs).

It didn't seem to me as a grave problem to make this a compile-time
option because I don't think the speed we gain by using OUTS vs OUT is
significant.  (I also cannot test this code on my machine, since I
don't have a serial link set up.)
From ac131313@cygnus.com Tue Feb 06 11:06:00 2001
From: Andrew Cagney <ac131313@cygnus.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: cgf@redhat.com, gdb-patches@sources.redhat.com
Subject: Re: [RFA] fix child_xfer_memory in hppah-nat.c
Date: Tue, 06 Feb 2001 11:06:00 -0000
Message-id: <3A804A32.D816139E@cygnus.com>
References: <3A7DCAB6.333C1DE0@cygnus.com> <Pine.SUN.3.91.1010205110800.5862G-100000@is> <20010205131813.A734@redhat.com> <200102061637.LAA08729@indy.delorie.com>
X-SW-Source: 2001-02/msg00077.html
Content-length: 1603

Eli Zaretskii wrote:
> 
> > Date: Mon, 5 Feb 2001 13:18:14 -0500
> > From: Christopher Faylor <cgf@redhat.com>
> >
> > Here are the lines from configure.in:
> >
> >     # NOTE: Don't add -Wall or -Wunused, they both include
> >     # -Wunused-parameter which reports bogus warnings.
> >
> > The TODO has some words, too:
> >
> >     Frequently requested but not approved requests.
> >
> >     --
> >
> >     Eliminate unused argument warnings using ATTRIBUTE_UNUSED.
> >
> >     The benefits on this one are thought to be marginal - GDBs design
> >     means that unused parameters are very common.  GCC 3.0 will also
> >     include the option -Wno-unused-parameter which means that ``-Wall
> >     -Wno-unused-parameters -Werror'' can be specified.
> >
> >
> > >Several files in the CVS use ATTRIBUTE_UNUSED (not surprisingly,
> > >go32-nat.c is one of them ;-).  So I wonder what is the current say-so
> > >on this matter.
> >
> > I specifically added some of these to win32-nat.c, too, not too long ago.
> > I do remember the discussion now.  I can't say that I agree with it,
> > but I remember it.
> >
> > It looks like at least one discussion is here:
> >
> > http://sources.redhat.com/ml/gdb/2000-q1/msg00826.html
> 
> Thanks for the pointers.
> 
> However, after reading those, I'm still unsure what, if anything,
> should I do with ATTRIBUTE_UNUSED in files I'm responsible for.

Nothing! You've plenty of other things to do above and beyond worrying
about them.  Just don't be suprised if someone some day submits a patch
to eliminate them (like chris just did for a bunch of PTRs).

	Andrew
From taylor@cygnus.com Tue Feb 06 11:15:00 2001
From: David Taylor <taylor@cygnus.com>
To: gdb-patches@sourceware.cygnus.com
Subject: [RFA] parse_frame_specification (stack.c)
Date: Tue, 06 Feb 2001 11:15:00 -0000
Message-id: <200102061915.OAA00445@texas.cygnus.com>
X-SW-Source: 2001-02/msg00079.html
Content-length: 2053

In gdb, if you say:

    "frame <small-number>"
or
    "info frame <small-number>"

then you expect to either move up or down some number of frames or to
get information on the frame having the specified "index".

But, if for your gdb target, addresses and pointers are different,
then the current code in parse_frame_specification will treat the
number as a pointer and convert it to an address.

So, if you have a Harvard architecture processor where a pointer of 0
(say) corresponds to a text address of 0x2000000 and a data address of
0x1000000, and you say

    frame 0

then gdb will try to move to frame 0x1000000.

Assuming you don't have that many frames, it will then try to create a
frame at address 0x1000000.  Which, in my case, will generate an
error...

This fixes it so that

    frame 0

will do the right thing on such configurations.

ChangeLog entry:

	* stack.c (parse_frame_specification): For one argument case,
 	handle the situation where the argument is an integer, not an
 	address -- arguably the most common case.  This matters on
	targets where pointers and addresses are different.

Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.11
diff -c -r1.11 stack.c
*** stack.c	2001/01/27 17:57:53	1.11
--- stack.c	2001/02/06 19:01:15
***************
*** 722,727 ****
--- 722,728 ----
    int numargs = 0;
  #define	MAXARGS	4
    CORE_ADDR args[MAXARGS];
+   int level;
  
    if (frame_exp)
      {
***************
*** 742,747 ****
--- 743,752 ----
  
  	  {
  	    tmp_cleanup = make_cleanup (xfree, addr_string);
+ 
+ 	    if (numargs == 0)
+ 	      level = parse_and_eval_long (addr_string);
+ 
  	    args[numargs++] = parse_and_eval_address (addr_string);
  	    do_cleanups (tmp_cleanup);
  	  }
***************
*** 762,768 ****
        /* NOTREACHED */
      case 1:
        {
- 	int level = args[0];
  	struct frame_info *fid =
  	find_relative_frame (get_current_frame (), &level);
  	struct frame_info *tfid;
--- 767,772 ----
From ac131313@cygnus.com Tue Feb 06 11:15:00 2001
From: Andrew Cagney <ac131313@cygnus.com>
To: Francisco Pastor <fpastor.etra-id@etra.es>
Cc: Eli Zaretskii <eliz@is.elta.co.il>, gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH]: Fix ser-go32.c for UARTs with FIFOs.
Date: Tue, 06 Feb 2001 11:15:00 -0000
Message-id: <3A804C5F.9F2B6D84@cygnus.com>
References: <Pine.SUN.3.91.1010204094707.20547Q-100000@is> <3A7F6BCF.605B1D7F@cygnus.com> <6137-Tue06Feb2001105337+0200-eliz@is.elta.co.il> <004f01c09034$e7aa2300$0500a8c0@etra.es>
X-SW-Source: 2001-02/msg00078.html
Content-length: 650

Francisco Pastor wrote:

> The problem with OUTS only happen with NT DOS console, not with true DOS
> 6.22. So, I think that a general solution is leave the patch with a compile
> time option or, perhaps, test the DOS version for avoid the use of OUTS. I
> don´t think that introduce a new interactive command be a good solution.

I've been assuming that a single DJGPP-GDB binary can run on all dos
platforms (6.22, NT, ...).  If that is the case then the serial
configury should be run-time configurable.  If that isn't the case then
a compile time flag is ok.

I suspect this will go onto Eli's very long to do one day list :-)

	enjoy,
		Andrew
From msnyder@cygnus.com Tue Feb 06 11:17:00 2001
From: Michael Snyder <msnyder@cygnus.com>
To: gary37@seed.net.tw
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: gdbserver arm-linux support?
Date: Tue, 06 Feb 2001 11:17:00 -0000
Message-id: <3A804DE9.962848E@cygnus.com>
References: <E14Pykg-00023g-00@fwm2.seed.net.tw>
X-SW-Source: 2001-02/msg00080.html
Content-length: 1015

gary37@seed.net.tw wrote:
> 
> Hi all,
> 
> I know this question has been asked before in this list
> but I got gdb 20001208 source and tried to apply the
> patches floating around here before. I can not successfully
> apply the patches into source tree. I tried to do it
> manually but found the source seems to be changed since.
> So, I fumbled the code a little and finally got the
> arm-linux gdbserver built ok.
> 
> But, when I am on a x86 host run gdb and arm client runs
> gdbserver, the connection seems to be up, but while I
> simply want to run the debugged program at host, it told
> me "don't know how to run", and the client gdbserver shows
> "killing the inferior ..." and dies.

When you use "target remote", you do not say "run".
You say "continue".  Just imagine that when you initially
connect, the process already exists and the PC is stopped
at the start address.

Try that, anyway, and see if it works.  Something like:
	(gdb) target remote foo
	(gdb) break main
	(gdb) continue

HTH,
Michael
From jtc@redback.com Tue Feb 06 11:44:00 2001
From: jtc@redback.com (J.T. Conklin)
To: Andrew Cagney <ac131313@cygnus.com>
Cc: Francisco Pastor <fpastor.etra-id@etra.es>, Eli Zaretskii <eliz@is.elta.co.il>, gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH]: Fix ser-go32.c for UARTs with FIFOs.
Date: Tue, 06 Feb 2001 11:44:00 -0000
Message-id: <5mitmnsik8.fsf@jtc.redback.com>
References: <Pine.SUN.3.91.1010204094707.20547Q-100000@is> <3A7F6BCF.605B1D7F@cygnus.com> <6137-Tue06Feb2001105337+0200-eliz@is.elta.co.il> <004f01c09034$e7aa2300$0500a8c0@etra.es> <3A804C5F.9F2B6D84@cygnus.com>
X-SW-Source: 2001-02/msg00081.html
Content-length: 1112

>>>>> "Andrew" == Andrew Cagney <ac131313@cygnus.com> writes:
Andrew> Francisco Pastor wrote:
>> The problem with OUTS only happen with NT DOS console, not with true DOS
>> 6.22. So, I think that a general solution is leave the patch with a compile
>> time option or, perhaps, test the DOS version for avoid the use of OUTS. I
>> don´t think that introduce a new interactive command be a good solution.

Andrew> I've been assuming that a single DJGPP-GDB binary can run on
Andrew> all dos platforms (6.22, NT, ...).  If that is the case then
Andrew> the serial configury should be run-time configurable.  If that
Andrew> isn't the case then a compile time flag is ok.
Andrew>
Andrew> I suspect this will go onto Eli's very long to do one day list :-)

Eli mentioned that he didn't think the speed gain from using OUTS 
vs. OUT was significant.  If that is really the case, why not use 
the conservative approach and always use OUT?  If there isn't a 
win, I can't see the value of having knobs to tweak the implement-
ation, either at compile time or run time.

        --jtc

-- 
J.T. Conklin
RedBack Networks
From eliz@delorie.com Tue Feb 06 11:50:00 2001
From: Eli Zaretskii <eliz@delorie.com>
To: ac131313@cygnus.com
Cc: fpastor.etra-id@etra.es, gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH]: Fix ser-go32.c for UARTs with FIFOs.
Date: Tue, 06 Feb 2001 11:50:00 -0000
Message-id: <200102061950.OAA13398@indy.delorie.com>
References: <Pine.SUN.3.91.1010204094707.20547Q-100000@is> <3A7F6BCF.605B1D7F@cygnus.com> <6137-Tue06Feb2001105337+0200-eliz@is.elta.co.il> <004f01c09034$e7aa2300$0500a8c0@etra.es> <3A804C5F.9F2B6D84@cygnus.com>
X-SW-Source: 2001-02/msg00082.html
Content-length: 766

> Date: Tue, 06 Feb 2001 11:11:27 -0800
> From: Andrew Cagney <ac131313@cygnus.com>
> 
> Francisco Pastor wrote:
> 
> > The problem with OUTS only happen with NT DOS console, not with true DOS
> > 6.22. So, I think that a general solution is leave the patch with a compile
> > time option or, perhaps, test the DOS version for avoid the use of OUTS. I
> > don't think that introduce a new interactive command be a good solution.
> 
> I've been assuming that a single DJGPP-GDB binary can run on all dos
> platforms (6.22, NT, ...).

This is true.  DJGPP programs run on MS-DOS, all versions of
MS-Windows, and any other environment that has some kind of ``DOS
Box'' (OS/2, DOSEmu, etc.)

> I suspect this will go onto Eli's very long to do one day list :-)

Yes ;-)
From msnyder@cygnus.com Tue Feb 06 12:03:00 2001
From: Michael Snyder <msnyder@cygnus.com>
To: gdb-patches@sources.redhat.com
Cc: hilfingr@gnat.com
Subject: [PATCH]: Allow compilation by Sun cc
Date: Tue, 06 Feb 2001 12:03:00 -0000
Message-id: <3A8058A8.5DE5CC35@cygnus.com>
X-SW-Source: 2001-02/msg00083.html
Content-length: 10483

I've checked in this portion of Paul Hilfinger's patch for compiling with Sun cc.

2001-02-06  Michael Snyder  <msnyder@makita.cygnus.com>
        Submitted by Paul Hilfinger (hilfingr@gnat.com) 
        and Andrei Petrov (and@genesyslab.com).
        * findvar.c: Buffers of size MAX_REGISTER_RAW_SIZE or REGISTER_BYTES
        must be allocated dynamically, since these are no longer constants.
        * infcmd.c: Ditto.
        * regcache.c: Ditto.
        * remote.c: Ditto.
        * sol-thread.c: Ditto.
        * valops.c: Ditto.
        * config/sparc/sun4sol2.mh (MH_CFLAGS): Add -I/usr/include/v9, as a
        work-around for a missing Sun header file in solaris for sparc64.

Index: gdb/findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.15
diff -c -3 -p -r1.15 findvar.c
*** findvar.c   2000/07/30 01:48:25     1.15
--- findvar.c   2001/02/06 19:52:57
*************** value_of_register (int regnum)
*** 393,399 ****
    CORE_ADDR addr;
    int optim;
    register value_ptr reg_val;
!   char raw_buffer[MAX_REGISTER_RAW_SIZE];
    enum lval_type lval;
  
    get_saved_register (raw_buffer, &optim, &addr,
--- 393,399 ----
    CORE_ADDR addr;
    int optim;
    register value_ptr reg_val;
!   char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
    enum lval_type lval;
  
    get_saved_register (raw_buffer, &optim, &addr,
*************** addresses have not been bound by the dyn
*** 606,612 ****
      case LOC_BASEREG:
      case LOC_BASEREG_ARG:
        {
!       char buf[MAX_REGISTER_RAW_SIZE];
        get_saved_register (buf, NULL, NULL, frame, SYMBOL_BASEREG (var),
                            NULL);
        addr = extract_address (buf, REGISTER_RAW_SIZE (SYMBOL_BASEREG (var)));
--- 606,612 ----
      case LOC_BASEREG:
      case LOC_BASEREG_ARG:
        {
!       char *buf = (char*) alloca (MAX_REGISTER_RAW_SIZE);
        get_saved_register (buf, NULL, NULL, frame, SYMBOL_BASEREG (var),
                            NULL);
        addr = extract_address (buf, REGISTER_RAW_SIZE (SYMBOL_BASEREG (var)));
*************** addresses have not been bound by the dyn
*** 616,622 ****
  
      case LOC_THREAD_LOCAL_STATIC:
        {
!       char buf[MAX_REGISTER_RAW_SIZE];
  
        get_saved_register (buf, NULL, NULL, frame, SYMBOL_BASEREG (var),
                            NULL);
--- 616,622 ----
  
      case LOC_THREAD_LOCAL_STATIC:
        {
!       char *buf = (char*) alloca (MAX_REGISTER_RAW_SIZE);
  
        get_saved_register (buf, NULL, NULL, frame, SYMBOL_BASEREG (var),
                            NULL);
*************** addresses have not been bound by the dyn
*** 711,717 ****
  value_ptr
  value_from_register (struct type *type, int regnum, struct frame_info *frame)
  {
!   char raw_buffer[MAX_REGISTER_RAW_SIZE];
    CORE_ADDR addr;
    int optim;
    value_ptr v = allocate_value (type);
--- 711,717 ----
  value_ptr
  value_from_register (struct type *type, int regnum, struct frame_info *frame)
  {
!   char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
    CORE_ADDR addr;
    int optim;
    value_ptr v = allocate_value (type);
Index: gdb/infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.19
diff -c -3 -p -r1.19 infcmd.c
*** infcmd.c    2001/01/31 01:24:01     1.19
--- infcmd.c    2001/02/06 19:52:57
*************** do_registers_info (int regnum, int fpreg
*** 1467,1474 ****
  
    for (i = 0; i < numregs; i++)
      {
!       char raw_buffer[MAX_REGISTER_RAW_SIZE];
!       char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE];
  
        /* Decide between printing all regs, nonfloat regs, or specific reg.  */
        if (regnum == -1)
--- 1467,1474 ----
  
    for (i = 0; i < numregs; i++)
      {
!       char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
!       char *virtual_buffer = (char*) alloca (MAX_REGISTER_VIRTUAL_SIZE);
  
        /* Decide between printing all regs, nonfloat regs, or specific reg.  */
        if (regnum == -1)
Index: gdb/regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.14
diff -c -3 -p -r1.14 regcache.c
*** regcache.c  2001/01/09 00:12:48     1.14
--- regcache.c  2001/02/06 19:52:57
*************** write_register_bytes (int myregstart, ch
*** 558,564 ****
        /* The register partially overlaps the range being written.  */
        else
        {
!         char regbuf[MAX_REGISTER_RAW_SIZE];
          /* What's the overlap between this register's bytes and
               those the caller wants to write?  */
          int overlapstart = max (regstart, myregstart);
--- 558,564 ----
        /* The register partially overlaps the range being written.  */
        else
        {
!         char *regbuf = (char*) alloca (MAX_REGISTER_RAW_SIZE);
          /* What's the overlap between this register's bytes and
               those the caller wants to write?  */
          int overlapstart = max (regstart, myregstart);
Index: gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.36
diff -c -3 -p -r1.36 remote.c
*** remote.c    2001/02/02 19:14:33     1.36
--- remote.c    2001/02/06 19:52:58
*************** remote_wait (int pid, struct target_wait
*** 2604,2610 ****
          {
            int i;
            long regno;
!           char regs[MAX_REGISTER_RAW_SIZE];
  
            /* Expedited reply, containing Signal, {regno, reg} repeat */
            /*  format is:  'Tssn...:r...;n...:r...;n...:r...;#cc', where
--- 2604,2610 ----
          {
            int i;
            long regno;
!           char* regs = (char*) alloca (MAX_REGISTER_RAW_SIZE);
  
            /* Expedited reply, containing Signal, {regno, reg} repeat */
            /*  format is:  'Tssn...:r...;n...:r...;n...:r...;#cc', where
*************** remote_async_wait (int pid, struct targe
*** 2825,2831 ****
          {
            int i;
            long regno;
!           char regs[MAX_REGISTER_RAW_SIZE];
  
            /* Expedited reply, containing Signal, {regno, reg} repeat */
            /*  format is:  'Tssn...:r...;n...:r...;n...:r...;#cc', where
--- 2825,2831 ----
          {
            int i;
            long regno;
!           char* regs = (char*) alloca (MAX_REGISTER_RAW_SIZE);
  
            /* Expedited reply, containing Signal, {regno, reg} repeat */
            /*  format is:  'Tssn...:r...;n...:r...;n...:r...;#cc', where
Index: gdb/sol-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/sol-thread.c,v
retrieving revision 1.20
diff -c -3 -p -r1.20 sol-thread.c
*** sol-thread.c        2001/01/24 21:01:02     1.20
--- sol-thread.c        2001/02/06 19:52:58
*************** sol_thread_store_registers (int regno)
*** 685,691 ****
    if (regno != -1)
      {                         /* Not writing all the regs */
        /* save new register value */
!       char old_value[REGISTER_SIZE];
        memcpy (old_value, &registers[REGISTER_BYTE (regno)], REGISTER_SIZE);
  
        val = p_td_thr_getgregs (&thandle, gregset);
--- 685,691 ----
    if (regno != -1)
      {                         /* Not writing all the regs */
        /* save new register value */
!       char* old_value = (char*) alloca (REGISTER_SIZE);
        memcpy (old_value, &registers[REGISTER_BYTE (regno)], REGISTER_SIZE);
  
        val = p_td_thr_getgregs (&thandle, gregset);
Index: gdb/valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.30
diff -c -3 -p -r1.30 valops.c
*** valops.c    2001/02/06 18:07:48     1.30
--- valops.c    2001/02/06 19:52:58
*************** value_assign (register value_ptr toval, 
*** 570,576 ****
  {
    register struct type *type;
    register value_ptr val;
!   char raw_buffer[MAX_REGISTER_RAW_SIZE];
    int use_buffer = 0;
  
    if (!toval->modifiable)
--- 570,576 ----
  {
    register struct type *type;
    register value_ptr val;
!   char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
    int use_buffer = 0;
  
    if (!toval->modifiable)
*************** CORE_ADDR
*** 1027,1033 ****
  push_word (CORE_ADDR sp, ULONGEST word)
  {
    register int len = REGISTER_SIZE;
!   char buffer[MAX_REGISTER_RAW_SIZE];
  
    store_unsigned_integer (buffer, len, word);
    if (INNER_THAN (1, 2))
--- 1027,1033 ----
  push_word (CORE_ADDR sp, ULONGEST word)
  {
    register int len = REGISTER_SIZE;
!   char *buffer = alloca (MAX_REGISTER_RAW_SIZE);
  
    store_unsigned_integer (buffer, len, word);
    if (INNER_THAN (1, 2))
*************** You must use a pointer to function type 
*** 1665,1671 ****
      SAVE_DUMMY_FRAME_TOS (sp);
  
    {
!     char retbuf[REGISTER_BYTES];
      char *name;
      struct symbol *symbol;
  
--- 1665,1671 ----
      SAVE_DUMMY_FRAME_TOS (sp);
  
    {
!     char *retbuf = (char*) alloca (REGISTER_BYTES);
      char *name;
      struct symbol *symbol;
  
Index: gdb/config/sparc/sun4sol2.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/sun4sol2.mh,v
retrieving revision 1.3
diff -c -3 -p -r1.3 sun4sol2.mh
*** sun4sol2.mh 2000/10/24 20:05:36     1.3
--- sun4sol2.mh 2001/02/06 19:52:58
*************** NAT_FILE= nm-sun4sol2.h
*** 8,13 ****
--- 8,16 ----
  NATDEPFILES= corelow.o core-sol2.o solib.o solib-svr4.o fork-child.o procfs.o \
        proc-api.o proc-events.o proc-flags.o proc-why.o
  
+ # /usr/include/v9 is needed only by core-sol2.c when including 
+ # v9/sys/privregs.h, or rather the headers it in turn includes.
+ MH_CFLAGS=-I/usr/include/v9
  # If you are compiling with Sun's compiler, add the -xs option to CC
  # (e.g. `make CC="cc -xs"').
  # Sun's compilers require the -xs option to produce debug information
*************** NATDEPFILES= corelow.o core-sol2.o solib
*** 15,19 ****
  # files only, with undocumented pointers to it in the linked executable.
  # This is commented out because we don't assume that the Sun compiler
  # is in use.
! #MH_CFLAGS=-xs
  HOST_IPC=-DBSD_IPC
--- 18,22 ----
  # files only, with undocumented pointers to it in the linked executable.
  # This is commented out because we don't assume that the Sun compiler
  # is in use.
! #MH_CFLAGS=-xs -I/usr/include/v9
  HOST_IPC=-DBSD_IPC
From philb@gnu.org Tue Feb 06 12:14:00 2001
From: Philip Blundell <philb@gnu.org>
To: "Scott Bambrough" <scottb@netwinder.org>
Cc: "Michael Snyder" <msnyder@cygnus.com>, "Mark Kettenis" <kettenis@wins.uva.nl>, gdb-patches@sources.redhat.com
Subject: Re: patch for ARM GNU/Linux 
Date: Tue, 06 Feb 2001 12:14:00 -0000
Message-id: <E14QETP-0006gb-00@kings-cross.london.uk.eu.org>
References: <E14PWEF-0006Yz-00@kings-cross.london.uk.eu.org> <3A7F0B3A.1D1B33B3@cygnus.com> <s3in1c07swk.fsf@soliton.wins.uva.nl> <01f401c08fca$055387e0$LocalHost@netbackup>
X-SW-Source: 2001-02/msg00084.html
Content-length: 64

>This patch is ok with me.

Thanks.  I've checked it in.

p.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-02-06  8:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200102040619.WAA29062@bosch.cygnus.com>
2001-02-04 11:48 ` [RFA] fix child_xfer_memory in hppah-nat.c Christopher Faylor
2001-02-04 13:37   ` Andrew Cagney
     [not found]     ` <Pine.SUN.3.91.1010205110800.5862G-100000@is>
     [not found]       ` <20010205131813.A734@redhat.com>
2001-02-06  8:37         ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox