gdb/
Fix compatibility with Linux kernel 3.8.3. * linux-tdep.c (linux_find_memory_regions_full): Move variable number to more inner block. Remove parsing of NUMBER from outer block. Parse NUMBER only if KEYWORD has been identified.
This commit is contained in:
parent
d1794952ba
commit
9ead1b844c
|
@ -1,3 +1,10 @@
|
||||||
|
2013-04-05 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
Fix compatibility with Linux kernel 3.8.3.
|
||||||
|
* linux-tdep.c (linux_find_memory_regions_full): Move variable number
|
||||||
|
to more inner block. Remove parsing of NUMBER from outer block.
|
||||||
|
Parse NUMBER only if KEYWORD has been identified.
|
||||||
|
|
||||||
2013-04-05 Jan Kratochvil <jan.kratochvil@redhat.com>
|
2013-04-05 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
Fix variable name shadowing.
|
Fix variable name shadowing.
|
||||||
|
|
|
@ -720,20 +720,30 @@ linux_find_memory_regions_full (struct gdbarch *gdbarch,
|
||||||
line = strtok (NULL, "\n"))
|
line = strtok (NULL, "\n"))
|
||||||
{
|
{
|
||||||
char keyword[64 + 1];
|
char keyword[64 + 1];
|
||||||
unsigned long number;
|
|
||||||
|
|
||||||
if (sscanf (line, "%64s%lu kB\n", keyword, &number) != 2)
|
if (sscanf (line, "%64s", keyword) != 1)
|
||||||
{
|
{
|
||||||
warning (_("Error parsing {s,}maps file '%s'"), mapsfilename);
|
warning (_("Error parsing {s,}maps file '%s'"), mapsfilename);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (strcmp (keyword, "Anonymous:") == 0)
|
if (strcmp (keyword, "Anonymous:") == 0)
|
||||||
has_anonymous = 1;
|
has_anonymous = 1;
|
||||||
if (number != 0 && (strcmp (keyword, "Shared_Dirty:") == 0
|
if (strcmp (keyword, "Shared_Dirty:") == 0
|
||||||
|| strcmp (keyword, "Private_Dirty:") == 0
|
|| strcmp (keyword, "Private_Dirty:") == 0
|
||||||
|| strcmp (keyword, "Swap:") == 0
|
|| strcmp (keyword, "Swap:") == 0
|
||||||
|| strcmp (keyword, "Anonymous:") == 0))
|
|| strcmp (keyword, "Anonymous:") == 0)
|
||||||
modified = 1;
|
{
|
||||||
|
unsigned long number;
|
||||||
|
|
||||||
|
if (sscanf (line, "%*s%lu", &number) != 1)
|
||||||
|
{
|
||||||
|
warning (_("Error parsing {s,}maps file '%s' number"),
|
||||||
|
mapsfilename);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (number != 0)
|
||||||
|
modified = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Older Linux kernels did not support the "Anonymous:" counter.
|
/* Older Linux kernels did not support the "Anonymous:" counter.
|
||||||
|
|
Loading…
Reference in New Issue