poke-devel
[Top][All Lists]
Advanced

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

[COMMITTED] poke: change handling of IOS identifiers in dot-commands


From: Jose E. Marchesi
Subject: [COMMITTED] poke: change handling of IOS identifiers in dot-commands
Date: Wed, 01 Nov 2023 11:49:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

IO spaces are characterized by an unique identifier, which is a
positive integer.  Up to now, in poke we have been using the notion of
"IO space tag", with the form #N, where N is the IO space identifier.

The several dot-commands getting IO spaces as arguments got these
arguments as "tags", like for example:

  .ios #23

for changing the current IO space to the one with Id 23.  Now,
however, we have support in poke for referring to IO spaces by name
using the $<...> construct.

This patch changes the several dot-commands that get IO spaces as
arguments in order to get arbitrary Poke expressions instead of tags.
This makes it possible to refer to IO space identifiers directly as
Poke integers, or stored in variables, or by name using $<...>.

Examples:

(poke) .ios $</bin/ls>
(poke) .map create foo, 2 + 1
(poke) .map create bar, variable_with_ios_id

2023-11-01  Jose E. Marchesi  <jemarch@gnu.org>

        * poke/pk-cmd-ios.c (expr_to_ios): New function.
        (pk_cmd_close): Get a Poke expression as an
        argument intead of an IOS tag.
        (pk_cmd_sub): Likewise.
        (pk_cmd_ios): Likewise.
        * poke/pk-cmd-map.c (pk_cmd_map_remove): Likewise.
        (pk_cmd_map_create): Likewise.
        (pk_cmd_map_show): Likewise.
        (pk_cmd_map_entry_add): Likewise.
        (pk_cmd_map_entry_remove): Likewise.
        (pk_cmd_map_load): Likewise.
        (pk_cmd_info_maps): Likewise.
        * testsuite/poke.cmd/extract-1.pk: Adapt test accordingly.
        * testsuite/poke.cmd/close-sub-1.pk: Likewise.
        * testsuite/poke.map/ass-map-22.pk: Likewise.
        * testsuite/poke.pkl/ios-cur-1.pk: Likewise.
        * testsuite/poke.cmd/ios-1.pk: Likewise.
        * testsuite/poke.cmd/sub-2.pk: Likewise.
        * testsuite/poke.cmd/sub-2.pk: Likewise.
        * testsuite/poke.cmd/maps-3.pk: Likewise.
        * testsuite/poke.cmd/maps-4.pk: Likewise.
        * testsuite/poke.cmd/maps-5.pk: Likewise.
        * testsuite/poke.cmd/maps-6.pk: Likewise.
        * testsuite/poke.cmd/maps-7.pk: Likewise.
        * testsuite/poke.cmd/maps-2.pk: Likewise.
        * testsuite/poke.cmd/maps-7.pk: Likewise.
        * testsuite/poke.cmd/maps-8.pk: Likewise.
        * testsuite/poke.cmd/maps-9.pk: Likewise.
        * testsuite/poke.cmd/file-mode.pk: Likewise.
        * testsuite/poke.cmd/file-bias-1.pk: Likewise.
        * testsuite/poke.cmd/file-bias-2.pk: Likewise.
        * testsuite/poke.cmd/file-relative.pk: Likewise.
        * doc/poke.texi: Update documentation on IO space tags and ids.
---
 ChangeLog                           |  36 +++++
 doc/poke.texi                       | 116 +++++++++-------
 poke/pk-cmd-ios.c                   |  94 ++++++++-----
 poke/pk-cmd-map.c                   | 197 ++++++++++++++++++++++------
 testsuite/poke.cmd/close-sub-1.pk   |   2 +-
 testsuite/poke.cmd/extract-1.pk     |   2 +-
 testsuite/poke.cmd/file-bias-1.pk   |   2 +-
 testsuite/poke.cmd/file-bias-2.pk   |   2 +-
 testsuite/poke.cmd/file-mode.pk     |   4 +-
 testsuite/poke.cmd/file-relative.pk |   2 +-
 testsuite/poke.cmd/ios-1.pk         |   4 +-
 testsuite/poke.cmd/maps-2.pk        |   2 +-
 testsuite/poke.cmd/maps-3.pk        |   4 +-
 testsuite/poke.cmd/maps-4.pk        |   2 +-
 testsuite/poke.cmd/maps-5.pk        |   2 +-
 testsuite/poke.cmd/maps-6.pk        |   2 +-
 testsuite/poke.cmd/maps-7.pk        |   4 +-
 testsuite/poke.cmd/maps-8.pk        |   6 +-
 testsuite/poke.cmd/maps-9.pk        |   6 +-
 testsuite/poke.cmd/sub-1.pk         |   2 +-
 testsuite/poke.cmd/sub-2.pk         |   2 +-
 testsuite/poke.map/ass-map-22.pk    |   4 +-
 testsuite/poke.pkl/ios-cur-1.pk     |   4 +-
 23 files changed, 352 insertions(+), 149 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a7bfa9cf..3191698a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,39 @@
+2023-11-01  Jose E. Marchesi  <jemarch@gnu.org>
+
+       * poke/pk-cmd-ios.c (expr_to_ios): New function.
+       (pk_cmd_close): Get a Poke expression as an
+       argument intead of an IOS tag.
+       (pk_cmd_sub): Likewise.
+       (pk_cmd_ios): Likewise.
+       * poke/pk-cmd-map.c (pk_cmd_map_remove): Likewise.
+       (pk_cmd_map_create): Likewise.
+       (pk_cmd_map_show): Likewise.
+       (pk_cmd_map_entry_add): Likewise.
+       (pk_cmd_map_entry_remove): Likewise.
+       (pk_cmd_map_load): Likewise.
+       (pk_cmd_info_maps): Likewise.
+       * testsuite/poke.cmd/extract-1.pk: Adapt test accordingly.
+       * testsuite/poke.cmd/close-sub-1.pk: Likewise.
+       * testsuite/poke.map/ass-map-22.pk: Likewise.
+       * testsuite/poke.pkl/ios-cur-1.pk: Likewise.
+       * testsuite/poke.cmd/ios-1.pk: Likewise.
+       * testsuite/poke.cmd/sub-2.pk: Likewise.
+       * testsuite/poke.cmd/sub-2.pk: Likewise.
+       * testsuite/poke.cmd/maps-3.pk: Likewise.
+       * testsuite/poke.cmd/maps-4.pk: Likewise.
+       * testsuite/poke.cmd/maps-5.pk: Likewise.
+       * testsuite/poke.cmd/maps-6.pk: Likewise.
+       * testsuite/poke.cmd/maps-7.pk: Likewise.
+       * testsuite/poke.cmd/maps-2.pk: Likewise.
+       * testsuite/poke.cmd/maps-7.pk: Likewise.
+       * testsuite/poke.cmd/maps-8.pk: Likewise.
+       * testsuite/poke.cmd/maps-9.pk: Likewise.
+       * testsuite/poke.cmd/file-mode.pk: Likewise.
+       * testsuite/poke.cmd/file-bias-1.pk: Likewise.
+       * testsuite/poke.cmd/file-bias-2.pk: Likewise.
+       * testsuite/poke.cmd/file-relative.pk: Likewise.
+       * doc/poke.texi: Update documentation on IO space tags and ids.
+
 2023-10-30  Jose E. Marchesi  <jemarch@gnu.org>
 
        * poke/pk-help.pk (pk_help): Hint at activating the page at the
diff --git a/doc/poke.texi b/doc/poke.texi
index 102dff8f..cfa013c2 100644
--- a/doc/poke.texi
+++ b/doc/poke.texi
@@ -1139,16 +1139,18 @@ about:
 @example
 (poke) .info ios
   Id   Type    Mode    Bias            Size            Name
-* #0   FILE    rw      0x00000000#B    0x00000398#B    ./foo.o
+* 0    FILE    rw      0x00000000#B    0x00000398#B    ./foo.o
 @end example
 
 The command @command{.info ios} gives us information about all the IO
-spaces that are currently open.  The first column tells us a @dfn{tag}
-that identifies the IOS.  In this example, the tag corresponding to
-@file{foo.o} is @code{#0}.  The second column tells us the type of
-IO space. The third column tells us that @file{foo.o} allows both
-reading and writing.  The fourth column tells us the size of the file,
-in hexadecimal.
+spaces that are currently open.  The first column tells us a positive
+integer that identifies the IOS.  This @dfn{IO space identifier} is
+unique at any given time.  In this example, the id corresponding to
+@file{foo.o} is @code{0}.  The second column tells us the type of IO
+space. The third column tells us that @file{foo.o} allows both reading
+and writing.  The fourth column tells us the size of the file, in
+hexadecimal.  The fifth column is the name of the IO space; in this
+case, it is the path to the file being edited.
 
 You may wonder what is that weird suffix @code{#B}.  It is a unit,
 and tells us that the size @code{0x398} is measured in bytes, @i{i.e.} the
@@ -1164,8 +1166,8 @@ clearly, let's open another file:
 The current IOS is now `./bar.o'.
 (poke) .info ios
   Id   Type    Mode    Bias            Size            Name
-* #1   FILE    rw      0x00000000#B    0x00000398#B    ./bar.o
-  #0   FILE    rw      0x00000000#B    0x00000398#B    ./foo.o
+* 1    FILE    rw      0x00000000#B    0x00000398#B    ./bar.o
+  0    FILE    rw      0x00000000#B    0x00000398#B    ./foo.o
 @end example
 
 Ah, there we have both @file{foo.o} and @file{bar.o}.  Now the current
@@ -1173,15 +1175,15 @@ IO space (the entry featuring the asterisk at the left) 
is the file
 that we just opened, @file{bar.o}.  This is because poke always sets
 the most recently open file as the current one.  We can switch back to
 @file{foo.o} using yet another dot-command, @command{.ios}, which gets
-an IO space tag as an argument:
+an IO space as an argument:
 
 @example
-(poke) .ios #0
+(poke) .ios 0
 The current IOS is now `./foo.o'.
 (poke) .info ios
   Id   Type    Mode    Bias            Size            Name
-  #1   FILE    rw      0x00000000#B    0x00000398#B    ./bar.o
-* #0   FILE    rw      0x00000000#B    0x00000398#B    ./foo.o
+  1    FILE    rw      0x00000000#B    0x00000398#B    ./bar.o
+* 0    FILE    rw      0x00000000#B    0x00000398#B    ./foo.o
 @end example
 
 @noindent
@@ -1189,10 +1191,22 @@ We are back to @file{foo.o}.  Since we are not really 
interested in
 @file{bar.o}, let's close it:
 
 @example
-(poke) .close #1
+(poke) .close 1
 (poke) .info ios
   Id   Type    Mode    Bias            Size            Name
-* #0   FILE    rw      0x00000000#B    0x00000398#B    ./foo.o
+* 0    FILE    rw      0x00000000#B    0x00000398#B    ./foo.o
+@end example
+
+Note how in the examples above we used the IO space identifiers (0 and
+1) in order to refer to them.  This can be inconvenient, as these ids
+are not memorable at all.  Fortunately it is also possible to refer to
+an IO space by name using the @code{$<@var{name}>} construct, like
+this:
+
+@example
+(poke) .ios $<./foo.o>
+The current IOS is now `./foo.o'.
+(poke) .close $<./bar.o>
 @end example
 
 @noindent
@@ -2658,7 +2672,7 @@ that opened a file as an IO space?
 The current IOS is now `./foo.o'.
 (poke) .info ios
   Id   Type    Mode    Bias            Size            Name
-* #0   FILE    rw      0x00000000#B    0x000004c8#B    ./foo.o
+* 0    FILE    rw      0x00000000#B    0x000004c8#B    ./foo.o
 @end example
 
 @noindent
@@ -2670,8 +2684,8 @@ Memory buffers can be created using a similar dot-command,
 The current IOS is now `*foo*'.
 (poke) .info ios
   Id   Type    Mode    Bias            Size            Name
-* #1   MEMORY          0x00000000#B    0x00001000#B    *foo*
-  #0   FILE    rw      0x00000000#B    0x000004c8#B    ./foo.o
+* 1    MEMORY          0x00000000#B    0x00001000#B    *foo*
+  0    FILE    rw      0x00000000#B    0x000004c8#B    ./foo.o
 @end example
 
 Note how the name of the buffer is built by prepending and appending
@@ -2795,8 +2809,8 @@ we can continue our work tomorrow.  This is how we would 
do that:
 @example
 (poke) .info ios
   Id   Type    Mode    Bias            Size            Name
-* #1   MEMORY          0x00000000#B    0x00001000#B    *scratch*
-  #0   FILE    rw      0x00000000#B    0x000f4241#B    ./foo.o
+* 1    MEMORY          0x00000000#B    0x00001000#B    *scratch*
+  0    FILE    rw      0x00000000#B    0x000f4241#B    ./foo.o
 (poke) save :from 0#B :size iosize (1) :file "scratch.dat"
 @end example
 
@@ -3839,8 +3853,8 @@ $ poke p.sbm
 The current IOS is now `*scratch*'.
 (poke) .info ios
   Id   Type    Mode    Bias            Size            Name
-* #1   MEMORY          0x00000000#B    0x00001000#B    *scratch*
-  #0   FILE    rw      0x00000000#B    0x0000006e#B    ./p.sbm
+* 1    MEMORY          0x00000000#B    0x00001000#B    *scratch*
+  0    FILE    rw      0x00000000#B    0x0000006e#B    ./p.sbm
 (poke) copy :from_ios 0 :from 0#B :to 0#B :size iosize (0)
 (poke) dump
 76543210  0011 2233 4455 6677 8899 aabb ccdd eeff  0123456789ABCDEF
@@ -6386,12 +6400,12 @@ programs using the following attributes:
 @end example
 
 That's it, @code{ehdr} is mapped at offset zero byte in the IO space
-@code{#0}, which corresponds to @code{foo.o}:
+@code{0}, which corresponds to @code{foo.o}:
 
 @example
 (poke) .info ios
   Id   Type    Mode    Bias            Size            Name
-* #0   FILE    rw      0x00000000#B    0x000004c8#B   ./foo.o
+* 0    FILE    rw      0x00000000#B    0x000004c8#B   ./foo.o
 @end example
 
 Now that we have the ELF header, we may use it to get access to the
@@ -6463,8 +6477,8 @@ ELF file: @code{bar.o}.  We would start by opening the 
file:
 (poke) .file bar.o
 (poke) .info ios
   Id   Type    Mode    Bias            Size            Name
-* #1   FILE    rw      0x00000000#B    0x000004c8#B    ./bar.o
-  #0   FILE    rw      0x00000000#B    0x000004c8#B    ./foo.o
+* 1    FILE    rw      0x00000000#B    0x000004c8#B    ./bar.o
+  0    FILE    rw      0x00000000#B    0x000004c8#B    ./foo.o
 @end example
 
 Now that @code{bar.o} is the current IO space, we can map its header.
@@ -6628,7 +6642,7 @@ the prompt changes accordingly:
 @example
 (poke) [self](poke) .mem foo
 The current IOS is now `*foo*'.
-(poke) .ios #0
+(poke) .ios $<*foo*>
 The current IOS is now `./foo.o'.
 [self](poke)
 @end example
@@ -6639,11 +6653,11 @@ full list of loaded maps, with more information about 
them:
 @example
 (poke) .info maps
 IOS   Name   Source
-#0    self   ./self.map
+0    self   ./self.map
 @end example
 
 In this case, there is a map @code{self} loaded in the IO space
-@code{#0}, which corresponds to @code{foo.o}.
+@code{0}, which corresponds to @code{foo.o}.
 
 Once we make @code{foo.o} our current IO space, we can ask poke to
 show us the entries corresponding to this map using another
@@ -6703,7 +6717,7 @@ depending on the current IO space:
 Offset       Entry
 0UL#B        $self::ehdr
 3158952UL#B  $self::shdr
-[self](poke) .ios #0
+[self](poke) .ios 0
 The current IOS is now `./foo.o'.
 [self](poke) .map show self
 Offset   Entry
@@ -6716,11 +6730,11 @@ Offset   Entry
 DSO:
 
 @example
-(poke) .ios #0
+(poke) .ios 0
 The current IOS is now `./foo.o'.
 [self](poke) $self::ehdr.e_type
 1UH
-[self](poke) .ios #2
+[self](poke) .ios 2
 The current IOS is now `/usr/local/lib/libpoke.so.0.0.0'.
 [self](poke) $self::ehdr.e_type
 3UH
@@ -6772,8 +6786,8 @@ contains DWARF info!  Let's take a look:
 @example
 [dwarf,self](poke) .info maps
 IOS   Name    Source
-#0    dwarf   /home/jemarch/gnu/hacks/poke/maps/dwarf.map
-#0    self    ./self.map
+0     dwarf   /home/jemarch/gnu/hacks/poke/maps/dwarf.map
+0     self    ./self.map
 [dwarf,self](poke) .map show dwarf
 Offset    Entry
 0x5bUL#B  $dwarf::info
@@ -8926,7 +8940,7 @@ The @command{.sub} command opens a new IO sub-space.  The 
syntax is:
 @end example
 
 @noindent
-where @var{ios} is the tag of some existing IO space, @var{base} and
+where @var{ios} identifies some existing IO space, @var{base} and
 @var{size} are integers denoting the base and size of the range
 covered by the sub-space (in bytes) and @var{name} is an optional
 name.
@@ -8935,14 +8949,16 @@ name.
 @section @code{.ios}
 @cindex @code{.ios}
 
-@cindex tags, file ID tags
-A list of open files, and their corresponding tags, can be obtained
-using the @command{.info ios} command.  Once a tag is known, you can
-use the @command{.ios} command to switch back to that file:
+A list of open IO spaces, and their corresponding identifiers and
+names, can be obtained using the @command{.info ios} command.  You can
+use the @command{.ios} command to switch back to a particular IO space
+by providing an expression that evaluates to its identifier:
 
 @example
-(poke) .ios #1
+(poke) .ios 1
 The current IOS is now `foo.o'.
+(poke) .ios $</bin/ls>
+The current IOS is now `/bin/ls'.
 @end example
 
 @node close command
@@ -8954,11 +8970,17 @@ The @command{.close} command closes the selected IO 
space.  The syntax
 is:
 
 @example
-.close @var{#tag}
+.close @var{ios}
 @end example
 
 @noindent
-where @var{#tag} is a tag identifying an open IO space.
+Where @var{ios} is a Poke expression that evaluates to an IO space
+identifier.  Examples:
+
+@example
+(poke) .close 1
+(poke) .close $<*foo*>
+@end example
 
 Note that closing an IO space with this dot-command implies closing
 any sub IO space having it as a base.
@@ -9025,8 +9047,8 @@ Display a list of open files.
 @example
 (poke) .info ios
   Id   Type    Mode    Bias            Size            Name
-  #1   FILE    r       0x00000000#B    0x0000df78#B    foo.o
-* #0   FILE    rw      0x00000000#B    0x00000022#B    foo.bson
+  1    FILE    r       0x00000000#B    0x0000df78#B    foo.o
+* 0    FILE    rw      0x00000000#B    0x00000022#B    foo.bson
 @end example
 
 @cindex IO space
@@ -9037,12 +9059,12 @@ the file that can be passed to the @command{.file} 
command in order to
 switch to it as the new current IO space:
 
 @example
-(poke) .ios #1
+(poke) .ios 1
 The current file is now `foo.o'.
 (poke) .info ios
   Id   Type    Mode    Bias            Size            Name
-* #1   FILE    r       0x00000000#B    0x0000df78#B    foo.o
-  #0   FILE    rw      0x00000000#B    0x00000022#B    foo.bson
+* 1    FILE    r       0x00000000#B    0x0000df78#B    foo.o
+  0    FILE    rw      0x00000000#B    0x00000022#B    foo.bson
 @end example
 
 @item .info variables [@var{regexp}]
diff --git a/poke/pk-cmd-ios.c b/poke/pk-cmd-ios.c
index 39a28bd9..cb51f777 100644
--- a/poke/pk-cmd-ios.c
+++ b/poke/pk-cmd-ios.c
@@ -37,27 +37,57 @@
 #  include "pk-hserver.h"
 #endif
 
+/* Get a Poke expression and compile it to get an IO space identifier.
+   Lexical cuckolding is active to allow referring to IO spaces by
+   name with $<...> constructs.  If the expression is invalid or
+   doesn't evaluate to a valid IO space id then return NULL.  */
+
+static pk_ios
+expr_to_ios (const char *expr)
+{
+  pk_val val;
+  pk_val exit_exception = PK_NULL;
+  int ret;
+
+  pk_set_lexical_cuckolding_p (poke_compiler, 1);
+  ret = pk_compile_expression (poke_compiler, expr, NULL, &val,
+                               &exit_exception);
+  pk_set_lexical_cuckolding_p (poke_compiler, 0);
+
+  if (ret != PK_OK || exit_exception != PK_NULL)
+    {
+      /* The compiler has already printed diagnostics in the
+         terminal.  */
+      if (exit_exception != PK_NULL)
+        poke_handle_exception (exit_exception);
+      return NULL;
+    }
+
+  /* See that VAL is an IO space, i.e. an int<32>.  */
+  if (pk_type_code (pk_typeof (val)) != PK_TYPE_INT
+      || pk_int_size (val) != 32)
+    return NULL;
+
+  return pk_ios_search_by_id (poke_compiler, pk_int_value (val));
+}
+
 static int
 pk_cmd_ios (int argc, struct pk_cmd_arg argv[], uint64_t uflags)
 {
-  /* ios #ID */
-
-  int io_id;
+  /* ios EXPR */
   pk_ios io;
 
   assert (argc == 2);
-  assert (PK_CMD_ARG_TYPE (argv[1]) == PK_CMD_ARG_TAG);
+  assert (PK_CMD_ARG_TYPE (argv[1]) == PK_CMD_ARG_STR);
 
-  io_id = PK_CMD_ARG_TAG (argv[1]);
-  io = pk_ios_search_by_id (poke_compiler, io_id);
+  io = expr_to_ios (PK_CMD_ARG_STR (argv[1]));
   if (io == NULL)
     {
-      pk_printf (_("No IOS with tag #%d\n"), io_id);
+      pk_puts ("error: no such IO space\n");
       return 0;
     }
 
   pk_ios_set_cur (poke_compiler, io);
-
   if (poke_interactive_p && !poke_quiet_p)
     pk_printf (_("The current IOS is now `%s'.\n"),
                pk_ios_handler (pk_ios_cur (poke_compiler)));
@@ -68,15 +98,17 @@ static int
 pk_cmd_sub (int argc, struct pk_cmd_arg argv[], uint64_t uflags)
 {
   char *handler, *name;
-  int ios;
+  pk_ios ios;
   uint64_t base, size;
 
   assert (argc == 5);
 
   /* Collect and validate arguments.  */
 
-  assert (PK_CMD_ARG_TYPE (argv[1]) == PK_CMD_ARG_TAG);
-  ios = PK_CMD_ARG_TAG (argv[1]);
+  assert (PK_CMD_ARG_TYPE (argv[1]) == PK_CMD_ARG_STR);
+  ios = expr_to_ios (PK_CMD_ARG_STR (argv[1]));
+  if (ios == NULL)
+    return 0;
 
   assert (PK_CMD_ARG_TYPE (argv[2]) == PK_CMD_ARG_INT);
   base = PK_CMD_ARG_INT (argv[2]);
@@ -90,7 +122,7 @@ pk_cmd_sub (int argc, struct pk_cmd_arg argv[], uint64_t 
uflags)
 
   /* Build the handler.  */
   if (asprintf (&handler, "sub://%d/0x%" PRIx64 "/0x%" PRIx64 "/%s",
-                ios, base, size, name ? name : "") == -1)
+                pk_ios_get_id (ios), base, size, name ? name : "") == -1)
     return 0;
 
   /* Open the IOS.  */
@@ -224,23 +256,20 @@ pk_cmd_close (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
 {
   /* close [#ID]  */
   pk_ios io;
-  int io_id;
+  const char *expr;
 
   assert (argc == 2);
+  assert (PK_CMD_ARG_TYPE (argv[1]) == PK_CMD_ARG_STR);
+  expr = PK_CMD_ARG_STR (argv[1]);
 
-  if (PK_CMD_ARG_TYPE (argv[1]) == PK_CMD_ARG_NULL)
-    {
-      io = pk_ios_cur (poke_compiler);
-      io_id = pk_ios_get_id (io);
-    }
+  if (*expr == '\0')
+    io = pk_ios_cur (poke_compiler);
   else
     {
-      io_id = PK_CMD_ARG_TAG (argv[1]);
-
-      io = pk_ios_search_by_id (poke_compiler, io_id);
+      io = expr_to_ios (expr);
       if (io == NULL)
         {
-          pk_printf (_("No such IO space: #%d\n"), io_id);
+          pk_printf (_("error: no such IO space\n"));
           return 0;
         }
     }
@@ -249,7 +278,8 @@ pk_cmd_close (int argc, struct pk_cmd_arg argv[], uint64_t 
uflags)
 
   /* All right, now we want to close all the open IOS which are subs
      of the space we just closed.  */
-  pk_ios_map (poke_compiler, close_if_sub_of, (void *) (intptr_t) io_id);
+  pk_ios_map (poke_compiler, close_if_sub_of,
+              (void *) (intptr_t) pk_ios_get_id (io));
 
   return 1;
 }
@@ -267,7 +297,7 @@ print_info_ios (pk_ios io, void *data)
   {
     char *tag;
 
-    asprintf (&tag, "%s#%d",
+    asprintf (&tag, "%s%d",
               io == pk_ios_cur (poke_compiler) ? "* " : "  ",
               pk_ios_get_id (io));
     pk_table_column (table, tag);
@@ -310,7 +340,7 @@ print_info_ios (pk_ios io, void *data)
     char *cmd;
     char *hyperlink;
 
-    asprintf (&cmd, ".ios #%d", pk_ios_get_id (io));
+    asprintf (&cmd, ".ios %d", pk_ios_get_id (io));
     hyperlink = pk_hserver_make_hyperlink ('e', cmd, PK_NULL);
     free (cmd);
 
@@ -328,7 +358,7 @@ print_info_ios (pk_ios io, void *data)
       char *cmd;
       char *hyperlink;
 
-      asprintf (&cmd, ".close #%d", pk_ios_get_id (io));
+      asprintf (&cmd, ".close %d", pk_ios_get_id (io));
       hyperlink = pk_hserver_make_hyperlink ('e', cmd, PK_NULL);
       free (cmd);
 
@@ -479,7 +509,7 @@ pk_cmd_mem (int argc, struct pk_cmd_arg argv[], uint64_t 
uflags)
 
   if (pk_ios_search (poke_compiler, mem_name) != NULL)
     {
-      printf (_("Buffer %s already opened.  Use `.ios #N' to switch.\n"),
+      printf (_("Buffer %s already opened.  Use `.ios IOS' to switch.\n"),
               mem_name);
       free (mem_name);
       return 0;
@@ -516,7 +546,7 @@ pk_cmd_nbd (int argc, struct pk_cmd_arg argv[], uint64_t 
uflags)
 
   if (pk_ios_search (poke_compiler, nbd_name) != NULL)
     {
-      printf (_("Buffer %s already opened.  Use `.ios #N' to switch.\n"),
+      printf (_("Buffer %s already opened.  Use `.ios IOS' to switch.\n"),
               nbd_name);
       free (nbd_name);
       return 0;
@@ -544,7 +574,7 @@ ios_completion_function (const char *x, int state)
 }
 
 const struct pk_cmd ios_cmd =
-  {"ios", "t", "", 0, NULL, NULL, pk_cmd_ios, "ios #ID", 
ios_completion_function};
+  {"ios", "s", "", 0, NULL, NULL, pk_cmd_ios, "ios EXPR", 
ios_completion_function};
 
 const struct pk_cmd file_cmd =
   {"file", "f", PK_FILE_UFLAGS, 0, NULL, NULL, pk_cmd_file, "file FILE-NAME",
@@ -554,7 +584,7 @@ const struct pk_cmd proc_cmd =
   {"proc", "i", PK_PROC_UFLAGS, 0, NULL, NULL, pk_cmd_proc, "proc PID", NULL};
 
 const struct pk_cmd sub_cmd =
-  {"sub", "t,i,i,?s", "", 0, NULL, NULL, pk_cmd_sub, "sub IOS, BASE, SIZE, 
[NAME]", NULL};
+  {"sub", "s,i,i,?s", "", 0, NULL, NULL, pk_cmd_sub, "sub IOS, BASE, SIZE, 
[NAME]", NULL};
 
 const struct pk_cmd mem_cmd =
   {"mem", "s", "", 0, NULL, NULL, pk_cmd_mem, "mem NAME", NULL};
@@ -565,8 +595,8 @@ const struct pk_cmd nbd_cmd =
 #endif
 
 const struct pk_cmd close_cmd =
-  {"close", "?t", "", PK_CMD_F_REQ_IO, NULL, NULL, pk_cmd_close,
-   "close [#ID]", ios_completion_function};
+  {"close", "s", "", PK_CMD_F_REQ_IO, NULL, NULL, pk_cmd_close,
+   "close [IOS]", ios_completion_function};
 
 const struct pk_cmd info_ios_cmd =
   {"ios", "", "", 0, NULL, NULL, pk_cmd_info_ios, "info ios", NULL};
diff --git a/poke/pk-cmd-map.c b/poke/pk-cmd-map.c
index 58782bcd..4052aff6 100644
--- a/poke/pk-cmd-map.c
+++ b/poke/pk-cmd-map.c
@@ -27,6 +27,35 @@
 #include "pk-map.h"
 #include "pk-table.h"
 
+/* Get a Poke expression and compile it to get an int<32> Poke value.
+   If the expression doesn't evaluate to an int<32> then return PK_
+   doesn't evaluate to a valid IO space id then return PK_NULL.  */
+
+static int
+expr_to_intval (const char *expr, pk_val *retval)
+{
+  pk_val val;
+  pk_val exit_exception = PK_NULL;
+  int ret;
+
+  pk_set_lexical_cuckolding_p (poke_compiler, 1);
+  ret = pk_compile_expression (poke_compiler, expr, NULL, &val,
+                               &exit_exception);
+  pk_set_lexical_cuckolding_p (poke_compiler, 0);
+
+  if (ret != PK_OK || exit_exception != PK_NULL)
+    {
+      /* The compiler has already printed diagnostics in the
+         terminal.  */
+      if (exit_exception != PK_NULL)
+        poke_handle_exception (exit_exception);
+      return 0;
+    }
+
+   *retval = val;
+   return 1;
+}
+
 #define SET_TO_CUR_IOS_ID(ios_id)                                             \
   do                                                                          \
     {                                                                         \
@@ -45,7 +74,7 @@
 static int
 pk_cmd_map_create (int argc, struct pk_cmd_arg argv[], uint64_t uflags)
 {
-  /* map create MAPNAME [,#IOS] */
+  /* map create MAPNAME [,IOS] */
 
   int ios_id;
   const char *mapname;
@@ -57,7 +86,7 @@ pk_cmd_map_create (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
 
   if (strlen (mapname) == 0)
     {
-      pk_printf (_("Invalid name for map\n"));
+      pk_printf (_("Invalid name for map.\n"));
       return 0;
     }
 
@@ -65,17 +94,30 @@ pk_cmd_map_create (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
     SET_TO_CUR_IOS_ID (ios_id);
   else
     {
-      ios_id = PK_CMD_ARG_TAG (argv[2]);
+      pk_val val;
+
+      if (!expr_to_intval (PK_CMD_ARG_STR (argv[2]), &val))
+        /* Compiler should have emitted diagnostics already.  */
+        return 0;
+
+      if (pk_type_code (pk_typeof (val)) != PK_TYPE_INT)
+        {
+          pk_printf (_("Expected IO space identifier.\n"));
+          return 0;
+        }
+
+      ios_id = pk_int_value (val);
+
       if (pk_ios_search_by_id (poke_compiler, ios_id) == NULL)
         {
-          pk_printf (_("No such IOS #%d\n"), ios_id);
+          pk_printf (_("No such IOS with Id %d.\n"), ios_id);
           return 0;
         }
     }
 
   if (!pk_map_create (ios_id, mapname, NULL /* source */))
     {
-      pk_printf (_("The map `%s' already exists in IOS #%d\n"),
+      pk_printf (_("The map `%s' already exists in IOS %d\n."),
                  mapname, ios_id);
       return 0;
     }
@@ -86,7 +128,7 @@ pk_cmd_map_create (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
 static int
 pk_cmd_map_remove (int argc, struct pk_cmd_arg argv[], uint64_t uflags)
 {
-  /* map remove MAPNAME [,#IOS] */
+  /* map remove MAPNAME [,IOS] */
 
   int ios_id;
   const char *mapname;
@@ -98,7 +140,7 @@ pk_cmd_map_remove (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
 
   if (strlen (mapname) == 0)
     {
-      pk_printf (_("Invalid name for map\n"));
+      pk_printf (_("Invalid name for map.\n"));
       return 0;
     }
 
@@ -106,17 +148,30 @@ pk_cmd_map_remove (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
     SET_TO_CUR_IOS_ID (ios_id);
   else
     {
-      ios_id = PK_CMD_ARG_TAG (argv[2]);
+      pk_val val;
+
+      if (!expr_to_intval (PK_CMD_ARG_STR (argv[2]), &val))
+        /* Compiler should have emitted diagnostics already.  */
+        return 0;
+
+      if (pk_type_code (pk_typeof (val)) != PK_TYPE_INT)
+        {
+          pk_printf (_("Expected IO space identifier.\n"));
+          return 0;
+        }
+
+      ios_id = pk_int_value (val);
+
       if (pk_ios_search_by_id (poke_compiler, ios_id) == NULL)
         {
-          pk_printf (_("No such IOS #%d\n"), ios_id);
+          pk_printf (_("No such IOS %d.\n"), ios_id);
           return 0;
         }
     }
 
   if (!pk_map_remove (ios_id, mapname))
     {
-      pk_printf (_("No such map `%s' in IOS #%d\n"),
+      pk_printf (_("No such map `%s' in IOS %d.\n"),
                  mapname, ios_id);
       return 0;
     }
@@ -127,7 +182,7 @@ pk_cmd_map_remove (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
 static int
 pk_cmd_map_show (int argc, struct pk_cmd_arg argv[], uint64_t uflags)
 {
-  /* map show MAPNAME [,#IOS] */
+  /* map show MAPNAME [,IOS] */
 
   int ios_id;
   const char *mapname;
@@ -142,10 +197,22 @@ pk_cmd_map_show (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
     SET_TO_CUR_IOS_ID (ios_id);
   else
     {
-      ios_id = PK_CMD_ARG_TAG (argv[2]);
+      pk_val val;
+
+      if (!expr_to_intval (PK_CMD_ARG_STR (argv[2]), &val))
+        /* Compiler should have emitted diagnostics already.  */
+        return 0;
+
+      if (pk_type_code (pk_typeof (val)) != PK_TYPE_INT)
+        {
+          pk_printf (_("Expected IO space identifier.\n"));
+          return 0;
+        }
+
+      ios_id = pk_int_value (val);
       if (pk_ios_search_by_id (poke_compiler, ios_id) == NULL)
         {
-          pk_printf (_("No such IOS #%d\n"), ios_id);
+          pk_printf (_("No such IOS %d.\n"), ios_id);
           return 0;
         }
     }
@@ -156,7 +223,7 @@ pk_cmd_map_show (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
   map = pk_map_search (ios_id, mapname);
   if (!map)
     {
-      pk_printf (_("No such map `%s' in IOS #%d\n"),
+      pk_printf (_("No such map `%s' in IOS %d.\n"),
                  mapname, ios_id);
       return 0;
     }
@@ -196,7 +263,7 @@ pk_cmd_map_show (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
 static int
 pk_cmd_map_entry_add (int argc, struct pk_cmd_arg argv[], uint64_t uflags)
 {
-  /* map entry add MAPNAME, VARNAME [,#IOS]  */
+  /* map entry add MAPNAME, VARNAME [,IOS]  */
 
   int ios_id;
   const char *mapname;
@@ -215,10 +282,22 @@ pk_cmd_map_entry_add (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
     SET_TO_CUR_IOS_ID (ios_id);
   else
     {
-      ios_id = PK_CMD_ARG_TAG (argv[3]);
+      pk_val val;
+
+      if (!expr_to_intval (PK_CMD_ARG_STR (argv[3]), &val))
+        /* Compiler should have emitted diagnostics already.  */
+        return 0;
+
+      if (pk_type_code (pk_typeof (val)) != PK_TYPE_INT)
+        {
+          pk_printf (_("Expected IO space identifier.\n"));
+          return 0;
+        }
+
+      ios_id = pk_int_value (val);
       if (pk_ios_search_by_id (poke_compiler, ios_id) == NULL)
         {
-          pk_printf (_("No such IOS #%d\n"), ios_id);
+          pk_printf (_("No such IOS %d.\n"), ios_id);
           return 0;
         }
     }
@@ -226,7 +305,7 @@ pk_cmd_map_entry_add (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
   /* Make sure the specified map exists in the given IO space.  */
   if (!pk_map_search (ios_id, mapname))
     {
-      pk_printf (_("No such map `%s' in IOS #%d\n"),
+      pk_printf (_("No such map `%s' in IOS %d.\n"),
                  mapname, ios_id);
       return 0;
     }
@@ -234,7 +313,7 @@ pk_cmd_map_entry_add (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
   /* Make sure the variable exists in the top-level environment.  */
   if (!pk_decl_p (poke_compiler, varname, PK_DECL_KIND_VAR))
     {
-      pk_printf ("Variable `%s' doesn't exist\n", varname);
+      pk_printf ("Variable `%s' doesn't exist.\n", varname);
       return 0;
     }
 
@@ -246,7 +325,7 @@ pk_cmd_map_entry_add (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
   if (!pk_val_mapped_p (val)
       || pk_int_value (pk_val_ios (val)) != ios_id)
     {
-      pk_printf ("Variable `%s' is not mapped in the IOS #%d\n",
+      pk_printf ("Variable `%s' is not mapped in the IOS %d.\n",
                  varname, ios_id);
       return 0;
     }
@@ -255,7 +334,7 @@ pk_cmd_map_entry_add (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
   if (!pk_map_add_entry (ios_id, mapname,
                          varname, varname, pk_val_offset (val)))
     {
-      pk_printf ("The entry `%s' already exists in map `%s'\n",
+      pk_printf ("The entry `%s' already exists in map `%s'.\n",
                  varname, mapname);
       return 0;
     }
@@ -266,7 +345,7 @@ pk_cmd_map_entry_add (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
 static int
 pk_cmd_map_entry_remove (int argc, struct pk_cmd_arg argv[], uint64_t uflags)
 {
-  /* map entry remove MAPNAME, VARNAME [,#IOS]  */
+  /* map entry remove MAPNAME, VARNAME [,IOS]  */
 
   int ios_id;
   const char *mapname;
@@ -284,10 +363,22 @@ pk_cmd_map_entry_remove (int argc, struct pk_cmd_arg 
argv[], uint64_t uflags)
     SET_TO_CUR_IOS_ID (ios_id);
   else
     {
-      ios_id = PK_CMD_ARG_TAG (argv[3]);
+      pk_val val;
+
+      if (!expr_to_intval (PK_CMD_ARG_STR (argv[3]), &val))
+        /* Compiler should have emitted diagnostics already.  */
+        return 0;
+
+      if (pk_type_code (pk_typeof (val)) != PK_TYPE_INT)
+        {
+          pk_printf (_("Expected IO space identifier.\n"));
+          return 0;
+        }
+
+      ios_id = pk_int_value (val);
       if (pk_ios_search_by_id (poke_compiler, ios_id) == NULL)
         {
-          pk_printf (_("No such IOS #%d\n"), ios_id);
+          pk_printf (_("No such IOS %d.\n"), ios_id);
           return 0;
         }
     }
@@ -295,14 +386,14 @@ pk_cmd_map_entry_remove (int argc, struct pk_cmd_arg 
argv[], uint64_t uflags)
   /* Make sure the specified map exists in the given IO space.  */
   if (!pk_map_search (ios_id, mapname))
     {
-      pk_printf (_("No such map `%s' in IOS #%d\n"),
+      pk_printf (_("No such map `%s' in IOS %d.\n"),
                  mapname, ios_id);
       return 0;
     }
 
   if (!pk_map_remove_entry (ios_id, mapname, entryname))
     {
-      pk_printf (_("no entry `%s' in map `%s'\n"),
+      pk_printf (_("No entry `%s' in map `%s'.\n"),
                  entryname, mapname);
       return 0;
     }
@@ -313,7 +404,7 @@ pk_cmd_map_entry_remove (int argc, struct pk_cmd_arg 
argv[], uint64_t uflags)
 static int
 pk_cmd_map_load (int argc, struct pk_cmd_arg argv[], uint64_t uflags)
 {
-  /* map load MAPNAME [,#IOS] */
+  /* map load MAPNAME [,IOS] */
 
   int ios_id, filename_p;
   const char *mapname, *filename;
@@ -327,10 +418,22 @@ pk_cmd_map_load (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
     SET_TO_CUR_IOS_ID (ios_id);
   else
     {
-      ios_id = PK_CMD_ARG_TAG (argv[2]);
+      pk_val val;
+
+      if (!expr_to_intval (PK_CMD_ARG_STR (argv[2]), &val))
+        /* Compiler should have emitted diagnostics already.  */
+        return 0;
+
+      if (pk_type_code (pk_typeof (val)) != PK_TYPE_INT)
+        {
+          pk_printf (_("Expected IO space identifier.\n"));
+          return 0;
+        }
+
+      ios_id = pk_int_value (val);
       if (pk_ios_search_by_id (poke_compiler, ios_id) == NULL)
         {
-          pk_printf (_("No such IOS #%d\n"), ios_id);
+          pk_printf (_("No such IOS %d.\n"), ios_id);
           return 0;
         }
     }
@@ -339,7 +442,7 @@ pk_cmd_map_load (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
   filename = pk_map_resolve_map (mapname, filename_p);
   if (!filename)
     {
-      pk_printf (_("No such map `%s'\n"), mapname);
+      pk_printf (_("No such map `%s'.\n"), mapname);
       return 0;
     }
 
@@ -369,7 +472,7 @@ pk_cmd_map_save (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
 static int
 pk_cmd_info_maps (int argc, struct pk_cmd_arg argv[], uint64_t uflags)
 {
-  /* info maps [,#IOS] */
+  /* info maps [,IOS] */
   int ios_id;
   pk_map maps, map;
 
@@ -379,10 +482,22 @@ pk_cmd_info_maps (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
     SET_TO_CUR_IOS_ID (ios_id);
   else
     {
-      ios_id = PK_CMD_ARG_TAG (argv[1]);
+      pk_val val;
+
+      if (!expr_to_intval (PK_CMD_ARG_STR (argv[1]), &val))
+        /* Compiler should have emitted diagnostics already.  */
+        return 0;
+
+      if (pk_type_code (pk_typeof (val)) != PK_TYPE_INT)
+        {
+          pk_printf (_("Expected IO space identifier.\n"));
+          return 0;
+        }
+
+      ios_id = pk_int_value (val);
       if (pk_ios_search_by_id (poke_compiler, ios_id) == NULL)
         {
-          pk_printf (_("No such IOS #%d\n"), ios_id);
+          pk_printf (_("No such IOS %d.\n"), ios_id);
           return 0;
         }
     }
@@ -403,7 +518,7 @@ pk_cmd_info_maps (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
 
           pk_table_row (table);
 
-          asprintf (&ios, "#%d", ios_id);
+          asprintf (&ios, "%d", ios_id);
           pk_table_column (table, ios);
           free (ios);
           pk_table_column (table, PK_MAP_NAME (map));
@@ -425,11 +540,11 @@ info_maps_completion_function (const char *x, int state)
 }
 
 const struct pk_cmd map_entry_add_cmd =
-  {"add", "s,s,?t", "", 0, NULL, NULL, pk_cmd_map_entry_add, "add MAPNAME, 
VARNAME [,#IOS]",
+  {"add", "s,s,?s", "", 0, NULL, NULL, pk_cmd_map_entry_add, "add MAPNAME, 
VARNAME [,IOS]",
    NULL};
 
 const struct pk_cmd map_entry_remove_cmd =
-  {"remove", "s,s,?t", "", 0, NULL, NULL, pk_cmd_map_entry_remove, "remove 
MAPNAME, VARNAME [,#IOS]",
+  {"remove", "s,s,?s", "", 0, NULL, NULL, pk_cmd_map_entry_remove, "remove 
MAPNAME, VARNAME [,IOS]",
    NULL};
 
 extern struct pk_cmd null_cmd; /* pk-cmd.c  */
@@ -455,19 +570,19 @@ const struct pk_cmd map_entry_cmd =
    map_entry_completion_function};
 
 const struct pk_cmd map_create_cmd =
-  {"create", "s,?t", "", 0, NULL, NULL, pk_cmd_map_create, "create MAPNAME 
[,#IOS]",
+  {"create", "s,?s", "", 0, NULL, NULL, pk_cmd_map_create, "create MAPNAME 
[,IOS]",
    NULL};
 
 const struct pk_cmd map_remove_cmd =
-  {"remove", "s,?t", "", 0, NULL, NULL, pk_cmd_map_remove, "remove MAPNAME 
[,#IOS]",
+  {"remove", "s,?s", "", 0, NULL, NULL, pk_cmd_map_remove, "remove MAPNAME 
[,IOS]",
    NULL};
 
 const struct pk_cmd map_show_cmd =
-  {"show", "s,?t", "", 0, NULL, NULL, pk_cmd_map_show, "show MAPNAME [,#IOS]",
+  {"show", "s,?s", "", 0, NULL, NULL, pk_cmd_map_show, "show MAPNAME [,IOS]",
    NULL};
 
 const struct pk_cmd map_load_cmd =
-  {"load", "s,?t", "", PK_CMD_F_REQ_IO, NULL, NULL, pk_cmd_map_load, "load 
MAPNAME [,#IOS]",
+  {"load", "s,?s", "", PK_CMD_F_REQ_IO, NULL, NULL, pk_cmd_map_load, "load 
MAPNAME [,IOS]",
    /* XXX use a completion function for maps.  */
    rl_filename_completion_function};
 
@@ -497,5 +612,5 @@ const struct pk_cmd map_cmd =
    map_completion_function};
 
 const struct pk_cmd info_maps_cmd =
-  {"maps", "?t", "", PK_CMD_F_REQ_IO, NULL, NULL, pk_cmd_info_maps, "info 
maps",
+  {"maps", "?s", "", PK_CMD_F_REQ_IO, NULL, NULL, pk_cmd_info_maps, "info 
maps",
    info_maps_completion_function};
diff --git a/testsuite/poke.cmd/close-sub-1.pk 
b/testsuite/poke.cmd/close-sub-1.pk
index bf45629b..554f49a5 100644
--- a/testsuite/poke.cmd/close-sub-1.pk
+++ b/testsuite/poke.cmd/close-sub-1.pk
@@ -5,7 +5,7 @@
 /* { dg-command {var sub1 = opensub (mem1, 0#B, 10#B, "sub1")} } */
 /* { dg-command {var sub2 = opensub (mem1, 0#B, 20#B, "sub2")} } */
 /* { dg-command {var sub3 = opensub (mem2, 0#B, 10#B, "sub3")} } */
-/* { dg-command {.close #0} } */
+/* { dg-command {.close $<*foo*>} } */
 /* { dg-command {.info ios} } */
 /* { dg-output ".*Id.*" } */
 /* { dg-output "\n.*sub3.*" } */
diff --git a/testsuite/poke.cmd/extract-1.pk b/testsuite/poke.cmd/extract-1.pk
index 0306b8c0..3f4c9b69 100644
--- a/testsuite/poke.cmd/extract-1.pk
+++ b/testsuite/poke.cmd/extract-1.pk
@@ -3,6 +3,6 @@
 
 /* { dg-command { .set obase 16 } } */
 /* { dg-command { extract :val (byte[3] @ 1#B) :to "buffer" } } */
-/* { dg-command { .ios #1 } } */
+/* { dg-command { .ios 1 } } */
 /* { dg-command { byte[3] @ 0#B } } */
 /* { dg-output "\\\[0x20UB,0x30UB,0x40UB\\\]" } */
diff --git a/testsuite/poke.cmd/file-bias-1.pk 
b/testsuite/poke.cmd/file-bias-1.pk
index 96ce3a22..918c06fd 100644
--- a/testsuite/poke.cmd/file-bias-1.pk
+++ b/testsuite/poke.cmd/file-bias-1.pk
@@ -5,4 +5,4 @@
 /* { dg-command { iosetbias (0x13#b) } } */
 /* { dg-command { .info ios } } */
 /* { dg-output "  Id +Type +Mode +Bias +Size +Name" } */
-/* { dg-output "\n\\* #0 +FILE +rw +0x00000013#b +0x00000008#B +./foo.data" } 
*/
+/* { dg-output "\n\\* 0 +FILE +rw +0x00000013#b +0x00000008#B +./foo.data" } */
diff --git a/testsuite/poke.cmd/file-bias-2.pk 
b/testsuite/poke.cmd/file-bias-2.pk
index cc9d7380..921188a2 100644
--- a/testsuite/poke.cmd/file-bias-2.pk
+++ b/testsuite/poke.cmd/file-bias-2.pk
@@ -5,4 +5,4 @@
 /* { dg-command { iosetbias (0x13#B) } } */
 /* { dg-command { .info ios } } */
 /* { dg-output "  Id +Type +Mode +Bias +Size +Name" } */
-/* { dg-output "\n\\* #0 +FILE +rw +0x00000013#B +0x00000008#B +./foo.data" } 
*/
+/* { dg-output "\n\\* 0 +FILE +rw +0x00000013#B +0x00000008#B +./foo.data" } */
diff --git a/testsuite/poke.cmd/file-mode.pk b/testsuite/poke.cmd/file-mode.pk
index 8e825eba..9ebbe67b 100644
--- a/testsuite/poke.cmd/file-mode.pk
+++ b/testsuite/poke.cmd/file-mode.pk
@@ -4,5 +4,5 @@
 /* { dg-command { .file /dev/null } } */
 /* { dg-command { .info ios } } */
 /* { dg-output "  Id +Type +Mode +Bias +Size +Name" } */
-/* { dg-output {\n. #1 +FILE +rw +0x00000000#B +0x00000000#B +/dev/null} } */
-/* { dg-output {\n  #0 +FILE +r[w ] +0x00000000#B +0x[0-9a-f]*#B +/etc/passwd} 
} */
+/* { dg-output {\n. 1 +FILE +rw +0x00000000#B +0x00000000#B +/dev/null} } */
+/* { dg-output {\n  0 +FILE +r[w ] +0x00000000#B +0x[0-9a-f]*#B +/etc/passwd} 
} */
diff --git a/testsuite/poke.cmd/file-relative.pk 
b/testsuite/poke.cmd/file-relative.pk
index 403a030b..dbcb5cfc 100644
--- a/testsuite/poke.cmd/file-relative.pk
+++ b/testsuite/poke.cmd/file-relative.pk
@@ -4,4 +4,4 @@
 /* { dg-command { .file a#b } } */
 /* { dg-command { .info ios } } */
 /* { dg-output "  Id +Type +Mode +Bias +Size +Name" } */
-/* { dg-output "\n\\* #0 +FILE +rw +0x00000000#B +0x00000008#B +./a#b" } */
+/* { dg-output "\n\\* 0 +FILE +rw +0x00000000#B +0x00000008#B +./a#b" } */
diff --git a/testsuite/poke.cmd/ios-1.pk b/testsuite/poke.cmd/ios-1.pk
index 24a158a9..b8cbd233 100644
--- a/testsuite/poke.cmd/ios-1.pk
+++ b/testsuite/poke.cmd/ios-1.pk
@@ -3,9 +3,9 @@
 
 /* { dg-command { .file foo.data } } */
 /* { dg-command { .mem bar } } */
-/* { dg-command { .ios #0 } } */
+/* { dg-command { .ios 0 } } */
 /* { dg-command { get_ios } } */
 /* { dg-output "0" } */
-/* { dg-command { .ios #1 } } */
+/* { dg-command { .ios 1 } } */
 /* { dg-command { get_ios } } */
 /* { dg-output "\n1" } */
diff --git a/testsuite/poke.cmd/maps-2.pk b/testsuite/poke.cmd/maps-2.pk
index 63fc5e6b..124b83bf 100644
--- a/testsuite/poke.cmd/maps-2.pk
+++ b/testsuite/poke.cmd/maps-2.pk
@@ -4,4 +4,4 @@
 /* { dg-command { .map create foo } } */
 /* { dg-command { .info maps } } */
 /* { dg-output "IOS +Name +Source" } */
-/* { dg-output "\n#0 +foo +<stdin>" } */
+/* { dg-output "\n0 +foo +<stdin>" } */
diff --git a/testsuite/poke.cmd/maps-3.pk b/testsuite/poke.cmd/maps-3.pk
index 4ab9b348..9affda41 100644
--- a/testsuite/poke.cmd/maps-3.pk
+++ b/testsuite/poke.cmd/maps-3.pk
@@ -1,7 +1,7 @@
 /* { dg-do run } */
 /* { dg-data {c*} {0x10 0x20 0x30 0x40  0x50 0x60 0x70 0x80   0x90 0xa0 0xb0 
0xc0} } */
 
-/* { dg-command { .map create foo,#0 } } */
+/* { dg-command { .map create foo, 0 } } */
 /* { dg-command { .info maps } } */
 /* { dg-output "IOS +Name +Source" } */
-/* { dg-output "\n#0 +foo +<stdin>" } */
+/* { dg-output "\n0 +foo +<stdin>" } */
diff --git a/testsuite/poke.cmd/maps-4.pk b/testsuite/poke.cmd/maps-4.pk
index 11eb908c..9acd723f 100644
--- a/testsuite/poke.cmd/maps-4.pk
+++ b/testsuite/poke.cmd/maps-4.pk
@@ -2,7 +2,7 @@
 /* { dg-data {c*} {0x10 0x20 0x30 0x40  0x50 0x60 0x70 0x80   0x90 0xa0 0xb0 
0xc0} } */
 
 /* { dg-command { var bar = byte[2] @ 0#B } } */
-/* { dg-command { .map create foo,#0 } } */
+/* { dg-command { .map create foo,0 } } */
 /* { dg-command { .map entry add foo, bar } } */
 /* { dg-command { .map show foo } } */
 /* { dg-output "Offset +Entry" } */
diff --git a/testsuite/poke.cmd/maps-5.pk b/testsuite/poke.cmd/maps-5.pk
index 32d5ff2d..9c121e53 100644
--- a/testsuite/poke.cmd/maps-5.pk
+++ b/testsuite/poke.cmd/maps-5.pk
@@ -4,7 +4,7 @@
 /* { dg-command { var bar = byte[2] @ 0#B } } */
 /* { dg-command { var quux = int[2] @ 2#B } } */
 /* { dg-command { var jorl = byte[1] @ 17#b } } */
-/* { dg-command { .map create foo,#0 } } */
+/* { dg-command { .map create foo, 0 } } */
 /* { dg-command { .map entry add foo, quux } } */
 /* { dg-command { .map entry add foo, bar } } */
 /* { dg-command { .map entry add foo, jorl } } */
diff --git a/testsuite/poke.cmd/maps-6.pk b/testsuite/poke.cmd/maps-6.pk
index b24a9cd8..ba311ef2 100644
--- a/testsuite/poke.cmd/maps-6.pk
+++ b/testsuite/poke.cmd/maps-6.pk
@@ -4,7 +4,7 @@
 /* { dg-command { var bar = byte[2] @ 0#B } } */
 /* { dg-command { var quux = int[2] @ 2#B } } */
 /* { dg-command { var jorl = byte[1] @ 17#b } } */
-/* { dg-command { .map create foo,#0 } } */
+/* { dg-command { .map create foo, 0 } } */
 /* { dg-command { .map entry add foo, quux } } */
 /* { dg-command { .map entry add foo, bar } } */
 /* { dg-command { .map entry add foo, jorl } } */
diff --git a/testsuite/poke.cmd/maps-7.pk b/testsuite/poke.cmd/maps-7.pk
index 671b578e..beb2757e 100644
--- a/testsuite/poke.cmd/maps-7.pk
+++ b/testsuite/poke.cmd/maps-7.pk
@@ -4,13 +4,13 @@
 /* { dg-command { var bar = byte[2] @ 0#B } } */
 /* { dg-command { var quux = int[2] @ 2#B } } */
 /* { dg-command { var jorl = byte[1] @ 17#b } } */
-/* { dg-command { .map create foo,#0 } } */
+/* { dg-command { .map create foo, 0 } } */
 /* { dg-command { .map entry add foo, quux } } */
 /* { dg-command { .map entry add foo, bar } } */
 /* { dg-command { .map entry add foo, jorl } } */
 /* { dg-command { .info maps } } */
 /* { dg-output "IOS +Name +Source" } */
-/* { dg-output "\n#0 +foo +<stdin>" } */
+/* { dg-output "\n0 +foo +<stdin>" } */
 /* { dg-command { .map remove foo } } */
 /* { dg-command { .info maps } } */
 /* { dg-output "" } */
diff --git a/testsuite/poke.cmd/maps-8.pk b/testsuite/poke.cmd/maps-8.pk
index b303eed1..747b5f69 100644
--- a/testsuite/poke.cmd/maps-8.pk
+++ b/testsuite/poke.cmd/maps-8.pk
@@ -5,12 +5,12 @@
 /* { dg-command { .map create bar } } */
 /* { dg-command { .info maps } } */
 /* { dg-output "IOS +Name +Source" } */
-/* { dg-output "\n#0 +bar +<stdin>" } */
-/* { dg-output "\n#0 +foo +<stdin>" } */
+/* { dg-output "\n0 +bar +<stdin>" } */
+/* { dg-output "\n0 +foo +<stdin>" } */
 /* { dg-command { .map remove foo } } */
 /* { dg-command { .info maps } } */
 /* { dg-output "\nIOS +Name +Source" } */
-/* { dg-output "\n#0 +bar +<stdin>" } */
+/* { dg-output "\n0 +bar +<stdin>" } */
 /* { dg-command { .map remove bar } } */
 /* { dg-command { .info maps } } */
 /* { dg-output "" } */
diff --git a/testsuite/poke.cmd/maps-9.pk b/testsuite/poke.cmd/maps-9.pk
index c8ef5d84..39471cee 100644
--- a/testsuite/poke.cmd/maps-9.pk
+++ b/testsuite/poke.cmd/maps-9.pk
@@ -5,12 +5,12 @@
 /* { dg-command { .map create bar } } */
 /* { dg-command { .info maps } } */
 /* { dg-output "IOS +Name +Source" } */
-/* { dg-output "\n#0 +bar +<stdin>" } */
-/* { dg-output "\n#0 +foo +<stdin>" } */
+/* { dg-output "\n0 +bar +<stdin>" } */
+/* { dg-output "\n0 +foo +<stdin>" } */
 /* { dg-command { .map remove bar } } */
 /* { dg-command { .info maps } } */
 /* { dg-output "\nIOS +Name +Source" } */
-/* { dg-output "\n#0 +foo +<stdin>" } */
+/* { dg-output "\n0 +foo +<stdin>" } */
 /* { dg-command { .map remove foo } } */
 /* { dg-command { .info maps } } */
 /* { dg-output "" } */
diff --git a/testsuite/poke.cmd/sub-1.pk b/testsuite/poke.cmd/sub-1.pk
index 216589cc..26d75a85 100644
--- a/testsuite/poke.cmd/sub-1.pk
+++ b/testsuite/poke.cmd/sub-1.pk
@@ -1,6 +1,6 @@
 /* { dg-do run } */
 /* { dg-data {c*} {0x10 0x20 0x30 0x40  0x50 0x60 0x70 0x80   0x90 0xa0 0xb0 
0xc0} } */
 
-/* { dg-command { .sub #0,0x2,0x5,sub1 } } */
+/* { dg-command { .sub 0,0x2,0x5,sub1 } } */
 /* { dg-command { iohandler (1) } } */
 /* { dg-output "sub://0/0x2/0x5/sub1" } */
diff --git a/testsuite/poke.cmd/sub-2.pk b/testsuite/poke.cmd/sub-2.pk
index 7db87f3f..a1c1af3b 100644
--- a/testsuite/poke.cmd/sub-2.pk
+++ b/testsuite/poke.cmd/sub-2.pk
@@ -1,6 +1,6 @@
 /* { dg-do run } */
 /* { dg-data {c*} {0x10 0x20 0x30 0x40  0x50 0x60 0x70 0x80   0x90 0xa0 0xb0 
0xc0} } */
 
-/* { dg-command { .sub #0,0x2,0x5 } } */
+/* { dg-command { .sub 2-2,0x2,0x5 } } */
 /* { dg-command { iohandler (1) } } */
 /* { dg-output "sub://0/0x2/0x5/" } */
diff --git a/testsuite/poke.map/ass-map-22.pk b/testsuite/poke.map/ass-map-22.pk
index edb9b90b..8492348e 100644
--- a/testsuite/poke.map/ass-map-22.pk
+++ b/testsuite/poke.map/ass-map-22.pk
@@ -9,9 +9,9 @@
 /* { dg-command {.file ass_map_22.data} } */
 /* { dg-command {.mem bar} } */
 /* { dg-command {uint32 @ 0#B = 0xabcdef00} } */
-/* { dg-command {.ios #1} } */
+/* { dg-command {.ios 1} } */
 /* { dg-command {uint32 @ 0#B} } */
 /* { dg-output "\n0x12345678U" } */
-/* { dg-command {.ios #0} } */
+/* { dg-command {.ios 0} } */
 /* { dg-command {uint32 @ 0#B} } */
 /* { dg-output "\n0x0+U" } */
diff --git a/testsuite/poke.pkl/ios-cur-1.pk b/testsuite/poke.pkl/ios-cur-1.pk
index 590606b6..abacc499 100644
--- a/testsuite/poke.pkl/ios-cur-1.pk
+++ b/testsuite/poke.pkl/ios-cur-1.pk
@@ -3,10 +3,10 @@
 /* { dg-command { .mem foo } } */
 /* { dg-command { .mem bar } } */
 /* { dg-command { byte @ 2#B = 20 } } */
-/* { dg-command { .ios #0 } } */
+/* { dg-command { .ios 0 } } */
 /* { dg-command { byte @ 2#B = 10 } } */
 /* { dg-command { byte @ 2#B } } */
 /* { dg-output "10UB" } */
-/* { dg-command { .ios #1 } } */
+/* { dg-command { .ios 1 } } */
 /* { dg-command { byte @ 2#B } } */
 /* { dg-output "\n20UB" } */
-- 
2.30.2




reply via email to

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