patches/gdb/6.3/750-debian_sparc-singlestep.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun May 20 13:48:26 2007 +0000 (2007-05-20)
changeset 112 ea15433daba0
permissions -rw-r--r--
Ah! I finally have a progress bar that doesn't stall the build!
- pipe size in Linux is only 8*512=4096 bytes
- pipe size is not setable
- when the feeding process spits out data faster than the eating
process can read it, then the feeding process stalls after 4KiB
of data sent to the pipe
- for us, the progress bar would spawn a sub-shell every line,
and the sub-shell would in turn spawn a 'date' command.
Which was sloooww as hell, and would cause some kind of a
starvation: the pipe was full most of the time, and the
feeding process was stalled all this time.

Now, we use internal variables and a little hack based onan offset
to determine the elapsed time. Much faster this way, but still
CPU-intensive.
yann@96
     1
Status: submitted for comments
yann@96
     2
yann@96
     3
2004-11-13  Daniel Jacobowitz  <dan@debian.org>
yann@96
     4
yann@96
     5
	* sparc-tdep.c (sparc_software_single_step): Handle stepping to NULL.
yann@96
     6
yann@96
     7
Index: gdb-6.3/gdb/sparc-tdep.c
yann@96
     8
===================================================================
yann@96
     9
--- gdb-6.3.orig/gdb/sparc-tdep.c	2004-06-06 22:02:55.000000000 -0400
yann@96
    10
+++ gdb-6.3/gdb/sparc-tdep.c	2004-11-13 17:06:05.000000000 -0500
yann@96
    11
@@ -1026,10 +1026,10 @@
yann@96
    12
 
yann@96
    13
   if (insert_breakpoints_p)
yann@96
    14
     {
yann@96
    15
-      CORE_ADDR pc;
yann@96
    16
+      CORE_ADDR pc, orig_npc;
yann@96
    17
 
yann@96
    18
       pc = sparc_address_from_register (tdep->pc_regnum);
yann@96
    19
-      npc = sparc_address_from_register (tdep->npc_regnum);
yann@96
    20
+      orig_npc = npc = sparc_address_from_register (tdep->npc_regnum);
yann@96
    21
 
yann@96
    22
       /* Analyze the instruction at PC.  */
yann@96
    23
       nnpc = sparc_analyze_control_transfer (pc, &npc);
yann@96
    24
@@ -1039,9 +1039,10 @@
yann@96
    25
 	target_insert_breakpoint (nnpc, nnpc_save);
yann@96
    26
 
yann@96
    27
       /* Assert that we have set at least one breakpoint, and that
yann@96
    28
-         they're not set at the same spot.  */
yann@96
    29
-      gdb_assert (npc != 0 || nnpc != 0);
yann@96
    30
-      gdb_assert (nnpc != npc);
yann@96
    31
+         they're not set at the same spot - unless we're going
yann@96
    32
+	 from here straight to NULL, i.e. a call or jump to 0.  */
yann@96
    33
+      gdb_assert (npc != 0 || nnpc != 0 || orig_npc == 0);
yann@96
    34
+      gdb_assert (nnpc != npc || orig_npc == 0);
yann@96
    35
     }
yann@96
    36
   else
yann@96
    37
     {