aboutsummaryrefslogtreecommitdiff
path: root/gdb/arm-tdep.c
diff options
context:
space:
mode:
authorAlok Kumar Sharma <AlokKumar.Sharma@amd.com>2020-08-20 10:35:27 +0530
committerAlok Kumar Sharma <AlokKumar.Sharma@amd.com>2020-08-20 10:38:59 +0530
commitc2fd7faea8f2c3a267f276ceb6a95f9f537ea7c1 (patch)
tree13ba6ecf6e6cb212269d5d01a0b97ea0112b307f /gdb/arm-tdep.c
parenta0522545b6ef4dd43f976d6acb4fd2b0aa964b27 (diff)
downloadfsf-binutils-gdb-c2fd7faea8f2c3a267f276ceb6a95f9f537ea7c1.zip
fsf-binutils-gdb-c2fd7faea8f2c3a267f276ceb6a95f9f537ea7c1.tar.gz
fsf-binutils-gdb-c2fd7faea8f2c3a267f276ceb6a95f9f537ea7c1.tar.bz2
Fix for incorrect breakpoint set in case of flang compiled binary
Currently, GDB is not able to set a breakpoint at subprogram post prologue for flang generated binaries. This is due to clang having two line notes one before and another after the prologue. Now the end of prologue is determined using symbol table, which was the way for clang generated binaries already. Since clang and flang both share same back-end it is true for flang as well. gdb/ChangeLog * amd64-tdep.c (amd64_skip_prologue): Using symbol table to find the end of prologue for flang compiled binaries. * arm-tdep.c (arm_skip_prologue): Likewise. * i386-tdep.c (i386_skip_prologue): Likewise. * producer.c (producer_is_llvm): New function. (producer_parsing_tests): Added new tests for clang/flang. * producer.h (producer_is_llvm): New declaration. gdb/testsuite/ChangeLog * gdb.fortran/vla-type.exp: Skip commands not required for the Flang compiled binaries after prologue fix.
Diffstat (limited to 'gdb/arm-tdep.c')
-rw-r--r--gdb/arm-tdep.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 9cedcc8..074eedb 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -60,6 +60,8 @@
#include "record-full.h"
#include <algorithm>
+#include "producer.h"
+
#if GDB_SELF_TEST
#include "gdbsupport/selftest.h"
#endif
@@ -1351,7 +1353,7 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
&& (cust == NULL
|| COMPUNIT_PRODUCER (cust) == NULL
|| startswith (COMPUNIT_PRODUCER (cust), "GNU ")
- || startswith (COMPUNIT_PRODUCER (cust), "clang ")))
+ || producer_is_llvm (COMPUNIT_PRODUCER (cust))))
return post_prologue_pc;
if (post_prologue_pc != 0)