Daniel Jacobowitz wrote: > On Fri, Jun 19, 2009 at 08:35:13AM -0700, Doug Evans wrote: >> Hi. At first I thought "Yikes!". :-) >> But it turns out that all fetch_registers routines treat 0 and -1 equivalently. >> I wouldn't hold up this patch (it's fine with me fwiw), though I would >> change the ChangeLog entry to something like: "Use -1 instead of 0 to >> fetch all registers." since passing 0 does actually fetch all >> registers. > > Agreed on all counts. > >> It would be good to remove this oddity and stop the conflation of 0 >> and -1, but I don't know what would break. >> We could run the testsuite and see what happens as a start. >> Does anyone know the history behind this? > > Pretty sure nothing will break - since nothing else calls these > functions. I could be mistaken though. > Ok, this would be a more complete patch (with cleanups in spots where -1 and 0 are used interchangeably). If you think it would be more appropriate to first commit regcache.c change only, and then the cleanup, let me know. ChangeLog: * linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0. * proc-service.c (ps_lgetregs): Pass -1 to fetch all registers. * regcache.c (get_regcache): Likewise. * spu-low.c (spu_fetch_registers): Remove 0 to -1 conversion. * win32-low.c (child_fetch_inferior_registers): Remove check for regno 0. -- Aleksandar Ristovski QNX Software Systems ChangeLog: * linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0. * proc-service.c (ps_lgetregs): Pass -1 to fetch all registers. * regcache.c (get_regcache): Likewise. * spu-low.c (spu_fetch_registers): Remove 0 to -1 conversion. * win32-low.c (child_fetch_inferior_registers): Remove check for regno 0.