From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19136 invoked by alias); 30 Aug 2006 18:50:11 -0000 Received: (qmail 19127 invoked by uid 22791); 30 Aug 2006 18:50:10 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 30 Aug 2006 18:50:09 +0000 Received: (qmail 3084 invoked from network); 30 Aug 2006 18:50:07 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 30 Aug 2006 18:50:07 -0000 To: "Rajesh Warange" Cc: gdb@sourceware.org Subject: Re: Into GDB References: From: Jim Blandy Date: Wed, 30 Aug 2006 18:50:00 -0000 In-Reply-To: (Rajesh Warange's message of "Wed, 30 Aug 2006 11:37:27 +0530") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-08/txt/msg00250.txt.bz2 "Rajesh Warange" writes: > I 'm very much new to GDB. My final goal is to change GDB for a native > chipset of ours. > I need some pointers from you in the right direction. > > 1. I wanted to know the "chain of functions" followed by GDB when we > just type "gdb" on the command-prompt. > 2. also the "chain of functions" when we give commands like step or > breakpoint etc. > > I 'm reading GDB Internals. But its not helping me much in this regard. > Please help. We have a manual on the internals of GDB in doc/gdbint.texinfo; it's not structured as a tutorial, however. I wouldn't recommend starting with 'main' and trying to see everything that happens. GDB is a large, old program, and you'll waste a lot of time trying to figure out stuff you don't need to change: at this point, GDB has been ported to dozens and dozens of different chips, so the chip-specific code is pretty nicely isolated in the *-tdep.c files. I would recommend finding a *-tdep.c file that seems relatively small and straightforward, and starting your work from that. Each foo-tdep.c file has a function at the end called _initialize_foo_tdep that is automatically called by GDB at startup; that registers a function called foo_gdbarch_init, which usually appears immediately above it. That registers callback functions for all the architecture-specific operations GDB uses.