mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +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,
|
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;
|
FAR struct binfmt_s *binfmt;
|
||||||
int ret = -ENOENT;
|
int ret = -ENOENT;
|
||||||
@@ -55,7 +56,7 @@ int core_dump(FAR struct memory_region_s *regions,
|
|||||||
|
|
||||||
if (binfmt->coredump)
|
if (binfmt->coredump)
|
||||||
{
|
{
|
||||||
ret = binfmt->coredump(regions, stream);
|
ret = binfmt->coredump(regions, stream, pid);
|
||||||
if (ret == OK)
|
if (ret == OK)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
|||||||
+5
-2
@@ -71,7 +71,8 @@ static int elf_loadbinary(FAR struct binary_s *binp,
|
|||||||
int nexports);
|
int nexports);
|
||||||
#ifdef CONFIG_ELF_COREDUMP
|
#ifdef CONFIG_ELF_COREDUMP
|
||||||
static int elf_dumpbinary(FAR struct memory_region_s *regions,
|
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
|
#endif
|
||||||
#if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_DEBUG_BINFMT)
|
#if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_DEBUG_BINFMT)
|
||||||
static void elf_dumploadinfo(FAR struct elf_loadinfo_s *loadinfo);
|
static void elf_dumploadinfo(FAR struct elf_loadinfo_s *loadinfo);
|
||||||
@@ -316,12 +317,14 @@ errout_with_init:
|
|||||||
|
|
||||||
#ifdef CONFIG_ELF_COREDUMP
|
#ifdef CONFIG_ELF_COREDUMP
|
||||||
static int elf_dumpbinary(FAR struct memory_region_s *regions,
|
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;
|
struct elf_dumpinfo_s dumpinfo;
|
||||||
|
|
||||||
dumpinfo.regions = regions;
|
dumpinfo.regions = regions;
|
||||||
dumpinfo.stream = stream;
|
dumpinfo.stream = stream;
|
||||||
|
dumpinfo.pid = pid;
|
||||||
|
|
||||||
return elf_coredump(&dumpinfo);
|
return elf_coredump(&dumpinfo);
|
||||||
}
|
}
|
||||||
|
|||||||
+320
-108
File diff suppressed because it is too large
Load Diff
@@ -139,7 +139,8 @@ struct binfmt_s
|
|||||||
/* Unload module callback */
|
/* Unload module callback */
|
||||||
|
|
||||||
CODE int (*coredump)(FAR struct memory_region_s *regions,
|
CODE int (*coredump)(FAR struct memory_region_s *regions,
|
||||||
FAR struct lib_outstream_s *stream);
|
FAR struct lib_outstream_s *stream,
|
||||||
|
pid_t pid);
|
||||||
};
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -209,7 +210,8 @@ int unregister_binfmt(FAR struct binfmt_s *binfmt);
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int core_dump(FAR struct memory_region_s *regions,
|
int core_dump(FAR struct memory_region_s *regions,
|
||||||
FAR struct lib_outstream_s *stream);
|
FAR struct lib_outstream_s *stream,
|
||||||
|
pid_t pid);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: load_module
|
* Name: load_module
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ struct elf_dumpinfo_s
|
|||||||
{
|
{
|
||||||
FAR struct memory_region_s *regions;
|
FAR struct memory_region_s *regions;
|
||||||
FAR struct lib_outstream_s *stream;
|
FAR struct lib_outstream_s *stream;
|
||||||
|
pid_t pid;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user