This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: constvars.exp & volatile.exp fixes
- From: Fernando Nasser <fnasser at redhat dot com>
- To: law at redhat dot com
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 19 Dec 2001 15:54:05 -0500
- Subject: Re: constvars.exp & volatile.exp fixes
- Organization: Red Hat , Inc. - Toronto
- References: <22600.1008793888@porcupine.cygnus.com>
OK with me. You can check it in.
Fernando
law@redhat.com wrote:
>
> constvars.exp & volatile.exp are failing miserably on the PA when using
> GCC.
>
> The problem is we compile these ".c" files with the C++ compiler.
>
> This causes names to be mangled, but because we're working with a .c
> file, the debugger has set the language to "C", not "C++". Therefore
> it does not demangle the names.
>
> It appears this was done to pacify HP's compilers; particularly since
> if you use GCC all these tests ought to pass without problems.
>
> The fix is pretty obvious. First, we have to get the compiler info
> so that we know whether we're using GCC or one of HP's compilers. Once
> armed with that information, we can arrange to do the right thing for
> whatever compiler we happen to be using.
>
> With this change, there are no unexpected failures in either test when
> using GCC.
>
> * gdb.base/constvars.exp: Only set lang to c++ if we're
> compiling the test with HP's compilers.
> * gdb.base/volatile.exp: Similarly.
>
> Index: constvars.exp
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/constvars.exp,v
> retrieving revision 1.8
> diff -c -3 -p -r1.8 constvars.exp
> *** constvars.exp 2001/09/28 11:46:40 1.8
> --- constvars.exp 2001/12/19 20:26:18
> *************** set testfile "constvars"
> *** 41,47 ****
> set srcfile ${testfile}.c
> set binfile ${objdir}/${subdir}/${testfile}
>
> ! if [istarget "hppa*-*-*"] {
> set lang "c++"
> } else {
> set lang ""
> --- 41,53 ----
> set srcfile ${testfile}.c
> set binfile ${objdir}/${subdir}/${testfile}
>
> ! # Create and source the file that provides information about the compiler
> ! # used to compile the test case.
> ! if [get_compiler_info ${binfile}] {
> ! return -1;
> ! }
> !
> ! if {$hp_aCC_compiler || $hp_cc_compiler} {
> set lang "c++"
> } else {
> set lang ""
> Index: volatile.exp
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/volatile.exp,v
> retrieving revision 1.6
> diff -c -3 -p -r1.6 volatile.exp
> *** volatile.exp 2001/09/28 11:46:40 1.6
> --- volatile.exp 2001/12/19 20:26:18
> *************** set testfile "constvars"
> *** 49,55 ****
> set srcfile ${testfile}.c
> set binfile ${objdir}/${subdir}/${testfile}
>
> ! if [istarget "hppa*-*-*"] {
> set lang "c++"
> } else {
> set lang ""
> --- 49,61 ----
> set srcfile ${testfile}.c
> set binfile ${objdir}/${subdir}/${testfile}
>
> ! # Create and source the file that provides information about the compiler
> ! # used to compile the test case.
> ! if [get_compiler_info ${binfile}] {
> ! return -1;
> ! }
> !
> ! if {$hp_aCC_compiler || $hp_cc_compiler} {
> set lang "c++"
> } else {
> set lang ""
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9