Author Topic: SlickEdit 15.0.0.5 can't find complete references?  (Read 9544 times)

abcd

  • Guest
SlickEdit 15.0.0.5 can't find complete references?
« on: June 08, 2010, 03:25:58 am »
I use CTRL+/ to find the reference of a variable or function, the reference list only a part, the actual references number isn't . If SlickEdit can't find all the references, then this function is not believable, it makes some troublesome to programmer.

abcd

  • Guest
Re: SlickEdit 15.0.0.5 can't find complete references?
« Reply #1 on: June 17, 2010, 02:13:32 am »
Who can help me?Could the SE support make analysis on this topic?

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2891
  • Hero Points: 436
Re: SlickEdit 15.0.0.5 can't find complete references?
« Reply #2 on: June 17, 2010, 08:51:27 pm »
We need more information to help you with this one.

1) what language are you working with?
2) code sample, what you are hitting Ctrl+/ on
3) code samples, references that are being found
4) code samples, references that are not being found
5) are all the files you are expecting to find references in your project or workspace?

abcd

  • Guest
Re: SlickEdit 15.0.0.5 can't find complete references?
« Reply #3 on: June 18, 2010, 01:30:19 am »
1. I work with c language
2.I press ctrl+/ on function name
3,4, for example, I press  ctrl+/ on function f called in file a.c, then the reference listed the declare in b.h, define in the file b.h , and called places in a.c file, but the called place in another d.c file didn't list. Of course, I didn't mean SE couldn't find complete references of each function or variant.
5.yes, I want to all the references in my workspace.

I had set the reference option "find references incrementally" to false, even I had set the option "build workspace tag file with references" to false, SE still couldn't find all the references.

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: SlickEdit 15.0.0.5 can't find complete references?
« Reply #4 on: June 18, 2010, 05:07:42 am »
Hi abcd, Dennis is looking for actual code samples.  Can you attach a .zip file that contains a set of file that reproduces the problem, and steps for how to reproduce the problem?  The more information that can be provided, the better the developers are able to look into an issue.

Graeme

  • Senior Community Member
  • Posts: 2422
  • Hero Points: 320
Re: SlickEdit 15.0.0.5 can't find complete references?
« Reply #5 on: June 18, 2010, 07:16:56 am »
abcd

Regarding Dennis's question 5  -  are all the files involved (e.g. d.c) members of your project?  If the file isn't in the project then it won't be in the tag file and won't be found by "find references".  On the tools menu, select "tag files" and check if the file d.c is in your tag file.

Do you have any conditional compilation in your code (#if, #ifdef).  If so, you need to set values for the preprocessor tokens involved using tools -> options -> languages -> C/C++ -> c/c++ Preprocessing

e.g. if you have
#ifdef PRO_BUILD

then you need to add PRO_BUILD to the preprocessor list and define a value for it.

Graeme

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2891
  • Hero Points: 436
Re: SlickEdit 15.0.0.5 can't find complete references?
« Reply #6 on: June 18, 2010, 12:41:30 pm »
> I had set the reference option "find references incrementally" to false,
> even I had set the option "build workspace tag file with references" to false,
> SE still couldn't find all the references.

Setting find references incrementally to false is fine, if you are doing that just for performance, but if your project is small, I would recommend leaving that option on.

Setting "build workspace tag file with references" to false is exactly the opposite of what you want.  You need to have to option on, and you need to make sure that your workspace tag file is built with references.  You can see that it is because it has a special icon when you look at in under Tools > Tag Files...

> 3,4, for example, I press  ctrl+/ on function f called in file a.c,
> then the reference listed the declare in b.h, define in the file b.h,
> and called places in a.c file, but the called place in another d.c file didn't list.

Go to the reference in d.c and press Ctrl+.  What happens?  Is the declaration or definition in b.h found?

Actually, I think I know what the problem is.  Is this function static?

abcd

  • Guest
Re: SlickEdit 15.0.0.5 can't find complete references?
« Reply #7 on: June 21, 2010, 02:16:17 am »
Quote
Setting find references incrementally to false is fine, if you are doing that just for performance, but if your project is small, I would recommend leaving that option on.

As the option's tip said: When set to False , all files with potential references are searched and analyzed. When set to False, the performance should be worse, isn't it? I set it to false to make SE find references in all the project files.

Quote
Setting "build workspace tag file with references" to false is exactly the opposite of what you want.  You need to have to option on, and you need to make sure that your workspace tag file is built with references.  You can see that it is because it has a special icon when you look at in under Tools > Tag Files.

When this option is off, I find SE still find references, but it likes finding in project files but not in tags, isn't it?So I turn off it, to make SE find references in real files but not in tags, for the tags built by SE seems not complete.


Today, I reappeared this problem. Before I tested it, I have rebuilt the tag file. And all project files is included in the tag file window.
The function isn't static. when I pressed Ctrl+., the definition could be located. And when I pressed ctrl+/ on f in the file d.c reference not be found in, the references list would list prior references plus these in this file.But when switched to prior file, and find references again, the lists still were lack of these in file d.c.

Reply to Graeme: In my referenced files, there's no condition compilation. But your advice is valuable, thanks!
« Last Edit: June 21, 2010, 02:18:40 am by abcd »

abcd

  • Guest
Re: SlickEdit 15.0.0.5 can't find complete references?
« Reply #8 on: June 23, 2010, 02:01:04 am »
It seems that SE 15.0 produces so many big problems, but where is version 15.0's significant improvement upon 14.0? I think the version publish isn't very careful.

abcd

  • Guest
Re: SlickEdit 15.0.0.5 can't find complete references?
« Reply #9 on: July 22, 2010, 02:25:31 am »
Today, I find this bug appears on SE 14.02 too.

In file x.h, there's a struct defination:
typedef struct
{
   GT_BOOL      accountQConf;
   GT_BOOL      accountFiltered;
   GT_BOOL      mgmtNrlEn;
   GT_BOOL      saNrlEn;
   GT_BOOL      daNrlEn;
   GT_BOOL      samplingMode;
   GT_PIRL_ACTION   actionMode;
   GT_ESB_LIMIT_ACTION ebsLimitAction;
   GT_U32      ebsLimit;
   GT_U32      cbsLimit;
   GT_U32      bktRateFactor;
   GT_U32      bktIncrement;
   GT_PIRL_FC_DEASSERT fcDeassertMode;
   GT_BUCKET_RATE_TYPE   bktRateType;
   GT_BOOL      priORpt;
   GT_U32      priMask;
   GT_U32      bktTypeMask;
   GT_PIRL2_COUNT_MODE   byteTobeCounted;
} GT_PIRL2_RESOURCE;

And in old file y.c , there is a function using this struct,
and I add a function in file z.c, where also used this struct,

when press Ctrl+/ on one member of struct GT_PIRL2_RESOURCE,
But , whatever I did, SE can ONLY found the references on x.h and y.c, even when I used Ctrl+/ on the variable in z.c.
So, who can tell how to do to make SE to find complete references?
If SE even can't do this function rightly, the other too many functions such as rename will be unbelievable, and SE will be the source of producing  software BUGS but not a good programming tool!!!

Overall, I need the method to make SE work rightly.
« Last Edit: July 22, 2010, 02:49:10 am by abcd »

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2891
  • Hero Points: 436
Re: SlickEdit 15.0.0.5 can't find complete references?
« Reply #10 on: July 22, 2010, 05:48:07 pm »
Thanks for the sample from the header file.  What does the code look like in the other files?  The more complete you can make your example, the more likely it will be that we can solve your problem.

abcd

  • Guest
Re: SlickEdit 15.0.0.5 can't find complete references?
« Reply #11 on: July 23, 2010, 01:21:29 am »
OK,
The function in y.c:
static GT_STATUS pirl2DataToResource
(
    IN  GT_QD_DEV           *dev,
    IN  GT_PIRL2_DATA      *pirlData,
    OUT GT_PIRL2_RESOURCE   *res
)
{
   GT_U32 typeMask;
   GT_U32 data;

   gtMemSet((void*)res,0,sizeof(GT_PIRL2_RESOURCE));

   data = (GT_U32)(pirlData->accountQConf|pirlData->accountFiltered|
               pirlData->mgmtNrlEn|pirlData->saNrlEn|pirlData->daNrlEn|
               pirlData->samplingMode);

   if (data > 1)
   {
      DBG_INFO(("GT_BAD_PARAM (Boolean)\n"));
printf("pirl2DataToResource data > 1\r\n");
        return GT_BAD_PARAM;
   }

   if (IS_IN_DEV_GROUP(dev,DEV_RESTRICTED_PIRL2_RESOURCE))
   {
      if (pirlData->samplingMode != GT_FALSE)
      {
         DBG_INFO(("GT_BAD_PARAM (sampling mode)\n"));
printf("GT_BAD_PARAM (sampling mode) data > 1\r\n");
         return GT_BAD_PARAM;
      }
   }

   res->accountQConf = pirlData->accountQConf;
   res->accountFiltered = pirlData->accountFiltered;
   res->mgmtNrlEn = pirlData->mgmtNrlEn;
   res->saNrlEn = pirlData->saNrlEn;
   res->daNrlEn = pirlData->daNrlEn;
   res->samplingMode = pirlData->samplingMode;

   switch(pirlData->actionMode)
   {
      case PIRL_ACTION_ACCEPT:
      case PIRL_ACTION_USE_LIMIT_ACTION:
         res->actionMode = pirlData->actionMode;
         break;
      default:
printf("pirlData->actionMode=%d\r\n", pirlData->actionMode);
         DBG_INFO(("GT_BAD_PARAM actionMode\n"));
         return GT_BAD_PARAM;
   }

   switch(pirlData->ebsLimitAction)
   {
      case ESB_LIMIT_ACTION_DROP:
      case ESB_LIMIT_ACTION_FC:
         res->ebsLimitAction = pirlData->ebsLimitAction;
         break;
      default:
printf("pirlData->ebsLimitAction=%d\r\n", pirlData->ebsLimitAction);
         DBG_INFO(("GT_BAD_PARAM ebsLimitAction\n"));
         return GT_BAD_PARAM;
   }

   switch(pirlData->fcDeassertMode)
   {
      case GT_PIRL_FC_DEASSERT_EMPTY:
      case GT_PIRL_FC_DEASSERT_CBS_LIMIT:
         res->fcDeassertMode = pirlData->fcDeassertMode;
         break;
      default:
         if(res->ebsLimitAction != ESB_LIMIT_ACTION_FC)
         {
            res->fcDeassertMode   = GT_PIRL_FC_DEASSERT_EMPTY;
            break;
         }
         DBG_INFO(("GT_BAD_PARAM fcDeassertMode\n"));
printf("pirlData->fcDeassertMode=%d\r\n", pirlData->fcDeassertMode);
         return GT_BAD_PARAM;
   }

   if(pirlData->customSetup.isValid == GT_TRUE)
   {
      res->ebsLimit = pirlData->customSetup.ebsLimit;
      res->cbsLimit = pirlData->customSetup.cbsLimit;
      res->bktIncrement = pirlData->customSetup.bktIncrement;
      res->bktRateFactor = pirlData->customSetup.bktRateFactor;
   }
   else
   {
      if(pirlData->ingressRate == 0)
      {
         DBG_INFO(("GT_BAD_PARAM ingressRate(%i)\n",pirlData->ingressRate));
printf("pirlData->ingressRate == 0\r\n", pirlData->fcDeassertMode);
         return GT_BAD_PARAM;
      }

      if(pirlData->ingressRate < 1000)   /* less than 1Mbps */
      {
         /* it should be divided by 64 */
         if(pirlData->ingressRate % 64)
         {
            DBG_INFO(("GT_BAD_PARAM ingressRate(%i)\n",pirlData->ingressRate));
printf("pirlData->ingressRate % 64\r\n");
            return GT_BAD_PARAM;
         }
         res->bktRateFactor = pirlData->ingressRate/64;
      }
      else if(pirlData->ingressRate < 10000)   /* less than or equal to 10Mbps */
      {
         /* it should be divided by 1000 */
         if(pirlData->ingressRate % 1000)
         {
            DBG_INFO(("GT_BAD_PARAM ingressRate(%i)\n",pirlData->ingressRate));
printf("pirlData->ingressRate % 1000\r\n");
            return GT_BAD_PARAM;
         }
         res->bktRateFactor = pirlData->ingressRate/128 + ((pirlData->ingressRate % 128)?1:0);
      }
      else if(pirlData->ingressRate < 100000)   /* less than or equal to 100Mbps */
      {
         /* it should be divided by 1000 */
         if(pirlData->ingressRate % 1000)
         {
            DBG_INFO(("GT_BAD_PARAM ingressRate(%i)\n",pirlData->ingressRate));
printf("pirlData->ingressRate % 1000 2\r\n");
            return GT_BAD_PARAM;
         }
         res->bktRateFactor = pirlData->ingressRate/1000;
      }
      else if(pirlData->ingressRate <= 200000)   /* less than or equal to 200Mbps */
      {
         /* it should be divided by 10000 */
         if(pirlData->ingressRate % 10000)
         {
            DBG_INFO(("GT_BAD_PARAM ingressRate(%i)\n",pirlData->ingressRate));
printf("pirlData->ingressRate % 100000 \r\n");
            return GT_BAD_PARAM;
         }
         res->bktRateFactor = pirlData->ingressRate/1000;
      }
      else
      {
         DBG_INFO(("GT_BAD_PARAM ingressRate(%i)\n",pirlData->ingressRate));
printf("GT_BAD_PARAM ingressRate(%i)\r\n", pirlData->ingressRate);
         return GT_BAD_PARAM;
      }

      res->ebsLimit = RECOMMENDED_ESB_LIMIT(dev, pirlData->ingressRate);
      res->cbsLimit = RECOMMENDED_CBS_LIMIT(dev, pirlData->ingressRate);
      res->bktIncrement = RECOMMENDED_BUCKET_INCREMENT(dev, pirlData->ingressRate);
   }

   switch(pirlData->bktRateType)
   {
      case BUCKET_TYPE_TRAFFIC_BASED:
         res->bktRateType = pirlData->bktRateType;

         typeMask = 0x7FFF;

         if (pirlData->bktTypeMask > typeMask)
         {
            DBG_INFO(("GT_BAD_PARAM bktTypeMask(%#x)\n",pirlData->bktTypeMask));
printf("pirlData->bktTypeMask > typeMask \r\n");
            return GT_BAD_PARAM;
         }

            res->bktTypeMask = pirlData->bktTypeMask;

         if (pirlData->bktTypeMask & BUCKET_TRAFFIC_ARP)
         {
            res->bktTypeMask &= ~BUCKET_TRAFFIC_ARP;
            res->bktTypeMask |= 0x80;
         }
         
         if (pirlData->priORpt > 1)
         {
            DBG_INFO(("GT_BAD_PARAM rpiORpt\n"));
printf("pirlData->priORpt > 1)\r\n");
            return GT_BAD_PARAM;
         }

         res->priORpt = pirlData->priORpt;

         if (pirlData->priMask >= (1 << 4))
         {
            DBG_INFO(("GT_BAD_PARAM priMask(%#x)\n",pirlData->priMask));
printf("pirlData->priMask >= (1 << 4)\r\n");
            return GT_BAD_PARAM;
         }

         res->priMask = pirlData->priMask;

         break;

      case BUCKET_TYPE_RATE_BASED:
         res->bktRateType = pirlData->bktRateType;
            res->bktTypeMask = pirlData->bktTypeMask;
         res->priORpt = pirlData->priORpt;
         res->priMask = pirlData->priMask;
         break;

      default:
         DBG_INFO(("GT_BAD_PARAM bktRateType(%#x)\n",pirlData->bktRateType));
printf("GT_BAD_PARAM bktRateType:%d\r\n", pirlData->bktRateType);
         return GT_BAD_PARAM;
   }

   switch(pirlData->byteTobeCounted)
   {
      case GT_PIRL2_COUNT_FRAME:
      case GT_PIRL2_COUNT_ALL_LAYER1:
      case GT_PIRL2_COUNT_ALL_LAYER2:
      case GT_PIRL2_COUNT_ALL_LAYER3:
         res->byteTobeCounted = pirlData->byteTobeCounted;
         break;
      default:
         DBG_INFO(("GT_BAD_PARAM byteTobeCounted(%#x)\n",pirlData->byteTobeCounted));
printf("pirlData->byteTobeCounted=%d\r\n", pirlData->byteTobeCounted);
         return GT_BAD_PARAM;
   }

   return GT_OK;         
}


code in z.c:
GT_STATUS swSetPortTrafficRateLimit2(GT_RATE_LIMIT_MODE traffic_type, GT_U32 ingressRate, GT_U32 port)
{

    GT_STATUS       status = 0;
    GT_PIRL2_DATA    pirlData = {0};
    GT_U32          irlUnit = 0;    /* always use 0 bucket. */
    GT_U32          devId = 0;
    GT_LPORT        port_num_indev = 0;

    if (port >= GT_PORT_MAX)
    {
        return(GT_BAD_PARAM);
    }

    if (ingressRate <= 0 || ingressRate > 200000)
    {
        return GT_BAD_PARAM;
    }

    pirlData.ingressRate        = ingressRate;
    pirlData.accountQConf       = GT_FALSE;
    //pirlData.accountFiltered    = GT_TRUE;
//    pirlData.ebsLimitAction     = ESB_LIMIT_ACTION_FC;
    pirlData.bktRateType        = BUCKET_TYPE_RATE_BASED;
    pirlData.bktTypeMask        = 0xFFF;
    pirlData.byteTobeCounted    = GT_PIRL_COUNT_ALL_LAYER3;

    devId = port/GT_PORT_PER_DEVICE;
    port_num_indev = port%GT_PORT_PER_DEVICE;

    if (devId >= N_OF_QD_DEVICES)
        return  GT_BAD_PARAM;

    sem_wait_ex(&sem_swrw);
    status = gpirl2WriteResource((GT_QD_DEV *)get_qd_dev_p(devId),port_num_indev, irlUnit, &pirlData);
    sem_post_ex(&sem_swrw);

    switch (status)
    {
        case GT_OK:
            SWMGMT_DBG_printf(SWMGMT_DBG_SHELL,"IRL Unit %d is activated rate %dM.\n", irlUnit, ingressRate);
            break;
        case GT_BAD_PARAM:
            SWMGMT_DBG_printf(SWMGMT_DBG_SHELL,"Invalid parameters are given.\n");
            break;
        case GT_NOT_SUPPORTED:
            SWMGMT_DBG_printf(SWMGMT_DBG_SHELL,"Device is not supporting PIRL.\n");
            break;
        default:
            printf("Failure to configure device. status=%d\r\n", status);
            SWMGMT_DBG_printf(SWMGMT_DBG_SHELL,"Failure to configure device.\n");
            break;
    }

    return status;
}

GT_STATUS swGetPortTrafficRateLimit2(GT_U32 *traffic_type, GT_U32 port, GT_U32 *limitRate)
{
    GT_STATUS       status;
    GT_PRI0_RATE      rate;
    GT_RATE_LIMIT_MODE  mode;
    GT_U32 devId;
    GT_U32 port_num_indev;
    GT_PIRL2_DATA pirl_data = {0};

    if (port >= GT_PORT_MAX)
    {
        return(GT_BAD_PARAM);
    }

    if (traffic_type ==NULL || limitRate == NULL)
        return GT_BAD_PARAM;

    devId = port/GT_PORT_PER_DEVICE;
    port_num_indev = port%GT_PORT_PER_DEVICE;  

    if (devId >= N_OF_QD_DEVICES)
        return  GT_BAD_PARAM;

    sem_wait_ex(&sem_swrw);
    status = gpirl2ReadResource((GT_QD_DEV *)get_qd_dev_p(devId),  port_num_indev, 0, &pirl_data);
    if (status != GT_OK)
        SWMGMT_DBG_printf(SWMGMT_DBG_SHELL,"grcGetLimitMode status=%d.\n", status);
    sem_post_ex(&sem_swrw);

    *limitRate = pirl_data.ingressRate;
    return status;
}


Today I try find references by Ctrl+/ on ingressRate        in function swSetPortTrafficRateLimit2(),
SE list the refernces in function swGetPortTrafficRateLimit2 and the structure definition in x.h,.


Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2891
  • Hero Points: 436
Re: SlickEdit 15.0.0.5 can't find complete references?
« Reply #12 on: July 30, 2010, 02:29:29 pm »
I do not see ingressRate defined in the x.h excerpt you sent in.  I added the following to x.h and tested and references worked perfectly.  However, I don't know how you have that struct defined in your code.

typedef struct
{
   GT_U32     ingressRate;
} GT_PIRL2_DATA;


Another question:

Did you save the changes in all files before looking up references?

In Tools > Options > Editing > Context Tagging(R), what settings do you have for:

Tag file on save?                                      (True or False)
Background tagging of open files?                (True or False)
Use background thread when possible?         (True or False)
Background tagging of other files                 (True or False)



abcd

  • Guest
Re: SlickEdit 15.0.0.5 can't find complete references?
« Reply #13 on: August 06, 2010, 03:59:29 am »
Dennis,
Tag file on save?                                      True
Background tagging of open files?              True
Use background thread when possible?         14.02 there's no such option
Background tagging of other files                 True

My workspace is more complicated than a project with the 3 file(x,y,z),there's more than 600 source files and with a tagfiles of 10000+ source file.

The problem appeared after I add the tagfiles of 10000+ source file. You may test SE with a tagfiles of linux kernal of more than 10000 files.