diff options
author | Kamil Rytarowski <n54@gmx.com> | 2020-07-28 17:29:35 +0200 |
---|---|---|
committer | Kamil Rytarowski <n54@gmx.com> | 2020-08-14 00:09:42 +0200 |
commit | b31488a3449cd97297b0972c016016f1d4c60389 (patch) | |
tree | a9707af272eb93896d792df09298e32c57cbcc45 /gdb/target.h | |
parent | 002a3166d359a759b6cddfe4571d1da5b4f96dce (diff) | |
download | gdb-b31488a3449cd97297b0972c016016f1d4c60389.zip gdb-b31488a3449cd97297b0972c016016f1d4c60389.tar.gz gdb-b31488a3449cd97297b0972c016016f1d4c60389.tar.bz2 |
gdb: Implement native dumpcore function
Add new API for systems with native kernel support for dumping
a process on demand. Wire it into the gdb's gcore functionality.
gdb/ChangeLog:
* target.h (supports_dumpcore, dumpcore): New
function declarations.
* target.c (supports_dumpcore, dumpcore): New
functions.
* target-delegates.c: Rebuild.
* gcore.c (gcore_command): Use target_supports_dumpcore ()
and target_dumpcore ().
Diffstat (limited to 'gdb/target.h')
-rw-r--r-- | gdb/target.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/target.h b/gdb/target.h index 4e8d4cc..71d575f 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -881,6 +881,14 @@ struct target_ops virtual bool supports_evaluation_of_breakpoint_conditions () TARGET_DEFAULT_RETURN (false); + /* Does this target support native dumpcore API? */ + virtual bool supports_dumpcore () + TARGET_DEFAULT_RETURN (false); + + /* Generate the core file with native target API. */ + virtual void dumpcore (const char *filename) + TARGET_DEFAULT_IGNORE (); + /* Does this target support evaluation of breakpoint commands on its end? */ virtual bool can_run_breakpoint_commands () @@ -1499,6 +1507,16 @@ int target_supports_disable_randomization (void); #define target_supports_evaluation_of_breakpoint_conditions() \ (current_top_target ()->supports_evaluation_of_breakpoint_conditions) () +/* Does this target support dumpcore API? */ + +#define target_supports_dumpcore() \ + (current_top_target ()->supports_dumpcore) () + +/* Generate the core file with target API. */ + +#define target_dumpcore(x) \ + (current_top_target ()->dumpcore (x)) + /* Returns true if this target can handle breakpoint commands on its end. */ |