Commit graph

3 commits

Author SHA1 Message Date
Quentin Minster
b82215965e
Refactor pointer write command * to use the API (#3793)
* Add tests for pointer write command `*`

Some test cases override `asm.arch` for bitness compatibility reasons.

* Refactor pointer write command `*` to use the API

* Allow use of more general exprs as value for pointer write command `*` ##shell

* Instead of detecting when to write a value, and write a hexpair
  otherwise, do the inverse: detect when to write a hexpair, and write a
  value otherwise. This allows more general value exprs such as
  variables, derefs, ...

* To enable this, add an option to `rz_hex_str_is_valid` so it can
  reject a 0x-prefixed string (because 0x-prefixed strings should be
  handled as values, not hexpairs, by the pointer write command)

* Add a test case to ensure a non-0x-prefixed value arg, that's not a
  valid hexpair, now gets eval'ed as an expr by the pointer write
  command (where previously it would throw an error)
2023-08-26 23:40:31 +08:00
Khairul Azhar Kasmiran
40b67c2f6d
Fix cmd_pointer test on Travis (#3791) 2023-08-26 14:13:21 +08:00
Quentin Minster
eb78e75cd4
Refactor the pointer command to use the API (#3788)
* Add test for pointer read command `*`

Test for `asm.bits=8` uses `asm.arch=6502` because `asm.bits=8` is
unsupported for the default arch.

* Fix pointer command `*` broken since move from `?` to `%` ##shell

* Refactor to use appropriate existing API in `num_callback`
2023-08-26 02:12:47 +00:00