DSPRelated.com
Forums

Problems with debugger

Started by Giovanni Parodi January 5, 2006
Hello everybody, I have some problem debugging my C
code:
I have a C code compiled using the following options

-g -pr -fr"$(Proj_dir)\Debug" -d"_DEBUG" -mo -mv6400
--mem_model:data --consultant

I use fastrts64x library (setting this library as the
first in the linker order).
I do not modify this library (so I don't recompile it,
I don't know if this is ok, I use memory model far and
RTS calls use memory model).

When I try to modify this subroutine (both on board
and on functional simulator) I have the following
problem:
stepping into a subroutine (which name is f()) works
until a certain level of the subroutine, then the
debugger "sends" me to the following line of the
string.h file.

#if defined(_INLINE) || defined(_STRNCAT)
_OPT_IDEFN char *strncat(char *dest, const char *src,
register size_t n)

In no place I use this subroutine in f() but, looking
at the map file I can see the following rows:

8070e8e0 000000e0 o2cr_char_segment.obj
(.text:_f)
8070e9c0 000000e0 rts6400.lib : strncat.obj
(.text:_strncat)

I'm not able to figure out what happens, it seems that
the obj code of f has not enough place, but I don't
understand how to solve this problem.

So I would like to know if someone had similar problem
with CCS 3.1 and if I have to recompile rts and
fastrts..
Thanks a lot
Giovanni

Chiacchiera con i tuoi amici in tempo reale!
http://it.messenger.yahoo.com" target="_blank" rel="nofollow">http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com



Hello Giovanni,

--- Giovanni Parodi <giovanniparodi79@giov...> wrote:

> Hello everybody, I have some problem debugging my C
> code:
> I have a C code compiled using the following options
>
> -g -pr -fr"$(Proj_dir)\Debug" -d"_DEBUG" -mo -mv6400
> --mem_model:data --consultant
>
> I use fastrts64x library (setting this library as
> the
> first in the linker order).
> I do not modify this library (so I don't recompile
> it,
> I don't know if this is ok, I use memory model far
> and
> RTS calls use memory model).
>
> When I try to modify this subroutine (both on board
> and on functional simulator) I have the following
> problem:
> stepping into a subroutine (which name is f()) works
> until a certain level of the subroutine, then the
> debugger "sends" me to the following line of the
> string.h file.
Have you tried...
After you step in f() and get near [but definitely
before] the problem area, change your display to
'mixed mode'. This will show the asm statements and
when you step, use 'asm step' instead of 'C step'.
Don't worry about understanding the details of the asm
code until you 'go into the weeds'. The assembly code
that is being executed before [we don't know how much
before] the 'bad branch' may give clues as to what is
going on.

mikedunn
>
> #if defined(_INLINE) || defined(_STRNCAT)
> _OPT_IDEFN char *strncat(char *dest, const char
> *src,
> register size_t n)
>
> In no place I use this subroutine in f() but,
> looking
> at the map file I can see the following rows:
>
> 8070e8e0 000000e0 o2cr_char_segment.obj
> (.text:_f)
> 8070e9c0 000000e0 rts6400.lib : strncat.obj
> (.text:_strncat)
>
> I'm not able to figure out what happens, it seems
> that
> the obj code of f has not enough place, but I don't
> understand how to solve this problem.
>
> So I would like to know if someone had similar
> problem
> with CCS 3.1 and if I have to recompile rts and
> fastrts..
> Thanks a lot
> Giovanni
>
> Chiacchiera con i tuoi amici in tempo reale!
http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com
> c6x-unsubscribe@c6x-...



No,
I haven't tried this, I will try it.
Do you think that using pragma CODE_SECTION will help me?
Thanks for your help Gio

Mike Dunn wrote:
Hello Giovanni,
--- Giovanni Parodi <g...@yahoo.it> wrote:
Hello everybody, I have some problem debugging my C
code:
I have a C code compiled using the following options
-g -pr -fr"$(Proj_dir)\Debug" -d"_DEBUG" -mo -mv6400
--mem_model:data --consultant
I use fastrts64x library (setting this library as
the
first in the linker order).
I do not modify this library (so I don't recompile
it,
I don't know if this is ok, I use memory model far
and
RTS calls use memory model).
When I try to modify this subroutine (both on board
and on functional simulator) I have the following
problem:
stepping into a subroutine (which name is f()) works
until a certain level of the subroutine, then the
debugger "sends" me to the following line of the
string.h file.
Have you tried...
After you step in f() and get near [but definitely
before] the problem area, change your display to
'mixed mode'. This will show the asm statements and
when you step, use 'asm step' instead of 'C step'.
Don't worry about understanding the details of the asm
code until you 'go into the weeds'. The assembly code
that is being executed before [we don't know how much
before] the 'bad branch' may give clues as to what is
going on.
mikedunn
#if defined(_INLINE) || defined(_STRNCAT)
_OPT_IDEFN char *strncat(char *dest, const char
*src,
register size_t n)
In no place I use this subroutine in f() but,
looking
at the map file I can see the following rows:
8070e8e0 000000e0 o2cr_char_segment.obj
(.text:_f)
8070e9c0 000000e0 rts6400.lib : strncat.obj
(.text:_strncat)
I'm not able to figure out what happens, it seems
that
the obj code of f has not enough place, but I don't
understand how to solve this problem.
So I would like to know if someone had similar
problem
with CCS 3.1 and if I have to recompile rts and
fastrts..
Thanks a lot Giovanni
Chiacchiera con i tuoi amici in tempo reale! 
http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com
	

Gio,

I don't know what happened to my mail reader here...

I think that 'pragma CODE_SECTION' might make the
problem go away. I think that is an OK solution for a
prototype or 'class assignment', but I tend to want to
have a better understanding of a problem cause before
I use something 'as a real fix'. I am not saying that
this is not a valid fix - it might well be a correct
fix. I have found that when I just 'make problems go
away' that they tend to come back in the future -
usually at a very inopportune time.

mikedunn

--- "giovanniparodi79@giov..."
<giovanniparodi79@giov...> wrote: ---------------------------------
No,
I haven't tried this, I will try it.
Do you think that using pragma CODE_SECTION will help
me?
Thanks for your help Gio

Mike Dunn wrote:
Hello Giovanni,--- Giovanni Parodi
<giovanniparodi79@giov...> wrote:

Hello everybody, I have some problem debugging my
Ccode:I have a C code compiled using the following
options-g -pr -fr"$(Proj_dir)\Debug" -d"_DEBUG" -mo
-mv6400--mem_model:data --consultantI use
fastrts64x library (setting this library asthefirst in
the linker order).I do not modify this library (so I
don't recompileit,I don't know if this is ok, I use
memory model farandRTS calls use memory model).When I
try to modify this subroutine (both on boardand on
functional simulator) I have the
followingproblem:stepping into a subroutine (which
name is f()) worksuntil a certain level of the
subroutine, then thedebugger "sends" me to the
following line of thestring.h file.

Have you tried...After you step in f() and get near
[but definitelybefore] the problem area, change your
display to'mixed mode'. This will show the asm
statements andwhen you step, use 'asm step' instead of
'C step'. Don't worry about understanding the details
of the asmcode until you 'go into the weeds'. The
assembly codethat is being executed before [we don't
know how muchbefore] the 'bad branch' may give clues
as to what isgoing on.mikedunn

#if defined(_INLINE) || defined(_STRNCAT)_OPT_IDEFN
char *strncat(char *dest, const char*src,register
size_t n)In no place I use this subroutine in f()
but,lookingat the map file I can see the following
rows: 8070e8e0 000000e0
o2cr_char_segment.obj(.text:_f) 8070e9c0 000000e0
rts6400.lib : strncat.obj(.text:_strncat)I'm not
able to figure out what happens, it seemsthatthe obj
code of f has not enough place, but I don'tunderstand
how to solve this problem.So I would like to know if
someone had similarproblemwith CCS 3.1 and if I have
to recompile rts andfastrts..Thanks a lot
GiovanniChiacchiera con i tuoi amici in tempo reale! http://it.messenger.yahoo.com" target="_blank" rel="nofollow">http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com NEW! You can now post a message or access andsearch
the archives of this group on
DSPRelated.com:http://www.dsprelated.com/groups/c6x/1.php_____________________________________Note:
If you do a simple "reply" with your emailclient, only
the author of this message will receiveyour answer.
You need to do a "reply all" if youwant your answer to
be distributed to the
entiregroup._____________________________________About
this discussion group:Archives:
http://www.dsprelated.com/groups/c6x/1.phpTo Post:
Send an email to c6x@c6x@... DSP Related
Groups:http://www.dsprelated.com/groups.php Yahoo!
unsubscribe from this group, send an emailto:
http://docs.yahoo.com/info/terms/


You are right
in fact it seems that the problem was a stack too small, but I'm not
able to understand how this can create problems as the jump out of a
function code.
However increasing the code size, it seems that all works correctly
without the use of CODE_SECTION
Thanks again for your useful help.
Giovanni

Mike Dunn wrote:
> Gio,
>
> I don't know what happened to my mail reader here...
>
> I think that 'pragma CODE_SECTION' might make the
> problem go away. I think that is an OK solution for a
> prototype or 'class assignment', but I tend to want to
> have a better understanding of a problem cause before
> I use something 'as a real fix'. I am not saying that
> this is not a valid fix - it might well be a correct
> fix. I have found that when I just 'make problems go
> away' that they tend to come back in the future -
> usually at a very inopportune time.
>
> mikedunn
>
> --- "giovanniparodi79@giov..."
> <giovanniparodi79@giov...> wrote: > ---------------------------------
> No,
> I haven't tried this, I will try it.
> Do you think that using pragma CODE_SECTION will help
> me?
> Thanks for your help Gio
>
> Mike Dunn wrote:
> Hello Giovanni,--- Giovanni Parodi
> <giovanniparodi79@giov...> wrote:
>
> Hello everybody, I have some problem debugging my
> Ccode:I have a C code compiled using the following
> options-g -pr -fr"$(Proj_dir)\Debug" -d"_DEBUG" -mo
> -mv6400--mem_model:data --consultantI use
> fastrts64x library (setting this library asthefirst in
> the linker order).I do not modify this library (so I
> don't recompileit,I don't know if this is ok, I use
> memory model farandRTS calls use memory model).When I
> try to modify this subroutine (both on boardand on
> functional simulator) I have the
> followingproblem:stepping into a subroutine (which
> name is f()) worksuntil a certain level of the
> subroutine, then thedebugger "sends" me to the
> following line of thestring.h file.
>
> Have you tried...After you step in f() and get near
> [but definitelybefore] the problem area, change your
> display to'mixed mode'. This will show the asm
> statements andwhen you step, use 'asm step' instead of
> 'C step'. Don't worry about understanding the details
> of the asmcode until you 'go into the weeds'. The
> assembly codethat is being executed before [we don't
> know how muchbefore] the 'bad branch' may give clues
> as to what isgoing on.mikedunn
>
> #if defined(_INLINE) || defined(_STRNCAT)_OPT_IDEFN
> char *strncat(char *dest, const char*src,register
> size_t n)In no place I use this subroutine in f()
> but,lookingat the map file I can see the following
> rows: 8070e8e0 000000e0
> o2cr_char_segment.obj(.text:_f) 8070e9c0 000000e0
> rts6400.lib : strncat.obj(.text:_strncat)I'm not
> able to figure out what happens, it seemsthatthe obj
> code of f has not enough place, but I don'tunderstand
> how to solve this problem.So I would like to know if
> someone had similarproblemwith CCS 3.1 and if I have
> to recompile rts andfastrts..Thanks a lot
> GiovanniChiacchiera con i tuoi amici in tempo reale! > http://it.messenger.yahoo.com" target="_blank" rel="nofollow">http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com > NEW! You can now post a message or access andsearch
> the archives of this group on
> DSPRelated.com:http://www.dsprelated.com/groups/c6x/1.php_____________________________________Note:
> If you do a simple "reply" with your emailclient, only
> the author of this message will receiveyour answer.
> You need to do a "reply all" if youwant your answer to
> be distributed to the
> entiregroup._____________________________________About
> this discussion group:Archives:
> http://www.dsprelated.com/groups/c6x/1.phpTo Post:
> Send an email to c6x@c6x@... DSP Related
> Groups:http://www.dsprelated.com/groups.php Yahoo!
> unsubscribe from this group, send an emailto:
> http://docs.yahoo.com/info/terms/ >
>