mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-30 06:50:31 +02:00
Work around requirement that size be non-zero in GDB 'open-memory'.
* module/system/base/types.scm (memory-port): Handle zero size case specially.
This commit is contained in:
parent
d848067b89
commit
8dcf3c6163
1 changed files with 6 additions and 2 deletions
|
@ -117,8 +117,12 @@ SIZE is omitted, return an unbounded port to the memory at ADDRESS."
|
||||||
(let ((open (memory-backend-open backend)))
|
(let ((open (memory-backend-open backend)))
|
||||||
(open address #f)))
|
(open address #f)))
|
||||||
((_ backend address size)
|
((_ backend address size)
|
||||||
(let ((open (memory-backend-open backend)))
|
(if (zero? size)
|
||||||
(open address size)))))
|
;; GDB's 'open-memory' raises an error when size
|
||||||
|
;; is zero, so we must handle that case specially.
|
||||||
|
(open-bytevector-input-port '#vu8())
|
||||||
|
(let ((open (memory-backend-open backend)))
|
||||||
|
(open address size))))))
|
||||||
|
|
||||||
(define (get-word port)
|
(define (get-word port)
|
||||||
"Read a word from PORT and return it as an integer."
|
"Read a word from PORT and return it as an integer."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue