]> git.pld-linux.org Git - packages/gdb.git/blobdiff - gdb-vla-intel-stringbt-fix.patch
- up to 8.2
[packages/gdb.git] / gdb-vla-intel-stringbt-fix.patch
index 937f8fe6f59e9a74c5ed279147a4d1e6e461f3e5..b2170f4c5493048a5342018b32e975663c0ddf04 100644 (file)
@@ -1,10 +1,11 @@
-http://sourceware.org/ml/gdb-patches/2014-08/msg00025.html
-Subject: [patch 1/2] Re: Crash regression(?) printing Fortran strings in bt  [Re: [V2 00/23] Fortran dynamic array support]
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Jan Kratochvil <jan.kratochvil@redhat.com>
+Date: Fri, 1 Aug 2014 23:02:17 +0200
+Subject: gdb-vla-intel-stringbt-fix.patch
 
+;;=push+jan
 
---FCuugMFkClbJLl1L
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline
+http://sourceware.org/ml/gdb-patches/2014-08/msg00025.html
 
 On Fri, 01 Aug 2014 09:20:19 +0200, Keven Boell wrote:
 > I just tried it on Fedora 20 i686.  Applied the patch, you mentioned, on top of
@@ -23,29 +24,43 @@ so that there is no longer needed the patch:
 The fix below has no regressions for me.  Unfortunately I do not see why you
 cannot reproduce it.
 
-
 Thanks,
 Jan
 
---FCuugMFkClbJLl1L
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline; filename="vlastringonly.patch"
-
-diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
-index 53cae2c..cf7ac26 100644
---- a/gdb/gdbtypes.c
-+++ b/gdb/gdbtypes.c
-@@ -1659,6 +1659,7 @@ is_dynamic_type_internal (struct type *type, int top_level)
-       return !has_static_range (TYPE_RANGE_DATA (type));
+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"
  
-     case TYPE_CODE_ARRAY:
-+    case TYPE_CODE_STRING:
-       {
-       gdb_assert (TYPE_NFIELDS (type) == 1);
+@@ -2348,6 +2349,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
+   ctx.per_cu = per_cu;
+   ctx.obj_address = 0;
  
++frame_id old_frame_id (get_frame_id (deprecated_safe_get_selected_frame ()));
++class RestoreCall {
++private:
++  const std::function<void ()> func;
++public:
++  RestoreCall(std::function<void ()> func_):func(func_) {}
++  ~RestoreCall() { func(); }
++} restore_frame([=]() {
++  frame_info *old_frame (frame_find_by_id (old_frame_id));
++  if (old_frame != NULL)
++    select_frame (old_frame);
++});
++if (frame != NULL) select_frame (frame);
++
+   scoped_value_mark free_values;
+   ctx.gdbarch = get_objfile_arch (objfile);
 diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
 new file mode 100644
-index 0000000..261ce17
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
 @@ -0,0 +1,24 @@
@@ -75,7 +90,6 @@ index 0000000..261ce17
 +end subroutine bar
 diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
 new file mode 100644
-index 0000000..570a28c
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
 @@ -0,0 +1,39 @@
@@ -120,7 +134,6 @@ index 0000000..570a28c
 +gdb_test "bt" {foo \(string='hello'.*}
 diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
 new file mode 100644
-index 0000000..2bc637d
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
 @@ -0,0 +1,36 @@
@@ -160,6 +173,3 @@ index 0000000..2bc637d
 +  end interface
 +  call foo ('hello')
 +end
-
---FCuugMFkClbJLl1L--
-
This page took 0.665948 seconds and 4 git commands to generate.