Re: [1/3] kgdb-lite for 2.6.3

From: Sam Ravnborg
Date: Sun Feb 22 2004 - 14:23:13 EST


Just some random comments after browsing the code.

Sam

> +
> +int kgdb_hexToLong(char **ptr, long *longValue);
A patch has been posted by Tom Rini to convert this to the
linux naming: kgdb_hex2long(...).

+static const char hexchars[] = "0123456789abcdef";
Grepping after 0123456789 in the src tree gives a lot of hits.
Maybe we should pull in some functionality from klibc, and place it in lib/
at some point in time.

+
+static char remcomInBuffer[BUFMAX];
+static char remcomOutBuffer[BUFMAX];
This does not follow usual Linux naming convention.
Something like: remcom_in_buf, remcom_out_buf?

> +static void getpacket(char *buffer)
> +{
> + unsigned char checksum;
> + unsigned char xmitcsum;
> + int i;
> + int count;
> + char ch;
> +
> + do {
> + /* wait around for the start character, ignore all other characters */
> + while ((ch = (kgdb_serial->read_char() & 0x7f)) != '$');

Placing ';' on a seperate line would be good for the readability.


> +int kgdb_handle_exception(int exVector, int signo, int err_code,
> + struct pt_regs *linux_regs)
> +{
> + unsigned long length, addr;
> + char *ptr;
> + unsigned long flags;
> + unsigned long gdb_regs[NUMREGBYTES / sizeof (unsigned long)];
> + int i;
> + long threadid;
> + threadref thref;
> + struct task_struct *thread = NULL;
> + unsigned procid;
> + static char tmpstr[256];

Too? large varriable on the stack.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/