You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by Atri Sharma <at...@gmail.com> on 2018/09/16 13:45:16 UTC

[QUESTION] Best way to attach debugger to CPP tests?

I am trying to run compute-test.cc tests and trace their execution,
but not sure what is the best mechanism for running individual tests
and tracing their code flow. I looked up the wiki but could not find
specific instructions.

Could someone point me to the best practices around attaching a debugger?

Regards,

Atri

Re: [QUESTION] Best way to attach debugger to CPP tests?

Posted by Wes McKinney <we...@gmail.com>.
This seems to be a known issue with Xcode

https://stackoverflow.com/questions/39680320/printing-debugging-libc-stl-with-xcode-lldb

There might be a way to configure Xcode to emit more debug symbols but the
best way is probably to develop on Linux in Docker or in a VM


On Sep 21, 2018 9:00 PM, "Atri Sharma" <at...@gmail.com> wrote:

MacOS High Sierra.

If you do a build (/debug, make) and then attach lldb to a test (lldb
-- compute_test), then try to access a class's members (e.g.
ArrayData's buffers), the error pops up.

On Sat, Sep 22, 2018 at 9:26 AM Wes McKinney <we...@gmail.com> wrote:
>
> What platform are you developing on (OS, compiler, etc)? Can you show
exact
> steps to arrive at the error?
>
> Thanks
>
> On Fri, Sep 21, 2018, 8:46 PM Atri Sharma <at...@gmail.com> wrote:
>
> > Hi Wes.
> >
> > Thanks, your command worked and I am able to attach a debugger.
> > However, I get the following error for some operations:
> >
> > error: Couldn't lookup symbols:
> >
> >   __ZNKSt3__110shared_ptrIN5arrow5ArrayEEptEv
> >
> > It seems that not all symbols are being loaded. I did a debug build
> > (according to README). Is there an additional flag I should use during
> > make to generate more debugging symbols?
> >
> > Regards,
> >
> > Atri
> > On Sun, Sep 16, 2018 at 7:21 PM Wes McKinney <we...@gmail.com>
wrote:
> > >
> > > hi Atri,
> > >
> > > Generally I use gdb and use the --gtest_filter argument to the test
> > executables
> > >
> > > $ gdb --args test-name --gtest_filter=*TestOfInterest*
> > >
> > > Then set breakpoints in gdb as usual. C-x a brings up the visual gdb
> > interface
> > >
> > > - Wes
> > > On Sun, Sep 16, 2018 at 9:45 AM Atri Sharma <at...@gmail.com>
wrote:
> > > >
> > > > I am trying to run compute-test.cc tests and trace their execution,
> > > > but not sure what is the best mechanism for running individual tests
> > > > and tracing their code flow. I looked up the wiki but could not find
> > > > specific instructions.
> > > >
> > > > Could someone point me to the best practices around attaching a
> > debugger?
> > > >
> > > > Regards,
> > > >
> > > > Atri
> >
> > --
> > Regards,
> >
> > Atri
> > l'apprenant
> >

-- 
Regards,

Atri
l'apprenant

Re: [QUESTION] Best way to attach debugger to CPP tests?

Posted by Atri Sharma <at...@gmail.com>.
MacOS High Sierra.

If you do a build (/debug, make) and then attach lldb to a test (lldb
-- compute_test), then try to access a class's members (e.g.
ArrayData's buffers), the error pops up.
On Sat, Sep 22, 2018 at 9:26 AM Wes McKinney <we...@gmail.com> wrote:
>
> What platform are you developing on (OS, compiler, etc)? Can you show exact
> steps to arrive at the error?
>
> Thanks
>
> On Fri, Sep 21, 2018, 8:46 PM Atri Sharma <at...@gmail.com> wrote:
>
> > Hi Wes.
> >
> > Thanks, your command worked and I am able to attach a debugger.
> > However, I get the following error for some operations:
> >
> > error: Couldn't lookup symbols:
> >
> >   __ZNKSt3__110shared_ptrIN5arrow5ArrayEEptEv
> >
> > It seems that not all symbols are being loaded. I did a debug build
> > (according to README). Is there an additional flag I should use during
> > make to generate more debugging symbols?
> >
> > Regards,
> >
> > Atri
> > On Sun, Sep 16, 2018 at 7:21 PM Wes McKinney <we...@gmail.com> wrote:
> > >
> > > hi Atri,
> > >
> > > Generally I use gdb and use the --gtest_filter argument to the test
> > executables
> > >
> > > $ gdb --args test-name --gtest_filter=*TestOfInterest*
> > >
> > > Then set breakpoints in gdb as usual. C-x a brings up the visual gdb
> > interface
> > >
> > > - Wes
> > > On Sun, Sep 16, 2018 at 9:45 AM Atri Sharma <at...@gmail.com> wrote:
> > > >
> > > > I am trying to run compute-test.cc tests and trace their execution,
> > > > but not sure what is the best mechanism for running individual tests
> > > > and tracing their code flow. I looked up the wiki but could not find
> > > > specific instructions.
> > > >
> > > > Could someone point me to the best practices around attaching a
> > debugger?
> > > >
> > > > Regards,
> > > >
> > > > Atri
> >
> > --
> > Regards,
> >
> > Atri
> > l'apprenant
> >

-- 
Regards,

Atri
l'apprenant

Re: [QUESTION] Best way to attach debugger to CPP tests?

Posted by Wes McKinney <we...@gmail.com>.
What platform are you developing on (OS, compiler, etc)? Can you show exact
steps to arrive at the error?

Thanks

On Fri, Sep 21, 2018, 8:46 PM Atri Sharma <at...@gmail.com> wrote:

> Hi Wes.
>
> Thanks, your command worked and I am able to attach a debugger.
> However, I get the following error for some operations:
>
> error: Couldn't lookup symbols:
>
>   __ZNKSt3__110shared_ptrIN5arrow5ArrayEEptEv
>
> It seems that not all symbols are being loaded. I did a debug build
> (according to README). Is there an additional flag I should use during
> make to generate more debugging symbols?
>
> Regards,
>
> Atri
> On Sun, Sep 16, 2018 at 7:21 PM Wes McKinney <we...@gmail.com> wrote:
> >
> > hi Atri,
> >
> > Generally I use gdb and use the --gtest_filter argument to the test
> executables
> >
> > $ gdb --args test-name --gtest_filter=*TestOfInterest*
> >
> > Then set breakpoints in gdb as usual. C-x a brings up the visual gdb
> interface
> >
> > - Wes
> > On Sun, Sep 16, 2018 at 9:45 AM Atri Sharma <at...@gmail.com> wrote:
> > >
> > > I am trying to run compute-test.cc tests and trace their execution,
> > > but not sure what is the best mechanism for running individual tests
> > > and tracing their code flow. I looked up the wiki but could not find
> > > specific instructions.
> > >
> > > Could someone point me to the best practices around attaching a
> debugger?
> > >
> > > Regards,
> > >
> > > Atri
>
> --
> Regards,
>
> Atri
> l'apprenant
>

Re: [QUESTION] Best way to attach debugger to CPP tests?

Posted by Atri Sharma <at...@gmail.com>.
Hi Wes.

Thanks, your command worked and I am able to attach a debugger.
However, I get the following error for some operations:

error: Couldn't lookup symbols:

  __ZNKSt3__110shared_ptrIN5arrow5ArrayEEptEv

It seems that not all symbols are being loaded. I did a debug build
(according to README). Is there an additional flag I should use during
make to generate more debugging symbols?

Regards,

Atri
On Sun, Sep 16, 2018 at 7:21 PM Wes McKinney <we...@gmail.com> wrote:
>
> hi Atri,
>
> Generally I use gdb and use the --gtest_filter argument to the test executables
>
> $ gdb --args test-name --gtest_filter=*TestOfInterest*
>
> Then set breakpoints in gdb as usual. C-x a brings up the visual gdb interface
>
> - Wes
> On Sun, Sep 16, 2018 at 9:45 AM Atri Sharma <at...@gmail.com> wrote:
> >
> > I am trying to run compute-test.cc tests and trace their execution,
> > but not sure what is the best mechanism for running individual tests
> > and tracing their code flow. I looked up the wiki but could not find
> > specific instructions.
> >
> > Could someone point me to the best practices around attaching a debugger?
> >
> > Regards,
> >
> > Atri

-- 
Regards,

Atri
l'apprenant

Re: [QUESTION] Best way to attach debugger to CPP tests?

Posted by Wes McKinney <we...@gmail.com>.
hi Atri,

Generally I use gdb and use the --gtest_filter argument to the test executables

$ gdb --args test-name --gtest_filter=*TestOfInterest*

Then set breakpoints in gdb as usual. C-x a brings up the visual gdb interface

- Wes
On Sun, Sep 16, 2018 at 9:45 AM Atri Sharma <at...@gmail.com> wrote:
>
> I am trying to run compute-test.cc tests and trace their execution,
> but not sure what is the best mechanism for running individual tests
> and tracing their code flow. I looked up the wiki but could not find
> specific instructions.
>
> Could someone point me to the best practices around attaching a debugger?
>
> Regards,
>
> Atri