This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Fix of default lookup for "this" symbol.
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Thu, 07 Jul 2016 11:52:10 -0400
- Subject: [binutils-gdb] Fix of default lookup for "this" symbol.
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT 4f19a0e6b45c63c0b4afe27a19d144cca412d4ae ***
Author: Walfred Tedeschi <walfred.tedeschi@intel.com>
Branch: master
Commit: 4f19a0e6b45c63c0b4afe27a19d144cca412d4ae
Fix of default lookup for "this" symbol.
Using the default lookup for the symbol "this" might lead to segmentation
fault in GDB.
Some languages, e.g. Fortran, use as default lookup routine the C++
routines.
For those languages "this" can be the instance of a class or even the
definition of a class.
When an instance of a class having the name "this" is evaluated
in GDB a segmentation fault was observed.
As example of the issue take into consideration the Fortran code:
type foo
real :: a
type(bar) :: x
character*7 :: b
end type foo
type(foo) :: this
Issue appears when evaluating the variable "this" in GDB.
Within the language definition structure there is a field that represents
the name of the special symbol used for the C++ "this" for the language
being described.
The fix presented here takes into account the aforementioned field. In the
case the aforementioned field is NULL "this" is not represented in the
language described and the lookup should return a null_block_symbol.
Tests: Performed tests with gfortran and ifort.
Reviewed:
https://sourceware.org/ml/gdb-patches/2016-04/msg00068.html
After the commited patch:
https://sourceware.org/ml/gdb-patches/2016-06/msg00364.html
Patch can be applied.
2016-06-16 Walfred Tedeschi <walfred.tedeschi@intel.com>
gdb/ChangeLog:
* cp-namespace.c (cp_lookup_bare_symbol): Use language passed as
parameter to look for the symbol "this".
gdb/testsuite/ChangeLog:
* gdb.fortran/derived-types.exp (result_line, result_line_2):
New variables.
(print this%a, print this%b, print this): New tests.
* gdb.fortran/derived-types.f90 (this): New object and
initialization.
- Follow-Ups:
- Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master
- *** COMPILATION FAILED *** Failures on Fedora-x86_64-c-build-m64, branch master *** BREAKAGE ***
- Failures on Fedora-ppc64be-cc-with-index, branch master
- Failures on Debian-i686, branch master
- Failures on Debian-x86_64-m64, branch master
- Failures on Debian-s390x-native-gdbserver-m64, branch master
- Failures on Fedora-s390x-m64, branch master
- Failures on Debian-s390x-m64, branch master
- Failures on Fedora-x86_64-m32, branch master
- Failures on Fedora-ppc64be-m64, branch master
- Failures on Debian-i686-native-extended-gdbserver, branch master
- Failures on Debian-x86_64-native-extended-gdbserver-m64, branch master
- Failures on Debian-s390x-native-extended-gdbserver-m64, branch master
- Failures on Fedora-ppc64be-native-gdbserver-m64, branch master
- Failures on Fedora-ppc64be-native-extended-gdbserver-m64, branch master
- Failures on Fedora-ppc64le-native-extended-gdbserver-m64, branch master
- Failures on Fedora-ppc64le-cc-with-index, branch master
- Failures on Fedora-ppc64le-native-gdbserver-m64, branch master
- Failures on Fedora-ppc64le-m64, branch master