[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] pkl: Fix selecting appropriate current IOS using string command
From: |
Guillermo E. Martinez |
Subject: |
[PATCH] pkl: Fix selecting appropriate current IOS using string command |
Date: |
Wed, 15 Sep 2021 22:01:06 -0500 |
Hello!,
Reading the poke manual and exercising some snippets I stumbled
with a weird behaviour using the 'string' command.
Please let me know WDYT about these changes, I'll really
appreciated that.
Kinds Regards,
Guillermo
Opening more than one buffer IOS and using the string command
to modified it, the update doesn't happens in the 'current' IOS,
instead update is occurs in the last element of the IOS stack:
(poke) .file 01.o
(poke) .file 01
(poke) .mem foo
The current IOS is now `*foo*'.
(poke) .info ios
Id Type Mode Bias Size Name
* #2 MEMORY rw 0x00000000#B 0x00001000#B *foo*
#1 FILE rw 0x00000000#B 0x000040e0#B 01
#0 FILE rw 0x00000000#B 0x00000628#B ./01.o
(poke) string @ 0#B = "FOO"
(poke) dump
76543210 0011 2233 4455 6677 8899 aabb ccdd eeff 0123456789ABCDEF
00000000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
...
(poke) .ios #1
The current IOS is now `01'.
(poke) dump
76543210 0011 2233 4455 6677 8899 aabb ccdd eeff 0123456789ABCDEF
00000000: 7f45 4c46 0201 0100 0000 0000 0000 0000 .ELF............
00000010: 0300 3e00 0100 0000 5010 0000 0000 0000 ..>.....P.......
...
(poke) .ios #0
The current IOS is now `./01.o'.
(poke) dump
76543210 0011 2233 4455 6677 8899 aabb ccdd eeff 0123456789ABCDEF
00000000: 464f 4f00 0001 0100 0000 0000 0000 0000 FOO.............
00000010: 0100 3e00 0100 0000 0000 0000 0000 0000 ..>.............
---
libpoke/pvm.jitter | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libpoke/pvm.jitter b/libpoke/pvm.jitter
index 976df1eb..ad939139 100644
--- a/libpoke/pvm.jitter
+++ b/libpoke/pvm.jitter
@@ -5990,7 +5990,7 @@ instruction pokes ()
JITTER_DROP_STACK();
JITTER_DROP_STACK();
- io = ios_search_by_id (PVM_VAL_INT (JITTER_TOP_STACK ()));
+ io = ios_cur();
if (io == NULL)
PVM_RAISE_DFL (PVM_E_NO_IOS);
--
2.30.2
- [PATCH] pkl: Fix selecting appropriate current IOS using string command,
Guillermo E. Martinez <=