OK, using some printf debugging, I found the issue and it's not Pandaboard specific at all:
in
arm-linux-nat.c there's a
get_linux_version function. This function naively assumes that a linux kernel version number always has three parts, but
3.0-ARCH only has two! So the third part is
null and
strtoul crashes. Kinda stupid bug, I wonder why nobody else hit that till now. Will search the GDB bugtracker now if it's already been filed.
Patch:
$this->bbcode_second_pass_code('', 'diff -ur gdb-7.3.1/gdb/arm-linux-nat.c gdb-7.3.1.patched/gdb/arm-linux-nat.c
--- gdb-7.3.1/gdb/arm-linux-nat.c 2011-02-21 09:03:37.000000000 -0600
+++ gdb-7.3.1.patched/gdb/arm-linux-nat.c 2011-09-22 09:50:22.000000000 -0500
@@ -674,9 +674,15 @@
pminor = strtok (NULL, ".");
prelease = strtok (NULL, ".");
- *vmajor = (unsigned int) strtoul (pmajor, &tail, 0);
- *vminor = (unsigned int) strtoul (pminor, &tail, 0);
- *vrelease = (unsigned int) strtoul (prelease, &tail, 0);
+ *vmajor = 0;
+ *vminor = 0;
+ *vrelease = 0;
+ if(pmajor)
+ *vmajor = (unsigned int) strtoul (pmajor, &tail, 0);
+ if(pminor)
+ *vminor = (unsigned int) strtoul (pminor, &tail, 0);
+ if(prelease)
+ *vrelease = (unsigned int) strtoul (prelease, &tail, 0);
return ((*vmajor << 16) | (*vminor << 8) | *vrelease);
}
')
BUG:
http://sourceware.org/bugzilla/show_bug.cgi?id=13218