elf/coredump: add support of dump task stack without memory segments

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an
2023-05-22 11:43:08 +08:00
committed by Xiang Xiao
parent 0133831a70
commit 24f4216066
5 changed files with 333 additions and 114 deletions

View File

@@ -44,7 +44,8 @@
****************************************************************************/
int core_dump(FAR struct memory_region_s *regions,
FAR struct lib_outstream_s *stream)
FAR struct lib_outstream_s *stream,
pid_t pid)
{
FAR struct binfmt_s *binfmt;
int ret = -ENOENT;
@@ -55,7 +56,7 @@ int core_dump(FAR struct memory_region_s *regions,
if (binfmt->coredump)
{
ret = binfmt->coredump(regions, stream);
ret = binfmt->coredump(regions, stream, pid);
if (ret == OK)
{
break;

View File

@@ -71,7 +71,8 @@ static int elf_loadbinary(FAR struct binary_s *binp,
int nexports);
#ifdef CONFIG_ELF_COREDUMP
static int elf_dumpbinary(FAR struct memory_region_s *regions,
FAR struct lib_outstream_s *stream);
FAR struct lib_outstream_s *stream,
pid_t pid);
#endif
#if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_DEBUG_BINFMT)
static void elf_dumploadinfo(FAR struct elf_loadinfo_s *loadinfo);
@@ -316,12 +317,14 @@ errout_with_init:
#ifdef CONFIG_ELF_COREDUMP
static int elf_dumpbinary(FAR struct memory_region_s *regions,
FAR struct lib_outstream_s *stream)
FAR struct lib_outstream_s *stream,
pid_t pid)
{
struct elf_dumpinfo_s dumpinfo;
dumpinfo.regions = regions;
dumpinfo.stream = stream;
dumpinfo.pid = pid;
return elf_coredump(&dumpinfo);
}

File diff suppressed because it is too large Load Diff