Re: [fpc-pascal] Compiler debug build

2017-07-22 Thread denisgolovan
Thanks.That's exactly what I need.22.07.2017, 20:20, "Maciej Izak" :2017-07-22 19:05 GMT+02:00 denisgolovan :So the question is why it's so difficult to build fpc compiler/rtl in debug mode?
Is it possible to fix? Or maybe I miss some official way?You don't need to edit Makefile.fpc. When I need debug info for rtl and packages I use this:make clean all LINKSMART=1  CREATESMART=1  DEBUG=1 OPTIMIZE=0  OPT="-gl -gw -godwarfsets -O-1" -- Best regards,Maciej Izak

,___fpc-pascal maillist  -  fpc-pascal@lists.freepascal.orghttp://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal-- Regards,Denis Golovan
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPCUnit/DUnit: How abort all other tests?

2017-07-22 Thread Graeme Geldenhuys

On 2017-07-22 21:50, Marcos Douglas B. Santos wrote:

I would like to know if there is a way to abort all other test and an
specific one fail. I mean, if some "special tests" fail, will be a
waste of time to continue.


There is such functionality in FPTest (the DUnit2 fork for Free Pascal). 
Take a look at the EarlyExitCheck() check procedure. For more detailed 
information, read the docs/DUnit2Description.html page in the 
repository, and then jump to the "Summary Level Checks" section.


FPTest (and DUnit2 from SF.net) are backwards compatible with DUnit 
v9.4, but also has many more improvements and features.



The FPTest code repository can be found here:

  https://github.com/graemeg/fptest

or cloned directly via:

  git clone git://github.com/graemeg/fptest.git


Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPCUnit/DUnit: How abort all other tests?

2017-07-22 Thread Michael Van Canneyt



On Sat, 22 Jul 2017, Marcos Douglas B. Santos wrote:


Hi,

I'm using FPCUnit and DUnit to test code.
I would like to know if there is a way to abort all other test and an
specific one fail. I mean, if some "special tests" fail, will be a
waste of time to continue.


No, there currently is not. But such a thing can be easily added.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] FPCUnit/DUnit: How abort all other tests?

2017-07-22 Thread Marcos Douglas B. Santos
Hi,

I'm using FPCUnit and DUnit to test code.
I would like to know if there is a way to abort all other test and an
specific one fail. I mean, if some "special tests" fail, will be a
waste of time to continue.

Best regards,
Marcos Douglas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Compiler debug build

2017-07-22 Thread Maciej Izak
2017-07-22 19:05 GMT+02:00 denisgolovan :

> So the question is why it's so difficult to build fpc compiler/rtl in
> debug mode?
> Is it possible to fix? Or maybe I miss some official way?
>

You don't need to edit Makefile.fpc. When I need debug info for rtl and
packages I use this:

make clean all LINKSMART=1  CREATESMART=1  DEBUG=1 OPTIMIZE=0  OPT="-gl -gw
-godwarfsets -O-1"

-- 
Best regards,
Maciej Izak
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Compiler debug build

2017-07-22 Thread denisgolovan
Hi all

Currently I am debugging a nasty shared memory bug.
More specifically it's related to memory allocator, though not directly.

More to the point - lack of backtraces is really tough - Lazarus debugger just 
shows one level. 
Upon some investigation I managed to get much more meaningful backtraces. 
However the only way to enable them which I found is manually editing root 
Makefile.fpc and removing all RELEASE directives (giving executing make DEBUG=1 
does not help) and compiler rebuild to avoid -O2 optimizations.

So the question is why it's so difficult to build fpc compiler/rtl in debug 
mode?
Is it possible to fix? Or maybe I miss some official way?

-- 
Regards,
Denis Golovan
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Semaphores removed from the rtl?

2017-07-22 Thread Anthony Walter
Michael, no I don't. I use
https://github.com/sysrpl/Bare.Game/blob/master/source/bare.interop.sdl2.pas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] backtrace code in fpc

2017-07-22 Thread Matias Vara
Hello Florian,

2017-07-22 13:49 GMT+01:00 Florian Klämpfl :

> Am 22.07.2017 um 14:47 schrieb Matias Vara:
> > Hello,
> >
> > I am not sure why my executable does not contains a .debug_aranges
> section. It contains .debug_line
> > and .debug_info. Am I missing some linker flags?
> >
>
> Maybe not included by the linker script?
>
>
Maybe, I am not sure. The map file does show a .debug_aranges section
either. Also I cannot find any information about .debug_arranges section in
the generated .s. The section is included by the link script:

.debug_aranges BLOCK(__section_alignment__) (NOLOAD) : { *(.debug_aranges) }


Matias




> __
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] backtrace code in fpc

2017-07-22 Thread Florian Klämpfl
Am 22.07.2017 um 14:47 schrieb Matias Vara:
> Hello, 
> 
> I am not sure why my executable does not contains a .debug_aranges section. 
> It contains .debug_line
> and .debug_info. Am I missing some linker flags?
> 

Maybe not included by the linker script?

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] backtrace code in fpc

2017-07-22 Thread Matias Vara
Hello,

I am not sure why my executable does not contains a .debug_aranges section.
It contains .debug_line and .debug_info. Am I missing some linker flags?

Thanks, Matias.

2017-07-19 0:05 GMT+01:00 Matias Vara :

> Hello Charlie and thanks for the comments. I ended up by implementing my
> own Infodwrf unit.
>
> Matias
>
>
> On 18 Jul 2017 11:48 p.m., "Karoly Balogh (Charlie/SGR)" <
> char...@scenergy.dfmk.hu> wrote:
>
> Hi,
>
> On Mon, 17 Jul 2017, Matias Vara wrote:
>
> > Hello everyone, I am trying to port the code for backtrace, e.g.,
> > GetLineInfo(), to my freepascal kernel in order to print a backtrace
> > when an exception happens.
>
> Slightly off topic, but make sure when you copy code from (or even study
> the source of) the RTL, that your resulting code is license compatible.
>
> > The drawback now is that I am not sure where the source is. I think it
> > is the unit lnfodwrf.pp however I am not sure.
>
> The backtrace/stack traversal code itself is in system unit, see
> FPC_PushExceptObject and surrounding code. To print the frames collected
> there, the system unit will just use BackTraceStrFunc as implemented by
> various debuginfo units to print lineinfo strings based on information by
> the different debug/symbol formats.
>
> You just have to implement your own debug info parser and custom
> BackTraceStrFunc, then the RTL should handle the rest. You can check the
> various locations where BackTraceStrFunc is called in system unit for
> further reference.
>
> > From the code, it seems that this unit is opening the executable to get
> > the debug section, is this correct? is it not getting the name of the
> > symbols from memory? In my case, the debug symbols must be taken from
> > memory since there is no disk access.
>
> The lnfodwrf unit just gets the symbol name for a given address, stored in
> DWARF debug info sections in an executable, and injects it's own
> BackTraceStrFunc in the RTL to return that.. The same with lineinfo unit
> for STABS debug info format, actually. Opening a file and loading it is
> not a requirement, as long as your tables are in the memory anyway. But
> normally these are not loaded by the executable loader of OSes, hence
> these units will load/parse them.
>
> If they're in memory in your case already, you can just skip the loading,
> and implement your own customized version of lnfodwrf unit, etc.
>
> BackTraceStrFunc is the key really, as it's quite universal. And the
> default implementation is quite simple, see SysBackTraceStr.
>
> Hope this was helpful,
> --
> Charlie
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
>
>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Semaphores removed from the rtl?

2017-07-22 Thread Michael Schnell



On 19.07.2017 18:29, Anthony Walter wrote:


As a note to this, I am using semaphores quite a bit in SDL2 ...

Do you use Jedi-SDL to combine fpc and SDL ?

-Michael
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal