2007-04-25 Luis Machado * dwarf2loc.c (loclist_read_variable): Corrected the PC value before calling the find_location_expression function Index: gdb/dwarf2loc.c =================================================================== --- gdb.orig/dwarf2loc.c 2007-04-25 10:29:05.000000000 -0700 +++ gdb/dwarf2loc.c 2007-04-25 11:04:55.000000000 -0700 @@ -528,9 +528,20 @@ gdb_byte *data; size_t size; +/* If the current Frame Level is 0, we pass the unmodified PC, but if the + Frame Level is greater than 0, we must adjust the PC by 1 since it was + decremented by get_frame_address_in_block() to be more intuitive to the + user (to point at the branch instruction rather than the instruction right + after the branch. Due to this adjusting, the Location List has an off-by-1 + error when checking the PC. This could cause wrong argument values to be + shown. */ + data = find_location_expression (dlbaton, &size, - frame ? get_frame_address_in_block (frame) - : 0); + frame ? + (frame_relative_level(frame)? (get_frame_address_in_block(frame) + sizeof(CORE_ADDR)) + : get_frame_address_in_block(frame)) + : 0); + if (data == NULL) { val = allocate_value (SYMBOL_TYPE (symbol));