Recent

Author Topic: gdb installation with errors  (Read 24624 times)

pawi

  • New member
  • *
  • Posts: 7
gdb installation with errors
« on: October 02, 2013, 03:23:34 pm »
Hi,
actually i try to run FPC under Lazarus. Lazarus complains about no gdb, so i try to install gdb-7.6.1 on my mac OSX10.8.5 but this fails on make with errors:
8 errors generated.
make[4]: *** [i386-dis.lo] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-opcodes] Error 2
make: *** [all] Error 2

I have XCODE 5 installed and also cmd line tools. FCP is running from command line!
As i am doing this the first time, i have no idea how to proceed!
Can you help?


Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1059
Re: gdb installation with errors
« Reply #1 on: October 02, 2013, 03:34:41 pm »
Xcode 5 indeed no longer includes gdb, only lldb. Lazarus does not (yet) support lldb, and adding support will probably be a quite a lot of work. Moreover, evaluating Pascal expressions would no longer work directly, since lldb doesn't understand Pascal (...yet, but I'm not aware of anyone working on this).

Building gdb on Mac OS X should generally work fine, but installing it on on recent Mac OS X versions is not trivial. The easiest way is probably to install it via fink, brew or macports. I haven't tried any of those ways yet, I've only recently installed 10.8.5 myself and am still spending most of my time in 10.6.

Edit: in case you are interested in installing gdb yourself on Mac OS X 10.7 or later, see http://stackoverflow.com/questions/12050257/gdb-fails-on-mountain-lion/12372035#12372035
« Last Edit: October 02, 2013, 06:16:08 pm by Jonas Maebe »

pawi

  • New member
  • *
  • Posts: 7
Re: gdb installation with errors
« Reply #2 on: October 02, 2013, 06:54:07 pm »
Hi Jonas,

thanks for your answer.
This somehow confirms my suspicion.
I guess there is no prebuilt gdb available (or possible)?


Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1059
Re: gdb installation with errors
« Reply #3 on: October 03, 2013, 01:30:48 am »
The problem is that on Mac OS X 10.7 and later, gdb (and any other debugger, for that matter) only works if it has been codesigned by a trusted certificate. So unless someone who is a member of the Mac developer program builds and signs gdb (and then updates it every year, since the certificates Apple hands out are only valid for a year), everyone has to at least codesign the gdb binary for themselves (using a self-signed certificate). This process is explained in the link I posted, and should be done automatically by fink/brew/macports. The building itself should be quite trivial. If you have problems, ask on the gdb mailing list. They are quite helpful there.

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1059
Re: gdb installation with errors
« Reply #4 on: October 03, 2013, 01:32:40 am »
Also: when asking for help on the gdb mailing list, show the actual errors that occur, because the error summary itself is useless in terms of figuring out what the problem might be.

pawi

  • New member
  • *
  • Posts: 7
Re: gdb installation with errors
« Reply #5 on: October 03, 2013, 10:57:17 am »
Hi Jonas,

didn't want to overflow you with all the listing of errors!
Maybe i did some basic errors myself first!?

I tried to follow your links and installed a certificate as proposed. But i guess this is important only later when gdb is running?
My problem is that i could'nt install gdb because already the make fails.

Nevertheless i tried the same with gdb 6.3 and there it seems to run through make without errors. But i get a lot (40?) of warnings, starting with:
---------------------
config.status: executing default commands
if [ x"" != x ]; then \
     gcc -c -DHAVE_CONFIG_H -g -O2  -I. -I./../include  -W -Wall -Wtraditional -pedantic  ./regex.c -o pic/regex.o; \
   else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2  -I. -I./../include  -W -Wall -Wtraditional -pedantic ./regex.c -o regex.o
warning: unknown warning option '-Wtraditional' [-Wunknown-warning-option]
1 warning generated.
if [ x"" != x ]; then \
     gcc -c -DHAVE_CONFIG_H -g -O2  -I. -I./../include  -W -Wall -Wtraditional -pedantic  ./cplus-dem.c -o pic/cplus-dem.o; \
   else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2  -I. -I./../include  -W -Wall -Wtraditional -pedantic ./cplus-dem.c -o cplus-dem.o
....
-----------------------
Do you want me to attach the whole log? ;-)

Sorry, but as i do this the first time and because i am not a UNIX guru, i feel really lost!
I think the next i have to try is fink/brew/macports (but i am sure other problems will come up, i hate this!!!)

pawi

  • New member
  • *
  • Posts: 7
Re: gdb installation with errors
« Reply #6 on: October 03, 2013, 11:02:14 am »
I wanted to add this:

Ignoring the warnings i tried to install with "make install gdb" and i get the following!?
---------
/bin/sh ./mkinstalldirs /usr/local /usr/local
for f in standards.info configure.info; do \
     if test -f ./`echo $f | sed -e 's/.info$/.texi/'`; then \
       if make "MAKEINFO=makeinfo --split-size=5000000" $f; then \
         true; \
       else \
         exit 1; \
       fi; \
     fi; \
   done
make[2]: `standards.info' is up to date.
make[2]: `configure.info' is up to date.
/bin/sh ./../mkinstalldirs /usr/local/info
if test ! -f standards.info; then cd .; fi; \
   if test -f standards.info; then \
     for i in standards.info*; do \
       /usr/bin/install -c -m 644 $i /usr/local/info/$i; \
     done; \
   fi
if test ! -f configure.info; then cd .; fi; \
   if test -f configure.info; then \
     for i in configure.info*; do \
       /usr/bin/install -c -m 644 $i /usr/local/info/$i; \
     done; \
   fi
make[2]: Nothing to be done for `all'.
/bin/sh ./../mkinstalldirs /usr/local/lib
/usr/bin/install -c -m 644 ./libiberty.a /usr/local/lib/./libiberty.an
( cd /usr/local/lib ; ranlib ./libiberty.an )
mv -f /usr/local/lib/./libiberty.an /usr/local/lib/./libiberty.a
if test -n ""; then \
     case "" in \
       /*)    thd=;; \
       *)     thd=/usr/local/include/;; \
     esac; \
     /bin/sh ./../mkinstalldirs ${thd}; \
     for h in ./../include/ansidecl.h ./../include/demangle.h ./../include/dyn-string.h ./../include/fibheap.h ./../include/floatformat.h ./../include/hashtab.h ./../include/libiberty.h ./../include/objalloc.h ./../include/partition.h ./../include/safe-ctype.h ./../include/sort.h ./../include/splay-tree.h ./../include/ternary.h; do \
       /usr/bin/install -c -m 644 $h ${thd}; \
     done; \
   fi
make[2]: Nothing to be done for `install'.
make[1]: Nothing to be done for `install'.
make: Nothing to be done for `gdb'.
-----------

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1059
Re: gdb installation with errors
« Reply #7 on: October 03, 2013, 12:59:52 pm »
As mentioned before, please ask on the gdb mailing list. Additionally, I doubt gdb 6.3 will work on Mac OS X 10.8.

And I suggested to post the actual errors (to the gdb mailing list), not to post the complete output nor to post only the warnings. You say that you don't want to overflow this forum with errors in case you did something wrong, but you don't even mention what exactly you did (which configure command line, which make command line) so how is anyone supposed to know?

Again: when asking for help, always provide all relevant information. This is unrelated to "unix" or anything else: what did you do, what happened, and possibly what did you expect to happen. It's the same regardless of whether you post on a forum, on a mailing list or when filing a bug report. The more information your provide, the easier it is for other people to figure out what the problem is. This is always true, even in real life.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9908
  • Debugger - SynEdit - and more
    • wiki
Re: gdb installation with errors
« Reply #8 on: October 03, 2013, 01:43:52 pm »
If you have a choice in version:
On other platforms (win/linux) gdb 7.5.9 / 7.6 / 7.6.1 have proven them self rather unstable. (No gdb is 100% stable, so far every gdb crashed at something)

I do not know how much of that applies to Mac.  But if you have the choice, consider 7.5.0 or 7.4

pawi

  • New member
  • *
  • Posts: 7
Re: gdb installation with errors
« Reply #9 on: October 03, 2013, 03:52:21 pm »
@Jonas:
OK, so let me start and let me tell you in every detail from the beginning (hopefully giving you all the information):
I have installed XCode and fcp which prooved to run from command line!
1. I downloaded and installed "lazarus-1.0.12-20130824-i386-macosx.dmg (141.7 MB)"
2. After installation (successfully) i started Lazarus and it came up with an exclamation mark (!) on "FPC-Sources" not finding fpcsrc!?
3. I started IDE and ignored the following warning that something might be restricted!?
Sorry, but i don't know if this is essential?
4. Lazarus comes up and i "Open" my very simple test program "Hello World".
5. Lazarus opens the source in a window and i try to run ("Start") this program.
6. Now a dialog comes up, telling me: "Debugger "/usr/bin/gdb" invalid, ... is either missing or not executable. See Preferences -> Debugger"
7. Going there only tells me, that it did not find gdb. I know, i don't have it, thanks to XCode 5 ( as you also mentioned).
So what now? Please tell me what i should do now?
My try was to install gdb, but this failed within the make command. I followed the "Readme" file in "gdb".

Is this now a subject of "Lazarus" or "gdb"?
What information can i give you more, to solve the problem?

@Martin_fr: I also tried gdb 6.3 as mentioned above. I was not able to even install!?

It looks like, in other posts here, it is possible to install and run "Lazarus" under XCode 5?
How did they manage to install the missing gdb?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9908
  • Debugger - SynEdit - and more
    • wiki
Re: gdb installation with errors
« Reply #10 on: October 03, 2013, 04:18:16 pm »
Unfortunately I will not be able to help much, as I do not use a Mac (I only know general/cross platform gdb usage (usage, but not install) issues)

Quote
Is this now a subject of "Lazarus" or "gdb"?

That is a good question.

In the past gdb was available by default. So there was never an issue.

Now it depends, on how hard it is to install a gdb. I can not answer this, as I do not know, if the problems are specific to gdb or the setup of your system...

On the mail list the following link was posted http://docwiki.embarcadero.com/RADStudio/XE4/de/Installieren_der_Xcode-Befehlszeilen-Tools_auf_einem_Mac
suggesting, that there is a pre-build gdb. But I do not know.

In any case, a solution with gdb is needed. Changing Lazarus to an alternative (if there is one, that works with pascal), is a huge task (probably talking a year or more)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: gdb installation with errors
« Reply #11 on: October 03, 2013, 04:22:38 pm »
@Pawi:
Weren't you going to try to build gdb and report any errors on the gdb mailing lists as this is a gdb problem, not a Lazarus problem?

Note: gdb is not essential for running Lazarus - if you don't have it you won't be able to run a debugger...

PS: Also please read the mac installation instructions on the wiki. In the steps you mentioned above, I missed an fpc installation...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

pawi

  • New member
  • *
  • Posts: 7
Re: gdb installation with errors
« Reply #12 on: October 03, 2013, 11:30:02 pm »
@ BigChimp
Actually and first it was a Lazarus problem. See my post below.
I guess Lazarus is expecting and needs gdb and it was no problem before XCODE 5, because it was already there.
I don't really know, if gdb is really needed but Lazarus seems to refuse to compile without it!?
How can i run Lazarus without gdb. In my case it stops with the error message noted in step 6!
Sorry i misspelled fpc! Of course i installed fpc first and i was able to compile simple programs first by cmd line (terminal).

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9908
  • Debugger - SynEdit - and more
    • wiki
Re: gdb installation with errors
« Reply #13 on: October 04, 2013, 12:19:46 am »
About "Essential": yes and no, but in the end, it is essential.

True you can do something without gdb. You can set the config to "no debugger", then F9 will even start the app.
But an IDE without debugger, is not complete, so yes essential.

Well, by the above, yes: Ultimately it is a Lazarus problem. BUT...

If no one here knows a [quick] answer, then it does not help you. It may be a Lazarus problem for a long time then.

As for building your own gdb: Errors in building gdb are something I do NOT think you will find an answer here.

As for alternatives: I don't know.

I would suggest:

- For alternatives: Try the Lazarus mail list. Maybe there are a few Mac users there that are not on this forum, and maybe you get additional feedback.

- as for errors building gdb. You can try and hope that someone here (or on the Lazarus mail list) will have an answer. As it is a tool used by lazarus it is not "off  topic" (imho), but the likelihood for an answer here is just very low. Your chances are far better on the gdb list.



kamischi

  • Full Member
  • ***
  • Posts: 177
Re: gdb installation with errors
« Reply #14 on: October 04, 2013, 12:24:39 am »
The surest way to get gdb is probably fink, macports or homebrew.

MiSchi
fpc 2.6.4, lazarus 1.4.0, Mac OS X, fink

 

TinyPortal © 2005-2018