From MAILER-DAEMON Fri Jun 15 16:32:51 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfdCN-0008OY-Rr
	for mharc-gdb@gnu.org; Fri, 15 Jun 2012 16:32:51 -0400
Received: from eggs.gnu.org ([208.118.235.92]:51837)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bounces@nabble.com>) id 1SfSLm-0005ho-34
	for Gdb@gnu.org; Fri, 15 Jun 2012 04:57:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bounces@nabble.com>) id 1SfSLk-0007K7-4H
	for Gdb@gnu.org; Fri, 15 Jun 2012 04:57:49 -0400
Received: from sam.nabble.com ([216.139.236.26]:45690)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bounces@nabble.com>) id 1SfSLj-0007K2-W6
	for Gdb@gnu.org; Fri, 15 Jun 2012 04:57:48 -0400
Received: from telerig.nabble.com ([192.168.236.162])
	by sam.nabble.com with esmtp (Exim 4.72)
	(envelope-from <bounces@nabble.com>) id 1SfSLi-0006Gx-IZ
	for Gdb@gnu.org; Fri, 15 Jun 2012 01:57:46 -0700
Message-ID: <34016836.post@talk.nabble.com>
Date: Fri, 15 Jun 2012 01:57:46 -0700 (PDT)
From: somersetgraham <graham.labdon@avalonsciences.com>
To: Gdb@gnu.org
Subject: gdb and python
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Nabble-From: graham.labdon@avalonsciences.com
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 216.139.236.26
X-Mailman-Approved-At: Fri, 15 Jun 2012 16:32:50 -0400
X-BeenThere: gdb@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Discussion list for gdb, the GNU source debugger." <gdb.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/gdb>,
	<mailto:gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/gdb>
List-Post: <mailto:gdb@gnu.org>
List-Help: <mailto:gdb-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gdb>,
	<mailto:gdb-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 15 Jun 2012 08:57:54 -0000


Hi
I have just started using a python enabled gdb with Qt code and eclipse.
At times gdb(7.4) crashes when the variables window is displayed. I think
this must be something to do with gsb not knowing what type a variable is.

Has anyone else experienced this and is there a fix?

Thanks

Graham
-- 
View this message in context: http://old.nabble.com/gdb-and-python-tp34016836p34016836.html
Sent from the Gnu - gdb - General mailing list archive at Nabble.com.



From MAILER-DAEMON Wed Jun 20 15:18:38 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShQQI-0004W2-Av
	for mharc-gdb@gnu.org; Wed, 20 Jun 2012 15:18:38 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47141)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <plantz@cds1.net>) id 1ShOrY-0002iF-0h
	for gdb@gnu.org; Wed, 20 Jun 2012 13:38:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <plantz@cds1.net>) id 1ShOrW-0002Yn-6I
	for gdb@gnu.org; Wed, 20 Jun 2012 13:38:39 -0400
Received: from mail.cds1.net ([209.204.131.36]:40236)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <plantz@cds1.net>) id 1ShOrV-0002YW-Uv
	for gdb@gnu.org; Wed, 20 Jun 2012 13:38:38 -0400
Received: from [192.168.1.101] (23-24-206-43-static.hfc.comcastbusiness.net
	[23.24.206.43]) by mail.cds1.net (Postfix) with ESMTP id C258FE899A59
	for <gdb@gnu.org>; Wed, 20 Jun 2012 10:38:30 -0700 (PDT)
Message-ID: <4FE20A95.2060509@cds1.net>
Date: Wed, 20 Jun 2012 10:38:29 -0700
From: Bob Plantz <plantz@cds1.net>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:12.0) Gecko/20120430 Thunderbird/12.0.1
MIME-Version: 1.0
To: gdb@gnu.org
Subject: Breakpoint on first instruction in program
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 209.204.131.36
X-Mailman-Approved-At: Wed, 20 Jun 2012 15:18:36 -0400
X-BeenThere: gdb@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: plantz@ieee.org
List-Id: "Discussion list for gdb, the GNU source debugger." <gdb.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/gdb>,
	<mailto:gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/gdb>
List-Post: <mailto:gdb@gnu.org>
List-Help: <mailto:gdb-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gdb>,
	<mailto:gdb-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Jun 2012 17:38:44 -0000

I am using the following assembly language program (doNothingProg.s) for 
instruction purposes:

         .text
         .globl  main
         .type   main, @function
main:
         pushq   %rbp        # save caller's frame pointer
         movq    %rsp, %rbp  # establish our frame pointer
         movl    $0, %eax    # return 0 to caller
         movq    %rbp, %rsp  # restore stack pointer
         popq    %rbp        # restore caller's frame pointer
         ret                 # back to caller

I want to set a breakpoint at the first instruction (pushq %rbp) so 
students can see how the stack frame is created.

I am running Ubuntu 12.04.

Under a previous version ( GNU gdb 6.8-debian) I could do this.
Under the current version (GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 
7.4-2012.04) when I set the breakpoint on that line then run the 
program, it actually breaks at the third instruction (movl $0, %eax).

I understand that the first two instructions are the prologue to the 
actual "work" of this function, and since gdb is intended for higher 
level languages, but it is possible to make a mistake in the prologue in 
assembly language.

Is there any way to get gdb to honor my request for a breakpoint on the 
first instruction of the program? Again, my main goal here is to allow 
students to single step through the stack frame set up.

--Bob Plantz



From MAILER-DAEMON Wed Jun 20 16:39:16 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShRgK-0008Ey-C8
	for mharc-gdb@gnu.org; Wed, 20 Jun 2012 16:39:16 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37224)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <adam@irvine.com>) id 1ShRgI-0008ET-9v
	for gdb@gnu.org; Wed, 20 Jun 2012 16:39:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <adam@irvine.com>) id 1ShRgG-0001TN-NK
	for gdb@gnu.org; Wed, 20 Jun 2012 16:39:13 -0400
Received: from larry-rp.irvine.com ([66.126.103.122]:62737
	helo=mailhub.irvine.com) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <adam@irvine.com>) id 1ShRgG-0001Sr-FW
	for gdb@gnu.org; Wed, 20 Jun 2012 16:39:12 -0400
Received: from irvine.com (shrike.irvine.com [192.160.8.7])
	by mailhub.irvine.com (Postfix) with ESMTP id BFCF5A8C858;
	Wed, 20 Jun 2012 13:39:08 -0700 (PDT)
To: plantz@ieee.org
Subject: Re: Breakpoint on first instruction in program 
In-Reply-To: Your message of "Wed, 20 Jun 2012 10:38:29 PDT."
	<4FE20A95.2060509@cds1.net> 
Date: Wed, 20 Jun 2012 13:39:07 -0700
From: Adam Beneschan <adam@irvine.com>
Message-Id: <20120620203908.BFCF5A8C858@mailhub.irvine.com>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-Received-From: 66.126.103.122
Cc: gdb@gnu.org
X-BeenThere: gdb@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Discussion list for gdb, the GNU source debugger." <gdb.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/gdb>,
	<mailto:gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/gdb>
List-Post: <mailto:gdb@gnu.org>
List-Help: <mailto:gdb-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gdb>,
	<mailto:gdb-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Jun 2012 20:39:15 -0000

 
> I am using the following assembly language program (doNothingProg.s) for 
> instruction purposes:
> 
>          .text
>          .globl  main
>          .type   main, @function
> main:
>          pushq   %rbp        # save caller's frame pointer
>          movq    %rsp, %rbp  # establish our frame pointer
>          movl    $0, %eax    # return 0 to caller
>          movq    %rbp, %rsp  # restore stack pointer
>          popq    %rbp        # restore caller's frame pointer
>          ret                 # back to caller
> 
> I want to set a breakpoint at the first instruction (pushq %rbp) so 
> students can see how the stack frame is created.

break *&main

                                -- Adam



From MAILER-DAEMON Wed Jun 20 17:28:50 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShSSI-0008Qb-Nr
	for mharc-gdb@gnu.org; Wed, 20 Jun 2012 17:28:50 -0400
Received: from eggs.gnu.org ([208.118.235.92]:46068)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <iurcic@gmail.com>) id 1ShSSG-0008Q5-4v
	for gdb@gnu.org; Wed, 20 Jun 2012 17:28:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <iurcic@gmail.com>) id 1ShSSE-0005hr-9r
	for gdb@gnu.org; Wed, 20 Jun 2012 17:28:47 -0400
Received: from mail-gh0-f169.google.com ([209.85.160.169]:56349)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <iurcic@gmail.com>) id 1ShSSE-0005eJ-1d
	for gdb@gnu.org; Wed, 20 Jun 2012 17:28:46 -0400
Received: by ghrr18 with SMTP id r18so7025647ghr.0
	for <gdb@gnu.org>; Wed, 20 Jun 2012 14:28:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=As0Z4cQtAeGR9LispnJ46GLqCXeZySx0VxM0UiHZGWA=;
	b=VrFElHKnazKFTmBzK2kOQuHTv99XrawFkfTf0++umHLkQbnrpgIhnoDAOaQcYPWzIw
	zXw6q4QrSX5fp/MMjUD7vdLRHivaKTpcZnBl+C2zR8ye5KUIh/1vNIX9myt1KT4Q0cJ9
	8D2xjj8bWo7uGK8wo7CLjJ3bZJ8wQEd6XNOWo1gSBprTigTQJBcIOMoip1Mx05NFuLbx
	GTv8x8fhmdgW1mQ0JzYsOJU6yQFT1ux/ut8h7+kDztY/8R80zTpLIdMw+AiLhQGwVHa0
	aTsvObynuDBXeWhEkVRtZv39OGf0jT0xNyDQ/RCdBhgqRF4+MD24slFeQqwPCnjTQfrv
	8Yqw==
MIME-Version: 1.0
Received: by 10.50.149.170 with SMTP id ub10mr5975034igb.38.1340227723398;
	Wed, 20 Jun 2012 14:28:43 -0700 (PDT)
Received: by 10.64.101.164 with HTTP; Wed, 20 Jun 2012 14:28:43 -0700 (PDT)
In-Reply-To: <20120620203908.BFCF5A8C858@mailhub.irvine.com>
References: <4FE20A95.2060509@cds1.net>
	<20120620203908.BFCF5A8C858@mailhub.irvine.com>
Date: Wed, 20 Jun 2012 22:28:43 +0100
Message-ID: <CAFpdKSDX4HK5YTWpTUmwhNn86cv9mOwg7EQP9ng9=YLyNVBX4g@mail.gmail.com>
Subject: Re: Breakpoint on first instruction in program
From: Iurie <iurcic@gmail.com>
To: Adam Beneschan <adam@irvine.com>
Content-Type: multipart/alternative; boundary=e89a8f3ba3095f0eef04c2ee15d0
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.160.169
Cc: plantz@ieee.org, gdb@gnu.org
X-BeenThere: gdb@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Discussion list for gdb, the GNU source debugger." <gdb.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/gdb>,
	<mailto:gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/gdb>
List-Post: <mailto:gdb@gnu.org>
List-Help: <mailto:gdb-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gdb>,
	<mailto:gdb-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Jun 2012 21:28:49 -0000

--e89a8f3ba3095f0eef04c2ee15d0
Content-Type: text/plain; charset=ISO-8859-1

that is the gdb command?

On 20 June 2012 21:39, Adam Beneschan <adam@irvine.com> wrote:

>
> > I am using the following assembly language program (doNothingProg.s) for
> > instruction purposes:
> >
> >          .text
> >          .globl  main
> >          .type   main, @function
> > main:
> >          pushq   %rbp        # save caller's frame pointer
> >          movq    %rsp, %rbp  # establish our frame pointer
> >          movl    $0, %eax    # return 0 to caller
> >          movq    %rbp, %rsp  # restore stack pointer
> >          popq    %rbp        # restore caller's frame pointer
> >          ret                 # back to caller
> >
> > I want to set a breakpoint at the first instruction (pushq %rbp) so
> > students can see how the stack frame is created.
>
> break *&main
>
>                                -- Adam
>
>
>

--e89a8f3ba3095f0eef04c2ee15d0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

that is the gdb command?<br><br><div class=3D"gmail_quote">On 20 June 2012 =
21:39, Adam Beneschan <span dir=3D"ltr">&lt;<a href=3D"mailto:adam@irvine.c=
om" target=3D"_blank">adam@irvine.com</a>&gt;</span> wrote:<br><blockquote =
class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid=
;padding-left:1ex">
<div class=3D"im"><br>
&gt; I am using the following assembly language program (doNothingProg.s) f=
or<br>
&gt; instruction purposes:<br>
&gt;<br>
&gt; =A0 =A0 =A0 =A0 =A0.text<br>
&gt; =A0 =A0 =A0 =A0 =A0.globl =A0main<br>
&gt; =A0 =A0 =A0 =A0 =A0.type =A0 main, @function<br>
&gt; main:<br>
&gt; =A0 =A0 =A0 =A0 =A0pushq =A0 %rbp =A0 =A0 =A0 =A0# save caller&#39;s f=
rame pointer<br>
&gt; =A0 =A0 =A0 =A0 =A0movq =A0 =A0%rsp, %rbp =A0# establish our frame poi=
nter<br>
&gt; =A0 =A0 =A0 =A0 =A0movl =A0 =A0$0, %eax =A0 =A0# return 0 to caller<br=
>
&gt; =A0 =A0 =A0 =A0 =A0movq =A0 =A0%rbp, %rsp =A0# restore stack pointer<b=
r>
&gt; =A0 =A0 =A0 =A0 =A0popq =A0 =A0%rbp =A0 =A0 =A0 =A0# restore caller&#3=
9;s frame pointer<br>
&gt; =A0 =A0 =A0 =A0 =A0ret =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # back to calle=
r<br>
&gt;<br>
&gt; I want to set a breakpoint at the first instruction (pushq %rbp) so<br=
>
&gt; students can see how the stack frame is created.<br>
<br>
</div>break *&amp;main<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-- Adam<br>
<br>
<br>
</font></span></blockquote></div><br>

--e89a8f3ba3095f0eef04c2ee15d0--


From MAILER-DAEMON Wed Jun 20 17:34:01 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShSXJ-0003et-CI
	for mharc-gdb@gnu.org; Wed, 20 Jun 2012 17:34:01 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55707)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <adam@irvine.com>) id 1ShSXF-0003cS-Q5
	for gdb@gnu.org; Wed, 20 Jun 2012 17:33:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <adam@irvine.com>) id 1ShSXE-0007fG-3T
	for gdb@gnu.org; Wed, 20 Jun 2012 17:33:57 -0400
Received: from larry-rp.irvine.com ([66.126.103.122]:64335
	helo=mailhub.irvine.com) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <adam@irvine.com>) id 1ShSXD-0007eX-S0
	for gdb@gnu.org; Wed, 20 Jun 2012 17:33:56 -0400
Received: from irvine.com (shrike.irvine.com [192.160.8.7])
	by mailhub.irvine.com (Postfix) with ESMTP id 626FCA8C858;
	Wed, 20 Jun 2012 14:33:53 -0700 (PDT)
To: Iurie <iurcic@gmail.com>
Subject: Re: Breakpoint on first instruction in program 
In-Reply-To: Your message of "Wed, 20 Jun 2012 22:28:43 BST."
	<CAFpdKSDX4HK5YTWpTUmwhNn86cv9mOwg7EQP9ng9=YLyNVBX4g@mail.gmail.com> 
Date: Wed, 20 Jun 2012 14:33:51 -0700
From: Adam Beneschan <adam@irvine.com>
Message-Id: <20120620213353.626FCA8C858@mailhub.irvine.com>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-Received-From: 66.126.103.122
Cc: plantz@ieee.org, gdb@gnu.org
X-BeenThere: gdb@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Discussion list for gdb, the GNU source debugger." <gdb.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/gdb>,
	<mailto:gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/gdb>
List-Post: <mailto:gdb@gnu.org>
List-Help: <mailto:gdb-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gdb>,
	<mailto:gdb-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Jun 2012 21:33:59 -0000

 
break *&main

> that is the gdb command?

Yes.  "break main" will break at the instruction past the prologue,
but "break *&main" just uses &main, which is the address of main, as
the breakpoint address.  I've tested this, but I can't say for certain
it will work with every version of gdb.

                                -- Adam


From MAILER-DAEMON Wed Jun 20 17:47:31 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShSkN-0003QX-Oo
	for mharc-gdb@gnu.org; Wed, 20 Jun 2012 17:47:31 -0400
Received: from eggs.gnu.org ([208.118.235.92]:49871)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <iurcic@gmail.com>) id 1ShSkL-0003Q5-FU
	for gdb@gnu.org; Wed, 20 Jun 2012 17:47:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <iurcic@gmail.com>) id 1ShSkJ-0002xo-PR
	for gdb@gnu.org; Wed, 20 Jun 2012 17:47:29 -0400
Received: from mail-gh0-f169.google.com ([209.85.160.169]:48462)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <iurcic@gmail.com>) id 1ShSkJ-0002xf-Ir
	for gdb@gnu.org; Wed, 20 Jun 2012 17:47:27 -0400
Received: by ghrr18 with SMTP id r18so7040511ghr.0
	for <gdb@gnu.org>; Wed, 20 Jun 2012 14:47:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=6jA3QJS87jdRqvYv/J/M2i4mddqakwc9ZY/La/lk8gA=;
	b=MfQp2ecQsF3vCkOwDJQliSS1Zq1bN4kLq8cAn0kenkVv1hHsA4flGT3H3FlOJrXwA5
	NC9ORYtnsiwKHI7M2YhbMRGI8j4pk2lQ9+aFPM0GuolVD9cLT/wiWVeiVixB0Xu6ZyGL
	+BDL1rFEZJTxAZrPkV9bNDVHjn5C1orkRBtZgi+y0SE/Y93XFCVmI1soyHjg258MH/8c
	1lQdWhuHTXBR/vloJMjNfhnqcvdrBY2REXWC0q72xU3fNb0R4YvjkmKDJi4r4wvP/lCB
	J7yk5YvK9AKiWy53rwkHIZ4wmLC75BgFC/c1LWDNIT37qMYq8u0XnuPoVOfk3VPDDVwr
	0yxA==
MIME-Version: 1.0
Received: by 10.43.106.147 with SMTP id du19mr11910947icc.56.1340228845531;
	Wed, 20 Jun 2012 14:47:25 -0700 (PDT)
Received: by 10.64.101.164 with HTTP; Wed, 20 Jun 2012 14:47:25 -0700 (PDT)
In-Reply-To: <20120620213353.626FCA8C858@mailhub.irvine.com>
References: <CAFpdKSDX4HK5YTWpTUmwhNn86cv9mOwg7EQP9ng9=YLyNVBX4g@mail.gmail.com>
	<20120620213353.626FCA8C858@mailhub.irvine.com>
Date: Wed, 20 Jun 2012 22:47:25 +0100
Message-ID: <CAFpdKSDu+EfwX_0B4CW3yKCG27eCKeiHj1ZDqP2qmvvmWvCdNQ@mail.gmail.com>
Subject: Re: Breakpoint on first instruction in program
From: Iurie <iurcic@gmail.com>
To: Adam Beneschan <adam@irvine.com>
Content-Type: multipart/alternative; boundary=20cf30334d314170e904c2ee583a
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.160.169
Cc: plantz@ieee.org, gdb@gnu.org
X-BeenThere: gdb@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Discussion list for gdb, the GNU source debugger." <gdb.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/gdb>,
	<mailto:gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/gdb>
List-Post: <mailto:gdb@gnu.org>
List-Help: <mailto:gdb-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gdb>,
	<mailto:gdb-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Jun 2012 21:47:30 -0000

--20cf30334d314170e904c2ee583a
Content-Type: text/plain; charset=ISO-8859-1

thanks for the answer, and after that how do i see how the stack frame is
created.?

On 20 June 2012 22:33, Adam Beneschan <adam@irvine.com> wrote:

>
> break *&main
>
> > that is the gdb command?
>
> Yes.  "break main" will break at the instruction past the prologue,
> but "break *&main" just uses &main, which is the address of main, as
> the breakpoint address.  I've tested this, but I can't say for certain
> it will work with every version of gdb.
>
>                                -- Adam
>

--20cf30334d314170e904c2ee583a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

thanks for the answer, and after that how do i see how the stack frame is c=
reated.?<br><br><div class=3D"gmail_quote">On 20 June 2012 22:33, Adam Bene=
schan <span dir=3D"ltr">&lt;<a href=3D"mailto:adam@irvine.com" target=3D"_b=
lank">adam@irvine.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><br>
break *&amp;main<br>
<div class=3D"im"><br>
&gt; that is the gdb command?<br>
<br>
</div>Yes. =A0&quot;break main&quot; will break at the instruction past the=
 prologue,<br>
but &quot;break *&amp;main&quot; just uses &amp;main, which is the address =
of main, as<br>
the breakpoint address. =A0I&#39;ve tested this, but I can&#39;t say for ce=
rtain<br>
it will work with every version of gdb.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-- Adam<br>
</font></span></blockquote></div><br>

--20cf30334d314170e904c2ee583a--


From MAILER-DAEMON Wed Jun 20 18:03:07 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShSzS-0008UK-Vp
	for mharc-gdb@gnu.org; Wed, 20 Jun 2012 18:03:06 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48736)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <adam@irvine.com>) id 1ShSzQ-0008Sx-5P
	for gdb@gnu.org; Wed, 20 Jun 2012 18:03:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <adam@irvine.com>) id 1ShSzO-0006lo-JC
	for gdb@gnu.org; Wed, 20 Jun 2012 18:03:03 -0400
Received: from larry-rp.irvine.com ([66.126.103.122]:61454
	helo=mailhub.irvine.com) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <adam@irvine.com>) id 1ShSzO-0006ky-BG
	for gdb@gnu.org; Wed, 20 Jun 2012 18:03:02 -0400
Received: from irvine.com (shrike.irvine.com [192.160.8.7])
	by mailhub.irvine.com (Postfix) with ESMTP id DAA5AA8C858;
	Wed, 20 Jun 2012 15:02:59 -0700 (PDT)
To: Iurie <iurcic@gmail.com>
Subject: Re: Breakpoint on first instruction in program 
In-Reply-To: Your message of "Wed, 20 Jun 2012 22:47:25 BST."
	<CAFpdKSDu+EfwX_0B4CW3yKCG27eCKeiHj1ZDqP2qmvvmWvCdNQ@mail.gmail.com> 
Date: Wed, 20 Jun 2012 15:02:57 -0700
From: Adam Beneschan <adam@irvine.com>
Message-Id: <20120620220259.DAA5AA8C858@mailhub.irvine.com>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-Received-From: 66.126.103.122
Cc: plantz@ieee.org, gdb@gnu.org
X-BeenThere: gdb@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Discussion list for gdb, the GNU source debugger." <gdb.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/gdb>,
	<mailto:gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/gdb>
List-Post: <mailto:gdb@gnu.org>
List-Help: <mailto:gdb-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gdb>,
	<mailto:gdb-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Jun 2012 22:03:05 -0000

 
> thanks for the answer, and after that how do i see how the stack frame is
> created.?

"stepi" steps through each instruction.  "info reg" shows the
registers, so you can use this after each step to watch how they
change.  "info reg ebp esp" will just show you those two registers
specifically.  If ESP is, say, BFFFF830, I use this command to dump 8
words at that address:

x/8xw 0xbffff380

That's all I know.  If there's some clever way to define a macro
command to step an instruction and display the top of the stack all in
one command, someone else will have to help with that.

                                -- Adam


From MAILER-DAEMON Thu Jun 21 00:45:35 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShZGx-0004gC-Nh
	for mharc-gdb@gnu.org; Thu, 21 Jun 2012 00:45:35 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45618)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <plantz@ieee.org>) id 1ShYiP-0006L0-S1
	for gdb@gnu.org; Thu, 21 Jun 2012 00:09:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <plantz@ieee.org>) id 1ShYiN-0000Vi-HF
	for gdb@gnu.org; Thu, 21 Jun 2012 00:09:53 -0400
Received: from mail.cds1.net ([209.204.131.36]:38373)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <plantz@ieee.org>) id 1ShYiN-0000Ue-7r
	for gdb@gnu.org; Thu, 21 Jun 2012 00:09:51 -0400
Received: from [192.168.1.101] (23-24-206-43-static.hfc.comcastbusiness.net
	[23.24.206.43])
	by mail.cds1.net (Postfix) with ESMTP id C883EE899E4C;
	Wed, 20 Jun 2012 21:09:30 -0700 (PDT)
Message-ID: <4FE29E75.1070901@ieee.org>
Date: Wed, 20 Jun 2012 21:09:25 -0700
From: Bob Plantz <plantz@ieee.org>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:13.0) Gecko/20120614 Thunderbird/13.0.1
MIME-Version: 1.0
To: Adam Beneschan <adam@irvine.com>
Subject: Re: Breakpoint on first instruction in program
References: <20120620203908.BFCF5A8C858@mailhub.irvine.com>
In-Reply-To: <20120620203908.BFCF5A8C858@mailhub.irvine.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 209.204.131.36
X-Mailman-Approved-At: Thu, 21 Jun 2012 00:45:33 -0400
Cc: gdb@gnu.org
X-BeenThere: gdb@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Discussion list for gdb, the GNU source debugger." <gdb.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/gdb>,
	<mailto:gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/gdb>
List-Post: <mailto:gdb@gnu.org>
List-Help: <mailto:gdb-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gdb>,
	<mailto:gdb-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 04:09:55 -0000

On 6/20/2012 1:39 PM, Adam Beneschan wrote:
>   
>> I am using the following assembly language program (doNothingProg.s) for
>> instruction purposes:
>>
>>           .text
>>           .globl  main
>>           .type   main, @function
>> main:
>>           pushq   %rbp        # save caller's frame pointer
>>           movq    %rsp, %rbp  # establish our frame pointer
>>           movl    $0, %eax    # return 0 to caller
>>           movq    %rbp, %rsp  # restore stack pointer
>>           popq    %rbp        # restore caller's frame pointer
>>           ret                 # back to caller
>>
>> I want to set a breakpoint at the first instruction (pushq %rbp) so
>> students can see how the stack frame is created.
> break *&main
>
>                                  -- Adam
Thank you for the response Adam.

Actually, break *main worked for me. (Or just br *main). I'm not in 
Linux right now, but I will double check next time I log in.

I found this by using info gdb and some looking around. As usual, the 
answer is in the documentation, as I often told my students. :-[

--Bob



From MAILER-DAEMON Thu Jun 21 06:46:27 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SheuB-0003N5-Kp
	for mharc-gdb@gnu.org; Thu, 21 Jun 2012 06:46:27 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55958)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <iurcic@gmail.com>) id 1Sheu5-0003Mu-4u
	for gdb@gnu.org; Thu, 21 Jun 2012 06:46:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <iurcic@gmail.com>) id 1Sheu0-0001vr-3g
	for gdb@gnu.org; Thu, 21 Jun 2012 06:46:20 -0400
Received: from mail-yw0-f51.google.com ([209.85.213.51]:41426)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <iurcic@gmail.com>) id 1Shetz-0001ve-Si
	for gdb@gnu.org; Thu, 21 Jun 2012 06:46:16 -0400
Received: by yhnn12 with SMTP id n12so304471yhn.38
	for <gdb@gnu.org>; Thu, 21 Jun 2012 03:46:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=SooDWCJIO9adv31OVoE25WWJI8EU0HCtxvrDFRwKQ1k=;
	b=oM1uLkIoBvI+Svig4FryvF3TCBxAuIhCEArdBpre/FqxPCPxyd/rutSePWZEfhduRI
	NNKbJym7zjkYE9g+3I9eo+qIqHdGwGRprj8qx9rZ4VGpYEIPgu8ba1REFlkuw66L3YkF
	ybW/76yHow+67Vurx3VTRihlLTGi7L9iYI55D0QHjZEAN3v3eg+MVVBDDuHxVBxiMocy
	/MYwhxFJXinDGJleFz78Ka0NX9OxV6uwudv6Cvb595b510LdUegAXKO/WpsoNPaK7WW7
	JXsrEhHwYOnrzGyJKhIFw1j1cg1D0d0VZ0gZkCSS849guopc6H33Hsd1ost2AzMflMpE
	Cfew==
MIME-Version: 1.0
Received: by 10.50.178.33 with SMTP id cv1mr7077232igc.1.1340275573949; Thu,
	21 Jun 2012 03:46:13 -0700 (PDT)
Received: by 10.64.101.164 with HTTP; Thu, 21 Jun 2012 03:46:13 -0700 (PDT)
In-Reply-To: <4FE29E75.1070901@ieee.org>
References: <20120620203908.BFCF5A8C858@mailhub.irvine.com>
	<4FE29E75.1070901@ieee.org>
Date: Thu, 21 Jun 2012 11:46:13 +0100
Message-ID: <CAFpdKSA0exvJsx2=3bT-67T72aAbyLbehhp+tuzUA8JNLamXRw@mail.gmail.com>
Subject: Re: Breakpoint on first instruction in program
From: Iurie <iurcic@gmail.com>
To: Bob Plantz <plantz@ieee.org>
Content-Type: multipart/alternative; boundary=e89a8f3bad137c84f004c2f939de
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.213.51
Cc: gdb@gnu.org
X-BeenThere: gdb@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Discussion list for gdb, the GNU source debugger." <gdb.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/gdb>,
	<mailto:gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/gdb>
List-Post: <mailto:gdb@gnu.org>
List-Help: <mailto:gdb-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gdb>,
	<mailto:gdb-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 10:46:27 -0000

--e89a8f3bad137c84f004c2f939de
Content-Type: text/plain; charset=ISO-8859-1

Hi Bob,
what course u are teaching out there? give me the link to it, perhaps i
will learn there something useful as i am also a student.

On 21 June 2012 05:09, Bob Plantz <plantz@ieee.org> wrote:

> On 6/20/2012 1:39 PM, Adam Beneschan wrote:
>
>>
>>
>>> I am using the following assembly language program (doNothingProg.s) for
>>> instruction purposes:
>>>
>>>          .text
>>>          .globl  main
>>>          .type   main, @function
>>> main:
>>>          pushq   %rbp        # save caller's frame pointer
>>>          movq    %rsp, %rbp  # establish our frame pointer
>>>          movl    $0, %eax    # return 0 to caller
>>>          movq    %rbp, %rsp  # restore stack pointer
>>>          popq    %rbp        # restore caller's frame pointer
>>>          ret                 # back to caller
>>>
>>> I want to set a breakpoint at the first instruction (pushq %rbp) so
>>> students can see how the stack frame is created.
>>>
>> break *&main
>>
>>                                 -- Adam
>>
> Thank you for the response Adam.
>
> Actually, break *main worked for me. (Or just br *main). I'm not in Linux
> right now, but I will double check next time I log in.
>
> I found this by using info gdb and some looking around. As usual, the
> answer is in the documentation, as I often told my students. :-[
>
> --Bob
>
>
>

--e89a8f3bad137c84f004c2f939de
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Bob,<br>what course u are teaching out there? give me the link to it, pe=
rhaps i will learn there something useful as i am also a student.=A0 <br><b=
r><div class=3D"gmail_quote">On 21 June 2012 05:09, Bob Plantz <span dir=3D=
"ltr">&lt;<a href=3D"mailto:plantz@ieee.org" target=3D"_blank">plantz@ieee.=
org</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"HOEnZb"><div class=3D"h5">On 6=
/20/2012 1:39 PM, Adam Beneschan wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
 =A0<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
I am using the following assembly language program (doNothingProg.s) for<br=
>
instruction purposes:<br>
<br>
 =A0 =A0 =A0 =A0 =A0.text<br>
 =A0 =A0 =A0 =A0 =A0.globl =A0main<br>
 =A0 =A0 =A0 =A0 =A0.type =A0 main, @function<br>
main:<br>
 =A0 =A0 =A0 =A0 =A0pushq =A0 %rbp =A0 =A0 =A0 =A0# save caller&#39;s frame=
 pointer<br>
 =A0 =A0 =A0 =A0 =A0movq =A0 =A0%rsp, %rbp =A0# establish our frame pointer=
<br>
 =A0 =A0 =A0 =A0 =A0movl =A0 =A0$0, %eax =A0 =A0# return 0 to caller<br>
 =A0 =A0 =A0 =A0 =A0movq =A0 =A0%rbp, %rsp =A0# restore stack pointer<br>
 =A0 =A0 =A0 =A0 =A0popq =A0 =A0%rbp =A0 =A0 =A0 =A0# restore caller&#39;s =
frame pointer<br>
 =A0 =A0 =A0 =A0 =A0ret =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # back to caller<br=
>
<br>
I want to set a breakpoint at the first instruction (pushq %rbp) so<br>
students can see how the stack frame is created.<br>
</blockquote>
break *&amp;main<br>
<br>
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 -- Adam<br=
>
</blockquote></div></div>
Thank you for the response Adam.<br>
<br>
Actually, break *main worked for me. (Or just br *main). I&#39;m not in Lin=
ux right now, but I will double check next time I log in.<br>
<br>
I found this by using info gdb and some looking around. As usual, the answe=
r is in the documentation, as I often told my students. :-[<span class=3D"H=
OEnZb"><font color=3D"#888888"><br>
<br>
--Bob<br>
<br>
<br>
</font></span></blockquote></div><br>

--e89a8f3bad137c84f004c2f939de--


From MAILER-DAEMON Thu Jun 21 11:41:49 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShjW1-0005c6-88
	for mharc-gdb@gnu.org; Thu, 21 Jun 2012 11:41:49 -0400
Received: from eggs.gnu.org ([208.118.235.92]:34546)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <plantz@ieee.org>) id 1ShjVt-0005bT-7F
	for gdb@gnu.org; Thu, 21 Jun 2012 11:41:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <plantz@ieee.org>) id 1ShjVm-0005YZ-KP
	for gdb@gnu.org; Thu, 21 Jun 2012 11:41:40 -0400
Received: from mail.cds1.net ([209.204.131.36]:56461)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <plantz@ieee.org>) id 1ShjVm-0005Xr-8M
	for gdb@gnu.org; Thu, 21 Jun 2012 11:41:34 -0400
Received: from [192.168.1.101] (23-24-206-43-static.hfc.comcastbusiness.net
	[23.24.206.43])
	by mail.cds1.net (Postfix) with ESMTP id C2DE0E89A2B5;
	Thu, 21 Jun 2012 08:41:30 -0700 (PDT)
Message-ID: <4FE340AA.8080907@ieee.org>
Date: Thu, 21 Jun 2012 08:41:30 -0700
From: Bob Plantz <plantz@ieee.org>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:12.0) Gecko/20120430 Thunderbird/12.0.1
MIME-Version: 1.0
To: Iurie <iurcic@gmail.com>
Subject: Re: Breakpoint on first instruction in program
References: <20120620203908.BFCF5A8C858@mailhub.irvine.com>
	<4FE29E75.1070901@ieee.org>
	<CAFpdKSA0exvJsx2=3bT-67T72aAbyLbehhp+tuzUA8JNLamXRw@mail.gmail.com>
In-Reply-To: <CAFpdKSA0exvJsx2=3bT-67T72aAbyLbehhp+tuzUA8JNLamXRw@mail.gmail.com>
Content-Type: multipart/alternative;
	boundary="------------060300000207060503000305"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 209.204.131.36
Cc: gdb@gnu.org
X-BeenThere: gdb@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: plantz@ieee.org
List-Id: "Discussion list for gdb, the GNU source debugger." <gdb.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/gdb>,
	<mailto:gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/gdb>
List-Post: <mailto:gdb@gnu.org>
List-Help: <mailto:gdb-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gdb>,
	<mailto:gdb-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 15:41:47 -0000

This is a multi-part message in MIME format.
--------------060300000207060503000305
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

On 06/21/2012 03:46 AM, Iurie wrote:
> Hi Bob,
> what course u are teaching out there? give me the link to it, perhaps 
> i will learn there something useful as i am also a student.

I retired from teaching in 2004, but I keep my book, Introduction to 
Computer Architecture, updated. It is available on my web site: 
bob.cs.sonoma.edu

I checked info gdb. Under Source->Specify Location I found an entry for 
`*ADDRESS'. Apparently, the *ADDRESS form is for C, C++, Java, 
Objective-C, Fortran, minimal, and assembly. The *&ADDRESS' form is for 
Pascal and Modula-2. However, it seems that gdb is forgiving between 
these two forms. And, from my personal experience, this can differ 
between versions and can change over time.

--Bob


>
> On 21 June 2012 05:09, Bob Plantz <plantz@ieee.org 
> <mailto:plantz@ieee.org>> wrote:
>
>     On 6/20/2012 1:39 PM, Adam Beneschan wrote:
>
>
>             I am using the following assembly language program
>             (doNothingProg.s) for
>             instruction purposes:
>
>                      .text
>                      .globl  main
>                      .type   main, @function
>             main:
>                      pushq   %rbp        # save caller's frame pointer
>                      movq    %rsp, %rbp  # establish our frame pointer
>                      movl    $0, %eax    # return 0 to caller
>                      movq    %rbp, %rsp  # restore stack pointer
>                      popq    %rbp        # restore caller's frame pointer
>                      ret                 # back to caller
>
>             I want to set a breakpoint at the first instruction (pushq
>             %rbp) so
>             students can see how the stack frame is created.
>
>         break *&main
>
>                                         -- Adam
>
>     Thank you for the response Adam.
>
>     Actually, break *main worked for me. (Or just br *main). I'm not
>     in Linux right now, but I will double check next time I log in.
>
>     I found this by using info gdb and some looking around. As usual,
>     the answer is in the documentation, as I often told my students. :-[
>
>     --Bob
>
>
>


--------------060300000207060503000305
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 06/21/2012 03:46 AM, Iurie wrote:
    <blockquote
cite="mid:CAFpdKSA0exvJsx2=3bT-67T72aAbyLbehhp+tuzUA8JNLamXRw@mail.gmail.com"
      type="cite">Hi Bob,<br>
      what course u are teaching out there? give me the link to it,
      perhaps i will learn there something useful as i am also a
      student.&nbsp; <br>
    </blockquote>
    <br>
    I retired from teaching in 2004, but I keep my book, Introduction to
    Computer Architecture, updated. It is available on my web site:
    bob.cs.sonoma.edu<br>
    <br>
    I checked info gdb. Under Source-&gt;Specify Location I found an
    entry for `*ADDRESS'. Apparently, the *ADDRESS form is for C, C++,
    Java, Objective-C, Fortran, minimal, and assembly. The
    *&amp;ADDRESS' form is for Pascal and Modula-2. However, it seems
    that gdb is forgiving between these two forms. And, from my personal
    experience, this can differ between versions and can change over
    time.<br>
    <br>
    --Bob<br>
    <br>
    <br>
    <blockquote
cite="mid:CAFpdKSA0exvJsx2=3bT-67T72aAbyLbehhp+tuzUA8JNLamXRw@mail.gmail.com"
      type="cite"><br>
      <div class="gmail_quote">On 21 June 2012 05:09, Bob Plantz <span
          dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:plantz@ieee.org" target="_blank">plantz@ieee.org</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div class="HOEnZb">
            <div class="h5">On 6/20/2012 1:39 PM, Adam Beneschan wrote:<br>
              <blockquote class="gmail_quote" style="margin:0 0 0
                .8ex;border-left:1px #ccc solid;padding-left:1ex"> &nbsp;<br>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  I am using the following assembly language program
                  (doNothingProg.s) for<br>
                  instruction purposes:<br>
                  <br>
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.text<br>
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.globl &nbsp;main<br>
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.type &nbsp; main, @function<br>
                  main:<br>
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pushq &nbsp; %rbp &nbsp; &nbsp; &nbsp; &nbsp;# save caller's frame
                  pointer<br>
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;movq &nbsp; &nbsp;%rsp, %rbp &nbsp;# establish our frame
                  pointer<br>
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;movl &nbsp; &nbsp;$0, %eax &nbsp; &nbsp;# return 0 to caller<br>
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;movq &nbsp; &nbsp;%rbp, %rsp &nbsp;# restore stack pointer<br>
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;popq &nbsp; &nbsp;%rbp &nbsp; &nbsp; &nbsp; &nbsp;# restore caller's frame
                  pointer<br>
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # back to caller<br>
                  <br>
                  I want to set a breakpoint at the first instruction
                  (pushq %rbp) so<br>
                  students can see how the stack frame is created.<br>
                </blockquote>
                break *&amp;main<br>
                <br>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -- Adam<br>
              </blockquote>
            </div>
          </div>
          Thank you for the response Adam.<br>
          <br>
          Actually, break *main worked for me. (Or just br *main). I'm
          not in Linux right now, but I will double check next time I
          log in.<br>
          <br>
          I found this by using info gdb and some looking around. As
          usual, the answer is in the documentation, as I often told my
          students. :-[<span class="HOEnZb"><font color="#888888"><br>
              <br>
              --Bob<br>
              <br>
              <br>
            </font></span></blockquote>
      </div>
      <br>
    </blockquote>
    <br>
  </body>
</html>

--------------060300000207060503000305--


From MAILER-DAEMON Thu Jun 21 12:04:56 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShjsO-0005tx-11
	for mharc-gdb@gnu.org; Thu, 21 Jun 2012 12:04:56 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56606)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <iurcic@gmail.com>) id 1ShjsH-0005lH-BT
	for gdb@gnu.org; Thu, 21 Jun 2012 12:04:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <iurcic@gmail.com>) id 1ShjsA-0003Kf-9P
	for gdb@gnu.org; Thu, 21 Jun 2012 12:04:48 -0400
Received: from mail-yx0-f169.google.com ([209.85.213.169]:65161)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <iurcic@gmail.com>) id 1ShjsA-0003KY-15
	for gdb@gnu.org; Thu, 21 Jun 2012 12:04:42 -0400
Received: by yenr5 with SMTP id r5so823771yen.0
	for <gdb@gnu.org>; Thu, 21 Jun 2012 09:04:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=Y2XM0xLfjwSBsKtQVy1ZVK6B3/88PJa1+Gl3/Ojlhp0=;
	b=fJ0BOIBj7Z7wuS7w6oM4VK5XJt49tG4BTCEdW9B1MdIEX8zUBAkSQLSkAEVUiwJleN
	tgYcgXKw+rV7xHdMomDOdU6ZNivdKqs3wdr9P+HE5J1K9kPxfA9zHGA3O3/oDJmPCBwf
	AB2ZnO56Y2nIO+CsXBt0zC6Cnu5Yxara7ZYBF7hbXNlPP8YI1P/0ZADyP8Ro/N656T+u
	aW4XqbkKg2YmobgKXGL9by9k/3KyXwHkdQOf0UV8jAn/0GTm94r44IIiyTS2BPz8VSaW
	c4h7wc34EggAiWAGuATGjuhVTIqLI3jMbMVs/2jzfllL0boefGr4T0l8Wbi7eMyyRuQm
	JOGw==
MIME-Version: 1.0
Received: by 10.50.46.230 with SMTP id y6mr7988039igm.20.1340294680022; Thu,
	21 Jun 2012 09:04:40 -0700 (PDT)
Received: by 10.64.101.164 with HTTP; Thu, 21 Jun 2012 09:04:39 -0700 (PDT)
In-Reply-To: <4FE340AA.8080907@ieee.org>
References: <20120620203908.BFCF5A8C858@mailhub.irvine.com>
	<4FE29E75.1070901@ieee.org>
	<CAFpdKSA0exvJsx2=3bT-67T72aAbyLbehhp+tuzUA8JNLamXRw@mail.gmail.com>
	<4FE340AA.8080907@ieee.org>
Date: Thu, 21 Jun 2012 17:04:39 +0100
Message-ID: <CAFpdKSB04oMyu3A=SGjyENa6e-DuEhrvP-pt0t2c-V1EhPCJcA@mail.gmail.com>
Subject: Re: Breakpoint on first instruction in program
From: Iurie <iurcic@gmail.com>
To: plantz@ieee.org
Content-Type: multipart/alternative; boundary=14dae9340bbf4c0e2404c2fdac54
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.213.169
Cc: gdb@gnu.org
X-BeenThere: gdb@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Discussion list for gdb, the GNU source debugger." <gdb.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/gdb>,
	<mailto:gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/gdb>
List-Post: <mailto:gdb@gnu.org>
List-Help: <mailto:gdb-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gdb>,
	<mailto:gdb-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 16:04:55 -0000

--14dae9340bbf4c0e2404c2fdac54
Content-Type: text/plain; charset=ISO-8859-1

hi,
i found your book very interesting. Can i also somehow contribute to it?



On 21 June 2012 16:41, Bob Plantz <plantz@ieee.org> wrote:

>  On 06/21/2012 03:46 AM, Iurie wrote:
>
> Hi Bob,
> what course u are teaching out there? give me the link to it, perhaps i
> will learn there something useful as i am also a student.
>
>
> I retired from teaching in 2004, but I keep my book, Introduction to
> Computer Architecture, updated. It is available on my web site:
> bob.cs.sonoma.edu
>
> I checked info gdb. Under Source->Specify Location I found an entry for
> `*ADDRESS'. Apparently, the *ADDRESS form is for C, C++, Java, Objective-C,
> Fortran, minimal, and assembly. The *&ADDRESS' form is for Pascal and
> Modula-2. However, it seems that gdb is forgiving between these two forms.
> And, from my personal experience, this can differ between versions and can
> change over time.
>
> --Bob
>
>
>
>
> On 21 June 2012 05:09, Bob Plantz <plantz@ieee.org> wrote:
>
>>  On 6/20/2012 1:39 PM, Adam Beneschan wrote:
>>
>>>
>>>
>>>> I am using the following assembly language program (doNothingProg.s) for
>>>> instruction purposes:
>>>>
>>>>          .text
>>>>          .globl  main
>>>>          .type   main, @function
>>>> main:
>>>>          pushq   %rbp        # save caller's frame pointer
>>>>          movq    %rsp, %rbp  # establish our frame pointer
>>>>          movl    $0, %eax    # return 0 to caller
>>>>          movq    %rbp, %rsp  # restore stack pointer
>>>>          popq    %rbp        # restore caller's frame pointer
>>>>          ret                 # back to caller
>>>>
>>>> I want to set a breakpoint at the first instruction (pushq %rbp) so
>>>> students can see how the stack frame is created.
>>>>
>>> break *&main
>>>
>>>                                 -- Adam
>>>
>>  Thank you for the response Adam.
>>
>> Actually, break *main worked for me. (Or just br *main). I'm not in Linux
>> right now, but I will double check next time I log in.
>>
>> I found this by using info gdb and some looking around. As usual, the
>> answer is in the documentation, as I often told my students. :-[
>>
>> --Bob
>>
>>
>>
>
>

--14dae9340bbf4c0e2404c2fdac54
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

hi,<br>i found your book very interesting. Can i also somehow contribute to=
 it?<br><br><br><br><div class=3D"gmail_quote">On 21 June 2012 16:41, Bob P=
lantz <span dir=3D"ltr">&lt;<a href=3D"mailto:plantz@ieee.org" target=3D"_b=
lank">plantz@ieee.org</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000"><div class=3D"im">
    On 06/21/2012 03:46 AM, Iurie wrote:
    <blockquote type=3D"cite">Hi Bob,<br>
      what course u are teaching out there? give me the link to it,
      perhaps i will learn there something useful as i am also a
      student.=A0 <br>
    </blockquote>
    <br></div>
    I retired from teaching in 2004, but I keep my book, Introduction to
    Computer Architecture, updated. It is available on my web site:
    <a href=3D"http://bob.cs.sonoma.edu" target=3D"_blank">bob.cs.sonoma.ed=
u</a><br>
    <br>
    I checked info gdb. Under Source-&gt;Specify Location I found an
    entry for `*ADDRESS&#39;. Apparently, the *ADDRESS form is for C, C++,
    Java, Objective-C, Fortran, minimal, and assembly. The
    *&amp;ADDRESS&#39; form is for Pascal and Modula-2. However, it seems
    that gdb is forgiving between these two forms. And, from my personal
    experience, this can differ between versions and can change over
    time.<span class=3D"HOEnZb"><font color=3D"#888888"><br>
    <br>
    --Bob</font></span><div class=3D"im"><br>
    <br>
    <br>
    <blockquote type=3D"cite"><br>
      <div class=3D"gmail_quote">On 21 June 2012 05:09, Bob Plantz <span di=
r=3D"ltr">&lt;<a href=3D"mailto:plantz@ieee.org" target=3D"_blank">plantz@i=
eee.org</a>&gt;</span>
        wrote:<br>
        <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border=
-left:1px #ccc solid;padding-left:1ex">
          <div>
            <div>On 6/20/2012 1:39 PM, Adam Beneschan wrote:<br>
              <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;=
border-left:1px #ccc solid;padding-left:1ex"> =A0<br>
                <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8e=
x;border-left:1px #ccc solid;padding-left:1ex">
                  I am using the following assembly language program
                  (doNothingProg.s) for<br>
                  instruction purposes:<br>
                  <br>
                  =A0 =A0 =A0 =A0 =A0.text<br>
                  =A0 =A0 =A0 =A0 =A0.globl =A0main<br>
                  =A0 =A0 =A0 =A0 =A0.type =A0 main, @function<br>
                  main:<br>
                  =A0 =A0 =A0 =A0 =A0pushq =A0 %rbp =A0 =A0 =A0 =A0# save c=
aller&#39;s frame
                  pointer<br>
                  =A0 =A0 =A0 =A0 =A0movq =A0 =A0%rsp, %rbp =A0# establish =
our frame
                  pointer<br>
                  =A0 =A0 =A0 =A0 =A0movl =A0 =A0$0, %eax =A0 =A0# return 0=
 to caller<br>
                  =A0 =A0 =A0 =A0 =A0movq =A0 =A0%rbp, %rsp =A0# restore st=
ack pointer<br>
                  =A0 =A0 =A0 =A0 =A0popq =A0 =A0%rbp =A0 =A0 =A0 =A0# rest=
ore caller&#39;s frame
                  pointer<br>
                  =A0 =A0 =A0 =A0 =A0ret =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # =
back to caller<br>
                  <br>
                  I want to set a breakpoint at the first instruction
                  (pushq %rbp) so<br>
                  students can see how the stack frame is created.<br>
                </blockquote>
                break *&amp;main<br>
                <br>
                =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 -- Adam<br>
              </blockquote>
            </div>
          </div>
          Thank you for the response Adam.<br>
          <br>
          Actually, break *main worked for me. (Or just br *main). I&#39;m
          not in Linux right now, but I will double check next time I
          log in.<br>
          <br>
          I found this by using info gdb and some looking around. As
          usual, the answer is in the documentation, as I often told my
          students. :-[<span><font color=3D"#888888"><br>
              <br>
              --Bob<br>
              <br>
              <br>
            </font></span></blockquote>
      </div>
      <br>
    </blockquote>
    <br>
  </div></div>

</blockquote></div><br>

--14dae9340bbf4c0e2404c2fdac54--


From MAILER-DAEMON Thu Jun 21 13:47:00 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShlTA-0002A0-FQ
	for mharc-gdb@gnu.org; Thu, 21 Jun 2012 13:47:00 -0400
Received: from eggs.gnu.org ([208.118.235.92]:34359)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <plantz@ieee.org>) id 1ShlT7-00029O-4x
	for gdb@gnu.org; Thu, 21 Jun 2012 13:46:58 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <plantz@ieee.org>) id 1ShlT4-0003ma-LI
	for gdb@gnu.org; Thu, 21 Jun 2012 13:46:56 -0400
Received: from mail.cds1.net ([209.204.131.36]:39281)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <plantz@ieee.org>) id 1ShlT0-0003kg-K2
	for gdb@gnu.org; Thu, 21 Jun 2012 13:46:54 -0400
Received: from [192.168.1.101] (23-24-206-43-static.hfc.comcastbusiness.net
	[23.24.206.43])
	by mail.cds1.net (Postfix) with ESMTP id B96FCE89A3E7;
	Thu, 21 Jun 2012 10:46:34 -0700 (PDT)
Message-ID: <4FE35DF5.2070804@ieee.org>
Date: Thu, 21 Jun 2012 10:46:29 -0700
From: Bob Plantz <plantz@ieee.org>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:12.0) Gecko/20120430 Thunderbird/12.0.1
MIME-Version: 1.0
To: Iurie <iurcic@gmail.com>
Subject: Re: Breakpoint on first instruction in program
References: <20120620203908.BFCF5A8C858@mailhub.irvine.com>
	<4FE29E75.1070901@ieee.org>
	<CAFpdKSA0exvJsx2=3bT-67T72aAbyLbehhp+tuzUA8JNLamXRw@mail.gmail.com>
	<4FE340AA.8080907@ieee.org>
	<CAFpdKSB04oMyu3A=SGjyENa6e-DuEhrvP-pt0t2c-V1EhPCJcA@mail.gmail.com>
In-Reply-To: <CAFpdKSB04oMyu3A=SGjyENa6e-DuEhrvP-pt0t2c-V1EhPCJcA@mail.gmail.com>
Content-Type: multipart/alternative;
	boundary="------------040504070000030502050200"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 209.204.131.36
Cc: gdb@gnu.org
X-BeenThere: gdb@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: plantz@ieee.org
List-Id: "Discussion list for gdb, the GNU source debugger." <gdb.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/gdb>,
	<mailto:gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/gdb>
List-Post: <mailto:gdb@gnu.org>
List-Help: <mailto:gdb-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gdb>,
	<mailto:gdb-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 17:46:59 -0000

This is a multi-part message in MIME format.
--------------040504070000030502050200
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I am currently updating the book for version 4.7.0 of gcc. As I do this, 
I am fixing typos, etc. There are several ways to contribute:

1. Send me feedback about any problems you see in the book: typos, parts 
that are difficult to understand, errors, etc.
2. Donate money (a sort of "royalty" for this free version) using either 
www.paypal.com or payments.amazon.com; my email address for this is 
plantz@cds1.net.
3. Wait until I publish the updated version of the book and buy it. 
Hopefully, this will be in a month or two. I plan to sell it through 
www.lulu.com in both pdf and paper versions. I plan to keep the price 
low, in the order of $10 - $15 for the pdf and $30 - $40 for the paper. 
Anyone who cannot afford to pay should contact me for other arrangements.

Of these three ways, number 1 is the most appreciated. My main goal is 
to create a book that is as useful as possible.

--Bob

On 06/21/2012 09:04 AM, Iurie wrote:
> hi,
> i found your book very interesting. Can i also somehow contribute to it?
>
>
>
> On 21 June 2012 16:41, Bob Plantz <plantz@ieee.org 
> <mailto:plantz@ieee.org>> wrote:
>
>     On 06/21/2012 03:46 AM, Iurie wrote:
>>     Hi Bob,
>>     what course u are teaching out there? give me the link to it,
>>     perhaps i will learn there something useful as i am also a student.
>
>     I retired from teaching in 2004, but I keep my book, Introduction
>     to Computer Architecture, updated. It is available on my web site:
>     bob.cs.sonoma.edu <http://bob.cs.sonoma.edu>
>
>     I checked info gdb. Under Source->Specify Location I found an
>     entry for `*ADDRESS'. Apparently, the *ADDRESS form is for C, C++,
>     Java, Objective-C, Fortran, minimal, and assembly. The *&ADDRESS'
>     form is for Pascal and Modula-2. However, it seems that gdb is
>     forgiving between these two forms. And, from my personal
>     experience, this can differ between versions and can change over time.
>
>     --Bob
>
>
>
>>
>>     On 21 June 2012 05:09, Bob Plantz <plantz@ieee.org
>>     <mailto:plantz@ieee.org>> wrote:
>>
>>         On 6/20/2012 1:39 PM, Adam Beneschan wrote:
>>
>>
>>                 I am using the following assembly language program
>>                 (doNothingProg.s) for
>>                 instruction purposes:
>>
>>                          .text
>>                          .globl  main
>>                          .type   main, @function
>>                 main:
>>                          pushq   %rbp        # save caller's frame
>>                 pointer
>>                          movq    %rsp, %rbp  # establish our frame
>>                 pointer
>>                          movl    $0, %eax    # return 0 to caller
>>                          movq    %rbp, %rsp  # restore stack pointer
>>                          popq    %rbp        # restore caller's frame
>>                 pointer
>>                          ret                 # back to caller
>>
>>                 I want to set a breakpoint at the first instruction
>>                 (pushq %rbp) so
>>                 students can see how the stack frame is created.
>>
>>             break *&main
>>
>>                                             -- Adam
>>
>>         Thank you for the response Adam.
>>
>>         Actually, break *main worked for me. (Or just br *main). I'm
>>         not in Linux right now, but I will double check next time I
>>         log in.
>>
>>         I found this by using info gdb and some looking around. As
>>         usual, the answer is in the documentation, as I often told my
>>         students. :-[
>>
>>         --Bob
>>
>>
>>
>
>


--------------040504070000030502050200
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I am currently updating the book for version 4.7.0 of gcc. As I do
    this, I am fixing typos, etc. There are several ways to contribute:<br>
    <br>
    1. Send me feedback about any problems you see in the book: typos,
    parts that are difficult to understand, errors, etc.<br>
    2. Donate money (a sort of "royalty" for this free version) using
    either <a class="moz-txt-link-abbreviated" href="http://www.paypal.com">www.paypal.com</a> or payments.amazon.com; my email address for
    this is <a class="moz-txt-link-abbreviated" href="mailto:plantz@cds1.net">plantz@cds1.net</a>.<br>
    3. Wait until I publish the updated version of the book and buy it.
    Hopefully, this will be in a month or two. I plan to sell it through
    <a class="moz-txt-link-abbreviated" href="http://www.lulu.com">www.lulu.com</a> in both pdf and paper versions. I plan to keep the
    price low, in the order of $10 - $15 for the pdf and $30 - $40 for
    the paper. Anyone who cannot afford to pay should contact me for
    other arrangements.<br>
    <br>
    Of these three ways, number 1 is the most appreciated. My main goal
    is to create a book that is as useful as possible.<br>
    <br>
    --Bob<br>
    <br>
    On 06/21/2012 09:04 AM, Iurie wrote:
    <blockquote
cite="mid:CAFpdKSB04oMyu3A=SGjyENa6e-DuEhrvP-pt0t2c-V1EhPCJcA@mail.gmail.com"
      type="cite">hi,<br>
      i found your book very interesting. Can i also somehow contribute
      to it?<br>
      <br>
      <br>
      <br>
      <div class="gmail_quote">On 21 June 2012 16:41, Bob Plantz <span
          dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:plantz@ieee.org" target="_blank">plantz@ieee.org</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div bgcolor="#FFFFFF" text="#000000">
            <div class="im"> On 06/21/2012 03:46 AM, Iurie wrote:
              <blockquote type="cite">Hi Bob,<br>
                what course u are teaching out there? give me the link
                to it, perhaps i will learn there something useful as i
                am also a student.&nbsp; <br>
              </blockquote>
              <br>
            </div>
            I retired from teaching in 2004, but I keep my book,
            Introduction to Computer Architecture, updated. It is
            available on my web site: <a moz-do-not-send="true"
              href="http://bob.cs.sonoma.edu" target="_blank">bob.cs.sonoma.edu</a><br>
            <br>
            I checked info gdb. Under Source-&gt;Specify Location I
            found an entry for `*ADDRESS'. Apparently, the *ADDRESS form
            is for C, C++, Java, Objective-C, Fortran, minimal, and
            assembly. The *&amp;ADDRESS' form is for Pascal and
            Modula-2. However, it seems that gdb is forgiving between
            these two forms. And, from my personal experience, this can
            differ between versions and can change over time.<span
              class="HOEnZb"><font color="#888888"><br>
                <br>
                --Bob</font></span>
            <div class="im"><br>
              <br>
              <br>
              <blockquote type="cite"><br>
                <div class="gmail_quote">On 21 June 2012 05:09, Bob
                  Plantz <span dir="ltr">&lt;<a moz-do-not-send="true"
                      href="mailto:plantz@ieee.org" target="_blank">plantz@ieee.org</a>&gt;</span>
                  wrote:<br>
                  <blockquote class="gmail_quote" style="margin:0 0 0
                    .8ex;border-left:1px #ccc solid;padding-left:1ex">
                    <div>
                      <div>On 6/20/2012 1:39 PM, Adam Beneschan wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex"> &nbsp;<br>
                          <blockquote class="gmail_quote"
                            style="margin:0 0 0 .8ex;border-left:1px
                            #ccc solid;padding-left:1ex"> I am using the
                            following assembly language program
                            (doNothingProg.s) for<br>
                            instruction purposes:<br>
                            <br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.text<br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.globl &nbsp;main<br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.type &nbsp; main, @function<br>
                            main:<br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pushq &nbsp; %rbp &nbsp; &nbsp; &nbsp; &nbsp;# save caller's
                            frame pointer<br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;movq &nbsp; &nbsp;%rsp, %rbp &nbsp;# establish our
                            frame pointer<br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;movl &nbsp; &nbsp;$0, %eax &nbsp; &nbsp;# return 0 to
                            caller<br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;movq &nbsp; &nbsp;%rbp, %rsp &nbsp;# restore stack
                            pointer<br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;popq &nbsp; &nbsp;%rbp &nbsp; &nbsp; &nbsp; &nbsp;# restore
                            caller's frame pointer<br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # back to
                            caller<br>
                            <br>
                            I want to set a breakpoint at the first
                            instruction (pushq %rbp) so<br>
                            students can see how the stack frame is
                            created.<br>
                          </blockquote>
                          break *&amp;main<br>
                          <br>
                          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -- Adam<br>
                        </blockquote>
                      </div>
                    </div>
                    Thank you for the response Adam.<br>
                    <br>
                    Actually, break *main worked for me. (Or just br
                    *main). I'm not in Linux right now, but I will
                    double check next time I log in.<br>
                    <br>
                    I found this by using info gdb and some looking
                    around. As usual, the answer is in the
                    documentation, as I often told my students. :-[<span><font
                        color="#888888"><br>
                        <br>
                        --Bob<br>
                        <br>
                        <br>
                      </font></span></blockquote>
                </div>
                <br>
              </blockquote>
              <br>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
    </blockquote>
    <br>
  </body>
</html>

--------------040504070000030502050200--


