Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <ghost@cs.msu.su>
To: Nick Roberts <nickrob@snap.net.nz>
Cc: Joel Brobecker <brobecker@adacore.com>,  gdb-patches@sourceware.org
Subject: Re: (gdb-6.8) Discard breakpoint address if shared library is unloaded
Date: Fri, 08 Feb 2008 06:44:00 -0000	[thread overview]
Message-ID: <200802080942.29622.ghost@cs.msu.su> (raw)
In-Reply-To: <18347.45621.630420.453287@kahikatea.snap.net.nz>

On Friday 08 February 2008 04:36:53 Nick Roberts wrote:
> Joel Brobecker writes:
>  > Vladimir,
>  > 
>  > I could use a little help with your feedback. I think I'm getting it,
>  > but I think you might know more about this part of the code.
> 
> Since it looks like Vladimir can't find the time to look at this

Huh? I don't think expecting a response within one business day
is quite reasonable.

> and because 
> you might like to make the branch shortly, FWIW, I've looked more closely
> at it:
> 
>  > I think we're still not there, unfortunately.
>  > 
>  > >   	 state -- it will be apparent from the locations.  */
>  > >         if (header_of_multiple)
>  > >   	pending = 0;
>  > > !       ui_out_field_fmt (uiout, "enabled", "%c", 
>  > > !  			bpenables[(int) b->enable_state]);
>  > >       }
>  > 
>  > The following code above "ui_out_field_fmt" can be deleted now:
>  > 
>  >       int pending = (b->loc == NULL || b->loc->shlib_disabled);
>  >       /* For header of multiple, there's no point showing pending
>  >          state -- it will be apparent from the locations.  */
>  >       if (header_of_multiple)
>  >         pending = 0;
>  > 
>  > That means that the curly braces can go too. We also need to restore
>  > the spacing after the enable state. We end up with:
> 
> I agree.
> 
>  >   annotate_field (3);
>  >   if (part_of_multiple)
>  >     ui_out_field_string (uiout, "enabled", loc->enabled ? "y" : "n");
>  >   else
>  >     ui_out_field_fmt (uiout, "enabled", "%c",
>  >                       bpenables[(int) b->enable_state]);
>  >   ui_out_spaces (uiout, 2);
> 
> Putting this back to 2 spaces requires a similar change to the header to keep
> alignment:
> 
> *************** breakpoint_1 (int bnum, int allflag)
> *** 3780,3786 ****
>     ui_out_table_header (uiout, 4, ui_left, "disp", "Disp");		/* 3 */
>     if (nr_printable_breakpoints > 0)
>       annotate_field (3);
> !   ui_out_table_header (uiout, 4, ui_left, "enabled", "Enb");	/* 4 */
>     if (addressprint)
>   	{
>   	  if (nr_printable_breakpoints > 0)
> --- 3767,3773 ----
>     ui_out_table_header (uiout, 4, ui_left, "disp", "Disp");		/* 3 */
>     if (nr_printable_breakpoints > 0)
>       annotate_field (3);
> !   ui_out_table_header (uiout, 3, ui_left, "enabled", "Enb");	/* 4 */
>     if (addressprint)
>   	{
>   	  if (nr_printable_breakpoints > 0)
> 
> 
>  > >   	      ui_out_field_string (uiout, "addr", "<PENDING>");
>  > >   	    else if (header_of_multiple)
>  > >   	      ui_out_field_string (uiout, "addr", "<MULTIPLE>");
>  > > + 	    else if (loc->shlib_disabled)
>  > > + 	      ui_out_field_string (uiout, "addr", "<PENDING>");
>  > >   	    else
>  > >   	      ui_out_field_core_addr (uiout, "addr", loc->address);
>  > >   	  }
>  > 
>  > I understand what Vladimir said, but I think that the following should
>  > work too:
>  > 
>  > @@ -3552,10 +3552,10 @@ print_one_breakpoint_location (struct br
>  >  	if (addressprint)
>  >  	  {
>  >  	    annotate_field (4);
>  > -	    if (b->loc == NULL)
>  > -	      ui_out_field_string (uiout, "addr", "<PENDING>");
>  > -	    else if (header_of_multiple)
>  > +	    if (header_of_multiple)
>  >  	      ui_out_field_string (uiout, "addr", "<MULTIPLE>");
>  > +	    if (b->loc == NULL || loc->shlib_disabled)
>  > +	      ui_out_field_string (uiout, "addr", "<PENDING>");
>  >  	    else
>  >  	      ui_out_field_core_addr (uiout, "addr", loc->address);
>  >  	  }
>  > 
>  > The idea is that you can't have header_of_multiple=1 and b->loc == NULL
>  > at the same time. So it's OK to move the check for header_of_multiple
>  > up.  And that avoids the code duplication.
> 
> I agree.
> 
> I can confirm that Gdb works as I would expect with these changes.

Since you seem to have a patch relative to previous one, would you mind
sending a complete patch relative to CVS HEAD?

> 
> On a related note, breakpoint.c now has 7 columns:
> 
>   ui_out_table_header (uiout, 7, ui_left, "number", "Num");		/* 1 */
> 
> up from the previous 3:
> 
>   ui_out_table_header (uiout, 3, ui_left, "number", "Num");		/* 1 */
> 
> presumably for breakpoint numbers like 1.2 etc but it still seems to
> anticipate a very large number of breakpoints.

That's part of the original multiple location patch; I don't think
it's related in any way to what we're discussing now.

- Volodya


 



  reply	other threads:[~2008-02-08  6:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080204214226.GF20922@adacore.com>
2008-02-04 21:55 ` Nick Roberts
2008-02-05  0:12   ` Joel Brobecker
2008-02-05  0:21     ` Joel Brobecker
2008-02-05  0:36       ` Nick Roberts
2008-02-05  0:54     ` Nick Roberts
2008-02-07  6:38       ` Joel Brobecker
2008-02-08  1:37         ` Nick Roberts
2008-02-08  6:44           ` Vladimir Prus [this message]
2008-02-08  7:37             ` Nick Roberts
2008-02-14 21:43               ` Joel Brobecker
2008-02-15  4:01                 ` Nick Roberts
2008-02-15  8:39                   ` Eli Zaretskii
2008-02-15  9:13                     ` Nick Roberts
2008-02-16 12:59                       ` Eli Zaretskii
2008-02-17  9:56                   ` Vladimir Prus
2008-02-17 19:53                     ` Nick Roberts
2008-02-19 19:02                   ` Joel Brobecker
2008-02-19 20:04                     ` Nick Roberts
2008-02-20 16:31                       ` Joel Brobecker
2008-02-20 19:21                         ` Nick Roberts
2008-02-20 20:27                           ` Vladimir Prus
2008-02-25 10:04                             ` Vladimir Prus
2008-02-25 19:39                               ` Joel Brobecker
2008-02-26 10:03                                 ` Vladimir Prus
2008-02-26 22:55                                   ` Joel Brobecker

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=200802080942.29622.ghost@cs.msu.su \
    --to=ghost@cs.msu.su \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nickrob@snap.net.nz \
    /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