Re: [Lazarus] Main shows lots of changes in language files after rebuilding

2024-04-09 Thread Christo Crause via lazarus
On Tue, Apr 9, 2024 at 1:42 PM Maxim Ganetsky via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> 09.04.2024 08:30, Christo Crause via lazarus пишет:
> > I updated the Lazarus main version yesterday.  After rebuilding the IDE,
> > git shows that the PO files in ide/packages/ideconfig/languages
> > changed.  If these files are modified by the build process can they be
> > updated in git please.  Or is something else wrong?
>
> Committed.
>
>
Thank you Maxim. I appreciate the time and effort you invest in maintaining
Lazarus.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Main shows lots of changes in language files after rebuilding

2024-04-08 Thread Christo Crause via lazarus
I updated the Lazarus main version yesterday.  After rebuilding the IDE,
git shows that the PO files in ide/packages/ideconfig/languages changed.
If these files are modified by the build process can they be updated in git
please.  Or is something else wrong?

Christo
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How to list available serial orts on Ubuuntu?

2022-11-28 Thread Christo Crause via lazarus
On Mon, Nov 28, 2022 at 12:31 PM Bo Berglund via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

>
> I have looked at /dev/tty* but it lists a large number of items which
> makes it
> impossible for me. I do not belive all of´them are real serial ports...
>
> What can I do to get a selector for real serial ports on Ubuntu.
> lazarus@lists.lazarus-ide.org
> https://lists.lazarus-ide.org/listinfo/lazarus


Here is an example for POSIX type OSs:
https://github.com/ccrause/LazScope/blob/master/gui/serialobject.pas#L299
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] CFI in FpDebug

2022-06-29 Thread Christo Crause via lazarus
Great news, thank you Joost. This should decrease the amount of code memory
that needs to be scanned when building a stack trace - a boost particularly
for remote debugging.

On Tue, 28 Jun 2022, 23:22 Joost van der Sluis via lazarus, <
lazarus@lists.lazarus-ide.org> wrote:

>
> Hi all,
>
> I've just pushed a commit that changed the stack-unwinding logic for
> FpDebug.
>
> What is new is that when the executable includes Call Frame Information
> (CFI) as specified by the Dwarf-format and CFI is available for the a
> certain location, the CFI is used to unwind the stack. (x86_64 and i386
> only)
>
> Note however, that the CFI generated by FPC is not always correct, but
> in those cases is should fallback to the old implementation.
>
> In principle things could only get better. But if not, please tell me.
>
> Regards,
>
> Joost.
> --
> ___
> lazarus mailing list
> lazarus@lists.lazarus-ide.org
> https://lists.lazarus-ide.org/listinfo/lazarus
>
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] I was just banned from the Lazarus Forum for no reason!

2022-06-05 Thread Christo Crause via lazarus
On Sun, Jun 5, 2022 at 5:59 AM Derek John Evans via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> My only feeling atm, is wtf. I just posted details on a project I've
> worked on for the last 6 months using Lazarus and pas2js on a farm
> environment, and then was banned!
>

This is quite unexpected.  What is your forum name, I want to check if I
can find the message - sometimes messages are moved to different boards.
This seems like a mistake, but perhaps a moderator can give feedback on
this?
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Love the IDE

2022-03-14 Thread Christo Crause via lazarus
On Tue, 15 Mar 2022, 04:11 Steve Gatenby via lazarus, <
lazarus@lists.lazarus-ide.org> wrote:

> have been using both Atom and VsCode for a couple of weeks now (ESP coding)
>
> Just like to note ( hopefully without bashing the above )
>
> really love the Lazarus IDE :) - it is miles above in usability
>

At least you are not stuck with the Arduino IDE...

You can use Lazarus and FPC (trunk) to write code for Esp8266 & Esp32:
https://wiki.lazarus.freepascal.org/Xtensa

Some bindings to the respective IDF SDKs :
https://github.com/ccrause/fpc-esp-freertos

Not yet fully supporting all the GCC features, but getting there. Obviously
also not as many 3rd party libraries.

>
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Making fpdebug more cross-platform friendly

2021-12-16 Thread Christo Crause via lazarus
Currently there are a few instances where x86 specific assumptions/code are
used [1] in what I consider as the target agnostic level of fpdebug.  My
proposal is to move these instances to a hardware target specific unit so
that these target specific handling is clearly separated.  One location for
the target specific code is perhaps the fpdbgdisas* units, since it already
provides a number of hardware specific concepts such as identifying call &
return instructions and some stack frame analysis.  Adding for example
IsSoftwareBreakInstruction seems like a logical addition.

These changes are hindering some functionality on AVR and Xtensa targets,
e.g. some instructions are incorrectly disassembled because they start with
$CC, which is incorrectly  interpreted as a software break.  Also the
StepOut functionality currently assumes the x86 ABI to locate the return
address, which obviously fails for other targets.  While these methods
could in principle be hidden by new target specific overrides, it is not
aligned with proper OOP principles.  I will start with some concepts to
address these soon.

Similarly, but possibly a bit more tricky, is to separate the OS code from
the OS view of the hardware.  This would imply for example that the
register handling in fpdbglinuxclasses needs to be separated from the rest
of the code so that one could re-use the Linux layer, but swap out the
hardware specific layer x86_Linux.  Similarly for Windows, the
WOW64_CONTEXT could be part of an x86_Windows unit, so that it is possible
to also define and use _ARM64_NT_CONTEXT for Windows on ARM64.

Any thoughts, critique or suggestions are welcome.

Best wishes,
Christo

[1] Examples of x86 specific code not in a x86 specific unit
fpdbgclasses.pas: checking for int3 and its x86 encoding in TDbgProcess,
TDbgThread and TBreakLocationMap
fpdbgcontroller.pas: TDbgControllerCallRoutineCmd uses x86 call specific
encoding in InsertCallInstructionCode and RestoreInstructionPointer,
StoreRoutineResult using x86 register specific assumptions,
TDbgControllerStepOutCmd.SetReturnAdressBreakpoint assumes return address
is stored according to x86 stack frame layout.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Programming Mechanical Simulations

2021-12-15 Thread Christo Crause via lazarus
On Wed, Dec 15, 2021 at 10:41 AM Anthony Walter via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> I wanted to share this
> .
>
> I can't stop writing code. I was inspired to design a program that can
> convert any SVG drawing into a simulation of a physical machine. I am just
> getting started writing such a program, but have had some promising initial
> results. See the link at the top of this message for context.
>

Well done, looks impressive!
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Debugger stops in c dll even when no breakpoint set

2021-10-29 Thread Christo Crause via lazarus
On Fri, Oct 29, 2021 at 10:41 AM Luca Olivetti via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

>
> I now tested under windows 10 64 bits (the exe is 32 bits, the previous
> test was under windows 7 32 bits), and here instead of stopping once in
> ntdll!RtlpNtMakeTemporaryKey it stops twice: in ntdll!RtlZeroHeap and in
> ntdll!RtlCaptureStackContext.
> The former (RtlZeroHeap) shows what it seems a bogus call stack (i.e.
> just two levels, the RtlZeroHeap itself and ).
>

Searching around seems to suggest that RtlpNtMakeTemporaryKey is typically
part of a stack trace involving memory/stack corruption or freeing an
invalid reference or already freed pointer.  See this example:
https://stackoverflow.com/questions/45162248/calling-free-in-c-triggers-ntdlldbgbreakpoint-in-debug-but-crashes-in-rel/45247035

Since the code writes something to memory in the int3 branch, check errno
to see if that reveals something.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Debugger stops in c dll even when no breakpoint set

2021-10-28 Thread Christo Crause via lazarus
On Thu, Oct 28, 2021 at 2:01 PM Luca Olivetti via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

>
> 77045AC4 cc   int3


The Int3 instruction means break, so this is the expected behaviour.  If
there is no debugger inserted break point for this location, it must be
compiled into the dll code.  This means not stopping here will be
problematic, unless you use some kind of script to step over this break
instruction automatically.  I do not think it is possible from inside
Lazarus, but haven't actually tried to work around something similar before.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Fpdebug merge request 6

2021-09-05 Thread Christo Crause via lazarus
On Sun, Sep 5, 2021 at 8:24 PM Martin Frb via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> I ve seen it. I am really rather busy ...
>

No worries, I do realise there are a lot of changes to work through.


> I had a look at the first 2 or 3 commits some weeks ago.
> From what I recall
>
> 1) adding to the IDE options. Looks that then every user using fpdebug,
> will see options for host/port?
> While really convenient for avr users, rather confusing for others?
>

I am starting to agree with this view. There are quite a few extra remote
options that should eventually be implemented, so the IDE options will
become more busy.  My simplistic view is that a new remote Lazarus debugger
will inherit just about all its core functionality from the existing
FpDebugDebugger, with added remote config options.

2) global vars (iirc for host/port)
> That is due to the lack of config that can be passed in
>
> FpDebug (package) can not see the IDE conf. FpDebug should have minimum
> package depenencies.
> It needs its own conf that can be passed
> I have some ideas there, 
>

Will gladly await your ideas.  This can wait, it is just a bad practise on
my side currently, but workable.


> -
> The rest I have not yet looked at, sorry.
>

No problem, as long as it is still on your radar!
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] trying to read an EXE

2021-09-05 Thread Christo Crause via lazarus
On Sun, Sep 5, 2021 at 12:50 PM duilio foschi via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> > An alternative is to use a tool such as objdump or dumpbin to
> disassemble the executable file.
>
> objdump seems to be a unix tool. AFAIK dumpbin will only work from Visual
> Studio.
>

You can get GNU binutils for Windows here:
https://sourceforge.net/projects/mingw/files/MinGW/Base/binutils/binutils-2.28/


> Is there a way to see the assembly on a 2nd monitor while an EXE is run?
> Without having the EXE source code, I mean
>

This sounds as if you want to debug the executable?  This is doable, but
without source code you will have to step through the assembler
instructions manually, or know where in the code to put breakpoints.  Use
your favourite Windows debugger, if you don't have one try gdb (part of the
full large Lazarus install I believe).  Even if this is what you want to
do, I suggest you dump the disassembled code into a text file, open this
and study it.  If the executable is stripped it may be very difficult to
make sense of the assembler code.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Fpdebug merge request 6

2021-09-05 Thread Christo Crause via lazarus
I'm busy adding xtensa/esp32 support to fpdebug, which builds on top of the
AVR support.  It would be helpful if the AVR merge request[1] for fpdebug
gets reviewed, since the current xtensa work builds on top of this (with
some refactoring).

Best wishes,
Christo

1. https://gitlab.com/freepascal.org/lazarus/lazarus/-/merge_requests/6
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] trying to read an EXE

2021-09-04 Thread Christo Crause via lazarus
On Sat, Sep 4, 2021 at 11:53 AM duilio foschi via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> I followed Bart's suggestion and added the -al switch to the fpc.cfg file.
>
> This was probably the right move, as - after a new compile - I could see
> the wanted .s file beside the regular EXE.
>
> I uploaded the .s file here:
> https://mega.nz/file/rlpyHa7b#fx0LYTjapmUdFRkzVGCCzFFogqYuEu7UvYQ5HtilLks
>
> I opened the new .s file with a text editor and had a new surprising
> result: the instruction
>
> i:=cmbYear.ItemIndex+2005;
>
> is nowhere to be found.
>

The assembler file you posted is for the .lpr file only.  The -al option
generates the assembler files per compilation unit, before the project gets
linked.  Also it doesn't show the machine code (this resides in the
compiled object file), which seems to be what you want to inspect/modify.

The easiest way to see both the machine code, the disassembled code and the
Pascal code from inside Lazarus is to place a breakpoint on the line of
interest, run until you hit that breakpoint, then switch to the Assembler
view.

An alternative is to use a tool such as objdump or dumpbin to disassemble
the executable file.  There are options to include source code lines in the
output if available as debug information.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] trying to read an EXE

2021-09-04 Thread Christo Crause via lazarus
On Fri, Sep 3, 2021 at 11:08 PM duilio foschi via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> I thought it would be easy to use an hex editor like PSPad hex, find the
> number
> 2005 as 07D5 then fix it (maybe after the right guess in case of multiple
> hits).
>

As a test I compiled a simple example on x86_64 with integers for the year,
month and day, placed a break point on the encodedate call and inspected
the assembler:
/home/christo/tmp/project1.lpr:14 date := EncodeDate(y+$1a2b3c4d,
m, d);
OpCode Assembler
8B05CEF70700 mov eax,[rip+$0007F7CE]
678DB84D3C2B1A   lea edi,[eax+$1A2B3C4D]
81E7 and edi,$
In this case the constant $1a2b3c4d is added to the content of register
eax, encoded in the lea instruction.  The constant is recognizable as a
little endian byte sequence 4D 3C 2B 1A following the lea instruction bytes
67 8D B8.  Since your setup is probably different, your code may be
compiled into slightly different instruction sequences so you have to
inspect the generated instruction sequence, as mentioned by Bart.

Also note that testing with a string value will likely yield completely
different results, since a string literal will in most cases be stored
separately as mentioned by Sven.  This is in contrast to your original
question of modifying an integerconstant which can easily be encoded as
part of an instruction.

To my surprise, I could not find the word 07D5. As I vaguely remember the
> big endian/little endian question, I tried to look for D507: no hit.
>

This is somewhat surprising since my simple example shows the little endian
encoded constant as part of the instruction bytes. However, you have to
look at the specific instructions generated in your program.

I assume this is for remote patching of a large executable, else it would
be simpler to just distribute the recompiled version?
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How to restore anchor docking manager in the IDE?

2021-07-13 Thread Christo Crause via lazarus
On Tue, Jul 13, 2021 at 4:22 PM John Landmesser via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> Am 13.07.21 um 14:07 schrieb John Landmesser via lazarus:
> > Hi,
> >
> > i just "ruined" layout of the anchor docking manager in the IDE.
> >
> > Reinstall the package does not restore the default layout and pulling
> > for example object inspector does not help.
> >
> > I would expect the IDE would show where to place the object inspector by
> > painting a frame where it would sit if i stop dragging?!
> >
> > Tipps are welcome ...
> >
> > John Landmesser
> >
>
> Heavy fiddling ...
>
> But this tipps worked:
>
> See
>
> https://forum.lazarus.freepascal.org/index.php/topic,51935.msg382004.html#msg382004
>
> Tipp: Don't mess around with layout of anchordockingsgn package!


If your main problem is resetting messed up settings for anchordocking
package, you can edit or delete the saved settings.  Open
environmentoptions.xml in your Lazarus profile folder (e.g. on Windows:
c:\users\username\AppData\Local\lazarus), search for  and
either edit or delete the node (I didn't test this myself...).
Alternatively delete the file, or the whole lazarus folder - but this will
obviously delete a whole bunch of history and other settings too. This is
for Lazarus 2.0.10, newer versions may be a bit different.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] The "Use" button in Component List

2021-06-28 Thread Christo Crause via lazarus
On Mon, Jun 28, 2021 at 1:45 PM Michael Van Canneyt via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

>
> On Mon, 28 Jun 2021, Juha Manninen via lazarus wrote:
>
> > The list opens with Ctrl-Alt-P and is an alternative to the Component
> > Palette.
> > Is the "Use" button somehow useful?
> > A component can be added by selecting it and clicking on designer, or by
> > double-clicking it.
> > The behavior was slightly changed in r64929, issue:
> > https://bugs.freepascal.org/view.php?id=38706
> > Now the "Use" button inserts a component at coord(0,0) right away, which
> is
> > the double-click behavior.
> > Should the button be removed?
>
> I don't think you should remove it.
> The fact that you can/must double click is not immediatly clear.
> A button has a clear meaning.
>
> Michael.
> --
>

FWIW (I don't build forms very often), I would like to expand on Michael's
comment to suggest the "Use" button's caption could be changed to "Insert
on form" or something similar to more clearly describe its function.  Or
maybe just "Insert" with a more descriptive hint (Insert selected component
on active form).
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Introducing new dependencies between components - how to update make files?

2021-02-21 Thread Christo Crause via lazarus
On Sun, Feb 21, 2021 at 12:08 PM Mattias Gaertner via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> On Sun, 21 Feb 2021 11:50:49 +0200
> Christo Crause via lazarus  wrote:
>
> > I'm busy working on expanding AVR support in fpdebug/fpdebugdebugger.
> >  Some of the property classes overlap with classes already defined in
> > gdbmidebugger and I want to move these classes up the hierarchy to
> > avoid duplication.  This introduces extra dependencies and I need to
> > update the affected component make files. I started doing this using
> > the "Create Makefile" option in the Lazarus package tool with FPC 3.2
> > and noticed large changes in the resulting make file, mostly related
> > to deleted targets such as xtensa-freertos.  Should I use FPC trunk
> > (and more specifically fpcmake from trunk) for  development of
> > Lazarus, or is this just required when regenerating make files?
> >
> > Also the build order of some of the targets needs to be reordered in
> > the root make file to satisfy the dependency chain,  can I update the
> > Makefile.fpc and MakeFile by hand, or is there a tool/option to also
> > update these make files which are not part of a package?
>
> The Lazarus Makefiles are created from the corresponding Makefile.fpc.
> In order to support fpc trunk, you need fpc trunk sources.
>
> You can update one Makefile by calling the one liner (e.g linux 64bit):
>
> FPCDIR=/path/to/fpc_sources/trunk/fpc/
> /path/to/fpc_sources/trunk/fpc/utils/fpcm/bin/x86_64-linux/fpcmake
> -TAll -v
>

Thank you Mattias, that does the trick.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Introducing new dependencies between components - how to update make files?

2021-02-21 Thread Christo Crause via lazarus
I'm busy working on expanding AVR support in fpdebug/fpdebugdebugger.  Some
of the property classes overlap with classes already defined in
gdbmidebugger and I want to move these classes up the hierarchy to avoid
duplication.  This introduces extra dependencies and I need to update the
affected component make files. I started doing this using the "Create
Makefile" option in the Lazarus package tool with FPC 3.2 and noticed large
changes in the resulting make file, mostly related to deleted targets such
as xtensa-freertos.  Should I use FPC trunk (and more specifically fpcmake
from trunk) for  development of Lazarus, or is this just required when
regenerating make files?

Also the build order of some of the targets needs to be reordered in the
root make file to satisfy the dependency chain,  can I update the
Makefile.fpc and MakeFile by hand, or is there a tool/option to also update
these make files which are not part of a package?

Best regards,
Christo
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus