From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46151 invoked by alias); 22 Dec 2015 12:03:20 -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 44792 invoked by uid 89); 22 Dec 2015 12:03:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=AWL,BAYES_00,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=HX-Received:Tue, UD:t.c, observed, char* 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; Tue, 22 Dec 2015 12:03:18 +0000 Received: by mail-ob0-f172.google.com with SMTP id iw8so142598749obc.1 for ; Tue, 22 Dec 2015 04:03:17 -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:date:message-id:subject:from:to :content-type; bh=hsRpKsRx8b7Ai181lou6tGTje8eLIxnuBZRcGb7w7z8=; b=X60SZqFKadsaa2VwzuFeINBxClox+M7ifnWuyItNjL1ud8XA4E1/IXqIQ0WGoSBsFP Yi6yg32gN0hujxbPZo9JMW/z2DrAcRMD9QaCHyhhPYNL2dCr427wfMHIny82Fnx6UUl8 hOg88YQv0UOu02zQzn1jVJZlLEmUfAyCoKN+Wo79eEbyIRkUe0tfzkH2n6+lVDd1qgrd uT27EVHQuyZBw/n7Q3Zc6mdaZmda5UiphFOp0xF4OWu03w94wKCj6k1n08S2/5ohh2zl +Z0Qygim/l0nzoRyb+gUxo5xNDGHJ4eeJFChVN6R8ms9A9avwWc7G1zwinn5IGYt4oho +EZg== X-Gm-Message-State: ALoCoQkxdseYr8OSb5FZfZFRfd26VnVp/dPVR9mp2CfawemneCaRL8vUggGquyrWcFo61/uKbfHjB2DNGfxhHwDpVDcWOTXc+A== MIME-Version: 1.0 X-Received: by 10.60.85.103 with SMTP id g7mr10178168oez.10.1450785796196; Tue, 22 Dec 2015 04:03:16 -0800 (PST) Received: by 10.202.201.139 with HTTP; Tue, 22 Dec 2015 04:03:16 -0800 (PST) Date: Tue, 22 Dec 2015 12:03:00 -0000 Message-ID: Subject: The step-Over (next) command seems repetitively displaying same statement execution From: Jitendra Pawar To: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg00030.txt.bz2 Hello, While using gdb some time I saw that the step-over(next) command repeats whatever display in last step. This mostly observed while stepping over the system calls. For example- Below is my sample code snippet- ------------------------------------------------------------------------ #include #include #include int main(void) { char *c; c = (char*) malloc (12); memcpy(c, "Hello World", 12); printf("%s\n", c); } ------------------------------------------------------------------------ While debugging this code I found that the malloc statement execution repeats as shown below- ------------------------------------------------------------------------ $ 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? Thanks in advance, - Jitendra Pawar