Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2001-03

FP IDE change: use GDB 5.0

6 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Pierre Muller

Starting 14/03/2001,
the v10 IDE snapshots will be compiled with GDB v5.0 libraries.

GDB 5.0 has several bug fixes and enhancements compared to 4.18 that was used until now.
These libraries are created after applying a patch that adds support for pascal expressions
(at least part of it, the main missing part is
that no string operations are supported !)

You can find the source patch to official GDB 5.0
on ftp.freepascal.org in /fpc/contrib/gdbpas/gdbpas-5.0.patch This patch allows both to create GDBPAS and the libs used with by IDE.

This switch to GDB 5.0 will also
enhance FPU window support in debug mode
(this window is still quite rough, but you can at least see the value of the different FPU registers and their state)

Please report any problems that could be related to this GDB lib switch!

Reply by email

Peter Vreman
Show quoted text 5 lines
Starting 14/03/2001, the v10 IDE snapshots will be compiled with GDB v5.0 libraries. GDB 5.0 has several bug fixes and enhancements compared to 4.18 that was used until now.

Can you provide gdbpas.exe binaries for go32v2 and win32. You can maybe already place them in a dos-1.0.6 dir on ftp.freepascal.org

Reply by email

Pavel V. Ozerski
to Pierre Muller: the v10 IDE snapshots will be compiled with GDB v5.0 libraries. GDB 5.0 has several bug…

Hello,
please fix a bug.

Symptom:

comparing pchar variable with string constant is not supported by compiler if this constant has one-character length.

Sample:

{$apptype console}
var
 p:pchar;
begin
 if p='TEST'then
  writeln('Correct')
 else if p='T'then
  writeln('Buggy');
end.

Pavel

Pavel V. Ozerski | Inst. of Evolutionary Physiology & Biochemistry, office +7 (812)552-6870(291)| Russian Academy of Sciences, FAX +7 (812)552-3012 | Thorez pr. 44, St.Petersburg, 194223, Russia home +7 (812)528-5576 | E-mail: |

Reply by email

Sebastian Günther
to Pavel V. Ozerski
"Pavel V. Ozerski" wrote
Hello, please fix a bug.

I don't think this is a bug...

comparing pchar variable with string constant is not supported by compiler if this constant has one-character length.

You cannot compare PChar strings directly using the "=" operator; use functions such as strcomp instead. PChar is just a pointer type, and "=" will compare the address.
"p='T'" is a special case: Here the compiler does an automatic pointer dereference, and as PChar is equivalent to ^Char, it's clear that this comparison will check the first character of p.

- Sebastian

Reply by email

Pavel V. Ozerski
to Sebastian Günther
Show quoted text 9 lines
You cannot compare PChar strings directly using the "=" operator; use functions such as strcomp instead. PChar is just a pointer type, and "=" will compare the address. "p='T'" is a special case: Here the compiler does an automatic pointer dereference, and as PChar is equivalent to ^Char, it's clear that this comparison will check the first character of p. - Sebastian

It's all could be true but:
1) Delphi supports this comparing;
2) Also FPC supports it if length of untyped string constant is more than 1-char. You could test it also using my example: only ONE error will be found in source by compiler! If you remove second comparing, this source will be successfully compiled. May be, this feature seems to be superfluous, but Borland-compatibility is also an important thing.

Pavel

Pavel V. Ozerski | Inst. of Evolutionary Physiology & Biochemistry, office +7 (812)552-6870(291)| Russian Academy of Sciences, FAX +7 (812)552-3012 | Thorez pr. 44, St.Petersburg, 194223, Russia home +7 (812)528-5576 | E-mail: |

Reply by email

Marco van de Voort
to Sebastian Günther: I don't think this is a bug... You cannot compare PChar strings directly using the "="…
Show quoted text 16 lines
"Pavel V. Ozerski" wrote: > > Hello, > please fix a bug. I don't think this is a bug... > comparing pchar variable with string constant is not supported by compiler if this constant has one-character length. You cannot compare PChar strings directly using the "=" operator; use functions such as strcomp instead. PChar is just a pointer type, and "=" will compare the address. "p='T'" is a special case: Here the compiler does an automatic pointer dereference, and as PChar is equivalent to ^Char, it's clear that this comparison will check the first character of p.

The compare operator works on ansistring, and pchar can be autoconverted to ansistring in some cases.

Reply by email