Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Nicholas Sherlock <n.sherlock@gmail.com>
To: Ulrich Weigand <uweigand@de.ibm.com>, gdb@sourceware.org
Subject: Re: ARM EABI Linux, breakpoints cause SIGILL and target dies
Date: Sun, 22 Jan 2012 23:34:00 -0000	[thread overview]
Message-ID: <CADwwazYiS3O01f8rG_x3-ASbTakoaSCW4YmmKDsUunE2TsX22g@mail.gmail.com> (raw)
In-Reply-To: <201201201044.q0KAimIE006755@d06av02.portsmouth.uk.ibm.com>

Hi Ulrich, thanks for the reply,

>  If you have the kernel sources, you might want to compare the routines
>  installed via register_undef_hook in arch/arm/kernel/ptrace.c.

So, the new kernel adds a bunch of code to support hardware
breakpoints, but I couldn't see any other changes there:

http://pastebin.com/HqTtdayG

> - Even on old kernels that return SIGILL, there is apparently some code
>  in GDB that tries to recognize breakpoints anyway.  It may well be
>  that this code does not (any longer) work correctly; it is never
>  exercised on recent kernels, so a bug might have crept in ...
>
>  Can you do a run with "set debug infrun 1" in the case where you
>  get the SIGILL?

Yep, here's the result:

Reading symbols from /root/a.out...done.
(gdb) set debug infrun 1
(gdb) start
Temporary breakpoint 1 at 0x81f4: file test.c, line 4.
Starting program: /root/a.out
infrun: proceed (addr=0x8170, signal=0, step=0)
infrun: resume (step=0, signal=0), trap_expected=0
infrun: wait_for_inferior (treat_exec_as_sigtrap=0)
infrun: target_wait (-1, status) =
infrun:   19563 [process 19563],
infrun:   status->kind = stopped, signal = SIGILL
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x81f6
infrun: random signal 4

Program received signal SIGILL, Illegal instruction.
infrun: stop_stepping
0x000081f6 in main () at test.c:4
4         printf("Hello, world!\n");
(gdb)

Cheers,
Nicholas Sherlock


  reply	other threads:[~2012-01-22 23:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CADwwazYuWuicgqL=4JyxbdoN+6MmVg354bD6UTzC=Ew-po8JzA@mail.gmail.com>
2012-01-20  2:45 ` Nicholas Sherlock
2012-01-20 10:45   ` Ulrich Weigand
2012-01-22 23:34     ` Nicholas Sherlock [this message]
2012-01-23  1:29       ` Nicholas Sherlock
2012-01-23 13:29         ` Ulrich Weigand
2012-01-24  2:44           ` Nicholas Sherlock
2012-01-24  3:02             ` Nicholas Sherlock
2012-01-24 13:37               ` Ulrich Weigand

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=CADwwazYiS3O01f8rG_x3-ASbTakoaSCW4YmmKDsUunE2TsX22g@mail.gmail.com \
    --to=n.sherlock@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=uweigand@de.ibm.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