The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,995 other followers

Archive for the ‘C++ Builder’ Category

OMF, COFF and the 32-bit/64-bit Delphi or C++ compilers

Posted by jpluimers on 2020/01/29

Via [WayBack] As far as I can tell (and documentation on that is reaaaaaaly hard to find), dcc64 can link in .obj files in OMF and COFF format. Bcc64 uses LLVM chain and therefore produces ELF .o files… – Primož Gabrijelčič – Google+:

David Heffernan:
dcc32 does coff and omf, dcc64 only coff

and later he commented:

One of the difficulties with linking objects is the handling of exceptions. The 64 bit exception model is table based, in contrast to the stack based 32 bit model.

I don’t think that the exception tables are written correctly for code linked in objects. If exceptions are raised then this can lead to abnormal process termination. Process just disappears. Poof!

One common way that this happens is floating point exceptions that are by default unmasked by the Delphi RTL. I have found it necessary to mask them when calling into any linked object code to avoid exceptions being raised.

And compiling with cl can be a bit of a game. It’s stack checking options need to be disabled. And there are a few other key switches that help. And then there’s the forward declaration trick to help the one pass compiler cope with C objects that are expected to be linked in a separate step.

Anyway, it can be quite a challenge at times, but I’ve yet to find a plain self contained C library that has defeated me!

–jeroen

Posted in C++, C++ Builder, Delphi, Delphi x64, Development, Software Development, Visual Studio C++ | 2 Comments »

Delphi and C++ builder Platform Status

Posted by jpluimers on 2018/12/28

Almost all pages at the Embarcadero DocWiki have an embedded product version in the URL or get redirected to one.

One of the notable exceptions is the [WayBackPlatform Status:

The following table shows supported platforms and operating systems for different RAD Studio versions.

* (star) sign next to an operating system indicates that there is a known issue with that operating system and a corresponding RAD Studio version.

To see the workaround for that particular issue, click on the name of the operating system or scroll down to the appropriate section.

It got introduced in 2015 ([WayBackNew DocWiki RAD Studio, Delphi and C++Builder Platform Status Page – Community Blogs – Embarcadero Community) and is maintained at irregular intervals.

For some history: https://web.archive.org/web/*/http://docwiki.embarcadero.com/PlatformStatus/en/Main_Page

–jeroen

via: [WayBack] Summary page showing supported platforms and OS versions for XE4 and upwards, as well as links to known issues for specific versions… – Lars Fosdal – Google+

Posted in C++, C++ Builder, Delphi, Development, Software Development | Leave a Comment »

RSS feed for Dave’s Development Blog – mostly OTA articles on the Open Tools API for Delphi and C++ Builder

Posted by jpluimers on 2017/01/16

TL;DR: http://www.davidghoyle.co.uk/WordPress/?feed=rss2

Since there is no RSS link  on the page [WayBackDave’s Development Blog – Software Development using Borland / Codegear / Embarcadero RAD Studio

Since I wanted to follow his “blog” (which is sort of a collection of WordPress pages, mainly about the programming OTA: the Open Tools API interface to Delphi and C++ Builder), I was looking for the RSS feed.

Luckily, Feedly knows how to detect most blogging platforms, so it came up with https://feedly.com/i/subscription/feed/http://www.davidghoyle.co.uk/WordPress/?feed=rss2 which indicates the final bit is the RSS feed URL.

Some interesting links from there:

via: [WayBackOTA Interface Search 1.1 and GitHub http://www.davidghoyle.co.uk/WordPress/?…

–jeroen

Posted in C++, C++ Builder, Delphi, Development, RSS, SocialMedia, Software Development | Leave a Comment »

Rudy’s Delphi Corner – Pitfalls of converting, on converting from C/C++ to Delphi

Posted by jpluimers on 2015/09/02

If ever in need to translate C/C++ headers or code to Delphi, this refernece by Rudy Velthuis – a dentist with a strong interest in programming – is the best I could find: Rudy’s Delphi Corner – Pitfalls of converting.

It is written in a pretty version agnostic way, and covers the vast majority of conversion topics.

And it has been updated over time numerous times.

–jeroen

Posted in Borland C++, C, C++, C++ Builder, Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 10 Comments »

The C language specification describes an abstract computer, not a real one – The Old New Thing – Site Home – MSDN Blogs

Posted by jpluimers on 2014/04/09

Interesting read:

The C language specification describes an abstract computer, not a real one – The Old New Thing – Site Home – MSDN Blogs.

In other words: any language that merges null behaviour in the underlying storage will have a problem somwehere.

So if you want to have true nullable types, your null flag should be stored outside the underlying storage.

The .NET framework 2 and up, most database management systems and many other environment support that.

But most languages don’t support it for pointer types. So there will be portions of address spaces either inaccessible, or only accessible when skipping the null pointer checks.

Note that the thread above contains some very interesting bits, for instance this one:

Matt 28 Mar 2013 5:58 PM #

@MarkY “Dereferencing null is undefined?  Cool!  I thought it was guaranteed to crash, just like a false assertion or something.  So crashing is the OS guarantee, not the language guarantee apparently.”

Nope. It’s not an OS guarantee either. The OS won’t ever normally allocate memory at address zero, but there’s nothing to stop you telling it to. Try doing “VirtualAlloc(1, 4096, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE)” on your pre-Windows8 machine.

In fact, this is the reason why null-dereferences in kernel mode are often exploitable as elevation of privilege attacks. The null-page is mappable and within the user-addressable region of memory, so if the kernel dereferences a null pointer, it reads attacker controllable data.

And btw, this is the reason why on Linux and Windows8+ you can’t map the null-page.

–jeroen

via: The C language specification describes an abstract computer, not a real one – The Old New Thing – Site Home – MSDN Blogs.

Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, Borland C++, Borland Pascal, C, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C++, C++ Builder, Database Development, Delphi, Development, Pascal, Quick Pascal, Software Development, Turbo Pascal, VB.NET, VB.NET 10.0, VB.NET 11.0, VB.NET 8.0, VB.NET 9.0 | Leave a Comment »

 
%d bloggers like this: