Bug 846018 - Add a pregion command to .gdbinit. r=BenWa
☠☠ backed out by a697e3ca8fb8 ☠ ☠
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Wed, 27 Feb 2013 14:16:00 -0500
changeset 215688 047d21f101de0d49a9784ccff6a51cafdb8f8b53
parent 215687 a8a987028757ee3feae3b5ef2c74b59662aa416b
child 215689 8be2344dcff3f1ad25f5343c35114548d46d06cc
push id9967
push usercbook@mozilla.com
push dateFri, 14 Nov 2014 12:30:22 +0000
treeherderfx-team@91fa67078183 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBenWa
bugs846018
milestone36.0a1
Bug 846018 - Add a pregion command to .gdbinit. r=BenWa
.gdbinit
--- a/.gdbinit
+++ b/.gdbinit
@@ -167,15 +167,29 @@ document ptarray
         Syntax: ptarray   
         Note: idx, idx1 and idx2 must be in acceptable range [0...size()-1].
         Examples:
         ptarray a - Prints tarray content, size, capacity and T typedef
         ptarray a 0 - Prints element[idx] from tarray
         ptarray a 1 2 - Prints elements in range [idx1..idx2] from tarray
 end
 
+# define a "pregion" command to print a region in the same format as ToString()
+def pregion
+  set $r = $arg0.mImpl.mRectListHead.next
+  printf "["
+  while ($r != &$arg0.mImpl.mRectListHead)
+    if ($r !=  $arg0.mImpl.mRectListHead.next)
+        printf "; "
+    end
+    printf "%d,%d,%d,%d", $r->x, $r->y, $r->x + $r->width, $r->y + $r->height
+    set $r = $r->next
+  end
+  printf "]\n"
+end
+
 def js
   call DumpJSStack()
 end
 
 def ft
   call $arg0->DumpFrameTree()
 end