aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/symtab.c12
2 files changed, 16 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e8fc63c..f6bd31c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-11 Kevin Buettner <kevinb@redhat.com>
+
+ * symtab.c (find_pc_sect_line): Add check which prevents infinite
+ recursion.
+
2020-03-11 Simon Marchi <simon.marchi@efficios.com>
* configure: Re-generate.
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 44b7113..aa415a9 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -3158,7 +3158,17 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
;
/* fall through */
else
- return find_pc_line (BMSYMBOL_VALUE_ADDRESS (mfunsym), 0);
+ {
+ /* Detect an obvious case of infinite recursion. If this
+ should occur, we'd like to know about it, so error out,
+ fatally. */
+ if (BMSYMBOL_VALUE_ADDRESS (mfunsym) == pc)
+ internal_error (__FILE__, __LINE__,
+ _("Infinite recursion detected in find_pc_sect_line;"
+ "please file a bug report"));
+
+ return find_pc_line (BMSYMBOL_VALUE_ADDRESS (mfunsym), 0);
+ }
}
symtab_and_line val;