mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 04:19:37 +08:00
coredump: fix issue that calculated dump region range is
smaller than it should be. 0x21000000 0x210105e8 0x210105f8 0x21044000 |----------------|-------------|--------------| If there is already a range of 0x210105e8 - 0x210105f8, adding another range of 0x21000000 - 0x21044000 would result in an incorrect range of 0x210105e8 - 0x21044000. Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
This commit is contained in:
@@ -777,11 +777,12 @@ int coredump_add_memory_region(FAR const void *ptr, size_t size)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if ((uintptr_t)ptr < region->end &&
|
else if ((uintptr_t)ptr < region->start &&
|
||||||
(uintptr_t)ptr + size >= region->end)
|
(uintptr_t)ptr + size >= region->end)
|
||||||
{
|
{
|
||||||
/* start in region, end out of region */
|
/* start out of region, end out of region */
|
||||||
|
|
||||||
|
region->start = (uintptr_t)ptr;
|
||||||
region->end = (uintptr_t)ptr + size;
|
region->end = (uintptr_t)ptr + size;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -793,12 +794,11 @@ int coredump_add_memory_region(FAR const void *ptr, size_t size)
|
|||||||
region->start = (uintptr_t)ptr;
|
region->start = (uintptr_t)ptr;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if ((uintptr_t)ptr < region->start &&
|
else if ((uintptr_t)ptr < region->end &&
|
||||||
(uintptr_t)ptr + size >= region->end)
|
(uintptr_t)ptr + size >= region->end)
|
||||||
{
|
{
|
||||||
/* start out of region, end out of region */
|
/* start in region, end out of region */
|
||||||
|
|
||||||
region->start = (uintptr_t)ptr;
|
|
||||||
region->end = (uintptr_t)ptr + size;
|
region->end = (uintptr_t)ptr + size;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user