[1/2] gdb: add inferior_cloned observable
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gdb_check--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Testing passed
|
Commit Message
The following patch makes the amdgpu port transfer a property from the
original inferior to the new inferior when using the clone-inferior
command. Add the inferior_cloned observable to help with this.
Change-Id: Id845a799813ec49b1b7b2fcb97b07d0a1e5e2631
---
gdb/inferior.c | 2 ++
gdb/observable.c | 1 +
gdb/observable.h | 4 ++++
3 files changed, 7 insertions(+)
base-commit: 38cc67cc00dc7385991e2658a1b4213d5ba3c4f0
Comments
>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
Simon> The following patch makes the amdgpu port transfer a property from the
Simon> original inferior to the new inferior when using the clone-inferior
Simon> command. Add the inferior_cloned observable to help with this.
FWIW this patch seems totally fine to me.
Tom
On 9/14/23 10:08, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
>
> Simon> The following patch makes the amdgpu port transfer a property from the
> Simon> original inferior to the new inferior when using the clone-inferior
> Simon> command. Add the inferior_cloned observable to help with this.
>
> FWIW this patch seems totally fine to me.
>
> Tom
Thanks, I'll add you Approved-By.
Simon
@@ -1041,6 +1041,8 @@ clone_inferior_command (const char *args, int from_tty)
for (const std::string &unset_var
: orginf->environment.user_unset_env ())
inf->environment.unset (unset_var.c_str ());
+
+ gdb::observers::inferior_cloned.notify (orginf, inf);
}
}
@@ -58,6 +58,7 @@ DEFINE_OBSERVABLE (inferior_appeared);
DEFINE_OBSERVABLE (inferior_pre_detach);
DEFINE_OBSERVABLE (inferior_exit);
DEFINE_OBSERVABLE (inferior_removed);
+DEFINE_OBSERVABLE (inferior_cloned);
DEFINE_OBSERVABLE (memory_changed);
DEFINE_OBSERVABLE (before_prompt);
DEFINE_OBSERVABLE (gdb_datadir_changed);
@@ -172,6 +172,10 @@ extern observable<struct inferior */* inf */> inferior_exit;
This method is called immediately before freeing INF. */
extern observable<struct inferior */* inf */> inferior_removed;
+/* The inferior CLONE has been created by cloning INF. */
+extern observable<struct inferior */* inf */, struct inferior */* clone */>
+ inferior_cloned;
+
/* Bytes from DATA to DATA + LEN have been written to the inferior
at ADDR. */
extern observable<struct inferior */* inferior */, CORE_ADDR /* addr */,