Re: Breakpoint on first instruction in program

Iurie <[email protected]> Wed, 20 Jun 2012 22:28:43 +0100
Newsgroups gmane.comp.gdb.general
Message-ID <CAFpdKSDX4HK5YTWpTUmwhNn86cv9mOwg7EQP9ng9=YLyNVBX4g@mail.gmail.com>
that is the gdb command?

On 20 June 2012 21:39, Adam Beneschan <[email protected]> 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
>
>
>