Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: gdb-patches@sourceware.org
Cc: Mark Kettenis <mark.kettenis@xs4all.nl>
Subject: Re: [RFA/RFC] mips tracepoint: fix Bug 12013
Date: Sun, 19 Dec 2010 12:16:00 -0000	[thread overview]
Message-ID: <AANLkTin_4XJTNA2sjA6QZJiEsaY28YyUdcuRoL4=j90J@mail.gmail.com> (raw)
In-Reply-To: <201012191039.oBJAdNBN010655@glazunov.sibelius.xs4all.nl>

On Sun, Dec 19, 2010 at 18:39, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>> From: Hui Zhu <teawater@gmail.com>
>> Date: Sun, 19 Dec 2010 16:35:59 +0800
>>
>> http://sourceware.org/bugzilla/show_bug.cgi?id=12013
>>
>> This bug make mips tracepoint cannot trace the backtrace.
>>
>> This patch to fix this issue with a directly way just remove the
>> decline of access to the raw register names.
>>
>> If you think it's not OK.  What about add a new interface to gdbarch
>> to access to the raw register names.
>
> It is a common trick to return an empty register name for a (raw)
> register to hide the register from the user.  So I don't think this
> diff is ok, since the goal obviously is to hide the raw registers in
> mips in favour of the pseudo registers.

Could you tell me what this hide for?  I didn't find who get some
advantage form this part?

>
> I'd say the proper way forward is to teach the trace code to handle
> pseudo registers.

void
regcache_cooked_read (struct regcache *regcache, int regnum, gdb_byte *buf)
{
  gdb_assert (regnum >= 0);
  gdb_assert (regnum < regcache->descr->nr_cooked_registers);
  if (regnum < regcache->descr->nr_raw_registers)
    regcache_raw_read (regcache, regnum, buf);
  else if (regcache->readonly_p
	   && regnum < regcache->descr->nr_cooked_registers
	   && regcache->register_valid_p[regnum])
    /* Read-only register cache, perhaps the cooked value was cached?  */
    memcpy (buf, register_buffer (regcache, regnum),
	    regcache->descr->sizeof_register[regnum]);
  else
    gdbarch_pseudo_register_read (regcache->descr->gdbarch, regcache,
				  regnum, buf);
}

For now, even if gdb doesn't how to handle pseudo, it put it to
gdbarch.  I need add a new interface to gdbarch to handle it if we
really need.

Thanks,
Hui

>
>> 2010-12-19  Hui Zhu  <teawater@gmail.com>
>>
>>       * mips-tdep.c (mips_register_name): Remove the check.
>>       (mips_print_registers_info): Remove the gdb_assert.
>>
>


  reply	other threads:[~2010-12-19 12:16 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-19  8:36 Hui Zhu
2010-12-19 10:39 ` Mark Kettenis
2010-12-19 12:16   ` Hui Zhu [this message]
2010-12-21 14:45     ` Hui Zhu
2010-12-21 14:58       ` Mark Kettenis
2010-12-21 15:09         ` Hui Zhu
2010-12-21 15:42     ` Kevin Buettner
2010-12-21 15:59       ` Hui Zhu
2010-12-22  6:04         ` Kevin Buettner
2010-12-22  7:12           ` Hui Zhu
2010-12-22 16:20             ` Kevin Buettner
2010-12-23  3:33               ` Hui Zhu
2010-12-27 13:20                 ` Hui Zhu
2010-12-27 13:56                   ` Joel Brobecker
2010-12-28  4:43                     ` Hui Zhu
2010-12-22 11:27           ` Pedro Alves
2010-12-25 19:10             ` Hui Zhu
2010-12-27 13:52               ` Pedro Alves
2010-12-28  9:52                 ` Hui Zhu
2010-12-28 10:30                   ` Pedro Alves
2010-12-28 17:09                     ` Hui Zhu
2010-12-28 18:04                       ` Joel Brobecker
2010-12-28 19:05                         ` Pedro Alves
2010-12-28 19:07                           ` Pedro Alves
2010-12-29  8:10                             ` Hui Zhu
2010-12-29 13:06                               ` Pedro Alves
2010-12-29 16:09                                 ` Hui Zhu
2010-12-29 17:57                                   ` Pedro Alves
2010-12-30  8:00                                     ` Hui Zhu

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='AANLkTin_4XJTNA2sjA6QZJiEsaY28YyUdcuRoL4=j90J@mail.gmail.com' \
    --to=teawater@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /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