From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93780 invoked by alias); 6 Mar 2020 17:40:18 -0000 Mailing-List: contact gdb-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: gdb-cvs-owner@sourceware.org List-Subscribe: Sender: gdb-cvs-owner@sourceware.org Received: (qmail 93717 invoked by uid 10274); 6 Mar 2020 17:40:18 -0000 Date: Fri, 06 Mar 2020 17:40:00 -0000 Message-ID: <20200306174018.93716.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Hannes Domani To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Don't try to get the TIB address without an inferior X-Act-Checkin: binutils-gdb X-Git-Author: Hannes Domani X-Git-Refname: refs/heads/master X-Git-Oldrev: 84d9ab33f3dc542c5f20abb9026240cfd48ccd97 X-Git-Newrev: b7d64b29094ef58448c9b41bcde299fad2976237 X-SW-Source: 2020-03/txt/msg00031.txt https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b7d64b29094ef58448c9b41bcde299fad2976237 commit b7d64b29094ef58448c9b41bcde299fad2976237 Author: Hannes Domani Date: Wed Mar 4 21:20:31 2020 +0100 Don't try to get the TIB address without an inferior 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 * windows-tdep.c (windows_solib_create_inferior_hook): Check if inferior is running. Diff: --- gdb/ChangeLog | 5 +++++ gdb/windows-tdep.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0e053e2..9c2e68d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-03-06 Hannes Domani + + * windows-tdep.c (windows_solib_create_inferior_hook): + Check if inferior is running. + 2020-03-06 Tom de Vries * NEWS: Fix "the the". diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c index 4e5d830..e02b1ce 100644 --- a/gdb/windows-tdep.c +++ b/gdb/windows-tdep.c @@ -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);