From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25129 invoked by alias); 22 Jan 2012 23:34:23 -0000 Received: (qmail 24843 invoked by uid 22791); 22 Jan 2012 23:34:22 -0000 X-SWARE-Spam-Status: No, hits=0.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qy0-f169.google.com (HELO mail-qy0-f169.google.com) (209.85.216.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 Jan 2012 23:34:08 +0000 Received: by qcsg1 with SMTP id g1so172523qcs.0 for ; Sun, 22 Jan 2012 15:34:07 -0800 (PST) Received: by 10.224.186.78 with SMTP id cr14mr6579283qab.11.1327275247275; Sun, 22 Jan 2012 15:34:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.100.14 with HTTP; Sun, 22 Jan 2012 15:33:46 -0800 (PST) In-Reply-To: <201201201044.q0KAimIE006755@d06av02.portsmouth.uk.ibm.com> References: <201201201044.q0KAimIE006755@d06av02.portsmouth.uk.ibm.com> From: Nicholas Sherlock Date: Sun, 22 Jan 2012 23:34:00 -0000 Message-ID: Subject: Re: ARM EABI Linux, breakpoints cause SIGILL and target dies To: Ulrich Weigand , gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00065.txt.bz2 Hi Ulrich, thanks for the reply, > =C2=A0If you have the kernel sources, you might want to compare the routi= nes > =C2=A0installed 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 > =C2=A0in GDB that tries to recognize breakpoints anyway. =C2=A0It may wel= l be > =C2=A0that this code does not (any longer) work correctly; it is never > =C2=A0exercised on recent kernels, so a bug might have crept in ... > > =C2=A0Can you do a run with "set debug infrun 1" in the case where you > =C2=A0get 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=3D0x8170, signal=3D0, step=3D0) infrun: resume (step=3D0, signal=3D0), trap_expected=3D0 infrun: wait_for_inferior (treat_exec_as_sigtrap=3D0) infrun: target_wait (-1, status) =3D infrun: 19563 [process 19563], infrun: status->kind =3D stopped, signal =3D SIGILL infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc =3D 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