Files
binutils-gdb/gdb/testsuite/gdb.rust
Rudnicki, Piotr a4f974e939 gdb, testsuite, rust: fix for empty array
For the Rust language, to avoid segmentation fault in case of an empty
array, do not try to copy any elements, but allocate and return
the empty array immediately.

With the command before the change, gdb crashes with message:

(gdb) set lang rust
(gdb) p [1;0]
Fatal signal: Segmentation fault

After the fix in this commit, gdb shows following message:
(gdb) set lang rust
(gdb) p [1;0]
$1 = []

Update the existing test case gdb.rust/expr.exp to verify the change.

Approved-By: Tom Tromey <tom@tromey.com>
2025-02-24 07:12:04 -07:00
..