This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: MI failures related to string printing
> I think the whole idea of doing string comparisons for C (or C++)
> "char *" pointers is flawed. There is no guarantee that a "char *"
> actually points to a null-terminated as the test shows. You should
> not treat "char *" any different from other pointers like "int *", at
> least not by default. You could implement a way for the user to
> specify that a "char *" is actually a pointer to a string instead of a
> single character. But otherwise I think the string comparison should
> only do for languages that have a genuine string type, such as Pascal.
It's unfortunate you didn't express this opinion earlier. There are no
gauarantees but generally if you are watching a "char *" type it points to
something useful, or you learn something if it doesn't. Without string
comparison you can't `watch' the contents of a string change. I think it's
better to focus on such practical issues than pathological cases in the
testsuite.
--
Nick http://www.inet.net.nz/~nickrob