From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: "otadmor ." Newsgroups: gmane.emacs.help Subject: Re: Executing Emacs commands when a gdb breakpoint is hit Date: Wed, 22 Jan 2020 21:55:29 +0200 Message-ID: References: <83o8uwvekv.fsf@gnu.org> <831rrrv2vq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="118673"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 22 20:56:37 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iuM7B-000Uq7-Mq for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 22 Jan 2020 20:56:37 +0100 Original-Received: from localhost ([::1]:46344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuM7A-0004Me-OF for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 22 Jan 2020 14:56:36 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49058) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuM6m-0004MV-AE for help-gnu-emacs@gnu.org; Wed, 22 Jan 2020 14:56:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iuM6l-0001OC-70 for help-gnu-emacs@gnu.org; Wed, 22 Jan 2020 14:56:12 -0500 Original-Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]:45415) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iuM6R-0001Bg-0s; Wed, 22 Jan 2020 14:55:51 -0500 Original-Received: by mail-lf1-x12e.google.com with SMTP id 203so499897lfa.12; Wed, 22 Jan 2020 11:55:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gjyqqn3UaESkCB/a6alPEIU6/giw9Y3T0gb9eSI3n9I=; b=Bn7L2Dk3rzAxrhW+wqoo7xKINrSmFt2dtEzQdHW+CQmWEaPSeMgGIVaWM74y7UYI/C 4b0dXAWNb9RTZDs7/AntrgFwmaZ+GlZsAdmA6rYd7khbPcZrH4POU0KlNLG2KQ20dwsN +EhK99y/BrCqFrDel5SZfDPc1E8NASkYU2ei44v+3sCc3bj07ai9wy/5jb1v+mkb1nBO JHCzgugXStg4VsAbYIU+AWwl/WRf+4B+Z0jHXqgsuRoZmXqyMcrrCoxGNJnc28FshtcR HGjDa7q+U0Itmqj4DpWoxNmhw36MdNGTYOSmAY/5DxaG/sLyUV24GD5Qo3WiqH6j+i20 GjZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gjyqqn3UaESkCB/a6alPEIU6/giw9Y3T0gb9eSI3n9I=; b=dZUF1BxWccE+QRq5XSA1j/gzbfFnb/Ie4HCEVHRa6oQooADD7CNp8J+Ilj1oh0rR3T l4xfY7dKf0jZCDTg9pNQRNWQueBU5AEEOlp1OFRmfz6DedX3SrcQt1BU11BZvJl9CGjw YLaxxA4gWzdX00UDF/OUH3IxA+pp6VYF/5Gf94Yl1CUOndSTyIefwE7RzHwtIAyxNGUs SAgRc9WJuPl/96Cb5SgXJAg6jogSpp1GzEdEY8ymUSfW948bu0mSKtl0ImU9s8h7tdJ9 hLuD3c0Rk2RTe5UXhbSHL5DS7iHdSYaVurraFvPpyFWywYdBYs5KQqh1DP3OKppf7xcP nlHg== X-Gm-Message-State: APjAAAWGdLB8MQjTZ14Y+n4a2hsNdmmIEkflrrBxgi4I774BL7sHHcOg DBumORnjNG+VpGeT18qcdmO7ih6lM/Lb8OcOLOwSYZok X-Google-Smtp-Source: APXvYqzSRTqA+Dzk5FVmz7W7S1hErTfHZW6KZIZnsw94qkYEjYNDaPjB3LjR/AEFYfCmqAVscfrbJ+NvtDqTVHCyrq4= X-Received: by 2002:a19:c192:: with SMTP id r140mr2639960lff.113.1579722947869; Wed, 22 Jan 2020 11:55:47 -0800 (PST) In-Reply-To: <831rrrv2vq.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::12e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:122260 Archived-At: I would like to suggest a bit different approach. I have a code allowing auto-completions from external programs running inside a comint buffer. It uses epc server running in emacs (elisp) and python-epc client. It allows me to complete, for example, gdb commands for the gdb running inside the comint buffer. The same code can call other server methods to notify a gdb stop event. The python code is loaded automatically into gdb using ~/.gdbinit, and the elisp code is stored in ~/.emacs.d. The completion code supports auto-complete, company and complete-at-point frontends and support python and frida backends. It seems easy to add the support for gdb stop events and I actually planned on doing it in the future when I will have time, I just dont have the time :-) On Wed, Jan 22, 2020 at 7:05 PM Eli Zaretskii wrote: > > > From: Skip Montanaro > > Date: Wed, 22 Jan 2020 07:48:17 -0600 > > Cc: Help GNU Emacs > > > > Now, is it possible to trigger an Emacs Lisp function of some sort when a GDB > > breakpoint is hit? I see the gdb-stopped-functions variable. This simple function seems to execute when my > > compiler_set_lineno breakpoint is hit: > > > > (defun stopped (reason) > > (message "%s" reason)) > > > > (setq gdb-stopped-functions '(stopped)) > > So you already have the answer to that question: gdb-stopped-functions. > > > I tried sticking in a short sleep, but that didn't help. Is there a way to force the *gud-python* to be ready for > > user input before calling get-gdb-value? > > I don't think I understand what you are trying to do and what are the > difficulties, sorry. > -- Gretz, Ofir Tadmor ICQ: 77685691 Mail: otadmor@gmail.com