From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 5C4293857808 for ; Sun, 15 Nov 2020 18:05:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5C4293857808 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id A7A021E552; Sun, 15 Nov 2020 13:05:44 -0500 (EST) Subject: Re: How can I implement new breakpoint commands To: Nagmat Nazar , "gdb@sourceware.org" References: From: Simon Marchi Message-ID: <6d10944a-137d-3bac-6212-cd126f9128ff@simark.ca> Date: Sun, 15 Nov 2020 13:05:44 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Nov 2020 18:05:46 -0000 On 2020-11-14 10:25 p.m., Nagmat Nazar wrote: > Dear Simon Marchi, > > Yeah I can handle that using breakpoint conditions for now, but I would like to improve it for my research. So, How can I add new commands on GDB? In which file shall I start coding? > > Kind regards, > Nagmat Hi Nagmat, Please keep the list in CC when participating in a discussion on a mailing list. The commands are added in the _initialize_* functions in various files. For example, here's where the "break" command is created: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/breakpoint.c;h=23278320d9d465943bf94ec2c35a5a1438c45f2a;hb=b74dbc2093191b10f4963f43ee570b54c9593404#l15802 Simon