* [PATCH] dejagnu runtest.exp cleanup
@ 2000-07-31 16:59 Jimmy Guo
2000-08-02 15:22 ` Jimmy Guo
0 siblings, 1 reply; 3+ messages in thread
From: Jimmy Guo @ 2000-07-31 16:59 UTC (permalink / raw)
To: gdb-patches
Mon Jul 31 16:45:29 Jimmy Guo <guo@cup.hp.com>
* runtest.exp: Cleanup reference to $env(MULTIPASS) and
$env(PASS). These were added by HP but unused since.
Index: runtest.exp
/usr/local/bin/diff -c -L runtest.exp runtest.exp@@/main/cygnus/6 runtest.exp
*** runtest.exp
--- runtest.exp Mon Jul 31 16:43:59 2000
***************
*** 1604,1623 ****
if { [info exists MULTIPASS] } {
set multipass $MULTIPASS
- } elseif {[info exists env(MULTIPASS)]} {
- set multipass $env(MULTIPASS)
}
if { $multipass == "" } {
set multipass { "" }
}
! # If PASS is specified, either as a TCL variable or in environment, we
! # want to run only the tests specified. Its value should be a number
! # or a list of numbers that specify the passes that we want to run.
if [info exists PASS] {
set pass $PASS
- } elseif [info exists env(PASS)] {
- set pass $env(PASS)
} else {
set pass ""
}
--- 1604,1619 ----
if { [info exists MULTIPASS] } {
set multipass $MULTIPASS
}
if { $multipass == "" } {
set multipass { "" }
}
! # If PASS is specified, we want to run only the tests specified.
! # Its value should be a number or a list of numbers that specify
! # the passes that we want to run.
if [info exists PASS] {
set pass $PASS
} else {
set pass ""
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dejagnu runtest.exp cleanup
2000-07-31 16:59 [PATCH] dejagnu runtest.exp cleanup Jimmy Guo
@ 2000-08-02 15:22 ` Jimmy Guo
0 siblings, 0 replies; 3+ messages in thread
From: Jimmy Guo @ 2000-08-02 15:22 UTC (permalink / raw)
To: gdb-patches
FYI I've committed this.
- Jimmy
On Mon, 31 Jul 2000, Jimmy Guo wrote:
>Mon Jul 31 16:45:29 Jimmy Guo <guo@cup.hp.com>
>
> * runtest.exp: Cleanup reference to $env(MULTIPASS) and
> $env(PASS). These were added by HP but unused since.
>
>Index: runtest.exp
>/usr/local/bin/diff -c -L runtest.exp runtest.exp@@/main/cygnus/6 runtest.exp
>*** runtest.exp
>--- runtest.exp Mon Jul 31 16:43:59 2000
>***************
>*** 1604,1623 ****
>
> if { [info exists MULTIPASS] } {
> set multipass $MULTIPASS
>- } elseif {[info exists env(MULTIPASS)]} {
>- set multipass $env(MULTIPASS)
> }
> if { $multipass == "" } {
> set multipass { "" }
> }
>
>! # If PASS is specified, either as a TCL variable or in environment, we
>! # want to run only the tests specified. Its value should be a number
>! # or a list of numbers that specify the passes that we want to run.
> if [info exists PASS] {
> set pass $PASS
>- } elseif [info exists env(PASS)] {
>- set pass $env(PASS)
> } else {
> set pass ""
> }
>--- 1604,1619 ----
>
> if { [info exists MULTIPASS] } {
> set multipass $MULTIPASS
> }
> if { $multipass == "" } {
> set multipass { "" }
> }
>
>! # If PASS is specified, we want to run only the tests specified.
>! # Its value should be a number or a list of numbers that specify
>! # the passes that we want to run.
> if [info exists PASS] {
> set pass $PASS
> } else {
> set pass ""
> }
>
>
Jimmy Guo, guo@cup.hp.com ADO eDL WDB
Voice: 800-477-6111 ext. 7451 Hewlett-Packard Company
(HP T-447-5229) 11000 Wolfe Road, MS 42UD
Fax: 408-447-4629 Cupertino, CA 95014-0678
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dejagnu runtest.exp cleanup
[not found] <Pine.LNX.4.10.10008010932120.1500-100000@hpcll168.cup.hp.com>
@ 2000-08-01 11:30 ` Fernando Nasser
0 siblings, 0 replies; 3+ messages in thread
From: Fernando Nasser @ 2000-08-01 11:30 UTC (permalink / raw)
To: Jimmy Guo; +Cc: gdb-patches
Jimmy Guo wrote:
>
> Well some of the env variables were added by HP ... and we have since
> moved to use the site.exp TCL var interface, after I learned that the
> env var interface might interfere with the standard build process
> (e.g. gnu make).
>
> I'm not too strong on this ... if you think keeping these env vars
> around is OK, that fine as well.
>
After I saw how this one is used I am having second thoughts. Specifying
things like CC_FOR_TARGET is one thing, but this MULTIPASS variable seems
to be a dangerous thing to be getting from multiple places. Too much for
consistence. Lets take the env() part out as you wanted.
Please check it in.
Thanks.
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@cygnus.com
2323 Yonge Street, Suite #300 Tel: 416-482-2661 ext. 311
Toronto, Ontario M4P 2C9 Fax: 416-482-6299
From fnasser@cygnus.com Tue Aug 01 11:31:00 2000
From: Fernando Nasser <fnasser@cygnus.com>
To: Jimmy Guo <guo@cup.hp.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH] dejagnu runtest.exp misc. fixes
Date: Tue, 01 Aug 2000 11:31:00 -0000
Message-id: <3987178C.BB3D58D4@cygnus.com>
References: <Pine.LNX.4.10.10008010936310.1500-100000@hpcll168.cup.hp.com>
X-SW-Source: 2000-08/msg00022.html
Content-length: 7687
Good stuff. Thanks.
I just wonder if your explanation or part thereof should not be turned into
comments. The way things work today Tcl will only go through it once so we
can add more comments.
Please check it in (if possible with some extra comments).
Thanks again.
F.
Jimmy Guo wrote:
>
> >Jimmy,
> >
> >Can you elaborate on how one would use this. What happens today and what
> >will happen after this change? Can you give an example, please?
> >
> >Thanks,
> >F.
>
> - dir_to_run / cmdline_dir_to_run:
>
> In multipass testing spec, one can do something like (in site.exp):
> set MULTIPASS "{1 \"dir_to_run=gdb.base gdb.c++\" \
> \"CXX_FOR_TARGET=... ...}"
>
> The cmdline_dir_to_run value can be specified through the runtest
> --di option.
>
> Today's runtest won't handle list of directories ... if you specify
> such a list no test will be run. The change will just introduce a
> loop around the possibly space delimited list of directories to check
> if a given test suite directory is specified in these variables.
>
> - find -maxdepth 1 ${dir} *.exp
>
> (Oops, lib/utils.exp needs to be changed accordingly. The revised
> patch is below.)
>
> ${dir} is one directory in the list of ${test_top_dirs}.
> ${test_top_dirs} is assigned by a statement:
> set test_top_dirs [lsort [getdirs -all ${srcdir} "${tool}*"]]
> For gdb testing, gdb.hp/gdb.base-hp/, for example, will have
> two directory entries in ${test_top_dirs}:
> gdb.hp/ gdb.hp/gdb.base-hp/
>
> When retrieving .exp files under a test directory, today's dejagnu
> would get and run all gdb.hp/gdb.base-hp/ tests twice. The change is
> to enforce the notion that we treat all test directories as if they
> are base directories, and don't look in sub-directories for tests.
>
> - Jimmy
>
> Mon Jul 31 16:54:52 Jimmy Guo <guo@cup.hp.com>
>
> * runtest.exp: Handle multiple directories in TCL variables
> dir_to_run and cmdline_dir_to_run; limit *.exp find to
> one directory level to avoid foo/bar/baz.exp getting tested
> twice (when ${dir} is 'foo', and when ${dir} is 'foo/bar').
>
> * lib/utils.exp (find): Add support for a -maxdepth <n>
> option to limit find to <n> directories deep.
>
> Index: runtest.exp
> /usr/local/bin/diff -c -L runtest.exp runtest.exp@@/main/cygnus/6 runtest.exp
> *** runtest.exp
> --- runtest.exp Mon Jul 31 16:54:33 2000
> ***************
> *** 1734,1740 ****
> # value (for example in MULTIPASS) and the test
> # directory matches that directory.
> if {[info exists dir_to_run] && $dir_to_run != ""} {
> ! if ![string match "*${dir_to_run}*" $dir] {
> continue
> }
> }
> --- 1734,1747 ----
> # value (for example in MULTIPASS) and the test
> # directory matches that directory.
> if {[info exists dir_to_run] && $dir_to_run != ""} {
> ! set found 0
> ! foreach directory $dir_to_run {
> ! if [string match "*${directory}*" $dir] {
> ! set found 1
> ! break
> ! }
> ! }
> ! if {!$found} {
> continue
> }
> }
> ***************
> *** 1744,1755 ****
> # directory matches that directory
> if {[info exists cmdline_dir_to_run] \
> && $cmdline_dir_to_run != ""} {
> ! if ![string match "*${cmdline_dir_to_run}*" $dir] {
> continue
> }
> }
>
> ! foreach test_name [lsort [find ${dir} *.exp]] {
> if { ${test_name} == "" } {
> continue
> }
> --- 1751,1772 ----
> # directory matches that directory
> if {[info exists cmdline_dir_to_run] \
> && $cmdline_dir_to_run != ""} {
> ! set found 0
> ! foreach directory $cmdline_dir_to_run {
> ! if [string match "*${directory}*" $dir] {
> ! set found 1
> ! break
> ! }
> ! }
> ! if {!$found} {
> continue
> }
> }
>
> ! # JYG: Limit find to one level, since we don't want
> ! # to pick up foo/bar/baz.exp twice ...
> ! # ${test_top_dirs} includes '... foo/ foo/bar/ ...'
> ! foreach test_name [lsort [find -maxdepth 1 ${dir} *.exp]] {
> if { ${test_name} == "" } {
> continue
> }
>
> Index: lib/utils.exp
> /usr/local/bin/diff -c -L lib/utils.exp lib/utils.exp@@/GDB_2000_07_24 lib/utils.exp
> *** lib/utils.exp
> --- lib/utils.exp Wed Dec 8 18:48:15 1999
> ***************
> *** 87,104 ****
>
> #
> # Finds all the files recursively
> ! # rootdir - this is the directory to start the search
> ! # from. This is and all subdirectories are search for
> ! # filenames. Directory names are not included in the
> ! # list, but the filenames have path information.
> ! # pattern - this is the pattern to match. Patterns are csh style
> ! # globbing rules.
> ! # returns: a list or a NULL.
> #
> ! proc find { rootdir pattern } {
> # first find all the directories
> set dirs "$rootdir "
> ! while 1 {
> set tmp $rootdir
> set rootdir ""
> if [string match "" $tmp] {
> --- 87,120 ----
>
> #
> # Finds all the files recursively
> ! # Args:
> ! # [-maxdepth <n>]
> ! # limit recursive find depth to <n> level;
> ! # default is to recursively find in all subdirectories
> ! # rootdir
> ! # the directory to start the search from. This is and all
> ! # subdirectories are searched for filenames. Directory names
> ! # are not included in the list, but the filenames have path
> ! # information.
> ! # pattern
> ! # the pattern to match. Patterns are csh style globbing rules.
> ! # Returns:
> ! # a list or a NULL.
> #
> ! proc find { args } {
> ! if { [lindex $args 0] == "-maxdepth" } {
> ! set maxdepth [lindex $args 1]
> ! set args [lrange $args 2 end]
> ! } else {
> ! set maxdepth 0
> ! }
> ! set rootdir [lindex $args 0]
> ! set pattern [lindex $args 1]
> !
> # first find all the directories
> set dirs "$rootdir "
> ! set depth 1
> ! while { $maxdepth == 0 || $depth < $maxdepth } {
> set tmp $rootdir
> set rootdir ""
> if [string match "" $tmp] {
> ***************
> *** 115,120 ****
> --- 131,137 ----
> }
> }
> set tmp ""
> + set depth [expr $depth + 1]
> }
>
> # find all the files that match the pattern
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@cygnus.com
2323 Yonge Street, Suite #300 Tel: 416-482-2661 ext. 311
Toronto, Ontario M4P 2C9 Fax: 416-482-6299
From fnasser@cygnus.com Tue Aug 01 11:35:00 2000
From: Fernando Nasser <fnasser@cygnus.com>
To: Jimmy Guo <guo@cup.hp.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH] dejagnu lib/framework.exp PRMS pattern
Date: Tue, 01 Aug 2000 11:35:00 -0000
Message-id: <3987187F.CF7BA1BC@cygnus.com>
References: <Pine.LNX.4.10.10008011111140.6905-100000@hpcll168.cup.hp.com>
X-SW-Source: 2000-08/msg00023.html
Content-length: 3092
The way I see it is that it won't hurt anyone. If some package requires
that only numeric ids are used because of gnats people can just keep using
numeric ids.
We will lose the detection of a typo (when ids are supposed to be numeric)
but a typo like this can be easily detected and corrected afterwards.
Lets get it in. I have the feeling that we all will want to use alpha ids.
Thanks.
F.
Jimmy Guo wrote:
>
> This patch is to relax the pattern for a PRMS id to allow a more general
> form of bug ID as part of setup_xfail call.
>
> Today, only an all-digit form of bug ID is accepted. For HP testing, we
> want to capture HP bug tracking IDs in the form of alphanumerics.
> This patch can be viewed as HP-specific. If so I'm also happy with
> keeping this chance HP local -- just something on the table for the
> maintainer to evaluate its general usefulness ... if it doesn't hurt,
> I'd like to see it in the repository though, which would make it easier
> to share tests between HP and non-HP developers (without need to chop
> things off setup_xfail calls).
>
> - Jimmy
>
> Tue Aug 1 11:09:39 Jimmy Guo <guo@cup.hp.com>
>
> * lib/framework.exp (setup_xfail): Relax PRMS string pattern
> to allow a more general bug ID specification (without '-').
>
> Index: lib/framework.exp
> /usr/local/bin/diff -c -L lib/framework.exp lib/framework.exp@@/main/cygnus/5 lib/framework.exp
> *** lib/framework.exp
> --- lib/framework.exp Tue Aug 1 11:09:03 2000
> ***************
> *** 417,424 ****
> # Setup a flag to control whether a failure is expected or not
> #
> # Multiple target triplet patterns can be specified for targets
> ! # for which the test fails. A decimal number can be specified,
> ! # which is the PRMS number.
> #
> proc setup_xfail { args } {
> global xfail_flag
> --- 417,424 ----
> # Setup a flag to control whether a failure is expected or not
> #
> # Multiple target triplet patterns can be specified for targets
> ! # for which the test fails. A bug report ID can be specified,
> ! # which is a string without '-'.
> #
> proc setup_xfail { args } {
> global xfail_flag
> ***************
> *** 428,435 ****
> set argc [ llength $args ]
> for { set i 0 } { $i < $argc } { incr i } {
> set sub_arg [ lindex $args $i ]
> ! # is a prms number. we assume this is a number with no characters
> ! if [regexp "^\[0-9\]+$" $sub_arg] {
> set xfail_prms $sub_arg
> continue
> }
> --- 428,435 ----
> set argc [ llength $args ]
> for { set i 0 } { $i < $argc } { incr i } {
> set sub_arg [ lindex $args $i ]
> ! # is a prms number. we assume this is a string with no '-' characters
> ! if [regexp "^\[^\-\]+$" $sub_arg] {
> set xfail_prms $sub_arg
> continue
> }
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@cygnus.com
2323 Yonge Street, Suite #300 Tel: 416-482-2661 ext. 311
Toronto, Ontario M4P 2C9 Fax: 416-482-6299
From fnasser@cygnus.com Tue Aug 01 11:37:00 2000
From: Fernando Nasser <fnasser@cygnus.com>
To: Jimmy Guo <guo@cup.hp.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH] dejagnu lib/target.exp HP warnings
Date: Tue, 01 Aug 2000 11:37:00 -0000
Message-id: <398718D2.702F0D7E@cygnus.com>
References: <Pine.LNX.4.10.10008011016581.1500-100000@hpcll168.cup.hp.com>
X-SW-Source: 2000-08/msg00024.html
Content-length: 2558
Sure. Check it in.
F.
Jimmy Guo wrote:
>
> Couple of changes specific to HP compilation message filtering.
>
> - Jimmy
>
> Tue Aug 1 10:13:22 Jimmy Guo <guo@cup.hp.com>
>
> * lib/target.exp (prune_warnings): Remove duplicate PA2.0 pattern;
> revise HP Fortran (f77 & f90) pattern.
>
> Index: lib/target.exp
> /usr/local/bin/diff -c -L lib/target.exp lib/target.exp@@/main/cygnus/12 lib/target.exp
> *** lib/target.exp
> --- lib/target.exp Tue Aug 1 10:12:06 2000
> ***************
> *** 146,153 ****
> # Ignore the compiler's warnings about PA incompatibility.
> regsub -all "(^|\n)\[^\n\]*PA 2.0 object file \[^\n\]* was detected. The linked output may not run on a PA 1.x system." $text "" text
>
> - regsub -all "(^|\n)\[^\n\]*PA 2.0 object file \[^\n\]* was detected. The linked output may not run on a PA 1.x system." $text "" text
> -
> # And the linker's +vcompatwarnings verbage.
> regsub -all "(^|\n)\[^\n\]*Linker features were used that may not be supported\[^\n\]*.\[^\n\]*." $text "" text
>
> --- 146,151 ----
> ***************
> *** 188,198 ****
> #
> regsub -all "aCC .assigner.: Warning .*Could not satisfy instantiation request for \[^\n\]* contained in\[^\n\]*\n\t/lib/pa20_64/lib\[a-zA-Z0-9\]*.sl" $text "" text
>
> ! # Remove the lines that are output by the HP F77 compiler to
> # indicate the functions that are being compiled.
> upvar compiler_type compiler_type
> if { [info exists compiler_type] && $compiler_type == "f77" } {
> ! regsub -all "\[ \ta-zA-Z_0-9\./\]*:\[\r\n\]+" $text "" text
> }
>
> # Ignore the warnings about unknown options
> --- 186,196 ----
> #
> regsub -all "aCC .assigner.: Warning .*Could not satisfy instantiation request for \[^\n\]* contained in\[^\n\]*\n\t/lib/pa20_64/lib\[a-zA-Z0-9\]*.sl" $text "" text
>
> ! # Remove the lines that are output by the HP F77 / F90 compiler to
> # indicate the functions that are being compiled.
> upvar compiler_type compiler_type
> if { [info exists compiler_type] && $compiler_type == "f77" } {
> ! regsub -all "\[ \ta-zA-Z_0-9\./\-\]*(:|)\[\r\n\]+.*" $text "" text
> }
>
> # Ignore the warnings about unknown options
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@cygnus.com
2323 Yonge Street, Suite #300 Tel: 416-482-2661 ext. 311
Toronto, Ontario M4P 2C9 Fax: 416-482-6299
From guo@cup.hp.com Tue Aug 01 15:27:00 2000
From: Jimmy Guo <guo@cup.hp.com>
To: gdb-patches@sourceware.cygnus.com
Subject: [PATCH] language support: case sensitivity
Date: Tue, 01 Aug 2000 15:27:00 -0000
Message-id: <Pine.LNX.4.10.10008011521540.6905-100000@hpcll168.cup.hp.com>
X-SW-Source: 2000-08/msg00025.html
Content-length: 23111
This patch adds case sensivity support and sets language specific case
sensitivity setting to *_language_defn. This is necessary to support
Fortran symbol lookup which is case insensitive.
Tue Aug 1 15:02:17 Jimmy Guo <guo@cup.hp.com>
* language.h: Add enum case_mode, case_sensitivity.
* language.c: Define case_mode, case_sensitivity. Set case
sensitivity on for unknown_language_defn, auto_language_defn,
and local_language_defn.
(show_case_command,set_case_command,set_case_str): New static func.
(set_type_range_case): New static func, replaces set_type_range ().
(set_language_command,set_type_command,set_range_command,set_language):
Call set_type_range_case ().
(language_info): Print case sensitivity setting.
(_initialize_language): Add set/show commands for 'case-sensitive'.
Set default case mode 'auto'. Set default language 'auto'.
* c-lang.c: Set case sensitivity on for c_language_defn,
cplus_language_defn, and asm_language_defn.
* ch-lang.c: Set case sensitivity on for chill_language_defn.
* f-lang.c: Set case sensivitity off for f_language_defn.
* jv-lang.c: Set case sensitivity on for java_language_defn.
* m2-lang.c: Set case sensitivity on for m2_language_defn.
* p-lang.c: Set case sensitivity on for pascal_language_defn.
* scm-lang.c: Set case sensitivity on for scm_language_defn.
* symtab.c (lookup_symbol): Downcase symbol name if case sensivitity
is off.
Index: language.h
/usr/local/bin/diff -c -L language.h language.h@@/main/cygnus/10 language.h
*** language.h
--- language.h Tue Aug 1 13:37:53 2000
***************
*** 81,86 ****
--- 81,106 ----
type_check_off, type_check_warn, type_check_on
}
type_check;
+
+ /* case_mode ==
+ case_mode_auto: case_sensitivity set upon selection of scope
+ case_mode_manual: case_sensitivity set only by user. */
+
+ extern enum case_mode
+ {
+ case_mode_auto, case_mode_manual
+ }
+ case_mode;
+
+ /* case_sensitivity ==
+ case_sensitive_on: Case sensitivity in name matching is used
+ case_sensitive_off: Case sensitivity in name matching is not used */
+
+ extern enum case_sensitivity
+ {
+ case_sensitive_on, case_sensitive_off
+ }
+ case_sensitivity;
\f
/* Information for doing language dependent formatting of printed values. */
***************
*** 139,144 ****
--- 159,167 ----
/* Default type checking */
enum type_check la_type_check;
+
+ /* Default case sensitivity */
+ enum case_sensitivity la_case_sensitivity;
/* Parser function. */
Index: language.c
/usr/local/bin/diff -c -L language.c language.c@@/main/cygnus/14 language.c
*** language.c
--- language.c Tue Aug 1 14:34:06 2000
***************
*** 57,62 ****
--- 57,68 ----
static void set_range_command (char *, int);
+ static void show_case_command (char *, int);
+
+ static void set_case_command (char *, int);
+
+ static void set_case_str (void);
+
static void set_range_str (void);
static void set_type_str (void);
***************
*** 71,77 ****
static void set_check (char *, int);
! static void set_type_range (void);
static void unk_lang_emit_char (int c, struct ui_file *stream, int quoter);
--- 77,83 ----
static void set_check (char *, int);
! static void set_type_range_case (void);
static void unk_lang_emit_char (int c, struct ui_file *stream, int quoter);
***************
*** 105,110 ****
--- 111,118 ----
enum range_check range_check = range_check_off;
enum type_mode type_mode = type_mode_auto;
enum type_check type_check = type_check_off;
+ enum case_mode case_mode = case_mode_auto;
+ enum case_sensitivity case_sensitivity = case_sensitive_on;
/* The current language and language_mode (see language.h) */
***************
*** 132,137 ****
--- 140,146 ----
static char *language;
static char *type;
static char *range;
+ static char *case_sensitive;
/* Warning issued when current_language and the language of the current
frame do not match. */
***************
*** 215,221 ****
/* Enter manual mode. Set the specified language. */
language_mode = language_mode_manual;
current_language = languages[i];
! set_type_range ();
set_lang_str ();
expected_language = current_language;
return;
--- 224,230 ----
/* Enter manual mode. Set the specified language. */
language_mode = language_mode_manual;
current_language = languages[i];
! set_type_range_case ();
set_lang_str ();
expected_language = current_language;
return;
***************
*** 267,275 ****
else if (STREQ (type, "auto"))
{
type_mode = type_mode_auto;
! set_type_range ();
/* Avoid hitting the set_type_str call below. We
! did it in set_type_range. */
return;
}
else
--- 276,284 ----
else if (STREQ (type, "auto"))
{
type_mode = type_mode_auto;
! set_type_range_case ();
/* Avoid hitting the set_type_str call below. We
! did it in set_type_range_case. */
return;
}
else
***************
*** 317,325 ****
else if (STREQ (range, "auto"))
{
range_mode = range_mode_auto;
! set_type_range ();
/* Avoid hitting the set_range_str call below. We
! did it in set_type_range. */
return;
}
else
--- 326,334 ----
else if (STREQ (range, "auto"))
{
range_mode = range_mode_auto;
! set_type_range_case ();
/* Avoid hitting the set_range_str call below. We
! did it in set_type_range_case. */
return;
}
else
***************
*** 330,341 ****
show_range_command ((char *) 0, from_tty);
}
! /* Set the status of range and type checking based on
the current modes and the current language.
If SHOW is non-zero, then print out the current language,
type and range checking status. */
static void
! set_type_range ()
{
if (range_mode == range_mode_auto)
--- 339,394 ----
show_range_command ((char *) 0, from_tty);
}
! /* Show command. Display a warning if the case sensitivity setting does
! not match the current language. */
! static void
! show_case_command(ignore, from_tty)
! char *ignore;
! int from_tty;
! {
! if (case_sensitivity != current_language->la_case_sensitivity)
! printf_unfiltered(
! "Warning: the current case sensitivity setting does not match the language.\n");
! }
!
! /* Set command. Change the setting for case sensitivity. */
! static void
! set_case_command(ignore, from_tty)
! char *ignore;
! int from_tty;
! {
! if (STREQ (case_sensitive, "on"))
! {
! case_sensitivity = case_sensitive_on;
! case_mode = case_mode_manual;
! }
! else if (STREQ (case_sensitive, "off"))
! {
! case_sensitivity = case_sensitive_off;
! case_mode = case_mode_manual;
! }
! else if (STREQ (case_sensitive, "auto"))
! {
! case_mode = case_mode_auto;
! set_type_range_case ();
! /* Avoid hitting the set_case_str call below. We
! did it in set_type_range_case. */
! return;
! }
! else
! {
! warning ("Unrecognized case-sensitive setting: \"%s\"", case_sensitive);
! }
! set_case_str();
! show_case_command ((char *) NULL, from_tty);
! }
!
! /* Set the status of range and type checking and case sensitivity based on
the current modes and the current language.
If SHOW is non-zero, then print out the current language,
type and range checking status. */
static void
! set_type_range_case ()
{
if (range_mode == range_mode_auto)
***************
*** 344,351 ****
--- 397,408 ----
if (type_mode == type_mode_auto)
type_check = current_language->la_type_check;
+ if (case_mode == case_mode_auto)
+ case_sensitivity = current_language->la_case_sensitivity;
+
set_type_str ();
set_range_str ();
+ set_case_str ();
}
/* Set current language to (enum language) LANG. Returns previous language. */
***************
*** 364,370 ****
if (languages[i]->la_language == lang)
{
current_language = languages[i];
! set_type_range ();
set_lang_str ();
break;
}
--- 421,427 ----
if (languages[i]->la_language == lang)
{
current_language = languages[i];
! set_type_range_case ();
set_lang_str ();
break;
}
***************
*** 444,449 ****
--- 501,529 ----
range = concat (pref, tmp, NULL);
}
+ static void
+ set_case_str()
+ {
+ char *tmp = NULL, *prefix = "";
+
+ if (case_mode==case_mode_auto)
+ prefix = "auto; currently ";
+
+ switch (case_sensitivity)
+ {
+ case case_sensitive_on:
+ tmp = "on";
+ break;
+ case case_sensitive_off:
+ tmp = "off";
+ break;
+ default:
+ error ("Unrecognized case-sensitive setting.");
+ }
+
+ free (case_sensitive);
+ case_sensitive = concat (prefix, tmp, NULL);
+ }
/* Print out the current language settings: language, range and
type checking. If QUIETLY, print only what has changed. */
***************
*** 465,470 ****
--- 545,552 ----
show_type_command ((char *) 0, 1);
printf_unfiltered ("Range checking: %s\n", range);
show_range_command ((char *) 0, 1);
+ printf_unfiltered ("Case sensitivity: %s\n", case_sensitive);
+ show_case_command ((char *) 0, 1);
}
}
\f
***************
*** 1477,1482 ****
--- 1559,1565 ----
&unknown_builtin_types[0],
range_check_off,
type_check_off,
+ case_sensitive_on,
unk_lang_parser,
unk_lang_error,
evaluate_subexp_standard,
***************
*** 1506,1511 ****
--- 1589,1595 ----
&unknown_builtin_types[0],
range_check_off,
type_check_off,
+ case_sensitive_on,
unk_lang_parser,
unk_lang_error,
evaluate_subexp_standard,
***************
*** 1534,1539 ****
--- 1618,1624 ----
&unknown_builtin_types[0],
range_check_off,
type_check_off,
+ case_sensitive_on,
unk_lang_parser,
unk_lang_error,
evaluate_subexp_standard,
***************
*** 1600,1615 ****
set->function.cfunc = set_range_command;
show->function.cfunc = show_range_command;
add_language (&unknown_language_defn);
add_language (&local_language_defn);
add_language (&auto_language_defn);
language = savestring ("auto", strlen ("auto"));
- set_language_command (language, 0);
-
type = savestring ("auto", strlen ("auto"));
- set_type_command (NULL, 0);
-
range = savestring ("auto", strlen ("auto"));
! set_range_command (NULL, 0);
}
--- 1685,1708 ----
set->function.cfunc = set_range_command;
show->function.cfunc = show_range_command;
+ set = add_set_cmd ("case-sensitive", class_support, var_string_noescape,
+ (char *) &case_sensitive,
+ "Set case sensitivity in name search. (on/off/auto)\n\
+ For Fortran the default is off; for other languages the default is on.",
+ &setlist);
+ show = add_show_from_set (set, &showlist);
+ set->function.cfunc = set_case_command;
+ show->function.cfunc = show_case_command;
+
add_language (&unknown_language_defn);
add_language (&local_language_defn);
add_language (&auto_language_defn);
language = savestring ("auto", strlen ("auto"));
type = savestring ("auto", strlen ("auto"));
range = savestring ("auto", strlen ("auto"));
! case_sensitive = savestring ("auto",strlen ("auto"));
!
! /* Have the above take effect */
! set_language (language_auto);
}
Index: c-lang.c
/usr/local/bin/diff -c -L c-lang.c c-lang.c@@/main/cygnus/9 c-lang.c
*** c-lang.c
--- c-lang.c Tue Aug 1 14:36:59 2000
***************
*** 420,425 ****
--- 420,426 ----
c_builtin_types,
range_check_off,
type_check_off,
+ case_sensitive_on,
c_parse,
c_error,
evaluate_subexp_standard,
***************
*** 471,476 ****
--- 472,478 ----
cplus_builtin_types,
range_check_off,
type_check_off,
+ case_sensitive_on,
c_parse,
c_error,
evaluate_subexp_standard,
***************
*** 499,504 ****
--- 501,507 ----
c_builtin_types,
range_check_off,
type_check_off,
+ case_sensitive_on,
c_parse,
c_error,
evaluate_subexp_standard,
Index: ch-lang.c
/usr/local/bin/diff -c -L ch-lang.c ch-lang.c@@/main/cygnus/7 ch-lang.c
*** ch-lang.c
--- ch-lang.c Tue Aug 1 14:38:14 2000
***************
*** 625,630 ****
--- 625,631 ----
chill_builtin_types,
range_check_on,
type_check_on,
+ case_sensitive_on,
chill_parse, /* parser */
chill_error, /* parser error function */
evaluate_subexp_chill,
Index: f-lang.c
/usr/local/bin/diff -c -L f-lang.c f-lang.c@@/main/cygnus/9 f-lang.c
*** f-lang.c
--- f-lang.c Tue Aug 1 14:39:34 2000
***************
*** 471,476 ****
--- 471,477 ----
f_builtin_types,
range_check_on,
type_check_on,
+ case_sensitive_off,
f_parse, /* parser */
f_error, /* parser error function */
evaluate_subexp_standard,
Index: jv-lang.c
/usr/local/bin/diff -c -L jv-lang.c jv-lang.c@@/main/cygnus/8 jv-lang.c
*** jv-lang.c
--- jv-lang.c Tue Aug 1 14:40:45 2000
***************
*** 1065,1070 ****
--- 1065,1071 ----
c_builtin_types,
range_check_off,
type_check_off,
+ case_sensitive_on,
java_parse,
java_error,
evaluate_subexp_java,
Index: m2-lang.c
/usr/local/bin/diff -c -L m2-lang.c m2-lang.c@@/main/cygnus/7 m2-lang.c
*** m2-lang.c
--- m2-lang.c Tue Aug 1 14:41:53 2000
***************
*** 425,430 ****
--- 425,431 ----
m2_builtin_types,
range_check_on,
type_check_on,
+ case_sensitive_on,
m2_parse, /* parser */
m2_error, /* parser error function */
evaluate_subexp_standard,
Index: p-lang.c
/usr/local/bin/diff -c -L p-lang.c p-lang.c@@/main/cygnus/0 p-lang.c
*** p-lang.c
--- p-lang.c Tue Aug 1 14:42:44 2000
***************
*** 402,407 ****
--- 402,408 ----
pascal_builtin_types,
range_check_on,
type_check_on,
+ case_sensitive_on,
pascal_parse,
pascal_error,
evaluate_subexp_standard,
Index: scm-lang.c
/usr/local/bin/diff -c -L scm-lang.c scm-lang.c@@/main/cygnus/7 scm-lang.c
*** scm-lang.c
--- scm-lang.c Tue Aug 1 14:43:39 2000
***************
*** 251,256 ****
--- 251,257 ----
c_builtin_types,
range_check_off,
type_check_off,
+ case_sensitive_on,
scm_parse,
c_error,
evaluate_subexp_scm,
Index: symtab.c
/usr/local/bin/diff -c -L symtab.c symtab.c@@/main/cygnus/22 symtab.c
*** symtab.c
--- symtab.c Tue Aug 1 13:31:54 2000
***************
*** 606,617 ****
register struct objfile *objfile = NULL;
register struct block *b;
register struct minimal_symbol *msymbol;
/* Search specified block and its superiors. */
while (block != 0)
{
! sym = lookup_block_symbol (block, name, namespace);
if (sym)
{
block_found = block;
--- 606,630 ----
register struct objfile *objfile = NULL;
register struct block *b;
register struct minimal_symbol *msymbol;
+ char *copy;
+ int len, i;
+
+ if (case_sensitivity == case_sensitive_on)
+ copy = (char *) name;
+ else
+ {
+ len = strlen (name);
+ copy = (char *) alloca (len + 1);
+ for (i= 0; i < len; i++)
+ copy[i] = tolower (name[i]);
+ copy[len] = 0;
+ }
/* Search specified block and its superiors. */
while (block != 0)
{
! sym = lookup_block_symbol (block, copy, namespace);
if (sym)
{
block_found = block;
***************
*** 664,670 ****
if (BLOCK_START (b) <= BLOCK_START (block)
&& BLOCK_END (b) > BLOCK_START (block))
{
! sym = lookup_block_symbol (b, name, VAR_NAMESPACE);
if (sym)
{
block_found = b;
--- 677,683 ----
if (BLOCK_START (b) <= BLOCK_START (block)
&& BLOCK_END (b) > BLOCK_START (block))
{
! sym = lookup_block_symbol (b, copy, VAR_NAMESPACE);
if (sym)
{
block_found = b;
***************
*** 684,690 ****
struct value *v = value_of_this (0);
*is_a_field_of_this = 0;
! if (v && check_field (v, name))
{
*is_a_field_of_this = 1;
if (symtab != NULL)
--- 697,703 ----
struct value *v = value_of_this (0);
*is_a_field_of_this = 0;
! if (v && check_field (v, copy))
{
*is_a_field_of_this = 1;
if (symtab != NULL)
***************
*** 702,708 ****
{
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
! sym = lookup_block_symbol (block, name, namespace);
if (sym)
{
block_found = block;
--- 715,721 ----
{
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
! sym = lookup_block_symbol (block, copy, namespace);
if (sym)
{
block_found = block;
***************
*** 720,726 ****
if (namespace == VAR_NAMESPACE)
{
! msymbol = lookup_minimal_symbol (name, NULL, NULL);
if (msymbol != NULL)
{
s = find_pc_sect_symtab (SYMBOL_VALUE_ADDRESS (msymbol),
--- 733,739 ----
if (namespace == VAR_NAMESPACE)
{
! msymbol = lookup_minimal_symbol (copy, NULL, NULL);
if (msymbol != NULL)
{
s = find_pc_sect_symtab (SYMBOL_VALUE_ADDRESS (msymbol),
***************
*** 760,766 ****
}
else if (MSYMBOL_TYPE (msymbol) != mst_text
&& MSYMBOL_TYPE (msymbol) != mst_file_text
! && !STREQ (name, SYMBOL_NAME (msymbol)))
{
/* This is a mangled variable, look it up by its
mangled name. */
--- 773,779 ----
}
else if (MSYMBOL_TYPE (msymbol) != mst_text
&& MSYMBOL_TYPE (msymbol) != mst_file_text
! && !STREQ (copy, SYMBOL_NAME (msymbol)))
{
/* This is a mangled variable, look it up by its
mangled name. */
***************
*** 777,788 ****
ALL_PSYMTABS (objfile, ps)
{
! if (!ps->readin && lookup_partial_symbol (ps, name, 1, namespace))
{
s = PSYMTAB_TO_SYMTAB (ps);
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
! sym = lookup_block_symbol (block, name, namespace);
if (!sym)
{
/* This shouldn't be necessary, but as a last resort
--- 790,801 ----
ALL_PSYMTABS (objfile, ps)
{
! if (!ps->readin && lookup_partial_symbol (ps, copy, 1, namespace))
{
s = PSYMTAB_TO_SYMTAB (ps);
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
! sym = lookup_block_symbol (block, copy, namespace);
if (!sym)
{
/* This shouldn't be necessary, but as a last resort
***************
*** 791,802 ****
* the psymtab gets it wrong in some cases.
*/
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
! sym = lookup_block_symbol (block, name, namespace);
if (!sym)
error ("Internal: global symbol `%s' found in %s psymtab but not in symtab.\n\
%s may be an inlined function, or may be a template function\n\
(if a template, try specifying an instantiation: %s<type>).",
! name, ps->filename, name, name);
}
if (symtab != NULL)
*symtab = s;
--- 804,815 ----
* the psymtab gets it wrong in some cases.
*/
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
! sym = lookup_block_symbol (block, copy, namespace);
if (!sym)
error ("Internal: global symbol `%s' found in %s psymtab but not in symtab.\n\
%s may be an inlined function, or may be a template function\n\
(if a template, try specifying an instantiation: %s<type>).",
! copy, ps->filename, copy, copy);
}
if (symtab != NULL)
*symtab = s;
***************
*** 815,821 ****
{
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
! sym = lookup_block_symbol (block, name, namespace);
if (sym)
{
block_found = block;
--- 828,834 ----
{
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
! sym = lookup_block_symbol (block, copy, namespace);
if (sym)
{
block_found = block;
***************
*** 827,838 ****
ALL_PSYMTABS (objfile, ps)
{
! if (!ps->readin && lookup_partial_symbol (ps, name, 0, namespace))
{
s = PSYMTAB_TO_SYMTAB (ps);
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
! sym = lookup_block_symbol (block, name, namespace);
if (!sym)
{
/* This shouldn't be necessary, but as a last resort
--- 840,851 ----
ALL_PSYMTABS (objfile, ps)
{
! if (!ps->readin && lookup_partial_symbol (ps, copy, 0, namespace))
{
s = PSYMTAB_TO_SYMTAB (ps);
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
! sym = lookup_block_symbol (block, copy, namespace);
if (!sym)
{
/* This shouldn't be necessary, but as a last resort
***************
*** 841,852 ****
* the psymtab gets it wrong in some cases.
*/
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
! sym = lookup_block_symbol (block, name, namespace);
if (!sym)
error ("Internal: static symbol `%s' found in %s psymtab but not in symtab.\n\
%s may be an inlined function, or may be a template function\n\
(if a template, try specifying an instantiation: %s<type>).",
! name, ps->filename, name, name);
}
if (symtab != NULL)
*symtab = s;
--- 854,865 ----
* the psymtab gets it wrong in some cases.
*/
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
! sym = lookup_block_symbol (block, copy, namespace);
if (!sym)
error ("Internal: static symbol `%s' found in %s psymtab but not in symtab.\n\
%s may be an inlined function, or may be a template function\n\
(if a template, try specifying an instantiation: %s<type>).",
! copy, ps->filename, copy, copy);
}
if (symtab != NULL)
*symtab = s;
***************
*** 873,879 ****
if (namespace == VAR_NAMESPACE)
{
! msymbol = lookup_minimal_symbol (name, NULL, NULL);
if (msymbol != NULL)
{
/* OK, we found a minimal symbol in spite of not
--- 886,892 ----
if (namespace == VAR_NAMESPACE)
{
! msymbol = lookup_minimal_symbol (copy, NULL, NULL);
if (msymbol != NULL)
{
/* OK, we found a minimal symbol in spite of not
***************
*** 940,946 ****
*/
else if (MSYMBOL_TYPE (msymbol) != mst_text
&& MSYMBOL_TYPE (msymbol) != mst_file_text
! && !STREQ (name, SYMBOL_NAME (msymbol)))
{
return lookup_symbol (SYMBOL_NAME (msymbol), block,
namespace, is_a_field_of_this, symtab);
--- 953,959 ----
*/
else if (MSYMBOL_TYPE (msymbol) != mst_text
&& MSYMBOL_TYPE (msymbol) != mst_file_text
! && !STREQ (copy, SYMBOL_NAME (msymbol)))
{
return lookup_symbol (SYMBOL_NAME (msymbol), block,
namespace, is_a_field_of_this, symtab);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2000-08-02 15:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-31 16:59 [PATCH] dejagnu runtest.exp cleanup Jimmy Guo
2000-08-02 15:22 ` Jimmy Guo
[not found] <Pine.LNX.4.10.10008010932120.1500-100000@hpcll168.cup.hp.com>
2000-08-01 11:30 ` Fernando Nasser
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox