3

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

Thanks and regards!

2
  • 1) Modify how? By applying a transformation? By assigning an arbitrary value? By copying values from another array? 2) Which elements? All? A range? Those whose value satisfy a given predicate? Commented Sep 17, 2009 at 14:29
  • 1) By assigning an arbitrary value 2) All But I also like to know what to do for all the others you mentioned. Tried to find the answers in the gdb manual "Debugging with gdb", but didn't find some. If you could point out where they are, I really appreciate it. Commented Sep 17, 2009 at 14:39

1 Answer 1

6

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?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.