aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/infrun.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2fe8ab1..7e3a7ea 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2017-09-05 Simon Marchi <simon.marchi@ericsson.com>
+ * infrun.c (follow_exec): Call add_thread after
+ target_find_description.
+
+2017-09-05 Simon Marchi <simon.marchi@ericsson.com>
+
* infrun.c (handle_inferior_event_1): When exec'ing, read
stop_pc after follow_exec.
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 1c6b186..1e301d3 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1211,7 +1211,6 @@ follow_exec (ptid_t ptid, char *exec_file_target)
set_current_inferior (inf);
set_current_program_space (inf->pspace);
- add_thread (ptid);
}
else
{
@@ -1243,6 +1242,11 @@ follow_exec (ptid_t ptid, char *exec_file_target)
registers. */
target_find_description ();
+ /* The add_thread call ends up reading registers, so do it after updating the
+ target description. */
+ if (follow_exec_mode_string == follow_exec_mode_new)
+ add_thread (ptid);
+
solib_create_inferior_hook (0);
jit_inferior_created_hook ();