This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: debugging problem through GDB


>>>>> "Tony" == Tony Ko <nhko@gctsemi.com> writes:

Tony> Hi.  I try to debug my custom board(mpc860 board) through GDB.
Tony> I used eCos-1.3.1 package and made eCos image including GDB
Tony> stubs.  but some wierd result happens when program stop by
Tony> breakpoint.

Tony> Passing argument values are not correct. Those looks like kind
Tony> of garbage value.

Tony> for example, source code is below,

Tony>  cyg_thread_create(10, // Priority - just a number net_test, //
Tony> entry 0, // entry parameter "Network test", // Name &stack[0],
Tony> // Stack STACK_SIZE, // Size &thread_handle, // Handle
Tony> &thread_data // Thread data structure );

Tony> but argument value after program stopp by breakpoint is below,

Tony> cyg_thread_create (sched_info=10, entry=0x20368 <net_test>,
Tony> entry_data=105916, name=0x47aa4 "", stack_base=0x1,
Tony> stack_size=286326799, handle=0x1111000e, thread=0x47acc) at
Tony> /opt/ecos/ecos-1.3.1/packages/kernel/v1_3_1/src/common/kapi.cxx:151
Tony> Current language: auto; currently c++

Tony> for instance, entry_data is 0 at source code, but the value on
Tony> console is 105916.

This is because GDB is not always able to tell where to find variable
values. Sometimes these are optimized into registers - you might be
able to work around it by compiling without optimziation.

Jesper


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]