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: Wed, 20 Jun 2012 21:09:25 -0700
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1

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]