From: Eli Zaretskii <eliz@gnu.org>
To: Jitendra Pawar <jitendrap@ryussi.com>
Cc: gdb@sourceware.org
Subject: Re: The step-Over (next) command seems repetitively displaying same statement execution
Date: Tue, 22 Dec 2015 16:21:00 -0000 [thread overview]
Message-ID: <83bn9iqwrt.fsf@gnu.org> (raw)
In-Reply-To: <CAO9sCwQiysreL3EK58yFV8e98w-AJL=43L1fBw19+EbWXhfJ+A@mail.gmail.com> (message from Jitendra Pawar on Tue, 22 Dec 2015 17:33:16 +0530)
> Date: Tue, 22 Dec 2015 17:33:16 +0530
> From: Jitendra Pawar <jitendrap@ryussi.com>
>
> $ gdb -q a.out
> Reading symbols from /home/jitendra/work/roughwork/a.out...done.
> (gdb) br main
> Breakpoint 1 at 0x40054c: file hello.c, line 9.
> (gdb) run
> Starting program: /home/itendrap/work/roughwork/a.out
> warning: no loadable sections found in added symbol-file
> system-supplied DSO at 0x7ffff7ffa000
>
> Breakpoint 1, main () at t.c:9
> 9 c = (char*) malloc (12);
> (gdb) n
> 9 c = (char*) malloc (12);
> (gdb) n
> 11 memcpy(c, "Hello World", 12);
> (gdb) n
> 13 printf("%s\n", c);
> (gdb) n
> Hello World
> 14 }
> (gdb)
> ------------------------------------------------------------------------
>
> Can anyone please explain whats going wrong here? Why the malloc
> statement 'c = (char*) malloc (12);' gets repeated?
What compilation command and switches did you use to compile this
program?
next prev parent reply other threads:[~2015-12-22 16:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-22 12:03 Jitendra Pawar
2015-12-22 16:21 ` Eli Zaretskii [this message]
2015-12-23 3:23 ` Jitendra Pawar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83bn9iqwrt.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb@sourceware.org \
--cc=jitendrap@ryussi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox