public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/19954] New: Compiler emits incomplete structure type
@ 2005-02-14 20:42 nikolay at etnus dot com
2005-02-14 20:49 ` [Bug debug/19954] " pinskia at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: nikolay at etnus dot com @ 2005-02-14 20:42 UTC (permalink / raw)
To: gcc-bugs
This is a readelf output of test program. The variable in question is
Derived1 d1;
<0><9dd>: Abbrev Number: 1 (DW_TAG_compile_unit)
DW_AT_stmt_list : 492
DW_AT_producer : GNU C++ 3.4.3
DW_AT_language : 4 (C++)
DW_AT_name : ../../src/tx_basic_class.cxx
<3><a86>: Abbrev Number: 4 (DW_TAG_variable)
DW_AT_name : d1
DW_AT_decl_file : 1
DW_AT_decl_line : 4
DW_AT_type : <ad5>
DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24; )
<1><ad5>: Abbrev Number: 6 (DW_TAG_structure_type)
DW_AT_sibling : <b06>
DW_AT_name : Derived1
DW_AT_declaration : 1
^^^^^^^^^
But there is no defining declaration of this class other than in different CU:
<0><ef7>: Abbrev Number: 1 (DW_TAG_compile_unit)
DW_AT_stmt_list : 1016
DW_AT_producer : GNU C++ 3.4.3
DW_AT_language : 4 (C++)
DW_AT_name : ../../src/Derived1.cxx
<1><f76>: Abbrev Number: 2 (DW_TAG_structure_type)
DW_AT_sibling : <10b6>
DW_AT_name : (indirect string, offset: 0x6ba): Derived1
DW_AT_byte_size : 16
DW_AT_decl_file : 2
DW_AT_decl_line : 5
DW_AT_containing_type: <11c4>
But this is clearly wrong, because this declaration have no connection with
previous one exept for the name. And in more complex examples it just plain
wrong and is not working.
Example files:
-------------------------------------------------
//Derived1.hxx
class Derived1{
public:
Derived1(int size=5);
virtual ~Derived1() { delete []myPointer; }
virtual int getId();
virtual float* getData(int);
private:
int mySize;
int myId;
float* myPointer;
};
---------------------------
//Derived111.cxx
#include "Derived111.hxx"
Derived1::Derived1(int size){
mySize=size;
myId=2;
myPointer=new float[mySize];
for(int i=0;i<mySize;i++)
myPointer[i]=i+1;
}
int Derived1::getId(){
return myId;
}
float* Derived1::getData(int dummy){
dummy=11;
return myPointer;
}
--------------------------
// main
#include "Derived111.hxx"
int main(){
Derived1 d1;
int m=d1.getId();
float* pt = d1.getData(1); /* set breakpoint here */
float* dummy_bp=pt;
Derived1* dp = &d1;
pt = dp->getData(1);
}
------------------------------------
--
Summary: Compiler emits incomplete structure type
Product: gcc
Version: 3.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: debug
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: nikolay at etnus dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19954
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug debug/19954] Compiler emits incomplete structure type
2005-02-14 20:42 [Bug debug/19954] New: Compiler emits incomplete structure type nikolay at etnus dot com
@ 2005-02-14 20:49 ` pinskia at gcc dot gnu dot org
2005-03-21 16:26 ` drow at gcc dot gnu dot org
2005-09-26 0:43 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-14 20:49 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-14 18:53 -------
I want to say this is duplicate of bug 12385.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19954
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug debug/19954] Compiler emits incomplete structure type
2005-02-14 20:42 [Bug debug/19954] New: Compiler emits incomplete structure type nikolay at etnus dot com
2005-02-14 20:49 ` [Bug debug/19954] " pinskia at gcc dot gnu dot org
@ 2005-03-21 16:26 ` drow at gcc dot gnu dot org
2005-09-26 0:43 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 6+ messages in thread
From: drow at gcc dot gnu dot org @ 2005-03-21 16:26 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From drow at gcc dot gnu dot org 2005-03-21 16:26 -------
I do consider it a bug that there is no way to request GCC emit full debug
information in this case. But can you give an example in which it doesn't work?
In general, it relies on the C++ One Definition Rule; if you have multiple
types in a C++ program with the same name, this isn't the only thing that's
going to go wrong.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19954
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug debug/19954] Compiler emits incomplete structure type
2005-02-14 20:42 [Bug debug/19954] New: Compiler emits incomplete structure type nikolay at etnus dot com
2005-02-14 20:49 ` [Bug debug/19954] " pinskia at gcc dot gnu dot org
2005-03-21 16:26 ` drow at gcc dot gnu dot org
@ 2005-09-26 0:43 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-26 0:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-26 00:43 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn| |12385
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-09-26 00:43:10
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19954
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug debug/19954] Compiler emits incomplete structure type
[not found] <bug-19954-4@http.gcc.gnu.org/bugzilla/>
2024-01-23 15:38 ` rguenth at gcc dot gnu.org
@ 2024-01-26 13:38 ` rguenth at gcc dot gnu.org
1 sibling, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-01-26 13:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19954
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Known to work| |13.2.1, 7.5.0
Status|NEW |RESOLVED
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
(gdb) n
6 float* pt = d1.getData(1); /* set breakpoint here */
(gdb) ptype d1
type = class Derived1 {
private:
int mySize;
int myId;
float *myPointer;
public:
Derived1(int);
~Derived1();
virtual int getId(void);
virtual float * getData(int);
}
works now as also verified in PR12385. Verified with GCC 7 and GCC 13.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug debug/19954] Compiler emits incomplete structure type
[not found] <bug-19954-4@http.gcc.gnu.org/bugzilla/>
@ 2024-01-23 15:38 ` rguenth at gcc dot gnu.org
2024-01-26 13:38 ` rguenth at gcc dot gnu.org
1 sibling, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-01-23 15:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19954
Bug 19954 depends on bug 12385, which changed state.
Bug 12385 Summary: Full debug info not emitted for C++ classes with external virtual functions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12385
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-01-26 13:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-14 20:42 [Bug debug/19954] New: Compiler emits incomplete structure type nikolay at etnus dot com
2005-02-14 20:49 ` [Bug debug/19954] " pinskia at gcc dot gnu dot org
2005-03-21 16:26 ` drow at gcc dot gnu dot org
2005-09-26 0:43 ` pinskia at gcc dot gnu dot org
[not found] <bug-19954-4@http.gcc.gnu.org/bugzilla/>
2024-01-23 15:38 ` rguenth at gcc dot gnu.org
2024-01-26 13:38 ` rguenth at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).