You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Carl Lefrançois <ca...@gmail.com> on 2008/02/22 21:30:27 UTC

[AXIS2C] trouble debugging under windows

For several days I have been struggling to enable line by line debugging in
visual C 6.0.

An example of the problem is that while stepping through code, when
attempting to step into a call to the client API, the debugger shows the
wrong lines of code and wrong call stack.

steps taken to resolve:

-make sure all modules are compiled with the same compiler and linker
options
-create new workspaces for each module
-take options directly from makefile provided in /build/win32
-replace LF line endings with windows-style CRLF line endings in .c and .h
sources (supposed to affect C preprocessor line count)

so far in all cases the behaviour is the same: I can step through my code
but not into any client API DLLs.

My hope in sending this message is that someone using the same environment
can confirm they are able to debug properly in client API DLLs (or any Axis2
DLL for that matter).

So far aside from work environment compatibility problems, the experience
with Axis2C is very positive.

Thanks in advance for any advice you may give me!
Carl

Re: [AXIS2C] trouble debugging under windows

Posted by Senaka Fernando <se...@wso2.com>.
Hi again Carl,

Below is an answer to three questions you had. I have not tried these,
mainly because I work in a VS2005 environment where I don't require such
modifications. but, I believe it is worth to give it a try.

Debugger Options
----------------

I did try to make a project on a Visual Studio 6.0 environment. I see that
it defines some flags as follows.

/nologo /MLd /W4 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D
"_MBCS" /Fp"Debug/hash.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c

Now, these are what we have in our makefiles,

/D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AXIS2_DECLARE_EXPORT"  \
	 /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_SECURE_NO_WARNINGS" \
         /D "AXIS2_SVR_MULTI_THREADED" /W3 /wd4100 /WX /MP10 /nologo
$(AXIS2_INCLUDE_PATH) \
	 $(APACHE_INCLUDE_PATH)

It seems that, /W4 can be /W3, /Gm and /GX are not so needed. The /F flags
are simply file outputs. *.pch is a pre-compiled header which is not
required. Also, /MLd is equivalent to /MDd that we use. However, you may
need the /ZI, /YX, /GZ flags in the makefile.

You have to add these three CFlags, at the end of the existing ones. This
is listed under the "compiler options" section in the makefile found
inside build\win32.

I hope this might help. If you still can't get it debugged, try adding the
/Zi and /Z7 flags too.


Line Ending Conversions
-----------------------

To do line ending conversions, there is a tool called dos2unix. Once you
install that, you will have to run UNIX2DOS on each file that you
experience this issue. It would be great if you could find a way to
reccursively call UNIX2DOS on each C file.

Below is a way to do that, but, I have not tried this.

for /F "tokens=*" %%G in ('dir /B /S *.c*') do <absolute_path_of_unix2dos>
"%%G"
for /F "tokens=*" %%G in ('dir /B /S *.h*') do <absolute_path_of_unix2dos>
"%%G"

You will have to replace <absolute_path_of_unix2dos> suitably, and if the
path has spaces remember to put quotation marks around. Run this inside
the axis2/c root folder so that it will recursively replace files in all
sub folders.


Creating Workspaces
-------------------

It would be great if you could add some VC 6.0 workspaces to Axis2/C so
that it would help other VC 6.0 based developers. Just raise an issue on
the Axis2/C JIRA and attach a .zip. Or simply mail in to the developer
list. To get an idea on what workspaces are required, you can have a run
through on the ones that we have for VS2005, which can be found in
ides/VC. Basically, each sub folder means a sub section.

You may not be able to open VS2005 projects in VC 6.0, but, of course they
are readable when you open them in wordpad. I believe this can guide you
through. Each project file would contain repeated information, and
therefore, by reading just two or three you will understand what is
happening.

Regards,
Senaka

> Hi Carl,
>
> I Think VC 6.0 can't recognize LF (unix style) line endings. We do support
> VS2005 upwards, and we don't see any issue there. Of course I believe that
> there should be a way that you could convert unix code into dos compatible
> code, by using something like unix2dos. Doing so, you can achieve your
> requirement.
>
> Also, we do have Visual Studio 2005, C projects for each major component.
> We believe that the wide majority of developers do use VS2005 by now, and
> we have only made sure that it builds on a VC 6.0 compiler.
>
> Regards,
> Senaka
>
>> For several days I have been struggling to enable line by line debugging
>> in
>> visual C 6.0.
>>
>> An example of the problem is that while stepping through code, when
>> attempting to step into a call to the client API, the debugger shows the
>> wrong lines of code and wrong call stack.
>>
>> steps taken to resolve:
>>
>> -make sure all modules are compiled with the same compiler and linker
>> options
>> -create new workspaces for each module
>> -take options directly from makefile provided in /build/win32
>> -replace LF line endings with windows-style CRLF line endings in .c and
>> .h
>> sources (supposed to affect C preprocessor line count)
>>
>> so far in all cases the behaviour is the same: I can step through my
>> code
>> but not into any client API DLLs.
>>
>> My hope in sending this message is that someone using the same
>> environment
>> can confirm they are able to debug properly in client API DLLs (or any
>> Axis2
>> DLL for that matter).
>>
>> So far aside from work environment compatibility problems, the
>> experience
>> with Axis2C is very positive.
>>
>> Thanks in advance for any advice you may give me!
>> Carl
>>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Re: [AXIS2C] trouble debugging under windows

Posted by Senaka Fernando <se...@wso2.com>.
Hi Carl,

I Think VC 6.0 can't recognize LF (unix style) line endings. We do support
VS2005 upwards, and we don't see any issue there. Of course I believe that
there should be a way that you could convert unix code into dos compatible
code, by using something like unix2dos. Doing so, you can achieve your
requirement.

Also, we do have Visual Studio 2005, C projects for each major component.
We believe that the wide majority of developers do use VS2005 by now, and
we have only made sure that it builds on a VC 6.0 compiler.

Regards,
Senaka

> For several days I have been struggling to enable line by line debugging
> in
> visual C 6.0.
>
> An example of the problem is that while stepping through code, when
> attempting to step into a call to the client API, the debugger shows the
> wrong lines of code and wrong call stack.
>
> steps taken to resolve:
>
> -make sure all modules are compiled with the same compiler and linker
> options
> -create new workspaces for each module
> -take options directly from makefile provided in /build/win32
> -replace LF line endings with windows-style CRLF line endings in .c and .h
> sources (supposed to affect C preprocessor line count)
>
> so far in all cases the behaviour is the same: I can step through my code
> but not into any client API DLLs.
>
> My hope in sending this message is that someone using the same environment
> can confirm they are able to debug properly in client API DLLs (or any
> Axis2
> DLL for that matter).
>
> So far aside from work environment compatibility problems, the experience
> with Axis2C is very positive.
>
> Thanks in advance for any advice you may give me!
> Carl
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org