Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: dan clark <2clarkd@gmail.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb@sourceware.org
Subject: Re: setting cooked registers desirable feature for coredump analysis but results in error
Date: Wed, 09 Feb 2011 21:31:00 -0000	[thread overview]
Message-ID: <AANLkTikz1wH5fiKmxTBHqjmCBTmqr9Ed8OQeQvr7YEi9@mail.gmail.com> (raw)
In-Reply-To: <20110208195334.GA14914@host1.dyn.jankratochvil.net>

Hi Jan!
Thank you for your suggestions and support!  Indeed as you say both
the program counter (pc/rip) and the stack pointer (sp/rsp) can be
passed through to setup an arbitrary starting point with the 'frame'
command.  Unfortunately this appears to be insufficient to provide a
reasonable back trace.  It appears that it is not until the frame
pointer (ebp/rbp) register is set that the trace works.   The frame.c
'create_new_frame()' call was easy to enhance to pass in the third
register value but unfortunately when attempting to set the new
sentinal_frames register value for the frame pointer it results in the
same error that does not allow registers to be modified for a core
dump analysis.

Is there a code change in create_new_frame that would allow the frame
pointer value to be passed in?

Is there a way of allowing the full set of registers to be manipulated
to provide a more flexible use of gdb when analyzing core dumps?

Thanks again for your ideas and response!
dan
On Tue, Feb 8, 2011 at 11:53 AM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> Hello Dan,
>
> On Mon, 07 Feb 2011 20:01:46 +0100, dan clark wrote:
>> An interesting debug scenario occurs when either a stack is corrupted
>
> the GDB `frame' command supports syntax `frame FRAMEADDR' and
> `frame FRAMEADDR PCADDR' where FRAMEADDR should be $sp in the caller.
> See the doc, this is exactly its purpose.  It behaved a bit erratically now to
> me on x86_64.
>
> If/as this is not a common task one can use `eu-readelf -n corefile'
> (eu-readelf is readelf from elfutils) and patch the registers using hexedit,
> IIRC I was doing to before.
>
>
> Regards,
> Jan
>


      parent reply	other threads:[~2011-02-09 21:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-07 19:01 dan clark
2011-02-08 19:53 ` Jan Kratochvil
2011-02-08 20:47   ` Daniel Jacobowitz
2011-02-09 21:31   ` dan clark [this message]

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=AANLkTikz1wH5fiKmxTBHqjmCBTmqr9Ed8OQeQvr7YEi9@mail.gmail.com \
    --to=2clarkd@gmail.com \
    --cc=gdb@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