Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gdb: additional upstream patch to aslr support.
Caused an error when trying to change the program from within GDB. Fixes #7004
- Loading branch information
1 parent
c7763b9
commit be339f2
Showing
2 changed files
with
65 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
From f6a460383f213f6f42dbc534bdb0fef4ef1dc823 Mon Sep 17 00:00:00 2001 | ||
From: Hannes Domani <ssbssa@yahoo.de> | ||
Date: Wed, 4 Mar 2020 21:20:31 +0100 | ||
Subject: [PATCH 2/2] 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 <ssbssa@yahoo.de> | ||
|
||
* windows-tdep.c (windows_solib_create_inferior_hook): | ||
Check if inferior is running. | ||
--- | ||
gdb/ChangeLog | 5 +++++ | ||
gdb/windows-tdep.c | 3 ++- | ||
2 files changed, 7 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/gdb/ChangeLog b/gdb/ChangeLog | ||
index ca700fbab5..4e824abcaa 100644 | ||
--- a/gdb/ChangeLog | ||
+++ b/gdb/ChangeLog | ||
@@ -30,6 +30,11 @@ | ||
PR symtab/26003 | ||
* symfile.c (symbol_file_add_separate): Preserve OBJF_MAINLINE. | ||
|
||
+2020-03-06 Hannes Domani <ssbssa@yahoo.de> | ||
+ | ||
+ * windows-tdep.c (windows_solib_create_inferior_hook): | ||
+ Check if inferior is running. | ||
+ | ||
2020-03-03 Hannes Domani <ssbssa@yahoo.de> | ||
|
||
* windows-tdep.c (windows_solib_create_inferior_hook): New function. | ||
diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c | ||
index a07c00b2f1..887654f29d 100644 | ||
--- a/gdb/windows-tdep.c | ||
+++ b/gdb/windows-tdep.c | ||
@@ -492,7 +492,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); | ||
-- | ||
2.28.0.windows.1 | ||
|