mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-29 16:30:19 +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
61e1c2130c
commit
4ab9f0f8b9
1 changed files with 7 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
;;; 'SCM' type tag decoding.
|
||||
;;; Copyright (C) 2014 Free Software Foundation, Inc.
|
||||
;;; Copyright (C) 2014, 2015 Free Software Foundation, Inc.
|
||||
;;;
|
||||
;;; This library is free software; you can redistribute it and/or modify it
|
||||
;;; under the terms of the GNU Lesser General Public License as published by
|
||||
|
@ -117,8 +117,12 @@ SIZE is omitted, return an unbounded port to the memory at ADDRESS."
|
|||
(let ((open (memory-backend-open backend)))
|
||||
(open address #f)))
|
||||
((_ backend address size)
|
||||
(if (zero? 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)))))
|
||||
(open address size))))))
|
||||
|
||||
(define (get-word port)
|
||||
"Read a word from PORT and return it as an integer."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue