You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Simon Chow <si...@gmail.com> on 2008/03/11 13:14:06 UTC

[general][debug] how to debug harmony using vs?

I am not very familiar with vs.net. Is there guide for doing this?
Should I use the executable file generated from ant build or
vs.netsolution/project build for debugging?
Thanks!
-- 
>From : Simon.Chow@Software School of Fudan University

Re: [general][debug] how to debug harmony using vs?

Posted by Simon Chow <si...@gmail.com>.
That is cool!
Thank you very much

On 11/03/2008, Pavel Pervov <pm...@gmail.com> wrote:
>
> You can instrument your code just as Gregory suggested.
>
> Use the construct like this:
>
> if(my_condition) {
>     _CrtDbgBreak();
> }
>
> 'if' clause can be skipped.
>
> Then run your app outside Visual Studio, but keep VS open with the
> project in it. Once dialog box pops up asking if you want to debug
> answer 'yes' and select VS you have opened. It will attach to your app
> and show you the source, where you've inserved your instrumentation.
>
> Pavel.
>
>
> On 3/11/08, Simon Chow <si...@gmail.com> wrote:
> > Thank you, Alexei
> > So is there any suggestion or acrobatics to make the debugger's side
> effect
> > less?
> >
> > On 11/03/2008, Alexei Fedotov <al...@gmail.com> wrote:
> > >
> > > I usually configure "Debugging" tab from inside the active project
> > > properties to use a binary which is built by ant. Running the process
> > > with VS attached all the time makes a thread behavior, memory
> > > violation addresses, etc, more or less reproducible from launch to
> > > launch.
> > >
> > >
> > > On Tue, Mar 11, 2008 at 3:19 PM, Gregory Shimansky
> > > <gs...@apache.org> wrote:
> > > > Simon Chow said the following on 11.03.2008 15:14:
> > > >
> > > > > I am not very familiar with vs.net. Is there guide for doing this?
> > > >  > Should I use the executable file generated from ant build or
> > > >  > vs.netsolution/project build for debugging?
> > > >
> > > >  I don't think that using project you can build a fully functional
> > > >  runtime. Usually I open the project just for files/symbols lookup
> and
> > > >  specify executable and command line options in the debug
> properties.
> > > >  Then I start debugging _without_ rebuilding the project.
> > > >
> > > >  More often I use just-in-time debugging feature. When a process
> crashes
> > > >  or hangs I attach MSVC to it from the crash dialog or using task
> > > manager.
> > > >
> > > >  --
> > > >  Gregory
> > > >
> > > >
> > >
> > >
> > >
> > >
> > > --
> > > With best regards,
> > >
> > > Alexei
> > >
> >
> >
> >
> > --
> > From : Simon.Chow@Software School of Fudan University
> >
>
>
>
> --
> Pavel Pervov,
> Intel Enterprise Solutions Software Division
>



-- 
>From : Simon.Chow@Software School of Fudan University

Re: [general][debug] how to debug harmony using vs?

Posted by Alexei Fedotov <al...@gmail.com>.
Simon,
I attach VS when a debugger side effect (aka "green threads") is
wanted. If not, just use another way as Pavel and Gregory suggested.

Thanks.


On Tue, Mar 11, 2008 at 5:15 PM, Pavel Pervov <pm...@gmail.com> wrote:
> You can instrument your code just as Gregory suggested.
>
>  Use the construct like this:
>
>  if(my_condition) {
>     _CrtDbgBreak();
>  }
>
>  'if' clause can be skipped.
>
>  Then run your app outside Visual Studio, but keep VS open with the
>  project in it. Once dialog box pops up asking if you want to debug
>  answer 'yes' and select VS you have opened. It will attach to your app
>  and show you the source, where you've inserved your instrumentation.
>
>  Pavel.
>
>
>
>  On 3/11/08, Simon Chow <si...@gmail.com> wrote:
>  > Thank you, Alexei
>  > So is there any suggestion or acrobatics to make the debugger's side effect
>  > less?
>  >
>  > On 11/03/2008, Alexei Fedotov <al...@gmail.com> wrote:
>  > >
>  > > I usually configure "Debugging" tab from inside the active project
>  > > properties to use a binary which is built by ant. Running the process
>  > > with VS attached all the time makes a thread behavior, memory
>  > > violation addresses, etc, more or less reproducible from launch to
>  > > launch.
>  > >
>  > >
>  > > On Tue, Mar 11, 2008 at 3:19 PM, Gregory Shimansky
>  > > <gs...@apache.org> wrote:
>  > > > Simon Chow said the following on 11.03.2008 15:14:
>  > > >
>  > > > > I am not very familiar with vs.net. Is there guide for doing this?
>  > > >  > Should I use the executable file generated from ant build or
>  > > >  > vs.netsolution/project build for debugging?
>  > > >
>  > > >  I don't think that using project you can build a fully functional
>  > > >  runtime. Usually I open the project just for files/symbols lookup and
>  > > >  specify executable and command line options in the debug properties.
>  > > >  Then I start debugging _without_ rebuilding the project.
>  > > >
>  > > >  More often I use just-in-time debugging feature. When a process crashes
>  > > >  or hangs I attach MSVC to it from the crash dialog or using task
>  > > manager.
>  > > >
>  > > >  --
>  > > >  Gregory
>  > > >
>  > > >
>  > >
>  > >
>  > >
>  > >
>  > > --
>  > > With best regards,
>  > >
>  > > Alexei
>  > >
>  >
>  >
>  >
>  > --
>  > From : Simon.Chow@Software School of Fudan University
>  >
>
>
>  --
>  Pavel Pervov,
>  Intel Enterprise Solutions Software Division
>



-- 
With best regards,
Alexei

Re: [general][debug] how to debug harmony using vs?

Posted by Pavel Pervov <pm...@gmail.com>.
You can instrument your code just as Gregory suggested.

Use the construct like this:

if(my_condition) {
    _CrtDbgBreak();
}

'if' clause can be skipped.

Then run your app outside Visual Studio, but keep VS open with the
project in it. Once dialog box pops up asking if you want to debug
answer 'yes' and select VS you have opened. It will attach to your app
and show you the source, where you've inserved your instrumentation.

Pavel.

On 3/11/08, Simon Chow <si...@gmail.com> wrote:
> Thank you, Alexei
> So is there any suggestion or acrobatics to make the debugger's side effect
> less?
>
> On 11/03/2008, Alexei Fedotov <al...@gmail.com> wrote:
> >
> > I usually configure "Debugging" tab from inside the active project
> > properties to use a binary which is built by ant. Running the process
> > with VS attached all the time makes a thread behavior, memory
> > violation addresses, etc, more or less reproducible from launch to
> > launch.
> >
> >
> > On Tue, Mar 11, 2008 at 3:19 PM, Gregory Shimansky
> > <gs...@apache.org> wrote:
> > > Simon Chow said the following on 11.03.2008 15:14:
> > >
> > > > I am not very familiar with vs.net. Is there guide for doing this?
> > >  > Should I use the executable file generated from ant build or
> > >  > vs.netsolution/project build for debugging?
> > >
> > >  I don't think that using project you can build a fully functional
> > >  runtime. Usually I open the project just for files/symbols lookup and
> > >  specify executable and command line options in the debug properties.
> > >  Then I start debugging _without_ rebuilding the project.
> > >
> > >  More often I use just-in-time debugging feature. When a process crashes
> > >  or hangs I attach MSVC to it from the crash dialog or using task
> > manager.
> > >
> > >  --
> > >  Gregory
> > >
> > >
> >
> >
> >
> >
> > --
> > With best regards,
> >
> > Alexei
> >
>
>
>
> --
> From : Simon.Chow@Software School of Fudan University
>


-- 
Pavel Pervov,
Intel Enterprise Solutions Software Division

Re: [general][debug] how to debug harmony using vs?

Posted by Simon Chow <si...@gmail.com>.
Thank you, Alexei
So is there any suggestion or acrobatics to make the debugger's side effect
less?

On 11/03/2008, Alexei Fedotov <al...@gmail.com> wrote:
>
> I usually configure "Debugging" tab from inside the active project
> properties to use a binary which is built by ant. Running the process
> with VS attached all the time makes a thread behavior, memory
> violation addresses, etc, more or less reproducible from launch to
> launch.
>
>
> On Tue, Mar 11, 2008 at 3:19 PM, Gregory Shimansky
> <gs...@apache.org> wrote:
> > Simon Chow said the following on 11.03.2008 15:14:
> >
> > > I am not very familiar with vs.net. Is there guide for doing this?
> >  > Should I use the executable file generated from ant build or
> >  > vs.netsolution/project build for debugging?
> >
> >  I don't think that using project you can build a fully functional
> >  runtime. Usually I open the project just for files/symbols lookup and
> >  specify executable and command line options in the debug properties.
> >  Then I start debugging _without_ rebuilding the project.
> >
> >  More often I use just-in-time debugging feature. When a process crashes
> >  or hangs I attach MSVC to it from the crash dialog or using task
> manager.
> >
> >  --
> >  Gregory
> >
> >
>
>
>
>
> --
> With best regards,
>
> Alexei
>



-- 
>From : Simon.Chow@Software School of Fudan University

Re: [general][debug] how to debug harmony using vs?

Posted by Alexei Fedotov <al...@gmail.com>.
I usually configure "Debugging" tab from inside the active project
properties to use a binary which is built by ant. Running the process
with VS attached all the time makes a thread behavior, memory
violation addresses, etc, more or less reproducible from launch to
launch.

On Tue, Mar 11, 2008 at 3:19 PM, Gregory Shimansky
<gs...@apache.org> wrote:
> Simon Chow said the following on 11.03.2008 15:14:
>
> > I am not very familiar with vs.net. Is there guide for doing this?
>  > Should I use the executable file generated from ant build or
>  > vs.netsolution/project build for debugging?
>
>  I don't think that using project you can build a fully functional
>  runtime. Usually I open the project just for files/symbols lookup and
>  specify executable and command line options in the debug properties.
>  Then I start debugging _without_ rebuilding the project.
>
>  More often I use just-in-time debugging feature. When a process crashes
>  or hangs I attach MSVC to it from the crash dialog or using task manager.
>
>  --
>  Gregory
>
>



-- 
With best regards,
Alexei

Re: [general][debug] how to debug harmony using vs?

Posted by Gregory Shimansky <gs...@apache.org>.
On 11 March 2008 Simon Chow wrote:
> Thanks!
> Is 'debugging _without_ rebuilding' a property can be set or just close the
> rebuild warning dialog?

You can check checkbox to never ask you again or always press No to rebuild 
the project.

> And more question :)
> how can I set the breakpoint after the program is running?

Usually all breakpoints set in sources that are used to run binary build work 
ok. So you can set them before running a process in MSVC. You can also 
interrupt a running process (Debug->Break All) and set new breakpoints at any 
moment.

For just in time debugging you can use _CrtDbgBreak() function defined in 
crtdbg.h. In debug mode this function is equivalent to int3 and will 
interrupt a running process. Then you can step over it to debug the process 
from the interrupted position. In release mode this function is a no-op.

> On 11/03/2008, Gregory Shimansky <gs...@apache.org> wrote:
> > Simon Chow said the following on 11.03.2008 15:14:
> > > I am not very familiar with vs.net. Is there guide for doing this?
> > > Should I use the executable file generated from ant build or
> > > vs.netsolution/project build for debugging?
> >
> > I don't think that using project you can build a fully functional
> > runtime. Usually I open the project just for files/symbols lookup and
> > specify executable and command line options in the debug properties.
> > Then I start debugging _without_ rebuilding the project.
> >
> > More often I use just-in-time debugging feature. When a process crashes
> > or hangs I attach MSVC to it from the crash dialog or using task manager.

-- 
Gregory

Re: [general][debug] how to debug harmony using vs?

Posted by Simon Chow <si...@gmail.com>.
Thanks!
Is 'debugging _without_ rebuilding' a property can be set or just close the
rebuild warning dialog?
And more question :)
how can I set the breakpoint after the program is running?


On 11/03/2008, Gregory Shimansky <gs...@apache.org> wrote:
>
> Simon Chow said the following on 11.03.2008 15:14:
>
> > I am not very familiar with vs.net. Is there guide for doing this?
> > Should I use the executable file generated from ant build or
> > vs.netsolution/project build for debugging?
>
>
> I don't think that using project you can build a fully functional
> runtime. Usually I open the project just for files/symbols lookup and
> specify executable and command line options in the debug properties.
> Then I start debugging _without_ rebuilding the project.
>
> More often I use just-in-time debugging feature. When a process crashes
> or hangs I attach MSVC to it from the crash dialog or using task manager.
>
> --
>
> Gregory
>
>


-- 
>From : Simon.Chow@Software School of Fudan University

Re: [general][debug] how to debug harmony using vs?

Posted by Gregory Shimansky <gs...@apache.org>.
Simon Chow said the following on 11.03.2008 15:14:
> I am not very familiar with vs.net. Is there guide for doing this?
> Should I use the executable file generated from ant build or
> vs.netsolution/project build for debugging?

I don't think that using project you can build a fully functional 
runtime. Usually I open the project just for files/symbols lookup and 
specify executable and command line options in the debug properties. 
Then I start debugging _without_ rebuilding the project.

More often I use just-in-time debugging feature. When a process crashes 
or hangs I attach MSVC to it from the crash dialog or using task manager.

-- 
Gregory