[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: running in the build directory
From: |
Bruno Haible |
Subject: |
Re: running in the build directory |
Date: |
Fri, 01 May 2020 13:58:53 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-177-generic; KDE/5.18.0; x86_64; ; ) |
Jose E. Marchesi wrote:
>
> It would be good to support
> $ ./run gdb poke
> but this fails:
> "/media/develdata/devel/POKE/poke/src/poke": not in executable format:
> Dateiformat nicht erkannt
>
> $ ./libtool --mode=execute gdb poke
> is the documented way to debug a program in the build dir. But this does
> not
> set the poke data variables.
>
> But
> $ ./run ./libtool --mode=execute gdb poke
> fails:
> "/media/develdata/devel/POKE/poke/src/poke": not in executable format:
> Dateiformat nicht erkannt
>
> In HACKING we document:
>
> Invoking GDB to debug an uninstalled poke
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Since we are using libtool, ``$(builddir)/src/poke`` is a shell
> script. In order to debug the uninstalled poke, you can do::
>
> $ libtool --mode=execute ./run gdb ./src/poke
Ah. Indeed both of
$ ./run ./libtool --mode=execute gdb src/poke
$ ./libtool --mode=execute ./run gdb src/poke
work. Notes:
- Here one has to mention 'src/poke', not 'poke'. Reason: The line
PATH=$b/src:$PATH
has no effect on how gdb locates the executable.
- I would recommend './libtool' instead of 'libtool'. Reason: 'libtool'
refers to a program in PATH, that may have been created by a different
version of libtool or for a different compiler.
- You can write 'src/poke' instead of './src/poke', since relative program
names that contain a slash are always relative to the current directory,
not to a member of $PATH.
Bruno