This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Constify find_condition_and_thread
- From: Tom Tromey <tromey at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Eli Zaretskii <eliz at gnu dot org>, Keith Seitz <keiths at redhat dot com>, gdb-patches at sourceware dot org
- Date: Fri, 01 Mar 2013 12:33:46 -0700
- Subject: Re: [RFA] Constify find_condition_and_thread
- References: <5130F0FD.2040203@redhat.com> <83ppzjufp5.fsf@gnu.org> <5130F9BB.6020002@redhat.com>
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
Pedro> An alternative would be to perhaps make the interface of
Pedro> parse_exp_1 similar to strtol -- split input and output
Pedro> pointers, with the explicit guarantee that the output pointer
Pedro> points somewhere within the input string. Is it really that
Pedro> messy? There doesn't seem to be many parse_exp_1 callers.
I think the problem is that the parsers probably do modify the input
string. So, you couldn't pass in a readonly string.
E.g., see c-exp.y:parse_number. It modifies the string, but then
modifies it back.
Tom