From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32753 invoked by alias); 30 Jan 2012 06:17:17 -0000 Received: (qmail 32731 invoked by uid 22791); 30 Jan 2012 06:17:15 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 30 Jan 2012 06:17:03 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1RrkY2-0006qn-55 from Yao_Qi@mentor.com ; Sun, 29 Jan 2012 22:17:02 -0800 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Sun, 29 Jan 2012 22:16:47 -0800 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.1.289.1; Sun, 29 Jan 2012 22:17:01 -0800 Message-ID: <4F2635DA.3060805@codesourcery.com> Date: Mon, 30 Jan 2012 06:17:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:9.0) Gecko/20111220 Thunderbird/9.0 MIME-Version: 1.0 To: Kevin Pouget CC: Robert Dewar , Jan Kratochvil , Xin Tong , Subject: Re: software breakpoint in gdb References: <20120129165303.GA18465@host2.jankratochvil.net> <4F25EA26.8020901@adacore.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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/msg00113.txt.bz2 On 01/30/2012 01:54 PM, Kevin Pouget wrote: > I would be curious about why it would be "a disastrous mistake". > Please correct me if I'm wrong in my understanding: The real disaster is interrupt instruction may corrupt the following instruction of breakpointed instruction, if interrupt instruction is longer than breakpointed instruction. For example, JMP L1: ... INSN1 (1-byte) L1:INSN2 (2-byte) Supposing the length of interrupt instruction is 2-byte, when setting breakpoint on INSN1, the INSN2 is corrupted. If the program runs JMP instruction to L1 directly, something wrong will be executed. -- Yao (齐尧)