[binutils-gdb] gdb/testsuite: fix gdb.cp/converts.exp to run with clang
Bruno Larsen
blarsen@sourceware.org
Mon Oct 31 12:44:50 GMT 2022
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1e7416363963e27c8d122bee2397d4b48a482ec3
commit 1e7416363963e27c8d122bee2397d4b48a482ec3
Author: Bruno Larsen <blarsen@redhat.com>
Date: Tue Oct 4 16:09:05 2022 +0200
gdb/testsuite: fix gdb.cp/converts.exp to run with clang
Clang attempts to minimize the size of the debug-info by not adding
complete information about types that aren't constructed in a given
file. Specifically, this meant that there was minimal information about
class B in the test gdb.cp/converts.exp. To fix this, we just need to
construct any object of type B in that file.
Approved-By: Andrew Burgess <aburgess@redhat.com>
Diff:
---
gdb/testsuite/gdb.cp/converts.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.cp/converts.cc b/gdb/testsuite/gdb.cp/converts.cc
index ecf806481fd..1224581a879 100644
--- a/gdb/testsuite/gdb.cp/converts.cc
+++ b/gdb/testsuite/gdb.cp/converts.cc
@@ -55,7 +55,7 @@ int main()
char av = 'a';
char *a = &av; // pointer to..
- B *bp;
+ B *bp = new B();
foo1_1 (a); // ..pointer
foo1_2 (a); // ..array
foo1_3 ((int*)a); // ..pointer of wrong type
More information about the Gdb-cvs
mailing list