1

We're in the process of debugging a cloth simulator written in C++ and a common problem is when something modifies velocities to be NaN or some large number.

Currently, this the best way we have to test for this is calling test_velocities_for_NaN() which is slow and must be called manually.

Is there any way to automate this process using GDB? I.e. being able to break if any value in an array of floats is modified to be either NaN or some value greater than a set constant?

Paulo Tomé
  • 1,910
  • 3
  • 18
  • 27
cmspice
  • 318
  • 1
  • 6
  • 1
    I haven't heard about such a thing being possible. Can't you just add this programmatically in the code instead, wrap all writes of doubles to this (or any) array into a function or macro. A long shot might be to use http://www.pintool.org/ if you can't change the code. With pin you can instrument any double-store to memory and write a handler for what to do when it happens. It's a bit slow running pin, but I think it will work if you are willing to invest the time. – Olof Mar 17 '12 at 13:29

0 Answers0