From: Aditya Chugh <Aditya@in.huawei.com>
To: bug-gdb@prep.ai.mit.edu, gdb@sourceware.cygnus.com,
ac131313@cygnus.com, ischis2@home.com,
"fnasser@ redhat.com" <cagney@cygnus.com>,
jtc@redback.com, alan@linuxcare.com.au, cpg@aladdin.de
Cc: bug-gdb-request@prep.ai.mit.edu
Subject: MACROS in gdb ???
Date: Wed, 21 Mar 2001 15:59:00 -0000 [thread overview]
Message-ID: <70EB682332F4D41187D6000629AE2C651AE3B1@mail.in.huawei.com> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1704 bytes --]
Title: MACROS in gdb ???
Hello ,
I am not sure this is the right forum for a question on gdb.I am a Newbie as far as gdb is concerned.
But I have been struggling with this for quite some time and would sincerely appreciate any help.
I am trying to use gdb for a C program which makes heavy
use of C macros.
The function ldpCreateIncarn() is called with parameter u2IncarnId set to 0.
UINT1 ldpCreateIncarn (UINT2 u2IncarnId)
{
  UINT1 u1HoldPrio;
  LDP_ASSERT(u2IncarnId == LDP_CUR_INCARN);
  if ( LDP_INCARN_STATUS(u2IncarnId) == ACTIVE )Â
  {
      return LDP_FAILURE;
  }
  gblTmrMemChkId = 1;
  gblSNMPMemChkId = 1;
.
.
.
}
After call to LDP_INCARN_STATUS(u2IncarnId) the value of
u2IncarnId MYSTERIOUSLY changes to 1.LDP_INCARN_STATUS is a macro defined as follows
#define LDP_INCARN_STATUS(x) (gLdpInfo.LdpIncarn[(x)].IncarnRowStatus)
...it only reads the status from a global data-stucture and checks to see if it is ACTIVE. It does not change the value of "x" in any way.
But after processing this macro the value of u2IncarnId changes unexplicably ????
Also in this function I have some other Macros like
INIT_LBL_MGR_INFO(u2IncarnId)
which are defined as
#define INIT_LBL_MGR_INFO(x) gLdpInfo.LdpIncarn[(x)].LdpLblMgrInfo.u4NumGrpsActive = LDP_ZERO;
At the time of entering such macros u2IncarnId is set to 0 but after processing the macro its value cahnges to 168 !!
(gdb) p u2IncarnId
$19 = 0
(gdb) n
(gdb) p u2IncarnId
$20 = 168
If I am missing something obvious please forgive me. I have spent the whole day trying to figure out where
I am going wrong.
Thanks in Advance,
Aditya
next reply other threads:[~2001-03-21 15:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-21 15:59 Aditya Chugh [this message]
2001-03-21 15:59 ` J.T. Conklin
2001-03-21 15:59 Aditya Chugh
2001-03-21 15:59 ` Eli Zaretskii
[not found] ` <eliz@is.elta.co.il>
2001-03-21 15:59 ` Kevin Buettner
2001-03-21 15:59 ` Eli Zaretskii
2001-03-21 15:59 ` Daniel Berlin
2001-03-21 15:59 ` J.T. Conklin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=70EB682332F4D41187D6000629AE2C651AE3B1@mail.in.huawei.com \
--to=aditya@in.huawei.com \
--cc=ac131313@cygnus.com \
--cc=alan@linuxcare.com.au \
--cc=bug-gdb-request@prep.ai.mit.edu \
--cc=bug-gdb@prep.ai.mit.edu \
--cc=cagney@cygnus.com \
--cc=cpg@aladdin.de \
--cc=gdb@sourceware.cygnus.com \
--cc=ischis2@home.com \
--cc=jtc@redback.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox