Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Waqas, Muhammad" <Muhammad_Waqas@mentor.com>
To: Pedro Alves <palves@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH] fix PR-15501
Date: Tue, 20 Aug 2013 06:45:00 -0000	[thread overview]
Message-ID: <53A5AC689E2AD547AE0EA5642E101306BB5F59@EU-MBX-04.mgc.mentorg.com> (raw)
In-Reply-To: <52123990.6070807@redhat.com>

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

Hi!

Sorry for inconvenience. please find attachment for the patch. I'm unable to set
mail editor settings after long try. But attached file will be applied  as
I had tested them.
________________________________________
From: Pedro Alves [palves@redhat.com]
Sent: Monday, August 19, 2013 8:28 PM
To: Waqas, Muhammad
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] fix PR-15501

Hi!

Unfortunately, I'm having trouble applying your patches.  Seems like
they're mangled somehow.  I see you're using Thunderbird.

Could you go through:

 http://sourceware.org/gdb/wiki/ContributionChecklist#Submitting_patches

and fix it up as necessary (and then check if you can apply
a patch that you privately send yourself?)

Thanks,
--
Pedro Alves


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: breakpoint.patch --]
[-- Type: text/x-patch; name="breakpoint.patch", Size: 3055 bytes --]

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.773
diff -u -p -r1.773 breakpoint.c
--- breakpoint.c	24 Jul 2013 19:50:32 -0000	1.773
+++ breakpoint.c	20 Aug 2013 05:55:02 -0000
@@ -14553,25 +14553,35 @@ disable_command (char *args, int from_tt
 	if (user_breakpoint_p (bpt))
 	  disable_breakpoint (bpt);
     }
-  else if (strchr (args, '.'))
+  else
     {
-      struct bp_location *loc = find_location_by_number (args);
-      if (loc)
+      char *num = extract_arg (&args);
+
+      while (num)
 	{
-	  if (loc->enabled)
+	  if (strchr (num, '.'))
 	    {
-	      loc->enabled = 0;
-	      mark_breakpoint_location_modified (loc);
+	      struct bp_location *loc = find_location_by_number (num);
+
+	      if (loc)
+		{
+		  if (loc->enabled)
+		    {
+		      loc->enabled = 0;
+		      mark_breakpoint_location_modified (loc);
+		    }
+		  if (target_supports_enable_disable_tracepoint ()
+		      && current_trace_status ()->running && loc->owner
+		      && is_tracepoint (loc->owner))
+		    target_disable_tracepoint (loc);
+		}
+	      update_global_location_list (0);
 	    }
-	  if (target_supports_enable_disable_tracepoint ()
-	      && current_trace_status ()->running && loc->owner
-	      && is_tracepoint (loc->owner))
-	    target_disable_tracepoint (loc);
+	  else
+	    map_breakpoint_numbers (num, do_map_disable_breakpoint, NULL);
+	  num = extract_arg (&args);
 	}
-      update_global_location_list (0);
     }
-  else
-    map_breakpoint_numbers (args, do_map_disable_breakpoint, NULL);
 }
 
 static void
@@ -14677,25 +14687,35 @@ enable_command (char *args, int from_tty
 	if (user_breakpoint_p (bpt))
 	  enable_breakpoint (bpt);
     }
-  else if (strchr (args, '.'))
+  else
     {
-      struct bp_location *loc = find_location_by_number (args);
-      if (loc)
+      char *num = extract_arg (&args);
+
+      while (num)
 	{
-	  if (!loc->enabled)
+	  if (strchr (num, '.'))
 	    {
-	      loc->enabled = 1;
-	      mark_breakpoint_location_modified (loc);
+	      struct bp_location *loc = find_location_by_number (num);
+
+	      if (loc)
+		{
+		  if (!loc->enabled)
+		    {
+		      loc->enabled = 1;
+		      mark_breakpoint_location_modified (loc);
+		    }
+		  if (target_supports_enable_disable_tracepoint ()
+		      && current_trace_status ()->running && loc->owner
+		      && is_tracepoint (loc->owner))
+		    target_enable_tracepoint (loc);
+		}
+	      update_global_location_list (1);
 	    }
-	  if (target_supports_enable_disable_tracepoint ()
-	      && current_trace_status ()->running && loc->owner
-	      && is_tracepoint (loc->owner))
-	    target_enable_tracepoint (loc);
+	  else
+	    map_breakpoint_numbers (num, do_map_enable_breakpoint, NULL);
+	  num = extract_arg (&args);
 	}
-      update_global_location_list (1);
     }
-  else
-    map_breakpoint_numbers (args, do_map_enable_breakpoint, NULL);
 }
 
 /* This struct packages up disposition data for application to multiple

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: ena-dis-br.patch --]
[-- Type: text/x-patch; name="ena-dis-br.patch", Size: 2639 bytes --]

Index: ena-dis-br.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ena-dis-br.exp,v
retrieving revision 1.22
diff -u -p -r1.22 ena-dis-br.exp
--- ena-dis-br.exp      27 Jun 2013 18:50:30 -0000      1.22
+++ ena-dis-br.exp      15 Aug 2013 09:12:04 -0000
@@ -301,5 +301,88 @@ gdb_test_multiple "continue 2" "$test" {
     }
 }
 
+# Verify that GDB correctly handles the "enable/disable" command with arguments.
+#
+if ![runto_main] then { fail "enable/disable break tests suppressed" }
+
+set b1 0
+set b2 0
+set b3 0
+set b4 0
+
+set b1 [break_at main ""]
+set b2 [break_at main ""]
+set b3 [break_at main ""]
+set b4 [break_at main ""]
+
+# This proc will work correctly If args will be according to below explaned values
+#
+# If "what" = "disable" then
+# "what_res" = "n"
+# "p1" = "pass"
+# "p2" = "fail".
+#
+# If "what" = "enable" then
+# "what_res" = "y"
+# "p1" = "fail"
+# "p2" = "pass".
+
+proc test_ena_dis_br { what what_res p1 p2 } {
+    global b1
+    global b2
+    global b3
+    global b4
+    global gdb_prompt
+   
+    gdb_test_no_output "$what $b1.1 $b2.1" "$what \$b1.1 \$b2.1"
+    set test1 "$what \$b1.1 and \$b2.1"
+   
+    gdb_test_multiple "info break" "$test1" {
+       -re "(${b1}.1)(\[^\n\r\]*)( n.*)(${b2}.1)(\[^\n\r\]*)( n.*)$gdb_prompt $" {
+           $p1 "$test1"
+       }
+       -re ".*$gdb_prompt $" {
+           $p2 "$test1"
+       }
+    }
+   
+    gdb_test "$what $b1 fooo.1" \
+       "Bad breakpoint number 'fooo'" \
+       "$what \$b1 fooo.1"
+   
+    gdb_test "info break" \
+       "(${b1})(\[^\n\r]*)( $what_res.*)" \
+       "${what}d \$b1"
+   
+    gdb_test_no_output "$what $b4 $b3.1" "$what \$b4 \$b3.1"   
+    set test1 "${what}d \$b4 and \$b3.1,remain enabled \$b3"
+   
+    gdb_test_multiple "info break" "$test1" {
+       -re "(${b3})(\[^\n\r]*)( y.*)(${b3}.1)(\[^\n\r\]*)( n.*)(${b4})(\[^\n\r\]*)( $what_res.*)$gdb_prompt $" {
+           $p1 "$test1"
+       }
+       -re "(${b3})(\[^\n\r]*)( y.*)(${b4})(\[^\n\r\]*)( $what_res.*)$gdb_prompt $" {
+           $p2 "$test1"
+       }
+    }
+   
+    gdb_test "$what $b4.1 fooobaar" \
+       "warning: bad breakpoint number at or near 'fooobaar'" \
+       "$what \$b4.1 fooobar"
+    set test1 "${what}d \$b4.1"
+   
+    gdb_test_multiple "info break" "$test1" {
+        -re "(${b4}.1)(\[^\n\r\]*)( n.*)$gdb_prompt $" {
+           $p1 "$test1"
+       }
+       -re ".*$gdb_prompt $" {
+           $p2 "$test1"
+       }
+    }
+}
+
+test_ena_dis_br "disable" "n" "pass" "fail"
+test_ena_dis_br "enable" "y" "fail" "pass"
+
 gdb_exit
 return 0

  reply	other threads:[~2013-08-20  6:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13 10:03 Muhammad Waqas
2013-08-13 17:37 ` Pedro Alves
2013-08-15 10:32   ` Muhammad Waqas
2013-08-19 15:28     ` Pedro Alves
2013-08-20  6:45       ` Waqas, Muhammad [this message]
2013-08-21 22:17     ` Pedro Alves
2013-08-22  9:36       ` Waqas, Muhammad
     [not found]         ` <5215FDBE.1060209@redhat.com>
2013-08-22 13:13           ` Waqas, Muhammad
2013-08-22 13:41             ` Pedro Alves
2013-08-23  7:27               ` Muhammad Waqas

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=53A5AC689E2AD547AE0EA5642E101306BB5F59@EU-MBX-04.mgc.mentorg.com \
    --to=muhammad_waqas@mentor.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@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