From mboxrd@z Thu Jan 1 00:00:00 1970 From: jtc@redback.com (J.T. Conklin) To: Aditya Chugh Cc: bug-gdb@prep.ai.mit.edu, gdb@sourceware.cygnus.com Subject: Re: MACROS in gdb ??? Date: Wed, 21 Mar 2001 15:59:00 -0000 Message-id: <5mofuxl5ft.fsf@jtc.redback.com> References: <70EB682332F4D41187D6000629AE2C651AE3B1@mail.in.huawei.com> X-SW-Source: 2001-03/msg00177.html >>>>> "Aditya" == Aditya Chugh 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 Aditya> wrong. I hope this helps. --jtc -- J.T. Conklin RedBack Networks