From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31078 invoked by alias); 20 Jan 2012 10:45:08 -0000 Received: (qmail 31051 invoked by uid 22791); 20 Jan 2012 10:45:06 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e06smtp17.uk.ibm.com (HELO e06smtp17.uk.ibm.com) (195.75.94.113) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 Jan 2012 10:44:53 +0000 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 20 Jan 2012 10:44:52 -0000 Received: from d06nrmr1407.portsmouth.uk.ibm.com (9.149.38.185) by e06smtp17.uk.ibm.com (192.168.101.147) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 20 Jan 2012 10:44:50 -0000 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q0KAioTh2207874 for ; Fri, 20 Jan 2012 10:44:50 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q0KAioFJ006796 for ; Fri, 20 Jan 2012 03:44:50 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id q0KAimIE006755; Fri, 20 Jan 2012 03:44:49 -0700 Message-Id: <201201201044.q0KAimIE006755@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 20 Jan 2012 11:44:48 +0100 Subject: Re: ARM EABI Linux, breakpoints cause SIGILL and target dies To: n.sherlock@gmail.com (Nicholas Sherlock) Date: Fri, 20 Jan 2012 10:45:00 -0000 From: "Ulrich Weigand" Cc: gdb@sourceware.org In-Reply-To: from "Nicholas Sherlock" at Jan 20, 2012 03:45:11 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit x-cbid: 12012010-0542-0000-0000-000000C431AB 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/msg00063.txt.bz2 Nicholas Sherlock wrote: > Running a.out alone or with GDB works fine, but any operation that > causes GDB to set a breakpoint results in the target being killed by > SIGILL: [snip] > So I would expect that this would work. Another piece of the puzzle, I > have a different phone here running a different Linux kernel, but the > same Ubuntu usermode binaries, where GDB breakpoints work perfectly: [snip] > How do I begin to debug this problem? I have the source code available > for both kernels if there is something to investigate there. So there's two issues here: - The kernel is supposed to recognize the special undefined instructions use to implement breakpoints, and deliver SIGTRAP instead of SIGILL if execution hits one of those. It may be that the older of the two kernels does not properly handle this, in particular for Thumb-2 breakpoints which were added only recently. If you have the kernel sources, you might want to compare the routines installed via register_undef_hook in arch/arm/kernel/ptrace.c. - 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? Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com