Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Aleksandar Ristovski <aristovski@qnx.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [patch] gdbarch_syscall_pc_increment
Date: Wed, 12 Dec 2012 15:30:00 -0000	[thread overview]
Message-ID: <50C8A2FA.5000105@codesourcery.com> (raw)
In-Reply-To: <50C8937A.1090905@qnx.com>

On 12/12/2012 10:23 PM, Aleksandar Ristovski wrote:
> This patch fixes stepping over system call instruction on architectures
> that use software single stepping and also may increment PC upon return
> from the system call to communicate error. (e.g. this is what we do on
> Neutrino).
>
> Note: I could only test this on Neutrino.
>

Hi,
I don't understand why do you add a gdbarch hook, but use it only in a 
target-specific part?  The goal of gdbarch hooks is about hiding the 
difference of ports and giving a common interface to the common part of 
GDB.  If your issue is arm specific, we don't need this new gdbarch hook 
at all.

If I understand your problem correctly, you have to define your own 
function 'arm_neutrino_syscall_next_pc' in your file 
arm-neutrino-tdep.c, and install it on function pointer 
'syscall_next_pc' (in 'struct gdbarch_tdep' in arm-tdep.h) in 
'arm_neutrino_init_abi'.  Please have a look on how 'syscall_next_pc' is 
set in arm-linux-tdep.c.  Then you can compute the pc for your own os in 
'arm_neutrino_syscall_next_pc'.  Hope it helps.

>
> ChangeLog:
>
>         * gdbarch.sh (syscall_pc_increment): New function.
>         * gdbarch.h, gdbarch.c: Regenerated.
>         * arm-tdep.c (arm_software_single_step): Use
>         gdbarch_syscall_pc_increment and if provided, insert second
>         single step breakpoint at the incremented address.

I guess the reason you need the 2nd single step breakpoint is that GDB 
computes the 'next pc' by mistake, so you need the 2nd single step 
breakpoint setting on the 'right' address of 'next pc'.  In other words, 
do we really need the 2nd single step breakpoint if the address of 'next 
pc' is computed correctly?

-- 
Yao (齐尧)


  reply	other threads:[~2012-12-12 15:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-12 14:24 Aleksandar Ristovski
2012-12-12 15:30 ` Yao Qi [this message]
2012-12-12 15:43   ` Aleksandar Ristovski
2012-12-13  1:33     ` Yao Qi
2012-12-13 14:08       ` Aleksandar Ristovski
2012-12-13 14:21         ` Yao Qi
2012-12-13 21:47         ` Pedro Alves
2012-12-14 14:23           ` Aleksandar Ristovski
2012-12-14 15:14             ` Pedro Alves

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=50C8A2FA.5000105@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=aristovski@qnx.com \
    --cc=gdb-patches@sourceware.org \
    /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