This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [MI non-stop 04/11] Implement --thread and --frame.
> From: Vladimir Prus <vladimir@codesourcery.com>
> Date: Sun, 29 Jun 2008 10:05:14 +0400
> Cc: gdb-patches@sources.redhat.com
>
> > > >> + if (strncmp (chp, "--thread", 8) == 0)
> > > >
> > > > Please, let's not use literal constants in this context, let's use
> > > > sizeof instead.
> > >
> > > sizeof? For all I know, sizeof("--thread") will be wrong here.
> >
> > Why would it be wrong?
>
> It will give you 9, here.
Well, I hope you trust that I knew this.
> > > >> + parse->frame = strtol (chp, &chp, 10);
> > > >
> > > > Do we really want to disallow non-decimal numbers here? What about
> > > > hex frame numbers?
> > >
> > > Why would frontend want to specify frame level in hex?
> >
> > I dunno, does the MI spec mandate decimal here? If it does, then my
> > comment is hereby withdrawn.
>
> The spec does not mandate decimal, or allow hex -- yet. Other commands that
> take numbers are also silent, however the code appears to use decimal. For
> example, -stack-list-args and friends use atoi -- which is 10-base.
Then perhaps we should document that it must be decimal.