Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew STUBBS <andrew.stubbs@st.com>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH] Don't give spurious warnings when using thread specific breakpoints
Date: Wed, 18 Oct 2006 12:01:00 -0000	[thread overview]
Message-ID: <45361793.1020202@st.com> (raw)
In-Reply-To: <20061011204525.GA9622@nevyn.them.org>

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

Daniel Jacobowitz wrote:
> This does make a little sense to me.  Anyone think there's value in keeping
> the note for breakpoints in different threads?

Ok, there seems to be a consensus that the added notes are useful, but 
nobody likes the idea of suppressing the message entirely when the 
breakpoints do not conflict.

How about the attached patch which includes the one without the other? 
I've also taken the opportunity to add _() macros to a few strings.

Andrew

[-- Attachment #2: threadbreak.patch --]
[-- Type: text/plain, Size: 2554 bytes --]

2006-10-18  Andrew Stubbs  <andrew.stubbs@st.com>

	* breakpoint.c (describe_other_breakpoints): Add thread parameter.
	Annotate display with thread number where appropriate.
	Add gettext _() macro where it was missing.
	(create_breakpoints): Add thread parameter to call to
	describe_other_breakpoints.

Index: src/gdb/breakpoint.c
===================================================================
--- src.orig/gdb/breakpoint.c	2006-10-18 12:30:23.000000000 +0100
+++ src/gdb/breakpoint.c	2006-10-18 12:58:17.000000000 +0100
@@ -102,7 +102,7 @@ static void breakpoint_adjustment_warnin
 static CORE_ADDR adjust_breakpoint_address (CORE_ADDR bpaddr,
                                             enum bptype bptype);
 
-static void describe_other_breakpoints (CORE_ADDR, asection *);
+static void describe_other_breakpoints (CORE_ADDR, asection *, int);
 
 static void breakpoints_info (char *, int);
 
@@ -3782,7 +3782,7 @@ maintenance_info_breakpoints (char *bnum
 /* Print a message describing any breakpoints set at PC.  */
 
 static void
-describe_other_breakpoints (CORE_ADDR pc, asection *section)
+describe_other_breakpoints (CORE_ADDR pc, asection *section, int thread)
 {
   int others = 0;
   struct breakpoint *b;
@@ -3802,17 +3802,21 @@ describe_other_breakpoints (CORE_ADDR pc
 	  if (!b->pending && (!overlay_debugging || b->loc->section == section))
 	    {
 	      others--;
-	      printf_filtered ("%d%s%s ",
-			       b->number,
+	      printf_filtered ("%d", b->number);
+	      if (b->thread == -1 && thread != -1)
+		printf_filtered (_(" (all threads)"));
+	      else if (b->thread != -1)
+		printf_filtered (_(" (thread %d)"), b->thread);
+	      printf_filtered ("%s%s ",
 			       ((b->enable_state == bp_disabled || 
 				 b->enable_state == bp_shlib_disabled || 
 				 b->enable_state == bp_call_disabled) 
-				? " (disabled)" 
+				? _(" (disabled)")
 				: b->enable_state == bp_permanent 
-				? " (permanent)"
+				? _(" (permanent)")
 				: ""),
 			       (others > 1) ? "," 
-			       : ((others == 1) ? " and" : ""));
+			       : ((others == 1) ? _(" and") : ""));
 	    }
       printf_filtered (_("also set at pc "));
       deprecated_print_address_numeric (pc, 1, gdb_stdout);
@@ -4960,7 +4964,7 @@ create_breakpoints (struct symtabs_and_l
 	struct symtab_and_line sal = sals.sals[i];
 
 	if (from_tty)
-	  describe_other_breakpoints (sal.pc, sal.section);
+	  describe_other_breakpoints (sal.pc, sal.section, thread);
 	
 	b = set_raw_breakpoint (sal, type);
 	set_breakpoint_count (breakpoint_count + 1);

  parent reply	other threads:[~2006-10-18 12:01 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-11 13:44 Andrew STUBBS
2006-10-11 13:55 ` Daniel Jacobowitz
2006-10-11 14:46   ` Andrew STUBBS
2006-10-11 20:45     ` Daniel Jacobowitz
2006-10-11 22:12       ` Mark Kettenis
2006-10-11 22:14       ` Joel Brobecker
2006-10-18 12:01       ` Andrew STUBBS [this message]
2006-10-18 14:14         ` Daniel Jacobowitz
2006-10-18 15:12           ` Andrew STUBBS
2006-10-18 19:47             ` Eli Zaretskii
2006-10-18 20:21               ` Andreas Schwab
2006-10-19  4:17                 ` Eli Zaretskii
2006-10-19  9:47               ` Andrew STUBBS
2006-10-20  6:10                 ` Eli Zaretskii
2006-10-20 14:29                   ` Daniel Jacobowitz
2006-10-20 17:42                     ` Eli Zaretskii
2006-10-20 17:47                       ` Daniel Jacobowitz
2006-10-20 18:03                         ` Eli Zaretskii
2006-10-20 18:07                           ` Daniel Jacobowitz
2006-10-20 18:11                             ` Eli Zaretskii
2006-10-19 13:28             ` Daniel Jacobowitz
2006-10-19 15:59               ` Andrew STUBBS
2006-10-18 19:22           ` Eli Zaretskii
2006-10-11 22:06   ` Mark Kettenis
2006-10-12 10:45     ` Andrew STUBBS

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=45361793.1020202@st.com \
    --to=andrew.stubbs@st.com \
    --cc=gdb-patches@sourceware.org \
    /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