This is the mail archive of the
mailing list for the GDB project.
Re: MACROS in gdb ???
- To: Aditya Chugh <Aditya at in dot huawei dot com>
- Subject: Re: MACROS in gdb ???
- From: jtc at redback dot com (J.T. Conklin)
- Date: 19 Mar 2001 15:11:50 -0800
- Cc: bug-gdb at prep dot ai dot mit dot edu, gdb at sourceware dot cygnus dot com
- References: <70EB682332F4D41187D6000629AE2C651AE3B1@mail.in.huawei.com>
- Reply-To: jtc at redback dot com
>>>>> "Aditya" == Aditya Chugh <Aditya@in.huawei.com> writes:
Aditya> I am not sure this is the right forum for a question on gdb.
I have culled the 'cc' list to the most relevant mailing lists.
Aditya> I am a Newbie as far as gdb is concerned. But I have been
Aditya> struggling with this for quite some time and would sincerely
Aditya> appreciate any help.
Aditya> But after processing this macro the value of u2IncarnId
Aditya> changes unexplicably ????
You don't mention what target you're using or what optimization level
was used when you compiled the files. But the symptoms you describe
often occur when debugging optimized code.
For example if a register is being used to hold a value and then that
value is no longer needed in the rest of the function, a compiler may
choose to use that register for an unrelated value. This can make
debugging a bit of a challenge, but looking at a disassembly of the
function or recompiling the system with no optimization can be used to
help diagnose the problem.
It helps to have a somewhat "flexible" attitude when it comes to
debugging optimized code. A rigid interpretation of results will
lead to frustration.
Aditya> If I am missing something obvious please forgive me. I have
Aditya> spent the whole day trying to figure out where I am going
I hope this helps.