Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

modify values of elements of an array in gdb for C++

Tags:

c++

arrays

gdb

Just wonder how to modify the values of multiple elements of an array under gdb for C++?

Thanks and regards!

like image 222
Tim Avatar asked Jan 28 '26 14:01

Tim


1 Answers

Something like:

print memcpy (the_array_you_want_to_modify, {newvalue1, newvalue2, ..., newvalueN}, N * sizeof(the_array_you_want_to_modify[0]))

may be what you're looking for?

like image 63
Éric Malenfant Avatar answered Jan 31 '26 03:01

Éric Malenfant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!