Created attachment 8056 [details] Example source code In the pascal parser, there is special code that will try to emulate case-insensivity despite the fact that pascal is not registered as a 'case-insensitive' language. # Compile attached source code, using Free Pascal compiler fpc -gs -Mobjfpc test-class-pascal.pas # Debug it gdb ./test-class-pascal ....... (gdb) b TA__CHECK Breakpoint 1 at 0x40154c: file test-class-pascal.pas, line 23. (gdb) r Starting program: E:\pas\test\test-class-pascal.exe [New Thread 6700.0x1ae0] Breakpoint 1, TA__CHECK (B=0x1572ee0, this=<error reading variable>) at test-class-pascal.pas:23 23 check:=(x < b.x); (gdb) p this $1 = (TA) 0x1572ed0 (gdb) p this^ warning: can't find linker symbol for virtual table for `TA' value $2 = {<TOBJECT> = {_vptr$ = {0x408014, 0x43}}, X = 67, Y = 33} (gdb) p X warning: can't find linker symbol for virtual table for `TA' value $3 = 67 (gdb) p B.X warning: can't find linker symbol for virtual table for `TA' value $4 = -1 (gdb) p b.x warning: can't find linker symbol for virtual table for `TA' value $5 = -1 (gdb) p x Type TA has no component named x. (gdb)
Created attachment 8057 [details] Fix for PR
The master branch has been updated by Pierre Muller <muller@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8aae434443df61440ff5228f5c8fe3e5d4a38798 commit 8aae434443df61440ff5228f5c8fe3e5d4a38798 Author: Pierre Muller <muller@ics.u-strasbg.fr> Date: Tue Apr 21 22:10:08 2015 +0200 Fix pascal behavior for class fields with testcase Problem reported as PR pascal/17815 Part 1/3: Remember the case pattern that allowed finding a field of this. File gdb/p-exp.y modified This is the fix in the pascal parser (p-exp.y), to avoid the error that GDB does find normal variables case insensitively, but not fields of this, inside a class or object method. Part 2/3: Add "class" option for pascal compiler File gdb/testsuite/lib/pascal.exp This part of the patch series is unchanged. It adds class option to pascal compiler which adds the required command line option to accept pascal class types. Part 3/3: New file: gdb/testsuite/gdb.pascal/case-insensitive-symbols.exp New file: gdb/testsuite/gdb.pascal/case-insensitive-symbols.pas Here is an updated version of this test, using Pedro's suggestions. Test to check that PR 17815 is fixed.
The commit from 2015-04-21 should fix this issue.
The gdb-7.9-branch branch has been updated by Pierre Muller <muller@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6ed34db8858cc18a5a941f32f22bb250017c3d48 commit 6ed34db8858cc18a5a941f32f22bb250017c3d48 Author: Pierre Muller <muller@ics.u-strasbg.fr> Date: Sat May 2 18:21:50 2015 +0200 Subject: [PATCH] Fix pascal behavior for class fields with testcase Problem reported as PR pascal/17815 Part 1/3: Remember the case pattern that allowed finding a field of this. File gdb/p-exp.y modified This is the fix in the pascal parser (p-exp.y), to avoid the error that GDB does find normal variables case insensitively, but not fields of this, inside a class or object method. Part 2/3: Add "class" option for pascal compiler File gdb/testsuite/lib/pascal.exp This part of the patch series is unchanged. It adds class option to pascal compiler which adds the required command line option to accept pascal class types. Part 3/3: New file: gdb/testsuite/gdb.pascal/case-insensitive-symbols.exp New file: gdb/testsuite/gdb.pascal/case-insensitive-symbols.pas Here is an updated version of this test, using Pedro's suggestions. Test to check that PR 17815 is fixed.