Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
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
Date: Tue, 04 Dec 2012 23:29:00 -0000	[thread overview]
Message-ID: <20670.34632.856080.472369@ruffy2.mtv.corp.google.com> (raw)
In-Reply-To: <201212040709.qB479ppK023958@glazunov.sibelius.xs4all.nl>

Mark Kettenis writes:
 > > Date: Tue, 04 Dec 2012 06:09:29 +0000 (GMT)
 > > From: KARTHIKVENKATESH BHAT <kv.bhat@samsung.com>
 > > 
 > > 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  <kv.bhat@samsung.com>
 > > +
 > > +	* 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  <dje@google.com>

	* 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);
     }
  


  parent reply	other threads:[~2012-12-04 23:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04  6:09 KARTHIKVENKATESH BHAT
     [not found] ` <201212040709.qB479ppK023958@glazunov.sibelius.xs4all.nl>
2012-12-04 23:29   ` Doug Evans [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-11-27 13:47 KARTHIKVENKATESH BHAT
2012-11-27 15:59 ` Tom Tromey
2012-11-21 15:39 KARTHIKVENKATESH BHAT
2012-11-21 15:53 ` Pedro Alves
2012-11-27 11:14 ` Mark Kettenis
2012-11-20  4:58 KARTHIKVENKATESH BHAT
2012-11-21 13:11 ` Pedro Alves
2012-11-21 13:20   ` Mark Kettenis
2012-11-21 14:11     ` Pedro Alves
2012-11-19  8:07 KARTHIKVENKATESH BHAT
2012-11-19 14:43 ` H.J. Lu
2012-11-19 15:50 ` Tom Tromey

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=20670.34632.856080.472369@ruffy2.mtv.corp.google.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kv.bhat@samsung.com \
    --cc=mark.kettenis@xs4all.nl \
    --cc=palves@redhat.com \
    --cc=tromey@redhat.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