Hi, > Your code assumes that is a literal number. Do we want > to allow an integral expression there, or is a literal number good > enough? I believe the thread command assumes a literal number as well. Were you thinking about more complex expressions defining the thread ID? Like a variable or an arithmetic expression? > In any case, this change, if and when accepted, should be accompanied > by a suitable change to the user manual. Agreed. We might as well keep the parameter format the same as for breakpoint commands. > Did you try your code when the argument has trailing whitespace? > Unless I'm missing something, the last line above make `tok' point to > the null character that ends the argument, so the while loop after > that will end immediately, even if there is whitespace after the > thread ID number, and the whole parsing business will not work > correctly. I did try the code with trailing white spaces and it seemed to work, but maybe i didn't pick a specific case that would break the code. Anyway, i've changed that in the new version to start before the null character, so if we have any trailing white spaces or tabs, it'll handle them correctly until the token shows up. > You don't need to compute `strlen (tok)' every time through the loops, > because each iteration you go back exactly one character. So you can > compute it only once, and then decrement its value inside the loop > bodies. Yes, that was something Bauermann suggested in the first version. That's updated in the new version of the patch. I exchanged those strlen()'s for "tok > arg" conditions. > There's a much better way of checking whether `tok' is a literal > number: look at the pointer returned by `strtol' in its 2nd arg, and > if it points to something other than a whitespace character, err out... This was also addressed in the new version. Looks better and cleaner. I've also addressed some coding standard issues with identations and spaces in comments. Thanks for the suggestions Eli. How does this new version look? Best regards, -- Luis Machado Software Engineer IBM Linux Technology Center e-mail: luisgpm@linux.vnet.ibm.com