3 ms·
I have been Linux only for 10 years, so I cannot try. I have used similar tricks with gdb to play a sound when some high-level function is called, can be reall
by usr1106 6y ago
I have been Linux only for 10 years, so I cannot try.
I have used similar tricks with gdb to play a sound when some high-level function is called, can be really useful. However, for malloc I would expect it to be called so often that a human cannot hear the difference. Or the program needs to measure the rate and select the tone according to the rate. Of course it depends on the program, but at least if there is enough allocation to be worried.
- spot5010 6y agoI love the idea of using sound as a mechanism for debugging code. It works wonderfully in other areas. I used to run a complex atomic physics experiment in graduate school which involved a series of steps repeated over and over again, with slight changes in the sequence every time. Over time I got really attuned to the sound of the machine: the clicking of shutters, hissing of valves, a annoying 10kHz note that was generated by an amplifier driving AC currents, etc. and could easily tell by ear if something was off (which happened a lot!). I would also use sound to tune control loops by sending the error signal to a speaker or earphones and listen to the noise. It complemented a signal analyzer wonderfully. Can gdb be configured to somehow “hum” a program by converting a series of operations into sound and we can hear our programs in action? No idea how to go about it though, and how to convert operations happening at the CPU clock rate into the audible regime, but seems like it’s worth exploring.