0

I am using free embedded NexusDB from GetIt which comes without sources, only .DCUs

However, these DCUs has debug info in them, which hamper debugging a lot, i.e. when I try to Step Into (F7) my code, IDE often prompts me about source file location of, say, nxdb.pas, and then, as I have no such file, come into CPU view with disassembly with line numbers only (see example at the bottom).

Same problem is with Trace to Next Source Line (Shift+F7)

NexusDB Library folder contains only one version of .DCUs, there is no "Release" version

So I come to this question - is there any way to strip debug info from .DCUs?

Example of CPU view with linenumbers only:

TnxDataset.Notification:
007930EC 55               push ebp
...
007930F7 8945FC           mov [ebp-$04],eax
<unknown file>.10682: 
007930FA 8BCB             mov ecx,ebx
...
00793101 E8F6F9D3FF       call TComponent.Notification
<unknown file>.10683: 
00793106 8B45FC           mov eax,[ebp-$04]
Serhii Kheilyk
  • 933
  • 1
  • 8
  • 24
  • 1
    The only solution is to pay $$$ for the source... – whosrdaddy Aug 31 '18 at 07:42
  • No, you can not. Only if you have the source code. – RBA Aug 31 '18 at 07:43
  • 1
    In Turbo Pascal days, Borland used to provide a utility, TDStrip.Exe, which could do this. Istr that the JEDI library includes code to parse the PE executable format, and you might be able to roll your own utility using that. E.g. you could overwrite the section which identifies where the debug info is located or even the debug info itself. – MartynA Aug 31 '18 at 08:26
  • @MartynA, thanks. I thought about the similar path using [DCU32Int](http://hmelnov.icc.ru/DCU/index.eng.html) – Serhii Kheilyk Aug 31 '18 at 09:15
  • 3
    Pay for the source and recompile it without debug info. Removing it might violate the licensing agreement - did you check to see if you're allowed to modify those .dcus? – Ken White Aug 31 '18 at 12:07
  • 1
    V. good point @KenWhite. – MartynA Aug 31 '18 at 19:57
  • @KenWhite thanks for pointing. I would assume that you should be right, but in fact there are no such claims - https://pastebin.com/Fv0HUWr4 – Serhii Kheilyk Aug 31 '18 at 21:36
  • I didn't ask for a link to pastebin. I asked if you had contacted the authors of those components to ask them if it was allowable under their terms of use for you to modify their DCU files without purchasing the source. – Ken White Aug 31 '18 at 22:56
  • @KenWhite No, I hadn't yet. Why do you think the EULA is not governing this? – Serhii Kheilyk Aug 31 '18 at 23:45
  • Because I am not a lawyer, and I don't make legal interpretations of EULAs for other people. :-) – Ken White Aug 31 '18 at 23:54
  • I see. Did you notice we aren't in the court? Just kidding ) – Serhii Kheilyk Aug 31 '18 at 23:56
  • @KenWhite is correct, the EULA does not permit any modification. – NexusDB Expert Sep 01 '18 at 01:31
  • 2
    Legal advice from anyone but an attorney licensed where you live is worthless. You may not be in a court now, but you could be next week/month/year if you violate the terms of that EULA, and if it does not **clearly state** that you're allowed to modify the files without purchasing the source, and you do so anyway, do so at your own risk. Don't ask SO readers to help you cut your own throat, however. IMO, if you want to modify the *free software*, you should buy the source to do so - the authors spent their time writing it and you're getting benefit from their work. – Ken White Sep 01 '18 at 01:36

1 Answers1

1

I'm not aware of any utility that will do this for you. Your best course of action is likely to actively set breakpoints in your event handlers etc. I suspect that the most common cause of the IDE's request for the source is when exceptions occur; then just continue running to see the exception.

NexusDB Expert
  • 301
  • 2
  • 3