Ilya Zakharevich said:
On a surface, it looks that this may be a true bug. However, what you
write is very ambiguous (and I suspect that English is not your first
language, so it may take a lot of time to clear through...). If you
can create a short example, please post it.
Thanks,
Ilya
I am not too sure what sort of example you want but here is one (hope
that does it):
(I have tested $casn too, that works but not $i...
--------------------------------------------------
DB<49> l 1027-1045
1027==>b if (exists $case[$casn+1]) { # A
next case exists?
1028: for($i=0; $i < scalar(@{$case[$casn]}); $i++) { # For
all sequences of this case (incl. general one)...
1029: print "Restore: i: $i \n"; # DEBUG!
1030: foreach $reg_key (keys (%{$case[$casn][$i]})) { # For
all register keys of this case + sequence...
1031: next if (defined
$case[$casn][$i]{$reg_key}{_RESTORE_} &&
$case[$casn][$i]{$reg_key}{_RESTORE_} eq "n");
1032 # Skip case
reg if restore to orig spec shall be done.
1033: foreach $field_key (keys
(%{$case[$casn][$i]{$reg_key}})) {
1034 # For all
slice keys of each register ...
1035: if (defined $case[$casn+1][$i] && ! defined
$case[$casn+1][$i]{$reg_key} &&
1036 ! defined
$case[$casn+1][$i]{$reg_key}{$field_key}){
1037 # Reg/slice
key not (re-)defined in next case? (->prevent overwriting)
1038: $case[$casn+1][$i]{$reg_key}{$field_key} =
$case[$casn][$i]{$reg_key}{$field_key};
1039 } # Take last's
cases rule or specical key and copy it to next one.
1040 }
1041 }
1042 }
1043 }
1044
1045: print CMDFILE "\nprint_msg (\"FINISHED PROGRAMMING
REGISTERS\"); \n\n";
DB<50> s
main:
gen_specs.pl:1028): for($i=0; $i <
scalar(@{$case[$casn]}); $i++) { # For all sequences of this case
(incl. general one)...
DB<50> s
main:
gen_specs.pl:1028): for($i=0; $i <
scalar(@{$case[$casn]}); $i++) { # For all sequences of this case
(incl. general one)...
DB<50>
main:
gen_specs.pl:1029): print "Restore: i: $i \n";
# DEBUG!
DB<50>
Restore: i: 0
main:
gen_specs.pl:1030): foreach $reg_key (keys
(%{$case[$casn][$i]})) { # For all register keys of this case +
sequence...
DB<50> p $i
Use of uninitialized value in print at (eval
21)[/cadappl/perl/5.6.1/lib/5.6.1/perl5db.pl:1521] line 2.
DB<51> print $i
Use of uninitialized value in print at (eval
22)[/cadappl/perl/5.6.1/lib/5.6.1/perl5db.pl:1521] line 2.
DB<52> p $casn
0
------------------------------------------------------
The related lines of code are inside gen_spec.pl:
if (exists $case[$casn+1]) {
for($i=0; $i < scalar(@{$case[$casn]}); $i++) {
print "Restore: i: $i \n"; # DEBUG!
foreach $reg_key (keys (%{$case[$casn][$i]})) {
next if (defined $case[$casn][$i]{$reg_key}{_RESTORE_} &&
$case[$casn][$i]{$reg_key}{_RESTORE_} eq "n");
foreach $field_key (keys (%{$case[$casn][$i]{$reg_key}})) {
if (defined $case[$casn+1][$i] &&
! defined $case[$casn+1][$i]{$reg_key} &&
! defined $case[$casn+1][$i]{$reg_key}{$field_key}){
$case[$casn+1][$i]{$reg_key}{$field_key} =
$case[$casn][$i]{$reg_key}{$field_key};
}
}
}
}
(Sorry for long lines above)
gen_spec.pl is invoked by another script with:
require "gen_specs.pl" ;
Hope that does it.
Thanks for helping, sorry for the delay of my response.
Volker