abrossard@watcgl.waterloo.edu (Alain Brossard) (10/13/88)
Compiler: gcc-1.28 -gg -O
Gdb: version 2.7
Problem: When a routine defines a variable but doesn't use it,
it goes into the symbol list. When locals_info is called, it
tries to print the variable in question via a call to
print_variable_value() which is given incorrect information.
This has happened twice in two different routines:
(ps the line numbering is not going to correspond with the one in the
distribution)
kill(0x2fb, 0x4) at 0x1b84c
abort(0x7fffe1d0) at 0x1b258
read_memory(memaddr = 2147476160, myaddr = "x\0342\0377\0177\0271\0325", len = 4), line 612 in "core.c"
read_var_value.$b10, line 331 in "findvar.c"
read_var_value(var = 0x887c0, frame = 1132892), line 331 in "findvar.c"
print_variable_value(var = 0x887c0, frame = 1132892, stream = 0x4152c), line 986 in "printcmd.c"
print_block_frame_locals(b = 0x88844, frame = 1132892, stream = 0x4152c, detail = 0), line 391 in "stack.c"
print_frame_local_vars(frame = 1132892, stream = 0x4152c, detail = 0), line 422 in "stack.c"
locals_info(detail = 0), line 446 in "stack.c"
(dbx) print *var
(name = "n", namespace = VAR_NAMESPACE, class = LOC_REGISTER, type = 0x874fc, va
lue = [union])
(dbx) print var->value.value
59
As can be seen, the variable is declared as a REGISTER variable, but
with an impossible register number. I ``think'' that this problem didn't
exist prior to gcc-1.26, but I could be mistaken. Updating gdb from
2.3 to 2.7 didn't help.
Alain Brossard
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Alain Brossard, CS Dept., U. Waterloo, Waterloo, Ontario, Canada N2L 3G1
INTERNET:abrossard@watcgl.uwaterloo.ca
INTERNET:abrossard@watcgl.waterloo.edu
UUCP :uunet!watmath!watcgl!abrossard
EAN :abrossard@cgl.waterloo.cdn