Skip to content

Commit 24f4216

Browse files
anchaoxiaoxiang781216
authored andcommitted
elf/coredump: add support of dump task stack without memory segments
Signed-off-by: chao an <[email protected]>
1 parent 0133831 commit 24f4216

File tree

5 files changed

+301
-82
lines changed

5 files changed

+301
-82
lines changed

binfmt/binfmt_coredump.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
****************************************************************************/
4545

4646
int core_dump(FAR struct memory_region_s *regions,
47-
FAR struct lib_outstream_s *stream)
47+
FAR struct lib_outstream_s *stream,
48+
pid_t pid)
4849
{
4950
FAR struct binfmt_s *binfmt;
5051
int ret = -ENOENT;
@@ -55,7 +56,7 @@ int core_dump(FAR struct memory_region_s *regions,
5556

5657
if (binfmt->coredump)
5758
{
58-
ret = binfmt->coredump(regions, stream);
59+
ret = binfmt->coredump(regions, stream, pid);
5960
if (ret == OK)
6061
{
6162
break;

binfmt/elf.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ static int elf_loadbinary(FAR struct binary_s *binp,
7171
int nexports);
7272
#ifdef CONFIG_ELF_COREDUMP
7373
static int elf_dumpbinary(FAR struct memory_region_s *regions,
74-
FAR struct lib_outstream_s *stream);
74+
FAR struct lib_outstream_s *stream,
75+
pid_t pid);
7576
#endif
7677
#if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_DEBUG_BINFMT)
7778
static void elf_dumploadinfo(FAR struct elf_loadinfo_s *loadinfo);
@@ -316,12 +317,14 @@ static int elf_loadbinary(FAR struct binary_s *binp,
316317

317318
#ifdef CONFIG_ELF_COREDUMP
318319
static int elf_dumpbinary(FAR struct memory_region_s *regions,
319-
FAR struct lib_outstream_s *stream)
320+
FAR struct lib_outstream_s *stream,
321+
pid_t pid)
320322
{
321323
struct elf_dumpinfo_s dumpinfo;
322324

323325
dumpinfo.regions = regions;
324326
dumpinfo.stream = stream;
327+
dumpinfo.pid = pid;
325328

326329
return elf_coredump(&dumpinfo);
327330
}

0 commit comments

Comments
 (0)