From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lucius Fox Newsgroups: gmane.emacs.help Subject: Re: How can I specify emacs to use a specified gdb with command parameters Date: Fri, 20 Mar 2009 23:05:21 -0700 Message-ID: <528a76e70903202305je24c60ei53f436a37225bc2@mail.gmail.com> References: <528a76e70903191827s7ea90e4dicf657f3910aaf841@mail.gmail.com> <528a76e70903192247v49693f8fx2bbc12f32cbc9557@mail.gmail.com> <528a76e70903192323g23505882te25c60a62b973ae@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1237615557 3874 80.91.229.12 (21 Mar 2009 06:05:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Mar 2009 06:05:57 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: David L Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 21 07:07:14 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LkuMT-0002Yj-FO for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Mar 2009 07:07:13 +0100 Original-Received: from localhost ([127.0.0.1]:35458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LkuL6-0002Vy-Q4 for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Mar 2009 02:05:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LkuKn-0002Vj-4Q for help-gnu-emacs@gnu.org; Sat, 21 Mar 2009 02:05:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LkuKi-0002R8-MN for help-gnu-emacs@gnu.org; Sat, 21 Mar 2009 02:05:28 -0400 Original-Received: from [199.232.76.173] (port=58067 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LkuKi-0002Qy-Jh for help-gnu-emacs@gnu.org; Sat, 21 Mar 2009 02:05:24 -0400 Original-Received: from wa-out-1112.google.com ([209.85.146.181]:41025) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LkuKi-00083u-3t for help-gnu-emacs@gnu.org; Sat, 21 Mar 2009 02:05:24 -0400 Original-Received: by wa-out-1112.google.com with SMTP id j40so737143wah.26 for ; Fri, 20 Mar 2009 23:05:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=cedThHm8WOYjr5xL+lXGr7M+xrOaZMmEPYuhxO9V1M8=; b=Z8nFFwXNPIPA46SWGKF+3F8SG+SWOoZcQ9AynRP551ZobUktr4OvLssamw2yHpHKOe vEEjFfqRGPowyPGJMyimXW9br5s2WPBVxuEq8Pr2PhGiHekLqyGZON38DRqtk3eX5WXG UJgCmGKzZohIrxehZAZvlneITegh6etILC0r0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=rw56dxcUT+JXpFw4TO961UCmQN4ZP0dIeEbCxxYGhXXqHTi3IY7Q6n+lDedeNPo9Cq +10otmnDWrmMIdwJpkUwvqNZQV1aoxF1Y2oub0GCtN0vYrAHn+5Z1WcJbQDk067jav1w yt1eDpKglriKbhzQ/NqJAlB4oNIxVXNHSeH28= Original-Received: by 10.114.154.1 with SMTP id b1mr2995996wae.77.1237615521028; Fri, 20 Mar 2009 23:05:21 -0700 (PDT) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:63154 Archived-At: Right now, I need to do this at a shell in order to remote debug a c++ prog= ram. $ cd /Volumne/workingdirectory $ source ./build/envsetup.sh $ gdb attach $pid How can I repeat the same steps in emacs gdb? After I type M-x gdb, i enter 'gdb attach $pid' , it just said 'gdb' command not found . My gdb location is setup by the script build/envsetup.sh. Thank you for any help. On Fri, Mar 20, 2009 at 6:38 AM, David L wrote: > On Thu, Mar 19, 2009 at 11:23 PM, Lucius Fox wrote: >> Thanks. >> >> Another question I have is >> * how does emacs knows where to pulll the source code during debugging? > > I think it learns it from gdb. =A0gdb learns if from the debugging symbol= s in > the executable. =A0I think there is some interaction with some emacs sett= ings > because I've had situations where I've been unable to insert a breakpoint > in a file by clicking in the left margin, but emacs has been able to brin= g > me to the right line when gdb stops at a breakpoint inserted the old > fashion way. > >> * after i open a file, how can I setup a break point at a particular lin= e? > If gdb is active and emacs and gdb agree that the file you've opened > is a source file (usually, but not always true in my experience), you can > just left click in the left margin. > > I'm responding on-list to this because other people might be able > to give better answers. > > Good luck, > > =A0 =A0 =A0 =A0 =A0 Dave > > >> >> On Thu, Mar 19, 2009 at 10:58 PM, David L wrote: >>> On Thu, Mar 19, 2009 at 10:47 PM, Lucius Fox =A0wrote: >>>> David, >>>> >>>> Thank you for your response. >>>> Is there a way to specify what my gdb command (like in your example, >>>> put '/tmp/mygdb --annotate=3D3 /tmp/myexec') =A0in .emacs file? So tha= t it >>>> does not prompt me everytime I use M-x gdb? >>> >>> I do something like this in my .emacs: >>> >>> (defun my-gdb () >>> =A0(interactive) >>> =A0(setq gdb-many-windows nil) >>> =A0(setq gdb-use-separate-io-buffer nil) >>> =A0(tool-bar-mode t) >>> =A0(set-fringe-mode 'default) >>> =A0(gdb "/tmp/mygdb --annotate=3D3")) >>> >>> Then I assign a key to run my-gdb >>> >>> (global-set-key [C-f7] =A0'my-gdb) >>> >>> >>> Cheers... >>> >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0Dave >>> >> >