From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2780 invoked by alias); 13 Oct 2006 19:05:43 -0000 Received: (qmail 2772 invoked by uid 22791); 13 Oct 2006 19:05:42 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.palmsource.com (HELO mx2.palmsource.com) (12.7.175.14) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 13 Oct 2006 19:05:40 +0000 Received: from localhost (localhost [127.0.0.1]) by localhost.domain.tld (Postfix) with ESMTP id F17B127A22; Fri, 13 Oct 2006 12:05:38 -0700 (PDT) Received: from mx2.palmsource.com ([127.0.0.1]) by localhost (mx2.palmsource.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 16937-01; Fri, 13 Oct 2006 12:05:37 -0700 (PDT) Received: from ussunex01.palmsource.com (unknown [192.168.101.9]) by mx2.palmsource.com (Postfix) with ESMTP id 399172754E; Fri, 13 Oct 2006 12:03:45 -0700 (PDT) Received: from 192.168.92.75 ([192.168.92.75]) by ussunex01.palmsource.com ([192.168.101.9]) via Exchange Front-End Server owa.palmsource.com ([10.0.20.17]) with Microsoft Exchange Server HTTP-DAV ; Fri, 13 Oct 2006 19:03:42 +0000 Received: from svmsnyderlnx by owa.palmsource.com; 13 Oct 2006 12:03:40 -0700 Subject: Re: the breakpoint of gdb From: Michael Snyder To: s88 Cc: gdb@sourceware.org In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Fri, 13 Oct 2006 19:05:00 -0000 Message-Id: <1160766220.14535.259.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00092.txt.bz2 On Sat, 2006-10-14 at 01:53 +0800, s88 wrote: > Hi all: > > Could anyone tell me something about how the gdb to achieve the the > breakpoint function in different platform? Thru a platform_specific method (function pointer) called "target_insert_breakpoint". Each target or platform defines this function as appropriate. Look for "target_insert_breakpoint" in breakpoint.c and target.h, then grep for "to_insert_breakpoint" in *.c. > I heard the gdb's breakpoint implement on the X86 platform is by the > instruction patch. It sounds interesting!! I want to know more > details. Yes, the most common method is to insert a trap instruction (or similar) into memory. See function "memory_insert_breakpoint" in mem-break.c. Again, each target platform has to define the appropriate bit-pattern or instruction to be inserted. > Any reference info, web page, books are welcome. Hah. If you write that book, you will become famous. ;-)