[DebugInfo] DIBuilder missing interface to generate DWARF info for packed_decimal basic type.

Adding tags on subject line

Hi Chirag,

The DW_ATE_packed_decimal (etc) constants exist because they are merely additional values in an enumeration, and we just added all the values defined in DWARF to the enumeration . LLVM does not actually support any of the decimal types, or scaled binary types. (Somebody is actively working on scaled binary operations, although they have not yet gotten to the point of wanting to support debug info.)

Without spending much time thinking about it, my inclination would be to add a new method to DIBuilder for the decimal and scaled binary types, because the additional parameters are meaningless in any other context. You might also consider whether to add a separate subclass of DIBasicType to handling scaling and decimal attributes. The decimal and scaled types are quite unusual, and we would not want to impose additional memory cost on all basic types to support these relatively rare cases.

Are you planning to support all the decimal types? I know the OpenVMS people will also want them, for COBOL and other languages, so there’s benefit in having proper support in LLVM. But even if you are interested only in packed decimal, the infrastructure ought to be designed to handle all cases.

Thanks,

–paulr

(who helped design the DWARF support for COBOL types a long time ago)

Hello Paul,

Thanks for the reply.

Yes, I am only looking for dwarf support at the moment and planning to support both PLI/COBOL decimal types. Also thanks for the suggestion, you are right as it is going to be rare cases, so it will be better to implement a separate subclass to avoid memory overhead for others.

(Somebody is actively working on scaled binary operations, although they have not yet gotten to the point of wanting to support debug info.)

If possible, can you kindly get me in touch with them so I would not spend time on which is already been done?

Regards,

(Somebody is actively working on scaled binary operations, although they have not yet gotten to the point of wanting to support debug info.)

If possible, can you kindly get me in touch with them so I would not spend time on which is already been done?

If you look on llvm-dev for the discussion “[llvm-dev] Fixed Point Support in LLVM” you’ll find them:

Leonard Chan leonardchan@google.com

Bevin Hansson bevin.hansson@ericsson.com

Admittedly this looks like binary-scaled, not decimal-scaled (I’ve been following the discussion, but not closely), so it might not be directly helpful to you; I don’t remember whether PL/I has binary-scaled types. However, DWARF supports both binary and decimal scale factors, so the DIBuilder and LLVM debug-info support should permit both.

John Reagan john.reagan@vmssoftware.com will also be looking ahead to supporting these types when the OpenVMS project gets to the point of supporting their broad range of non-C/C++ compilers, which includes PL/I and COBOL.

Regards,

–paulr

Thank you paul, that was helpful.

Hi!

In our out-of-tree compiler we have added custom types for the fixed-point types that we support. (We also use an out-of-tree gdb).

So unfortunately this means that we have not done any work on getting any of the general Dwarf to work for these types.

Hello Mattias,

Thanks for the info.
I am only looking for related dwarf generation part in llvm using the general DWARF spec. Currently just measuring the work needed to get there.

Regards,
Chirag Patel.

Chirag Patel| Software Engineer
RAINCODE Mainframe to .NET
Tel : +91 080 41159811 | Mob : +91 90493 36744
www.raincodelabs.com