View Issue Details

IDProjectCategoryView StatusLast Update
0023581FPCTextmode IDEpublic2020-02-11 20:26
ReporterAlexL Assigned ToPierre Muller  
PrioritynormalSeveritycrashReproducibilityalways
Status assignedResolutionopen 
PlatformallOSMageia 
Product Version2.6.0 
Summary0023581: gdb does not work
DescriptionI buit fp with gdb support, I used v7.2 from ftp://ftp.freepascal.org/pub/fpc/contrib/libgdb/
I have installed gdb 7.3.50.
IDE can not set Breakpoint and write "Program generated a signal 11. Save your sources and restart the IDE." "The IDE generated an internal error and will be close."
I think I need new tar.gz ftp://ftp.freepascal.org/pub/fpc/contrib/libgdb/ for my gdb and for fp-2.6.0.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

Pierre Muller

2013-01-04 15:53

developer   ~0064613

  You forgot to mention the system on which you
are compiling and using your home-built IDE.
  This information is critical for such bug reports.
Without it, it is not possible to help you.
  

AlexL

2013-01-04 16:52

reporter   ~0064616

Mageia 2

Pierre Muller

2013-01-04 17:38

developer   ~0064618

Excuse me, but I have no idea what Mageia 2 means...
Is it a Linux distribution?

  I would like to know the CPU/TARGET pair as
given by "fpc -iSOSP".

AlexL

2013-01-04 17:49

reporter   ~0064619

Mageia is Linux distribution, which more popular, then Ubuntu after Mint http://distrowatch.com/ . Mageia is new Mandriva based distro.
fpc -iSOSP
linux i386
But I will be build rpm package for x86_64 also.

Pierre Muller

2013-01-04 18:35

developer   ~0064624

I have a locally rebuild i386 linux IDE with 7.2 GDB library,
which works wirhout problems for simple test (stepping through
compiled test.pas, in ide directory).
  Did you try to remove fp.dsk and fp.ini,
to see if the crash remains.
  Could you explain your sentence, "I have installed gdb 7.3.50."
How is it related to your bug report?

AlexL

2013-01-04 19:26

reporter   ~0064626

http://pkgs.org/search/?keyword=gdb
I have no 7.2 GDB, I have gdb-7.3.50.20110722-4.mga2.i586.rpm for Mageia 2.
I removed fp.dsk and fp.ini - no result.

Pierre Muller

2013-01-04 20:14

developer   ~0064627

You can't use a system installed GDB (even if it provides
libgdb...)
  If you don't want to use contrib/libgdb/v7.2/libgdb-7.2.i386-linux.tar.gz
in contrib/libgdb directories, you should rather download GDB sources, recompile then, and use packages/gdbint/gen-libgdb-inc.sh script.

AlexL

2013-01-04 22:03

reporter   ~0064630

Last edited: 2013-01-05 07:28

My spec file. I can not find error. Please, help.

Summary: Console Free Pascal IDE
Name: fp-ide
Version: 2.6.0
Release: %mkrel 6
License: GPLv2+ and LGPLv2+ with exceptions
Group: Development/Tools
Url: http://sourceforge.net/projects/freepascal/
Source0: fpc-%{version}.source.tar.gz
Source1: %{name}.png
Source2: %{name}
Source3: %{name}.desktop
Source4: video.pp
#From ftp://ftp.freepascal.org/pub/fpc/contrib/libgdb/
Source5: libgdb-7.2.i386-linux.tar.gz
Requires: fpc >= %{version}, luit, gdb
BuildRequires: fpc >= %{version}, gcc
#For libpython2.7.so
BuildRequires: libpython-devel
AutoReqProv: no

%description
Console Free Pascal IDE

%prep
%setup -q -n fpc-%{version}
cp -f %{SOURCE4} ./rtl/unix/
tar -xf %{SOURCE5}
rm -f ./libgdb/linux/i386/libpython2.6.a

#Fix for better result
sed -i -e "s|Write(' Press any key to return to IDE');|Writeln(' Press any key to return to IDE');|g" ./ide/fpide.pas

#Fix for Russian "ё" in CP866
sed -i -e "s|'_', 0000241|'_'|g" ./ide/fpcalc.pas
sed -i -e "s|0000241|'_'|g" ./ide/fpcalc.pas

#Fix for new docs
sed -i -e "s|http://www.freepascal.org/down/docs/docs.html|ftp://ftp.freepascal.org/pub/fpc/dist/|g" ./ide/wconstse.inc

%build
export GDBLIBDIR=./libgdb/linux/i386
sed -i -e "s|LINKLIB python|LINKLIB python2.7|g" ./packages/gdbint/src/gdbint.pp
sed -i -e "s|LINKLIB python2.6|LINKLIB python2.7|g" ./libgdb/linux/i386/gdblib.inc
GDB_VER=`cat ./libgdb/linux/i386/gdblib.inc|grep GDB_V|awk '{print $2}'`
%make all OPT="-d$GDB_VER"

%install
install -dm 755 %{buildroot}%{_datadir}/applications
install -m 0644 %{SOURCE3} %{buildroot}%{_datadir}/applications/
install -dm 755 %{buildroot}%{_datadir}/pixmaps
install -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/pixmaps/
install -dm 755 %{buildroot}%{_bindir}
install -m 777 %{SOURCE2} %{buildroot}%{_bindir}/
install -dm 755 %{buildroot}/usr/local/bin
cp -f ./ide/fp %{buildroot}/usr/local/bin/

%files
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%{_bindir}/%{name}
/usr/local/bin/fp

%changelog

AlexL

2013-01-07 08:46

reporter   ~0064698

Please, help

AlexL

2013-01-11 11:03

reporter   ~0064812

Last edited: 2013-01-11 11:27

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=528855
Abou Al Montacir wrote:
"The issue with gdb is that upstream uses libgdb.a which is frozen on
their svn and is quite different from abandoned/legacy official libgdb.a
As we can not accept to have sw links to unofficial lib, we can not
enable debug support. There is no way to get sources for this lib."

Will you use official libgdb.a?

AlexL

2013-01-11 14:56

reporter   ~0064816

If I use libgdb-7.2.i386-linux.tar.gz from ftp://ftp.freepascal.org/pub/fpc/contrib/libgdb/ , then fp compiled with gdb support, run well, but gdb support does not work.
If I use libgdb.a, libgnu.a, libdecnumber.a from official gdb (other *.a I use from devel packages from distro), then fp compiled with gdb support, but can not run, black screen.

AlexL

2013-01-11 16:34

reporter   ~0064820

I used packages/gdbint/gen-libgdb-inc.sh script for official gdb and I have http://phet-gui.googlecode.com/files/libgdb.tar.gz , but fp compiled with gdb support, but can not run, black screen.
Please, look my libgdb.tar.gz.

AlexL

2013-01-11 19:23

reporter   ~0064828

Only one distro haves gdb support - Alt Linux, but gdb does not work one year (https://bugzilla.altlinux.org/show_bug.cgi?id=26799). It means you must find better solution for gdb support in fp like lazarus, which have no problems with gdb.

AlexL

2013-01-14 20:22

reporter   ~0064879

https://bugs.archlinux.org/task/33361#comment104733
"ftp://ftp.freepascal.org/pub/fpc/contrib/libgdb/v7.4/libgdb-7.4-mingw32.zip contains only i386 libs and it looks like windows only.
Also fp can not be build with gdb-7.5, please report upstream."

AlexL

2013-04-30 17:32

reporter   ~0067298

Russian project fp-ide: ftp://ftp.mageialinux.ru/mageia2/SRPMS/ has in package fp-ide-2.6.0-20 (and later) gdb support. In src.rpm you can find all patches for gdb+fp, spec and other patches for fp.

AlexL

2013-07-07 22:06

reporter   ~0068743

There are new fp-ide-2.6.2 with gdb 7.5.1: ftp://ftp.mageialinux.ru/mageia2/SRPMS
Pierre, please look in src.rpm. There are some errors in gdb support in fp, which were fixed in fp-ide project.

AlexL

2014-01-26 21:50

reporter   ~0072719

All modifications are available in projects:
http://code.google.com/p/fp-ide-ru
http://code.google.com/p/fp-ide-en

Nikolay Nikolov

2015-02-21 16:57

developer   ~0081312

FYI, I have started working on GDB/MI support for the IDE in FPC trunk. Long term, this should be the way to go on Linux. It's still not completely stable, but you can give it a try and submit bug reports for that. You can enable it by building a fpc snapshot with GDBMI=1

Marco van de Voort

2017-05-07 16:06

manager   ~0100143

- old report
- Google code references are down
- mageialinux.ru url is down
- MI in trunk.

What is left to do here?

Thaddy de Koning

2017-05-07 17:05

reporter   ~0100144

By now? advise to compile with GDBMI=1 and close?

AlexL

2018-12-19 03:38

reporter   ~0112678

Compilled with GDBMI=1, no effect, it builds without debugger support.

AlexL

2018-12-19 08:39

reporter  

gdbint.pp.patch (403 bytes)   
--- packages/gdbint/src/gdbint.pp.orig	2015-03-05 01:21:01.000000000 +0200
+++ packages/gdbint/src/gdbint.pp	2017-12-25 19:20:47.000000000 +0200
@@ -753,7 +768,8 @@
 {$ifdef GDB_CORE_ADDR_FORCE_64BITS}
   CORE_ADDR = qword;
 {$else}
-  CORE_ADDR = ptrint; { might be target dependent PM }
+  CORE_ADDR = qword;
 {$endif}
   streamtype = (afile,astring);
   C_FILE     = ptrint; { at least under DJGPP }
gdbint.pp.patch (403 bytes)   

AlexL

2018-12-19 08:42

reporter   ~0112692

ptrint can not be used on 32BIT, because it works unstable, needs to use qword instead. Patch: gdbint.pp.patch.

Pierre Muller

2018-12-19 22:32

developer   ~0112717

 Hi,

 we cannot help you with such outdated versions.

  Could you at least try the latest release 3.0.4,
or even better the current trunk.
  For 3.0.4 sources, you will still need a libgdb,
but for trunk or even fixes_3_2, you can use the GDBMI code developed
by Nikolay, whic uses GDBMI protocol to communicate
with a GDB executable.

  Remember that for 3.0.4 version, for which you will need the
libgdb.a library, GDB needs to be compiled for the CPU for
which you target the IDE.
  Don't hesitate to build both GDB and the IDE with debugging support,
debugging the IDE is do-able and helps a lot!

 

AlexL

2018-12-19 23:11

reporter   ~0112722

For 3.0.4 needs to apply gdbint.pp.patch and the next reason of crashing is wrong linking with gdb libraries; other packages have the same libraries like gdb.

Pierre Muller

2018-12-19 23:30

developer   ~0112727

I remember having the same problems
on installation that have a system libbfd.a for instance.

  A possible workaround is to use Free Pascal compiler -Xd option,
or it GNU linker counterpart -nostdlib (use -k-nostdlib when calling
the Free Pascal compiler).
   The main hassle is that you then need to supply all base libraries.
You could probably achieve this by adding some links to standard libraries
in the directory that contains libgdb.a

  Just try with what is generated by the gen-libgdb-inc.sh script
and add each missing library as a link into the same directory.

AlexL

2018-12-20 00:57

reporter   ~0112734

At the moment we have sollution to link library:

http://svnweb.mageia.org/packages/cauldron/fp-ide-en/current/
http://svnweb.mageia.org/packages/cauldron/fp-ide-ru/current/

Not upstreamed by you gdbint.pp.patch only.

AlexL

2018-12-20 08:38

reporter   ~0112739

I tried the latest snapshot:
make all GDBMI=1 NOGDB=1
Result: external debugger does not work, no debugger support.

Pierre Muller

2018-12-20 08:42

developer   ~0112740

Hi Alex,

you should not use NOGDB=1,
could you please try again with simply
make all GDBMI=1
and test?

AlexL

2018-12-20 10:42

reporter   ~0112742

The main problem it impossible to update fpc on the latest snapshot in repository, needs to keep stable release.
And I need

make ide GDBMI=1

to build ide only.
Will you implement? It would help a lot.

Marco van de Voort

2018-12-20 10:49

manager   ~0112743

Last edited: 2018-12-20 10:49

View 2 revisions

Isn't gdbmi default in the upcoming FPC 3.2. branch (svn svn.freepascal.org/FPC/svn/fpc/branches/fixes_3_2 )?

It will arrive within now and about half an year.

I would direct current efforts in that direction.

Pierre Muller

2018-12-20 11:47

developer   ~0112750

If you really want to keep stable compiler features,
you can use the sources of the fixes branch for ide source code only.

  All you need to do is mainly to use the
sources files in fixes_3_2 fpcsrc/packages/ide directory
and put those into fpcsrc/ide of the release sources.
  If you want to use fpmake.pp from fpcsrc/packages/ide,
you will have to deal with the fact that ide was moved from
fpcsrc level to fpcsrc/packages.
  You might also try to simply add the fixes_3_2 packages/ide directory
to the release packages directory and add:
fpmake_add.inc:142: add_ide(ADirectory+IncludeTrailingPathDelimiter('ide'));
and
fpmake_proc.inc:799:{$include ide/fpmake.pp}

AlexL

2018-12-21 03:37

reporter   ~0112771

How using ftp://ftp.freepascal.org/pub/fpc/snapshot/fixes/source/fpcbuild.zip and fpc-3.0.4 installed to have workable ide?
I changed 3.2.0-beta on 3.0.4 everywhere, but ide still shows Compiller version 3.2.0-beta and does not work. Needs to know how to change 3.2.0-beta on 3.0.4 fully.

AlexL

2018-12-21 08:12

reporter   ~0112773

It was wrong way to build 3.2.0-beta using fpc-3.0.4.

Thank you Pierre, your way is workable. IDE was built with external gdb.
I will write after tests.

AlexL

2018-12-24 02:35

reporter   ~0112854

External gdb works except if installation of gdb was made when IDE was ran while installation. In this case gdb works after restart IDE. Not enought error messages if gdb is not installed.

For this bug gdbint.pp.patch was not upstreamed.

Thank you guys for working on gdb.

Joost van der Sluis

2020-02-11 20:26

manager   ~0121019

Can we close this now?

Issue History

Date Modified Username Field Change
2013-01-04 15:08 AlexL New Issue
2013-01-04 15:53 Pierre Muller Note Added: 0064613
2013-01-04 15:53 Pierre Muller Assigned To => Pierre Muller
2013-01-04 15:53 Pierre Muller Status new => feedback
2013-01-04 16:52 AlexL Note Added: 0064616
2013-01-04 17:38 Pierre Muller Note Added: 0064618
2013-01-04 17:49 AlexL Note Added: 0064619
2013-01-04 18:35 Pierre Muller Note Added: 0064624
2013-01-04 19:26 AlexL Note Added: 0064626
2013-01-04 20:14 Pierre Muller Note Added: 0064627
2013-01-04 22:03 AlexL Note Added: 0064630
2013-01-05 07:28 AlexL Note Edited: 0064630
2013-01-07 08:46 AlexL Note Added: 0064698
2013-01-11 11:03 AlexL Note Added: 0064812
2013-01-11 11:27 AlexL Note Edited: 0064812
2013-01-11 14:56 AlexL Note Added: 0064816
2013-01-11 16:34 AlexL Note Added: 0064820
2013-01-11 19:23 AlexL Note Added: 0064828
2013-01-14 20:22 AlexL Note Added: 0064879
2013-04-30 17:32 AlexL Note Added: 0067298
2013-04-30 17:32 AlexL Status feedback => assigned
2013-07-07 22:06 AlexL Note Added: 0068743
2014-01-26 21:50 AlexL Note Added: 0072719
2015-02-21 16:57 Nikolay Nikolov Note Added: 0081312
2017-05-07 16:06 Marco van de Voort Note Added: 0100143
2017-05-07 17:05 Thaddy de Koning Note Added: 0100144
2018-12-19 03:38 AlexL Note Added: 0112678
2018-12-19 08:39 AlexL File Added: gdbint.pp.patch
2018-12-19 08:42 AlexL Note Added: 0112692
2018-12-19 22:32 Pierre Muller Note Added: 0112717
2018-12-19 22:32 Pierre Muller Status assigned => feedback
2018-12-19 23:11 AlexL Note Added: 0112722
2018-12-19 23:11 AlexL Status feedback => assigned
2018-12-19 23:30 Pierre Muller Note Added: 0112727
2018-12-20 00:57 AlexL Note Added: 0112734
2018-12-20 08:38 AlexL Note Added: 0112739
2018-12-20 08:42 Pierre Muller Note Added: 0112740
2018-12-20 10:42 AlexL Note Added: 0112742
2018-12-20 10:49 Marco van de Voort Note Added: 0112743
2018-12-20 10:49 Marco van de Voort Note Edited: 0112743 View Revisions
2018-12-20 11:47 Pierre Muller Note Added: 0112750
2018-12-21 03:37 AlexL Note Added: 0112771
2018-12-21 08:12 AlexL Note Added: 0112773
2018-12-24 02:35 AlexL Note Added: 0112854
2020-02-11 20:26 Joost van der Sluis Note Added: 0121019