This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: MI failures related to string printing
- From: Vladimir Prus <ghost at cs dot msu dot su>
- To: Nick Roberts <nickrob at snap dot net dot nz>, gdb-patches at sources dot redhat dot com
- Date: Tue, 16 Jan 2007 05:08:17 +0300
- Subject: Re: MI failures related to string printing
- References: <200701121351.29310.vladimir@codesourcery.com> <17831.31430.442855.801431@kahikatea.snap.net.nz>
Nick Roberts wrote:
> > 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.
Is there any chance you'll robustify the testsuite?
Thanks,
Volodya