compiling DLDs with "-g" ?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

compiling DLDs with "-g" ?

Eric Chassande-Mottin-5

I'd like to debug DLDs. In the wiki, it is written
that DLDs can be compiled with "-g". But it is not
explained how to give the flag to mkoctfile.

mkoctfile -g file.cc   does not work.
mkoctfile: unrecognized argument -g

any hint please?

eric.

-- quote --

Using gdb to debug your extensions

gdb can be used to debug DEFUN_DLD functions. There are N preliminary
steps one should during the compilations phase.

     * compile all of the code with -g or -ggdb

[...]


-- quote --



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: compiling DLDs with "-g" ?

Andrey Romanenko
Hi!

On Monday 14 November 2005 12:57, Eric Chassande-Mottin wrote:
> I'd like to debug DLDs. In the wiki, it is written
> that DLDs can be compiled with "-g". But it is not
> explained how to give the flag to mkoctfile.

This works for me:
CXXFLAGS="-ggdb" mkoctfile file.cc
or even
XTRA_CXXFLAGS="-ggdb" mkoctfile file.cc

Andrey



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: compiling DLDs with "-g" ?

Stéfan van der Walt
In reply to this post by Eric Chassande-Mottin-5
Hi Eric

It's a bit of a kludge, but you can do

mkoctfile -v

to see the command that mkoctfile executes, and then just add -g.

Regards
Stefan

On Mon, Nov 14, 2005 at 01:57:28PM +0100, Eric Chassande-Mottin wrote:

> I'd like to debug DLDs. In the wiki, it is written
> that DLDs can be compiled with "-g". But it is not
> explained how to give the flag to mkoctfile.
>
> mkoctfile -g file.cc   does not work.
> mkoctfile: unrecognized argument -g
>
> any hint please?
>
> eric.



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: compiling DLDs with "-g" ?

Eric Chassande-Mottin-5


thanks stefan

is there any reason why there is no easy way to
give a flag to mkoctfile?

eric.

> Hi Eric
>
> It's a bit of a kludge, but you can do
>
> mkoctfile -v
>
> to see the command that mkoctfile executes, and then just add -g.
>
> Regards
> Stefan
>
> On Mon, Nov 14, 2005 at 01:57:28PM +0100, Eric Chassande-Mottin wrote:
>> I'd like to debug DLDs. In the wiki, it is written
>> that DLDs can be compiled with "-g". But it is not
>> explained how to give the flag to mkoctfile.
>>
>> mkoctfile -g file.cc   does not work.
>> mkoctfile: unrecognized argument -g
>>
>> any hint please?
>>
>> eric.
>



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: compiling DLDs with "-g" ?

Stéfan van der Walt
On Mon, Nov 14, 2005 at 04:00:48PM +0100, Eric Chassande-Mottin wrote:
> is there any reason why there is no easy way to
> give a flag to mkoctfile?

Looks like Andrey has an elegant solution, but the -g flag should
probably be recognised by mkoctfile.  If you write a patch, John will
consider it.

Regards
Stefan



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: compiling DLDs with "-g" ?

Stéfan van der Walt
The attached patch does the job, but I am not sure if ALL_CXXFLAGS and
ALL_CFLAGS are the best places to add "-ggdb".

Stéfan

On Mon, Nov 14, 2005 at 07:20:28PM +0200, Stefan van der Walt wrote:
> On Mon, Nov 14, 2005 at 04:00:48PM +0100, Eric Chassande-Mottin wrote:
> > is there any reason why there is no easy way to
> > give a flag to mkoctfile?

mkoctfile.debug.patch (751 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: compiling DLDs with "-g" ?

John W. Eaton-6
On 15-Nov-2005, Stefan van der Walt wrote:

| The attached patch does the job, but I am not sure if ALL_CXXFLAGS and
| ALL_CFLAGS are the best places to add "-ggdb".

And ggdb is probably only valid if you are using GCC.  So I can't take
this patch as it is.

jwe



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: compiling DLDs with "-g" ?

Stéfan van der Walt
On Mon, Nov 14, 2005 at 08:04:23PM -0500, John W. Eaton wrote:
> On 15-Nov-2005, Stefan van der Walt wrote:
>
> | The attached patch does the job, but I am not sure if ALL_CXXFLAGS and
> | ALL_CFLAGS are the best places to add "-ggdb".
>
> And ggdb is probably only valid if you are using GCC.  So I can't take
> this patch as it is.

How about "-g"?

Stéfan

mkoctfile.debug.patch2 (745 bytes) Download Attachment
mkoctfile.debug.patch2 (745 bytes) Download Attachment