freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2-demos] master 13eb36c 2/2: [ttdebug]: Key `K' shows full stac


From: Werner LEMBERG
Subject: [freetype2-demos] master 13eb36c 2/2: [ttdebug]: Key `K' shows full stack.
Date: Sat, 30 Dec 2017 17:22:26 -0500 (EST)

branch: master
commit 13eb36c227822f97565165c058add4ffd8e29fec
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>

    [ttdebug]: Key `K' shows full stack.
    
    * src/ttdebug.c (RunIns): Update help display.
    Handle key `K'.
---
 ChangeLog     |  9 ++++++++-
 src/ttdebug.c | 46 +++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 47 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 36643c6..1d801dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
 2017-12-30  Werner Lemberg  <address@hidden>
 
-       [ttdebug]: Key 'I' toggles hexadecimal/decimal numbers display.
+       [ttdebug]: Key `K' shows full stack.
+
+       * src/ttdebug.c (RunIns): Update help display.
+       Handle key `K'.
+
+2017-12-30  Werner Lemberg  <address@hidden>
+
+       [ttdebug]: Key `I' toggles hexadecimal/decimal numbers display.
 
        * src/ttdebug.c (use_hex): New global variable.
        (Cur_U_Line): Use it.
diff --git a/src/ttdebug.c b/src/ttdebug.c
index 6374e57..3b1f30e 100644
--- a/src/ttdebug.c
+++ b/src/ttdebug.c
@@ -1242,7 +1242,7 @@
         {
           char  temp[90];
           int   n, col, pop;
-          int   args = CUR.args;
+          int   args;
 
 
           sprintf( temp, "%78c\n", ' ' );
@@ -1286,7 +1286,7 @@
             if ( pop == 0 )
               temp[col - 1] = temp[col - 1] == '(' ? ' ' : ')';
 
-            if ( args < CUR.top && args >= 0 )
+            if ( args >= 0 )
             {
               long  val = (signed long)CUR.stack[args];
 
@@ -1390,9 +1390,10 @@
             "n   skip to next instruction            T   show twilight zone\n"
             "s   step into                           S   show storage area\n"
             "f   finish current function             C   show CVT data\n"
-            "l   show last bytecode instruction      F   toggle 
floating/fixed\n"
-            "b   toggle breakpoint at curr. pos.         point format\n"
-            "p   toggle breakpoint at prev. pos.     I   toggle hexadecimal/\n"
+            "l   show last bytecode instruction      K   show full stack\n"
+            "b   toggle breakpoint at curr. pos.     F   toggle 
floating/fixed\n"
+            "p   toggle breakpoint at prev. pos.         point format\n"
+            "                                        I   toggle hexadecimal/\n"
             "                                            decimal int. format\n"
             "                                        B   show backtrace\n"
             "\n"
@@ -1405,9 +1406,10 @@
             "  the second line the changes after the instruction,\n"
             "  indicated by parentheses and brackets for emphasis.\n"
             "\n"
-            "  A `T', `F', `S', or `C' appended to the index indicates\n"
+            "  `T', `F', `S', `s', or `C' appended to the index indicates\n"
             "  a twilight point, a phantom point, a storage location,\n"
-            "  or data from the Control Value Table (CVT), respectively.\n"
+            "  a stack value, or data from the Control Value Table (CVT),\n"
+            "  respectively.\n"
             "\n"
             "  Possible tag values are `P' (on curve), `C' (control point),\n"
             "  `X' (touched horizontally), and `Y' (touched vertically).\n"
@@ -1553,6 +1555,36 @@
           }
           break;
 
+        /* Show full stack */
+        case 'K':
+          {
+            int  args = CUR.top - 1;
+
+
+            if ( args >= 0 )
+            {
+              printf( "Stack\n"
+                      "\n" );
+              printf( " idx         value       \n"
+                      "-------------------------\n" );
+
+              for ( ; args >= 0; args-- )
+              {
+                long  val = (signed long)CUR.stack[args];
+
+
+                printf( "%3lds  %8ld (%8.2f)\n",
+                        CUR.top - args,
+                        val,
+                        val / 64.0 );
+              }
+              printf( "\n" );
+            }
+            else
+              printf( "Stack empty\n" );
+          }
+          break;
+
         /* Show glyph points table */
         case 'P':
           show_points_table( &pts, code_range, pts.n_points, 0 );



reply via email to

[Prev in Thread] Current Thread [Next in Thread]