gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Breakpoint on first instruction in program


From: Bob Plantz
Subject: Re: Breakpoint on first instruction in program
Date: Thu, 21 Jun 2012 10:46:29 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

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 address@hidden.
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 <address@hidden> 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 <address@hidden> 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







reply via email to

[Prev in Thread] Current Thread [Next in Thread]