This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 40/67] Constify some commands in tracepoint.c
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Thu, 21 Sep 2017 11:03:45 +0100
- Subject: Re: [RFA 40/67] Constify some commands in tracepoint.c
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4116981E13
- References: <20170921051023.19023-1-tom@tromey.com> <20170921051023.19023-41-tom@tromey.com>
This looks OK, but ...
On 09/21/2017 06:09 AM, Tom Tromey wrote:
> @@ -2501,9 +2489,10 @@ tfind_range_command (char *args, int from_tty)
>
> if (0 != (tmp = strchr (args, ',')))
> {
> - *tmp++ = '\0'; /* Terminate start address. */
> + std::string start_addr (args, tmp);
> + ++tmp;
... this fixes an actual bug:
(gdb) tfind range 1, 2
Breakpoint 4, tfind_range_command (args=0x30a0cbc "1, 2", from_tty=1) at src/gdb/tracepoint.c:2496
...
(top gdb) c
(gdb) <enter again for repeat>
Breakpoint 4, tfind_range_command (args=0x30a0cbc "1", from_tty=1) at src/gdb/tracepoint.c:2496
Which is great, and shows that constification pays off.
I think it'd have been nice to split fixes like these to a
separate patch, or at least mention them in the commit log, though.
[/me goes read patches 2-40 again to double check.]
Thanks,
Pedro Alves