Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: roman.penyaev@profitbricks.com (Roman Pen)
Cc: roman.penyaev@profitbricks.com (Roman Pen),
	       palves@redhat.com (Pedro Alves),
	       dan@codesourcery.com (Daniel Jacobowitz),
	       jan.kratochvil@redhat.com (Jan Kratochvil),
	gdb-patches@sourceware.org,
	       stefanha@redhat.com (Stefan Hajnoczi)
Subject: Re: [PATCH 1/1] [RFC] gdb: corelow: make possible to modify (set) registers for a corefile
Date: Tue, 14 Mar 2017 13:15:00 -0000	[thread overview]
Message-ID: <20170314131454.533FAD830FF@oc3748833570.ibm.com> (raw)
In-Reply-To: <20170314100838.12647-1-roman.penyaev@profitbricks.com> from "Roman Pen" at Mar 14, 2017 11:08:37 AM

Roman Pen wrote:

> Despite the fact that this is a hairy hack this change eases debugging
> of a jmp_buf (setjmp()) and user contexts (makecontext()), which are
> highly used in QEMU project as a part of coroutines.
> 
> This change allows setting registers for a corefile, thus QEMU gdb
> script (qemu/scripts/qemugdb/coroutine.py) is allowed to investigate
> backtrace of a preempted coroutine context.  Previously only debugging
> of a live process was allowed.
> 
> This patch caches all register on a first attempt to modify register
> '(gdb) set $REG = ADDR' and then cached copy is always returned from
> get_core_registers().
> 
> This change should not break previous behaviour if nobody sets any
> register, i.e. on each get_core_registers() call registers from a
> corefile will be reread.

I'm wondering why you need that extra copy of the registers;
there already should be a regcache that would be able to hold
any modified values.

It is not currently possible to actually change those values
in the regcache because there is no to_store_registers routine.
But simply adding such a routine that does nothing (just like
to_prepare_to_store in your patch) should hopefully be enough ...

In any case, it would be good to add or extend a test case to
verify that this feature is working as intended.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


  reply	other threads:[~2017-03-14 13:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-14 10:09 Roman Pen
2017-03-14 13:15 ` Ulrich Weigand [this message]
2017-03-15  9:02   ` Roman Penyaev

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=20170314131454.533FAD830FF@oc3748833570.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=dan@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=palves@redhat.com \
    --cc=roman.penyaev@profitbricks.com \
    --cc=stefanha@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