[PATCH] DW_CFA_GNU_negative_offset_extended support
Daniel Jacobowitz
drow@false.org
Wed Jan 3 18:27:00 GMT 2007
On Sat, Dec 30, 2006 at 08:06:15PM +0100, Jan Kratochvil wrote:
> The testcase is not good as it is i386-limited.
> Unaware how to produce such CFI with new GCC.
You can't; that's the whole point :-) It was a GNU extension and it
was replaced by a standard opcode.
> + case DW_CFA_GNU_negative_offset_extended:
> + insn_ptr = read_uleb128 (insn_ptr, insn_end, ®);
> + insn_ptr = read_uleb128 (insn_ptr, insn_end, &offset);
> + offset *= fs->data_align;
> + dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
> + fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_OFFSET;
> + fs->regs.reg[reg].loc.offset = -offset;
> + break;
> +
What about the eh_frame_p check in all the other cases?
Do you know if DW_CFA_GNU_negative_offset_extended was a factored
offset? I'm guessing yes from Jakub's patch, but I don't know. If
it was not, the multiplicaton by data_align is incorrect. If it was,
then it's right the way you have it.
> +# We should stop in abort(3).
> +
> +gdb_test "run" \
> + "Program received signal SIGABRT,.*" \
> + "run"
Please use gdb_run_cmd instead. See other tests for an example.
("run" doesn't work for remote targets.)
> +send_gdb "info frame\n";
> +gdb_expect {
> + -re "Stack level 3, frame at (0x\[0-9a-f\]+):.*Saved registers:.* ecx at (0x\[0-9a-f\]+),.*" {
> + pass "Value of the CFI inserted register"
> + if { [string compare $expect_out(1,string) $expect_out(2,string)] } then {
> + fail "Value of the CFI inserted register"
> + } else {
> + pass "Value of the CFI inserted register"
> + }
> + }
> + default {
> + fail "Existence of the CFI inserted register"
> + }
> +}
Please use gdb_test_multiple instead of send_gdb / gdb_expect. Then
you won't need the default case, which was wrong above anyway - it
has to consume the prompt.
Also, I think you have a typo - didn't mean for that to pass twice,
right?
--
Daniel Jacobowitz
CodeSourcery
More information about the Gdb-patches
mailing list