From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62711 invoked by alias); 23 Dec 2015 03:23:01 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 62699 invoked by uid 89); 23 Dec 2015 03:23:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mail-ob0-f172.google.com Received: from mail-ob0-f172.google.com (HELO mail-ob0-f172.google.com) (209.85.214.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 23 Dec 2015 03:22:59 +0000 Received: by mail-ob0-f172.google.com with SMTP id ba1so65622958obb.3 for ; Tue, 22 Dec 2015 19:22:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=wC7x7NpRT9KocAqhsUNWheB4OKaJGu7SN04ZNtKNYEg=; b=I8rgxW7A+OYUr46UqlDvYpJgiOVQwiuGnbt+UmY/HWh4Xq09wWAlYj2+XQSHXOHVrI pqWuLyJp7jbPznN+yBD6vaBR6Ve1Zr7HDFb2WXgMWFAsRhMDMcqruTMxDSPTlr3fhO0T /vUoh7ogEJuLvVuzQIh+GKamUOXvRuEbHXxpCBzAtUfQOmtNQ8QD3ECUkkn3MJBwWV6s 9UVG1b1HkKcNOhnYH4FmlCzeOOo6rdRevjP5t6vgVvGVTBTiNRa/wL2uHxgZYd6RuNir iJsFxvamNjHyWCVcZSdxoiMAX3GvAG7sLS2HgOgyOIWjeSYtHhodH8J8TSufhLuYu3eZ EYSg== X-Gm-Message-State: ALoCoQm+S5f07HVTLmnQR35PyMugeICOn+W1neN6X3wA+fqnAwZcZ+LL1bcRWP5NWMixG+7YaYRhNj6fzYV/yllFZlNZg3d9ew== MIME-Version: 1.0 X-Received: by 10.60.98.97 with SMTP id eh1mr12270184oeb.74.1450840977146; Tue, 22 Dec 2015 19:22:57 -0800 (PST) Received: by 10.202.201.139 with HTTP; Tue, 22 Dec 2015 19:22:57 -0800 (PST) In-Reply-To: <83bn9iqwrt.fsf@gnu.org> References: <83bn9iqwrt.fsf@gnu.org> Date: Wed, 23 Dec 2015 03:23:00 -0000 Message-ID: Subject: Re: The step-Over (next) command seems repetitively displaying same statement execution From: Jitendra Pawar To: Eli Zaretskii Cc: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg00032.txt.bz2 Hello Eli, I am sorry, I forgot to mention that. Compilation command is: " gcc hello.c -g " thats it. gcc version is: 4.6.3 gdb version is: GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04 Thanks, - Jitendra Pawar On Tue, Dec 22, 2015 at 9:51 PM, Eli Zaretskii wrote: >> Date: Tue, 22 Dec 2015 17:33:16 +0530 >> From: Jitendra Pawar >> >> $ 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?