From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Christopher Faylor Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] fix child_xfer_memory in hppah-nat.c Date: Sun, 04 Feb 2001 13:37:00 -0000 Message-id: <3A7DCAB6.333C1DE0@cygnus.com> References: <200102040619.WAA29062@bosch.cygnus.com> <20010204144850.C1342@redhat.com> X-SW-Source: 2001-02/msg00043.html 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 To: Michael Snyder 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 To: GDB Patches 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 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 "love without fear" === 2001-02-04 Michael Chastain * 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\]+|) " } ! 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 " ! 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\]+ " } # --- 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 " 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\]+|) " } ! ! 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 To: Andrew Cagney Cc: Christopher Faylor , 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: 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 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 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> 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 To: GDB Patches 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 * 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); /* 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 **** /* 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 ---- /* 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 To: Michael Elizabeth Chastain 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 > 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 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 To: Andrew Cagney 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 To: Andrew Cagney Cc: GDB Patches 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 To: Michael Elizabeth Chastain 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. Good Pilgrim -- Your Appeal Has Been Granted! > > 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 > > "love without fear" > > === > > 2001-02-03 Michael Chastain > > * 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 To: Philip Blundell 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: 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 > > * 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 > + > +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 To: Michael Snyder Cc: Philip Blundell , gdb-patches@sources.redhat.com Subject: Re: patch for ARM GNU/Linux Date: Mon, 05 Feb 2001 12:51:00 -0000 Message-id: References: <3A7F0B3A.1D1B33B3@cygnus.com> X-SW-Source: 2001-02/msg00057.html Content-length: 345 Michael Snyder 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 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 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 To: Dean Luick , 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> 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 > > 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