Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] DW_CFA_GNU_negative_offset_extended support
Date: Wed, 03 Jan 2007 18:27:00 -0000	[thread overview]
Message-ID: <20070103182742.GD17935@nevyn.them.org> (raw)
In-Reply-To: <20061230190615.GA22829@host0.dyn.jankratochvil.net>

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, &reg);
> +	      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


  reply	other threads:[~2007-01-03 18:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-30 19:06 Jan Kratochvil
2007-01-03 18:27 ` Daniel Jacobowitz [this message]
2007-01-11 19:11   ` Jan Kratochvil
2007-01-11 20:02     ` Daniel Jacobowitz
2007-01-21 17:28     ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070103182742.GD17935@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox