From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Yates Newsgroups: gmane.emacs.help Subject: Re: highlight current source line during debugging Date: Tue, 5 Feb 2013 08:56:38 -0600 Message-ID: References: <87k3qndq98.fsf@rosalinde.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1360076663 10867 80.91.229.3 (5 Feb 2013 15:04:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Feb 2013 15:04:23 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Stephen Berman Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 05 16:04:44 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U2k4g-0008Ax-MS for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Feb 2013 16:04:42 +0100 Original-Received: from localhost ([::1]:38057 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2k4O-0004dp-05 for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Feb 2013 10:04:24 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:48921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2k4C-0004aK-H8 for help-gnu-emacs@gnu.org; Tue, 05 Feb 2013 10:04:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U2k45-0000iB-BF for help-gnu-emacs@gnu.org; Tue, 05 Feb 2013 10:04:12 -0500 Original-Received: from mail-wi0-f174.google.com ([209.85.212.174]:40521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2k45-0000i0-2b for help-gnu-emacs@gnu.org; Tue, 05 Feb 2013 10:04:05 -0500 Original-Received: by mail-wi0-f174.google.com with SMTP id hi8so3815263wib.7 for ; Tue, 05 Feb 2013 07:04:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=3oa6tXrp2SwZa+aPEzbdC6cdznTioW+d2r2SI1pZpqA=; b=dCppIxmCDT7wYTVRRW1ggPt0ModIb3fWBTwztHZbKk9yuM691ThlVvgeocl20uQSLW 41c9MD7H4TeEHLvg14mNp88L/AMLqtD7/MrVac/2JKEyO3/6rPmkVnceXDkUYdJh8bcm cLTJoq7Zf0/W6DNppL8bQMHLOI3ybgyLvZIcUV7nZjzfXSHYRPwnWZuYOhtfa4YMlCAg 2aYMrdt6yOPZkfmWCJlOuK9PtdryNQQseo0Gv9Vc5TlfhYt9LSwVgZlk3qVIw9XbOgeG ZbIs9ZbDFmbbK/zI66DhTSeibY3KGMQ0QiL5WqVXMIaXUzpd8kKDBXw8g7eUT24+Onvs qJaw== X-Received: by 10.180.93.41 with SMTP id cr9mr17743562wib.19.1360076198571; Tue, 05 Feb 2013 06:56:38 -0800 (PST) Original-Received: by 10.194.175.164 with HTTP; Tue, 5 Feb 2013 06:56:38 -0800 (PST) In-Reply-To: <87k3qndq98.fsf@rosalinde.fritz.box> X-Google-Sender-Auth: SVDdnmYxpKfX18H183gILUjiP8c X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.212.174 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:88961 Archived-At: Hi Stephen, Thanks for this suggestion. To implement it seems to require that one know the name of the elisp function which places the overlay arrow. I have been having a hard time figuring this out for gdb disassembly buffers. Performing cleanup based on an event in the buffer seems fragile. Would it not be better to hook buffer destruction? Finally, does this technique keep the line high lighted even when the buffer is not selected? In a normal debugging session it is the buffer with the gdb prompt that is selected most of the time. /john On Tue, Feb 5, 2013 at 4:11 AM, Stephen Berman wrote: > On Mon, 4 Feb 2013 17:21:18 -0500 John Yates wrote: > >> When debugging I get a small triangular arrow in the left fringe. >> Especially when stepping through disassembled machine instructions it >> would be a big help to have the entire current line high lighted in >> some fashion. Can anyone suggest a solution? > > A useful package for this is hl-line. How you use it might depend on > what kind of program you are debugging and what debugger you are using. > As an example, here's how you could get it for Emacs Lisp code using Edebug: > > (defadvice edebug-overlay-arrow (around highlight-line activate) > "Highlight line currently being edebugged." > (require 'hl-line) > (hl-line-mode) > ad-do-it) > > (defun my-edebug-quit () > "Stop edebugging and remove highlighting." > (interactive) > (hl-line-mode -1) > (top-level)) > > (define-key edebug-mode-map [remap top-level] 'my-edebug-quit) > > HTH > > Steve Berman