mirror of
https://github.com/apache/nuttx.git
synced 2025-12-11 21:20:26 +08:00
elf/coredump: add support of dump task stack without memory segments
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user