Author Topic: static symbols from C files  (Read 6642 times)

Offline niraj

  • Single posting newcomer
  • *
  • Posts: 6
static symbols from C files
« on: May 06, 2011, 06:49:22 am »
Hi all,
        Is it possible to display static symbols from current file in symbol table? Also, can I split symbol table in 2 toolbars, one showing symbols from whole project while other showing symbols from active file?


Thanks
Niraj

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: static symbols from C files
« Reply #1 on: May 06, 2011, 06:52:09 am »
what does static symbol means???
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline niraj

  • Single posting newcomer
  • *
  • Posts: 6
Re: static symbols from C files
« Reply #2 on: May 06, 2011, 06:54:04 am »
Sorry for first question. Actually I wanted static variables/functions displayed, but it turns out they are already shown in symbol table.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: static symbols from C files
« Reply #3 on: May 06, 2011, 08:09:25 am »
Sorry for first question. Actually I wanted static variables/functions displayed, but it turns out they are already shown in symbol table.
you mean show static functions/variables in symbol browser??? or some other place.
So, what it the expect behavior, can you give a more detailed description? I can't understand your feature request, sorry.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline niraj

  • Single posting newcomer
  • *
  • Posts: 6
Re: static symbols from C files
« Reply #4 on: May 07, 2011, 07:03:36 am »
Sorry for confusion. Actually I would like to have a symbol browser more like Geany. So rather than selecting every time from symbol table drop down menu, can I have symbol browser divided in 2 parts. Upper part showing global symbol (from whole project) whereas lower part showing symbols in local file. Also it would be great to show all symbols by type than choosing them from drop down menu (again more like Geany).

Another question I would like to ask, is there any usage indicator for given symbol (eg varibale) ie, if i click a variable, is it possible to find all occurrences in current file or whole project?

I apologize for bringing diverse topics in single post.

Thanks
Niraj

ahmed_az

  • Guest
Re: static symbols from C files
« Reply #5 on: May 09, 2011, 09:42:21 pm »
Dear Niraj and Ollydbg,

The question asked about splitting static symbol is also one of my concerns. I am really confused how to do it.Ollydbg is trying a lot to explain but still it is confusing.

I think we must concern some of our more Senior and experience field men,may be we understand from their point of view.

What you both say?

Let me know
« Last Edit: May 09, 2011, 09:44:33 pm by ahmed_az »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: static symbols from C files
« Reply #6 on: May 10, 2011, 03:02:18 pm »
ahmed_az and niraj:
I review your posts, and I'm still confused about what's the expect way to show "symbols". I have visit the geany site to see some screenshot of geany: http://www.geany.org/Documentation/Screenshots
In its left panel, there are three tabs: symbols, documents, files. Look at the symbols tab, it seems it only show some functions.
see:

Can you give us a screen shot to demonstrate your idea?
BTW: if you use c++ language, I think we usually do not need a lot of static variables and global variables. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline niraj

  • Single posting newcomer
  • *
  • Posts: 6
Re: static symbols from C files
« Reply #7 on: May 11, 2011, 06:23:32 pm »
I've pasted an image of my concept at http://imagepaste.nullnetwork.net/viewimage.php?id=2224 (sorry for poor editing)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: static symbols from C files
« Reply #8 on: May 12, 2011, 03:32:31 am »
I've pasted an image of my concept at http://imagepaste.nullnetwork.net/viewimage.php?id=2224 (sorry for poor editing)
Ok, from this image, I can see it shows all the global functions.
Quote
  Is it possible to display static symbols from current file in symbol table? Also, can I split symbol table in 2 toolbars, one showing symbols from whole project while other showing symbols from active file?
But what you want is you want two tabs "global variable" tab and "static variables in current file" tab.
So, where is the later one. you image seems only show the first one.
Am I right?

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline niraj

  • Single posting newcomer
  • *
  • Posts: 6
Re: static symbols from C files
« Reply #9 on: May 12, 2011, 06:45:18 pm »
Actually the symbols shown are local to file (please forget whatever I had said abt static variables. They are shown anyways in symbol table), and the box named Global Variables should have global symbols(not only global variables from current file, but from all files in current project) . So it's vertical  division of symbol table window, with upper half containing local symbols (actually shown in figure as symbols) and lower half containing global symbols (only represented as an empty box labeled Global Variables ). Currently what we have is a drop down list, from which we have to select whether we want local or global symbols.

I am pasting one more image. http://imagepaste.nullnetwork.net/viewimage.php?id=2228


Thanks
Niraj

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: static symbols from C files
« Reply #10 on: May 13, 2011, 08:50:00 am »
Ok, you image another pic by Niraj show much clear idea.

Quote
Currently what we have is a drop down list, from which we have to select whether we want local or global symbols.
Yes, currently, CC show this way, but I'm quite convenient about this way.
Have you ever see the Codecompletion's toolbar? it always show the local symbols(mostly functions) of the current file. So, I think you can let the symbol browser showing the global symbols, then view the local symbols of the current file through Codecompletion's toolbar. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline niraj

  • Single posting newcomer
  • *
  • Posts: 6
Re: static symbols from C files
« Reply #11 on: May 13, 2011, 03:21:41 pm »
Thanks for response.
Is it feasible to modify code by myself for this feature? Will it be trivial or too complex?

Thanks
Niraj

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: static symbols from C files
« Reply #12 on: May 15, 2011, 10:58:00 am »
Thanks for response.
Is it feasible to modify code by myself for this feature? Will it be trivial or too complex?

Thanks
Niraj
From my point of view, modifying the cc's source code on symbol browser is like building a wxWidgets tree structure.
Did you familiar with the source?
It is mostly here:
src\plugins\codecompletion\classbrowserbuilderthread.cpp

You can try to read it and check whether it is difficult for you. :D

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.