diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
-@@ -42,6 +42,7 @@
- #include <algorithm>
- #include <vector>
- #include <unordered_set>
-+#include <functional>
- #include "common/underlying.h"
- #include "common/byte-vector.h"
-
-@@ -2348,6 +2349,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
+@@ -2154,6 +2154,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
ctx.per_cu = per_cu;
ctx.obj_address = 0;