From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12367 invoked by alias); 5 Dec 2003 11:36:21 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 12355 invoked from network); 5 Dec 2003 11:36:18 -0000 Received: from unknown (HELO mail.pune.nevisnetworks.com) (203.124.166.107) by sources.redhat.com with SMTP; 5 Dec 2003 11:36:18 -0000 Received: from nevis_pune_xchg.pune.nevisnetworks.com (nevis_pune_xchg.pune.nevisnetworks.com [192.168.2.7]) by mail.pune.nevisnetworks.com (8.12.5/8.12.5) with ESMTP id hB5BnIpX019664 for ; Fri, 5 Dec 2003 17:19:19 +0530 X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: break point command Z0 not supported Date: Fri, 05 Dec 2003 11:36:00 -0000 Message-ID: <36993D449C7FA647BF43568E0793AB3E32A63E@nevis_pune_xchg.pune.nevisnetworks.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Nitin Gupta" To: "Manoj Verma, Noida" Cc: X-SW-Source: 2003-12/txt/msg00106.txt.bz2 Hi Manoj, > 2) The gdb is reading data at some particular location (here=20 > 4000acb0 & 8048338)and inserting "cc" at that address. And at=20 > the end of 'continue' response it replaces back the original=20 > data at that particular address. Is this the standard way of=20 > GDB functioning? >=20 The way GDB and many other debuggers work is by this way only. Here is my understanding of the ways thing happen in general. You have a breakpoint instruction and whenever a user issues a breakpoint at a particular location, the dubugger will _replace_ the instruction at that very location with a breakpoint insn. It saves the removed insn in its breakpoint table. Now when the CPU hits this breakpoint insn, a debug exception is raised that is handled by an appropriate handler. giving control back to GDB. at this point GDB again _replace_ the breakpoint insn with the original insn held in its breakpoint table. Then when you give a next or a step, this insn is executed. This is valid for targets that have a valid breakpoint insn. For those not supporting breakpoint insns, alternate code that can just raise a debug exception is inserted. Hope this helps. Thanks and Regards Nitin Gupta