Messages in this thread | | | Date | Sun, 10 Feb 2008 14:36:41 +0100 | From | Jan Kiszka <> | Subject | Re: [3/6] kgdb: core |
| |
Marcin Slusarz wrote: > On Sun, Feb 10, 2008 at 08:13:31AM +0100, Ingo Molnar wrote: >> + } else { >> + while (count-- > 0) { >> + unsigned char ch; >> + >> + if (probe_kernel_address(mem, ch)) { >> + kgdb_may_fault = 0; >> + return ERR_PTR(-EINVAL); >> + } >> + mem++; >> + *buf++ = hexchars[ch >> 4]; >> + *buf++ = hexchars[ch & 0xf]; > use pack_hex_byte?
Good point! kgdb introduces this helper but don't use it consequently!
>> +/* >> + * While we find nice hex chars, build a long_val. >> + * Return number of chars processed. >> + */ >> +int kgdb_hex2long(char **ptr, long *long_val) >> +{ >> + int hex_val; >> + int num = 0; >> + >> + *long_val = 0; >> + >> + while (**ptr) { >> + hex_val = hex(**ptr); >> + if (hex_val >= 0) { >> + *long_val = (*long_val << 4) | hex_val; >> + num++; >> + } else >> + break; >> + >> + (*ptr)++; >> + } > if (hex_val < 0) > break; > *long_val = (*long_val << 4) | hex_val; > num++; > (*ptr)++;
Jep, will include this in the cleanup patch I'm currently baking.
Jan
| |