]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Don't try to get the TIB address without an inferior
authorHannes Domani <ssbssa@yahoo.de>
Wed, 4 Mar 2020 20:20:31 +0000 (21:20 +0100)
committerHannes Domani <ssbssa@yahoo.de>
Fri, 6 Mar 2020 17:38:47 +0000 (18:38 +0100)
The target_get_tib_address call always fails in this case, and there is an
error when changing the program with the file command:

(gdb) file allocer64.exe
Reading symbols from allocer64.exe...
You can't do that when your target is `exec'

Now it will skip this part, there is no need to rebase the executable without
an inferior anyways.

gdb/ChangeLog:

2020-03-06  Hannes Domani  <ssbssa@yahoo.de>

* windows-tdep.c (windows_solib_create_inferior_hook):
Check if inferior is running.

gdb/ChangeLog
gdb/windows-tdep.c

index 0e053e2feb6fa17e15a7e08ce8f912068bd4fcd6..9c2e68d1859f2589854a28877d2f7c47fe2ce79e 100644 (file)
@@ -1,3 +1,8 @@
+2020-03-06  Hannes Domani  <ssbssa@yahoo.de>
+
+       * windows-tdep.c (windows_solib_create_inferior_hook):
+       Check if inferior is running.
+
 2020-03-06  Tom de Vries  <tdevries@suse.de>
 
        * NEWS: Fix "the the".
index 4e5d8303ca451d7591c4b25a4e21e65655424a56..e02b1ceed3873e3d4906a8df62964258a777f2a4 100644 (file)
@@ -843,7 +843,8 @@ windows_solib_create_inferior_hook (int from_tty)
     }
   CORE_ADDR tlb;
   gdb_byte buf[8];
-  if (target_get_tib_address (inferior_ptid, &tlb)
+  if (target_has_execution
+      && target_get_tib_address (inferior_ptid, &tlb)
       && !target_read_memory (tlb + peb_offset, buf, ptr_bytes))
     {
       CORE_ADDR peb = extract_unsigned_integer (buf, ptr_bytes, byte_order);