bx_debug: allow expressions instead of numerals, where relevant

Samium Gromoff <[email protected]> Wed, 09 Oct 2013 00:48:00 +0400
Newsgroups gmane.comp.emulators.bochs.devel
Message-ID <[email protected]>
Good day, folks!

The attached patch allows numeric expressions, where only numbers were
allowed, for some bx_debug commands.

-- 
regards,
Samium Gromoff
--

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk

_______________________________________________
bochs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bochs-developers
commit-1ed9410 (text/diff, 3.1 KB)
commit 1ed94103340b370cf6a23e1358995bfc9146c7dd
Author: Samium Gromoff <[email protected]>
Date:   Tue Sep 24 19:56:11 2013 +0400

    bx_debug: allow expressions instead of numerals, where relevant

diff --git a/bochs/bx_debug/parser.y b/bochs/bx_debug/parser.y
index 037428d..0acfa35 100644
--- a/bochs/bx_debug/parser.y
+++ b/bochs/bx_debug/parser.y
@@ -216,12 +216,12 @@ BX_TOKEN_SEGREG:
 ;
 
 timebp_command:
-      BX_TOKEN_TIMEBP BX_TOKEN_NUMERIC '\n'
+      BX_TOKEN_TIMEBP expression '\n'
       {
           bx_dbg_timebp_command(0, $2);
           free($1);
       }
-    | BX_TOKEN_TIMEBP_ABSOLUTE BX_TOKEN_NUMERIC '\n'
+    | BX_TOKEN_TIMEBP_ABSOLUTE expression '\n'
       {
           bx_dbg_timebp_command(1, $2);
           free($1);
@@ -392,7 +392,7 @@ symbol_command:
         bx_dbg_symbol_command($2, 0, 0);
         free($1); free($2);
       }
-    | BX_TOKEN_LOAD_SYMBOLS BX_TOKEN_STRING BX_TOKEN_NUMERIC '\n'
+    | BX_TOKEN_LOAD_SYMBOLS BX_TOKEN_STRING expression '\n'
       {
         bx_dbg_symbol_command($2, 0, $3);
         free($1); free($2);
@@ -402,7 +402,7 @@ symbol_command:
         bx_dbg_symbol_command($3, 1, 0);
         free($1); free($2); free($3);
       }
-    | BX_TOKEN_LOAD_SYMBOLS BX_TOKEN_GLOBAL BX_TOKEN_STRING BX_TOKEN_NUMERIC '\n'
+    | BX_TOKEN_LOAD_SYMBOLS BX_TOKEN_GLOBAL BX_TOKEN_STRING expression '\n'
       {
         bx_dbg_symbol_command($3, 1, $4);
         free($1); free($2); free($3);
@@ -418,7 +418,7 @@ where_command:
     ;
 
 print_string_command:
-      BX_TOKEN_PRINT_STRING BX_TOKEN_NUMERIC '\n'
+      BX_TOKEN_PRINT_STRING expression '\n'
       {
         bx_dbg_print_string_command($2);
         free($1);
@@ -470,7 +470,7 @@ set_command:
         bx_dbg_set_auto_disassemble($3);
         free($1); free($2);
       }
-    | BX_TOKEN_SET BX_TOKEN_SYMBOLNAME '=' BX_TOKEN_NUMERIC '\n'
+    | BX_TOKEN_SET BX_TOKEN_SYMBOLNAME '=' expression '\n'
       {
         bx_dbg_set_symbol_command($2, $4);
         free($1); free($2);
@@ -653,7 +653,7 @@ info_command:
 
 optional_numeric :
    /* empty */ { $$ = EMPTY_ARG; }
-   | BX_TOKEN_NUMERIC;
+   | expression;
    
 regs_command:
       BX_TOKEN_REGISTERS '\n'
@@ -782,7 +782,7 @@ restore_command:
     ;
 
 writemem_command:
-      BX_TOKEN_WRITEMEM BX_TOKEN_STRING BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC '\n'
+      BX_TOKEN_WRITEMEM BX_TOKEN_STRING expression expression '\n'
       {
         bx_dbg_writemem_command($2, $3, $4);
         free($1); free($2);
@@ -790,7 +790,7 @@ writemem_command:
     ;
 
 setpmem_command:
-      BX_TOKEN_SETPMEM BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC '\n'
+      BX_TOKEN_SETPMEM expression expression expression '\n'
       {
         bx_dbg_setpmem_command($2, $3, $4);
         free($1);
@@ -885,7 +885,7 @@ instrument_command:
     ;
 
 doit_command:
-      BX_TOKEN_DOIT BX_TOKEN_NUMERIC '\n'
+      BX_TOKEN_DOIT expression '\n'
       {
         bx_dbg_doit_command($2);
         free($1);
@@ -893,7 +893,7 @@ doit_command:
     ;
 
 crc_command:
-      BX_TOKEN_CRC BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC '\n'
+      BX_TOKEN_CRC expression expression '\n'
       {
         bx_dbg_crc_command($2, $3);
         free($1);