From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5016 invoked by alias); 4 Dec 2012 23:29:24 -0000 Received: (qmail 4966 invoked by uid 22791); 4 Dec 2012 23:29:23 -0000 X-SWARE-Spam-Status: No, hits=-5.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-fa0-f73.google.com (HELO mail-fa0-f73.google.com) (209.85.161.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 04 Dec 2012 23:29:18 +0000 Received: by mail-fa0-f73.google.com with SMTP id v1so297932fav.0 for ; Tue, 04 Dec 2012 15:29:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:mime-version:content-type:content-transfer-encoding:message-id :date:to:cc:subject:in-reply-to:references:x-mailer :x-gm-message-state; bh=nnDFvp3h/Iw5p1+JXkcnRXP6bwLNe/L7pBpgRbH3jLM=; b=VytT/NzF+4iySEKcMhYM5TngO9bUOnDfTBL3+98lCkmIUrUiPdafcRsqrXSFU553if dJlfbq6dWcNcXxVuoUVnB7w36SmYGlIDH/AdJkXp4D9+eTWeYCriZqwQMuUzj+gt1Cuq RWqkk0cm+puw4pO0dPnmNns+trVzOBmM1yGk84rvEDqM0LbWXLOwjJSZ5EeEBv0k0dnv kT1flPYxemIg3Q0loDDXts5g0bk8DjIAVd2GrOmycS6UcBtpK6KD/11VfNA04BmUoFVz rTsLsnFuxImyasF7EHsNsl90NxjVAAkS2dJSMYMup+GNUide5u1e6HT0HgluHlwcQ7AS gZbw== Received: by 10.14.204.199 with SMTP id h47mr7485050eeo.4.1354663756427; Tue, 04 Dec 2012 15:29:16 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id z44si866962een.0.2012.12.04.15.29.16 (version=TLSv1/SSLv3 cipher=AES128-SHA); Tue, 04 Dec 2012 15:29:16 -0800 (PST) Received: from ruffy2.mtv.corp.google.com (ruffy2.mtv.corp.google.com [172.17.128.107]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 267AF200059; Tue, 4 Dec 2012 15:29:13 -0800 (PST) From: Doug Evans MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20670.34632.856080.472369@ruffy2.mtv.corp.google.com> Date: Tue, 04 Dec 2012 23:29:00 -0000 To: Mark Kettenis Cc: kv.bhat@samsung.com, palves@redhat.com, gdb-patches@sourceware.org, tromey@redhat.com Subject: Re: [PATCH] Fix for incorect breakpoint set in case of clang compiled binary In-Reply-To: <201212040709.qB479ppK023958@glazunov.sibelius.xs4all.nl> References: <20101179.243591354601368727.JavaMail.weblogic@epml08> <201212040709.qB479ppK023958@glazunov.sibelius.xs4all.nl> X-Gm-Message-State: ALoCoQkR4sxSc/h/SH9S87OHY885O8Bom2tEAKjdux8UIcJUV9aoJx8fGQomCqknAaOIzP06BmsQt6nAoFACs2lErWCzNltME9kPM7OKu/f754rFVNgl+5ui2UY6mgc1OZ2Mc/8RWYYSmFR/uMrKib2TZLg4l0XXgoxkjifxWOXwt2hybqOABCtYkOccuGusmH+ysoaTG5jQcXHtKHHz8HS1qKxtNqtIrA== X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-12/txt/msg00067.txt.bz2 Mark Kettenis writes: > > Date: Tue, 04 Dec 2012 06:09:29 +0000 (GMT) > > From: KARTHIKVENKATESH BHAT > > > > Hi Mark/Tom/Palves, > > Thanks for taking your time out for review. > > I have implemented the review comments. Please let me know if i can commit the same. > > > > cvs diff: Diffing . > > Index: ChangeLog > > =================================================================== > > RCS file: /cvs/src/src/gdb/ChangeLog,v > > retrieving revision 1.14880 > > diff -u -p -r1.14880 ChangeLog > > --- ChangeLog 3 Dec 2012 22:31:02 -0000 1.14880 > > +++ ChangeLog 4 Dec 2012 05:06:29 -0000 > > @@ -1,3 +1,10 @@ > > +2012-12-04 Karthik Bhat > > + > > + * i386-tdep.c (i386_skip_prologue): Using symbol table > > + to find the end of prologue for clang compiled binaries. > > + * amd64-tdep.c (amd64_skip_prologue):Using symbol table > > + to find the end of prologue for clang compiled binaries. > > Missing space between : and Using in your ChangeLog entry. Otherwise > this looks ok to me. > > > Index: amd64-tdep.c > > =================================================================== > > RCS file: /cvs/src/src/gdb/amd64-tdep.c,v > > retrieving revision 1.115 > > diff -u -p -r1.115 amd64-tdep.c > > --- amd64-tdep.c 26 Oct 2012 19:34:09 -0000 1.115 > > +++ amd64-tdep.c 4 Dec 2012 05:06:30 -0000 > > @@ -2252,6 +2252,22 @@ amd64_skip_prologue (struct gdbarch *gdb > > { > > struct amd64_frame_cache cache; > > CORE_ADDR pc; > > + CORE_ADDR func_addr; > > + > > + if (find_pc_partial_function (start_pc, NULL, &func_addr, NULL)) > > + { > > + CORE_ADDR post_prologue_pc > > + = skip_prologue_using_sal (gdbarch, func_addr); > > + struct symtab *s = find_pc_symtab (func_addr); > > + > > + /* Clang always emits a line note before the prologue and another > > + one after. We trust clang to emit usable line notes. */ > > + if (post_prologue_pc > > + && (s != NULL > > + && s->producer != NULL > > + && strncmp (s->producer, "clang ", sizeof ("clang ") - 1) == 0)) > > + return max (start_pc, post_prologue_pc); > > + } > > > > amd64_init_frame_cache (&cache); > > pc = amd64_analyze_prologue (gdbarch, start_pc, 0xffffffffffffffffLL, > > Index: i386-tdep.c > > =================================================================== > > RCS file: /cvs/src/src/gdb/i386-tdep.c,v > > retrieving revision 1.364 > > diff -u -p -r1.364 i386-tdep.c > > --- i386-tdep.c 21 Nov 2012 14:09:10 -0000 1.364 > > +++ i386-tdep.c 4 Dec 2012 05:06:30 -0000 > > @@ -1582,7 +1582,23 @@ i386_skip_prologue (struct gdbarch *gdba > > CORE_ADDR pc; > > gdb_byte op; > > int i; > > + CORE_ADDR func_addr; > > > > + if (find_pc_partial_function (start_pc, NULL, &func_addr, NULL)) > > + { > > + CORE_ADDR post_prologue_pc > > + = skip_prologue_using_sal (gdbarch, func_addr); > > + struct symtab *s = find_pc_symtab (func_addr); > > + > > + /* Clang always emits a line note before the prologue and another > > + one after. We trust clang to emit usable line notes. */ > > + if (post_prologue_pc > > + && (s != NULL > > + && s->producer != NULL > > + && strncmp (s->producer, "clang ", sizeof ("clang ") - 1) == 0)) > > + return max (start_pc, post_prologue_pc); > > + } > > + > > cache.locals = -1; > > pc = i386_analyze_prologue (gdbarch, start_pc, 0xffffffff, &cache); > > if (cache.locals < 0) > > This indentation looks wonky. Ok to check in? 2012-12-04 Doug Evans * amd64-tdep.c (amd64_skip_prologue): Fix indentation. * i386-tdep.c (i386_skip_prologue): Fix indentation. Index: amd64-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/amd64-tdep.c,v retrieving revision 1.116 diff -u -p -r1.116 amd64-tdep.c --- amd64-tdep.c 4 Dec 2012 07:43:19 -0000 1.116 +++ amd64-tdep.c 4 Dec 2012 23:18:19 -0000 @@ -2263,9 +2263,9 @@ amd64_skip_prologue (struct gdbarch *gdb /* Clang always emits a line note before the prologue and another one after. We trust clang to emit usable line notes. */ if (post_prologue_pc - && (s != NULL - && s->producer != NULL - && strncmp (s->producer, "clang ", sizeof ("clang ") - 1) == 0)) + && s != NULL + && s->producer != NULL + && strncmp (s->producer, "clang ", sizeof ("clang ") - 1) == 0) return max (start_pc, post_prologue_pc); } Index: i386-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/i386-tdep.c,v retrieving revision 1.365 diff -u -p -r1.365 i386-tdep.c --- i386-tdep.c 4 Dec 2012 07:43:19 -0000 1.365 +++ i386-tdep.c 4 Dec 2012 23:18:19 -0000 @@ -1593,9 +1593,9 @@ i386_skip_prologue (struct gdbarch *gdba /* Clang always emits a line note before the prologue and another one after. We trust clang to emit usable line notes. */ if (post_prologue_pc - && (s != NULL - && s->producer != NULL - && strncmp (s->producer, "clang ", sizeof ("clang ") - 1) == 0)) + && s != NULL + && s->producer != NULL + && strncmp (s->producer, "clang ", sizeof ("clang ") - 1) == 0) return max (start_pc, post_prologue_pc); }