jingu kang via llvm-dev
2016-Mar-31 23:02 UTC
[llvm-dev] Question about 'isUnsignedDIType' function on DwarfUnit.cpp
Hi All,
I have question about 'isUnsignedDIType' function on
'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp'
When we want to generate object file with dwarf debug format, clang
can generates 'DW_ATE_lo_user' encoding for complex integer type as
follow:
"clang/lib/CodeGen/CGDebugInfo.cpp"
llvm::DIType *CGDebugInfo::CreateType(const ComplexType *Ty) {
...
if (Ty->isComplexIntegerType())
Encoding = llvm::dwarf::DW_ATE_lo_user;
...
There is a assert for DIBasicType's enconding in the
'isUnsignedDIType' function and it generates assertion for
'DW_ATE_lo_user'. Is it intended? I think it should not generate
assertion for 'DW_ATE_lo_user' because it comes from complex integer
type. How do you think about it? If I missed something, please let me
know.
Thanks,
JinGu Kang
Robinson, Paul via llvm-dev
2016-Apr-01 05:33 UTC
[llvm-dev] Question about 'isUnsignedDIType' function on DwarfUnit.cpp
+llvm-dev which got lost somehow> -----Original Message----- > From: Robinson, Paul > Sent: Thursday, March 31, 2016 10:33 PM > To: 'jingu kang' > Subject: RE: [llvm-dev] Question about 'isUnsignedDIType' function on > DwarfUnit.cpp > > > > > -----Original Message----- > > From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of > jingu > > kang via llvm-dev > > Sent: Thursday, March 31, 2016 4:02 PM > > To: llvm-dev > > Subject: [llvm-dev] Question about 'isUnsignedDIType' function on > > DwarfUnit.cpp > > > > Hi All, > > > > I have question about 'isUnsignedDIType' function on > > 'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp' > > > > When we want to generate object file with dwarf debug format, clang > > can generates 'DW_ATE_lo_user' encoding for complex integer type as > > follow: > > > > "clang/lib/CodeGen/CGDebugInfo.cpp" > > llvm::DIType *CGDebugInfo::CreateType(const ComplexType *Ty) { > > ... > > if (Ty->isComplexIntegerType()) > > Encoding = llvm::dwarf::DW_ATE_lo_user; > > ... > > > > There is a assert for DIBasicType's enconding in the > > 'isUnsignedDIType' function and it generates assertion for > > 'DW_ATE_lo_user'. Is it intended? I think it should not generate > > assertion for 'DW_ATE_lo_user' because it comes from complex integer > > type. How do you think about it? If I missed something, please let me > > know. > > I tried compiling the following with -g: > _Complex int foo; > I do not see an assertion, I see it producing a DW_TAG_base_type > with name "complex" and an encoding of 0x80 (decimal 128). > Do you have a sample source file and command line to reproduce the > assertion? Are you using an older compiler? > --paulr > > > > > Thanks, > > JinGu Kang > > _______________________________________________ > > LLVM Developers mailing list > > llvm-dev at lists.llvm.org > > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
jingu kang via llvm-dev
2016-Apr-01 10:59 UTC
[llvm-dev] Question about 'isUnsignedDIType' function on DwarfUnit.cpp
Hi Paul,
Ah... You are right! It is my mistake. I am implementing new backend
on llvm and clang 3.7.0. I thought the mechanism of debugging
information is same between 3.7.0 and trunk. When I look at trunk, it
seems to pass the problem.
I used following example.
int err;
__complex__ int ctest_int (__complex__ int x)
{
__complex__ int res;
res = ~x;
return res;
}
void test_int (void)
{
__complex__ int res, x;
x = 1.0 + 2.0i;
res = ctest_int (x);
if (res != 1.0 - 2.0i) {
printf ("test_" "int" " failed\n");
++err;
}
}
When above example is compiled with '-g' option and my target, Codeden
constructs VariableDIE with following DBG_VALUE and DIBasicType.
DBG_VALUE 1, 0, !"res", <!32>; line no:12
!DIBasicType(name: "complex", size: 64, align: 32, encoding: 128)
llvm-3.7.0 tried to add constant value directly and it generated
assertion on 'isUnsignedDIType' function as I mentioned on previous
e-mail. But trunk checks whether there is DBG_VALUE or not. Therefore,
I think trunk could pass the problem.
Thanks,
JinGu Kang
2016-04-01 6:33 GMT+01:00 Robinson, Paul <Paul_Robinson at
playstation.sony.com>:> +llvm-dev which got lost somehow
>
>> -----Original Message-----
>> From: Robinson, Paul
>> Sent: Thursday, March 31, 2016 10:33 PM
>> To: 'jingu kang'
>> Subject: RE: [llvm-dev] Question about 'isUnsignedDIType'
function on
>> DwarfUnit.cpp
>>
>>
>>
>> > -----Original Message-----
>> > From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On
Behalf Of
>> jingu
>> > kang via llvm-dev
>> > Sent: Thursday, March 31, 2016 4:02 PM
>> > To: llvm-dev
>> > Subject: [llvm-dev] Question about 'isUnsignedDIType'
function on
>> > DwarfUnit.cpp
>> >
>> > Hi All,
>> >
>> > I have question about 'isUnsignedDIType' function on
>> > 'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp'
>> >
>> > When we want to generate object file with dwarf debug format,
clang
>> > can generates 'DW_ATE_lo_user' encoding for complex
integer type as
>> > follow:
>> >
>> > "clang/lib/CodeGen/CGDebugInfo.cpp"
>> > llvm::DIType *CGDebugInfo::CreateType(const ComplexType *Ty) {
>> > ...
>> > if (Ty->isComplexIntegerType())
>> > Encoding = llvm::dwarf::DW_ATE_lo_user;
>> > ...
>> >
>> > There is a assert for DIBasicType's enconding in the
>> > 'isUnsignedDIType' function and it generates assertion for
>> > 'DW_ATE_lo_user'. Is it intended? I think it should not
generate
>> > assertion for 'DW_ATE_lo_user' because it comes from
complex integer
>> > type. How do you think about it? If I missed something, please let
me
>> > know.
>>
>> I tried compiling the following with -g:
>> _Complex int foo;
>> I do not see an assertion, I see it producing a DW_TAG_base_type
>> with name "complex" and an encoding of 0x80 (decimal 128).
>> Do you have a sample source file and command line to reproduce the
>> assertion? Are you using an older compiler?
>> --paulr
>>
>> >
>> > Thanks,
>> > JinGu Kang
>> > _______________________________________________
>> > LLVM Developers mailing list
>> > llvm-dev at lists.llvm.org
>> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Maybe Matching Threads
- Question about 'isUnsignedDIType' function on DwarfUnit.cpp
- [LLVMdev] Signed/unsigned value type resolution
- [LLVMdev] Issues with clang-llvm debug info validity
- [LLVMdev] Issues with clang-llvm debug info validity
- Collecting address ranges in DWARFUnit::collectAddressRanges.