From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70124 invoked by alias); 26 Mar 2015 18:32:13 -0000 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 Received: (qmail 70114 invoked by uid 89); 26 Mar 2015 18:32:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-oi0-f47.google.com Received: from mail-oi0-f47.google.com (HELO mail-oi0-f47.google.com) (209.85.218.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 26 Mar 2015 18:32:12 +0000 Received: by oiag65 with SMTP id g65so56848969oia.2 for ; Thu, 26 Mar 2015 11:32:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=zR7OG1LC+Lqi4yIhN4dAY2kffHqNebgThGRRsLGLCq4=; b=SceB9BY7rHpbO0Umx1Uqhy8wKCW7mzlJD2XVDr6flfavmJM7lsNhetq9URun4hTie6 FrgHC5p/9s98gj7CJ/e1lAwHjtz/Zd+fHrraX6+4rAILZI1ZdGeQQODhJcMbuwGgUNmv V6vj7mqLZ02G7wQ89Yf2VTymScQCBFfG26bQscAvNej7K0XkC8BD5GVoAkAYIB/DKcP5 AYuojwaYkfYjd/U7Qskuc9vT0DR/zSj/47pkDJFjMF4o6H+PE2L1kid9W0cD7gt7yJk6 vL7Vu5vTeZJdW5hg55IR89QMgjs3PspVW9wshhT1oOxJy2nENzUCbX6NUEAJgY4oXcJa ljCg== X-Gm-Message-State: ALoCoQlA0paiVh0GHLqsQxz5nzpUlmEDyU6/ksgFJQvOY9rK23UpRb94uTUmHCzCbOOkxivvbMLV MIME-Version: 1.0 X-Received: by 10.202.232.65 with SMTP id f62mr12608492oih.116.1427394730056; Thu, 26 Mar 2015 11:32:10 -0700 (PDT) Received: by 10.182.142.226 with HTTP; Thu, 26 Mar 2015 11:32:09 -0700 (PDT) In-Reply-To: References: Date: Thu, 26 Mar 2015 18:32:00 -0000 Message-ID: Subject: Re: How to add a new command? From: Doug Evans To: Fei Ding Cc: "gdb@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00103.txt.bz2 On Wed, Mar 25, 2015 at 7:59 PM, Fei Ding wrote: > Hi all: > > I want to add a new command to GDB based on my team's requirement, > like `(gdb) auto-check [input file]` , but I found it a litter bit > difficult to find related source code. I guess GDB should initialize > all command at some place, and I plan to learn from it first. Any > body familiar with this? I just need some files' names of source code > ,maybe function names is even more useful. Another alternative is to write it in Python or Scheme: [assuming your gdb is configured with their support] https://sourceware.org/gdb/current/onlinedocs/gdb/Commands-In-Python.html#Commands-In-Python https://sourceware.org/gdb/current/onlinedocs/gdb/Commands-In-Guile.html#Commands-In-Guile