I have reported and traced down problem with setting (resetting) breakpoints in
shared libraries earlier.
The problem exists in 4.18 but also in 5.0.
The problem occurs when you do a debug session and rerun the session. All
dynamically loaded libraries will be unloaded upon rerun, set breakpoints
will be remembered and reused for the new run.
When the program is rerun, gdb tries to set the breakpoints again but finds
that it cannot resolve the addresses on which these stored breakpoints should
be reset (because the addresses are not loaded yet). This generates a lot of
error messages since gdb tries to set these addresses several times.
Later when the library gets loaded and gdb again tries to set the
breakpoint, it correctly resolves the addresses. However, the returned
address is identical to the address that is stored in the remembered breakpoint
data structure (this is normal since dynamic libraries get loaded on the same
address upon each sucessive run).
Because of this IDENTICAL address, gdb WRONGLY concludes that the breakpoint is still
set (armed) and should therefore NOT be rearmed.
I think that the cached addresses should be cleaned out (set to 0x0000000) for
dynamic libraries that get unloaded when rerun). I tracked down this problem to
the code that tests whether to set or not a breakpoint.
THIS IS THE 5 TIME I REPORT THIS ERROR AND ITS ANALYSIS. IT IS A SEVERE PROBLEM
AND I AM SURE THAT THE ABOVE EXPLANATION COVERS THE PROBLEM. I HAVE TRACKED
THIS DOWN FOR 2 DAYS TRYING TO FIX IT MYSELF BUT ALTHOUGH I KNOW WHY THE ERROR
OCCURS AND ALSO WHAT CODE IS IN ERROR I DO NOT KNOW THE CLEAN/NICE/ELEGANT WAY
TO FIX IT.
IS THERE ANYBODY WHO CAN LOOK INTO THIS !!!!!!!!!!!!!
Wim Delvaux