mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 05:55:46 +08:00
binfmt: Add a configuration flag to store the module filename
This flag can be used to store the filename of a loaded module or executable in binfmt. The filename is useful for example in debugging. For example, gdb or a jtag debugger can be configured to automatically fetch the symbols for the currently executing module. Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This commit is contained in:
committed by
Xiang Xiao
parent
62660a692d
commit
5961b8bd1a
@@ -89,3 +89,9 @@ config BINFMT_ELF_EXECUTABLE
|
|||||||
Produce a full linked executable object as output.
|
Produce a full linked executable object as output.
|
||||||
|
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
|
config BINFMT_STORE_FILENAME
|
||||||
|
bool "Store the binary filename"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Store the filename of the loaded binary
|
||||||
|
|||||||
@@ -122,6 +122,12 @@ static int load_absmodule(FAR struct binary_s *bin, FAR const char *filename,
|
|||||||
|
|
||||||
binfo("Successfully loaded module %s\n", filename);
|
binfo("Successfully loaded module %s\n", filename);
|
||||||
|
|
||||||
|
/* Save the filename of the loaded module */
|
||||||
|
|
||||||
|
#ifdef CONFIG_BINFMT_STORE_FILENAME
|
||||||
|
strlcpy(bin->fname, filename, sizeof(bin->fname));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Save the unload method for use by unload_module */
|
/* Save the unload method for use by unload_module */
|
||||||
|
|
||||||
bin->unload = binfmt->unload;
|
bin->unload = binfmt->unload;
|
||||||
|
|||||||
@@ -96,6 +96,11 @@ struct binary_s
|
|||||||
|
|
||||||
uint8_t priority; /* Task execution priority */
|
uint8_t priority; /* Task execution priority */
|
||||||
size_t stacksize; /* Size of the stack in bytes (unallocated) */
|
size_t stacksize; /* Size of the stack in bytes (unallocated) */
|
||||||
|
|
||||||
|
#ifdef CONFIG_BINFMT_STORE_FILENAME
|
||||||
|
char fname[NAME_MAX];
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SCHED_USER_IDENTITY
|
#ifdef CONFIG_SCHED_USER_IDENTITY
|
||||||
uid_t uid; /* File owner user identity */
|
uid_t uid; /* File owner user identity */
|
||||||
gid_t gid; /* File owner group user identity */
|
gid_t gid; /* File owner group user identity */
|
||||||
|
|||||||
Reference in New Issue
Block a user