public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
* Re: SN and C Struct's
@ 2000-08-04  0:35 dave.banham
  2000-08-04  5:54 ` Mo DeJong
  0 siblings, 1 reply; 6+ messages in thread
From: dave.banham @ 2000-08-04  0:35 UTC (permalink / raw)
  To: sourcenav

Mo,
For what you indicate this sounds like you are suggesting that the C/C++ parser
needs modification so that it classifies/processes C struct's and typedef's
differently. Has the parser not collected sufficient information already and it
is 'simply' (nothing is ever simple!) a matter of modifying the hierarchy and
class browsers?

Will both the parser and the browsers need modification?

This sounds like 'hairy' stuff for an absolute tcl/tk beginner!!!

Regards
Dave Banham



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SN and C Struct's
  2000-08-04  0:35 SN and C Struct's dave.banham
@ 2000-08-04  5:54 ` Mo DeJong
  0 siblings, 0 replies; 6+ messages in thread
From: Mo DeJong @ 2000-08-04  5:54 UTC (permalink / raw)
  To: sourcenav

On Fri, 4 Aug 2000 dave.banham@tde.alstom.com wrote:
 
> Mo,
> For what you indicate this sounds like you are suggesting that the C/C++ parser
> needs modification so that it classifies/processes C struct's and typedef's
> differently. Has the parser not collected sufficient information already and it
> is 'simply' (nothing is ever simple!) a matter of modifying the hierarchy and
> class browsers?

If the parser is reading your code properly, that you should not
have to change it. I don't know if it is working correctly
in the case you describe, you will have to look at the
xref files in the DB to figure that out.

You can use dbdump (from the sn/bin dir) to print out
lots of info from the DB.

Here is an quick dump of the to refs in a small DB.

% cat f1.c 
int func1(int i) { return 0; }

% cat f2.c 
int func2(int i) { return func1(0); }

int funcu() {};
% dbdump .snprj/foo.by
# func1 fu # func2 fu r 000001 f2.c;{int} {int}

% dbdump .snprj/foo.to 
# func2 fu # func1 fu r 000001 f2.c;{int} {int}


> Will both the parser and the browsers need modification?
> 
> This sounds like 'hairy' stuff for an absolute tcl/tk beginner!!!

If the parser is getting all the info you need, then you can
ignore it and just focus on the browser bits. Trust me, you are
a lot better off writing Tcl code compared to spelunking
around in the parser source.

Mo DeJong
Red Hat Inc

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SN and C Struct's
  2000-08-06  9:49   ` Carl C. Petersen
@ 2000-08-06 13:14     ` Mo DeJong
  0 siblings, 0 replies; 6+ messages in thread
From: Mo DeJong @ 2000-08-06 13:14 UTC (permalink / raw)
  To: sourcenav

> Out of curiosity how have you set up SN for SN. Is it all one project
> or have you broken out the components into sub projects?
> 
> -carl

All in one big project. That makes it really easy to jump around
from SN Tcl code, to SN C code, to Tcl C code, to Itcl C code, you
get the idea. I also tend to have a copy of Tcl 8.3 sitting in
its own project so that I can compare Tcl 8.1 C code to the new
version.

Mo DeJong
Red Hat Inc

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SN and C Struct's
  2000-08-03 20:01 ` Mo DeJong
@ 2000-08-06  9:49   ` Carl C. Petersen
  2000-08-06 13:14     ` Mo DeJong
  0 siblings, 1 reply; 6+ messages in thread
From: Carl C. Petersen @ 2000-08-06  9:49 UTC (permalink / raw)
  To: sourcenav

Mo DeJong wrote:
> 
> On Thu, 3 Aug 2000 dave.banham@tde.alstom.com wrote:
> 
> > Dear all,
> > I am about to make some suggestions for some improvements to SN4.5.1, but
> > thought it best to make my introductions first.
> 
> Hi Dave.
> 
> > I am a senior software engineer in the UK working for a large engineering
> > Company. The products that I am involved with have a reasonably large code base
> > of around 400KLOC, most of which is C with a small amount of assembler. All of
> > this is embedded with a real time operating system, which is partly why we
> > haven't yet made the move to C++, and developed on Win NT4 workstations with
> > Clear Case CM. It is also worth noting that the software is partitioned into a
> > number of distinct sections, each in its own Clear Case VOB (that is root
> > folder), which are maintained by distinct groups of engineers and used by
> > several projects/products.
> 
> To be honest, the clear case support is not that well tested, so it
> will be nice to have someone pounding on it.
> 
> ... (long list of bugs) ...
> 
> > I have had a quick look through the SN SDK manual. It is not very obvious where
> > to even start such customisations, and since I am not a TCL/TK programmer it is
> > difficult to know where to start. Moreover, it sounds like setting up a MS VC++
> > 5 build of SN is going to be a little tricky. Does any one have any suggestions?

< snip >

> 
> If you want to hack on SN itself, be sure to run it like so:
> 
> ./snavigator --debug 9
> 
> That will print lots of info about what SN is doing
> to the terminal. It is a good way to find out what is going
> on. Don't forget, you can use SN on SN. It is a bit more tricky
> because you will be working on more than one language (Tcl and C),
> but it works real nice.
> 

Out of curiosity how have you set up SN for SN. Is it all one project
or have you broken out the components into sub projects?

-carl

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SN and C Struct's
  2000-08-03  3:52 dave.banham
@ 2000-08-03 20:01 ` Mo DeJong
  2000-08-06  9:49   ` Carl C. Petersen
  0 siblings, 1 reply; 6+ messages in thread
From: Mo DeJong @ 2000-08-03 20:01 UTC (permalink / raw)
  To: sourcenav

On Thu, 3 Aug 2000 dave.banham@tde.alstom.com wrote:

> Dear all,
> I am about to make some suggestions for some improvements to SN4.5.1, but
> thought it best to make my introductions first.

Hi Dave.

> I am a senior software engineer in the UK working for a large engineering
> Company. The products that I am involved with have a reasonably large code base
> of around 400KLOC, most of which is C with a small amount of assembler. All of
> this is embedded with a real time operating system, which is partly why we
> haven't yet made the move to C++, and developed on Win NT4 workstations with
> Clear Case CM. It is also worth noting that the software is partitioned into a
> number of distinct sections, each in its own Clear Case VOB (that is root
> folder), which are maintained by distinct groups of engineers and used by
> several projects/products.

To be honest, the clear case support is not that well tested, so it
will be nice to have someone pounding on it.

... (long list of bugs) ...

> I have had a quick look through the SN SDK manual. It is not very obvious where
> to even start such customisations, and since I am not a TCL/TK programmer it is
> difficult to know where to start. Moreover, it sounds like setting up a MS VC++
> 5 build of SN is going to be a little tricky. Does any one have any suggestions?


Learning Tcl/Tk part is the going to be the most simple part of this
task. There are lots or Tcl/Tk resources on the web.

http://dev.scriptics.com/scripting/
http://starbase.neosoft.com/~claird/comp.lang.tcl/

You could also subscribe to the comp.lang.tcl newsgroup, there
are lot of helpful folks on that newsgroup. You will
be able to ask questions without getting flamed like on
some other scripting language newsgroups.

After that, you will need to learn how to parsers work. This
is by far the least fun, unless you like parsers. The SDK
does an good job with the basics.

If you want to hack on SN itself, be sure to run it like so:

./snavigator --debug 9

That will print lots of info about what SN is doing
to the terminal. It is a good way to find out what is going
on. Don't forget, you can use SN on SN. It is a bit more tricky
because you will be working on more than one language (Tcl and C),
but it works real nice.

Mo DeJong  
Red Hat Inc

^ permalink raw reply	[flat|nested] 6+ messages in thread

* SN and C Struct's
@ 2000-08-03  3:52 dave.banham
  2000-08-03 20:01 ` Mo DeJong
  0 siblings, 1 reply; 6+ messages in thread
From: dave.banham @ 2000-08-03  3:52 UTC (permalink / raw)
  To: sourcenav

Dear all,
I am about to make some suggestions for some improvements to SN4.5.1, but
thought it best to make my introductions first.

I am a senior software engineer in the UK working for a large engineering
Company. The products that I am involved with have a reasonably large code base
of around 400KLOC, most of which is C with a small amount of assembler. All of
this is embedded with a real time operating system, which is partly why we
haven't yet made the move to C++, and developed on Win NT4 workstations with
Clear Case CM. It is also worth noting that the software is partitioned into a
number of distinct sections, each in its own Clear Case VOB (that is root
folder), which are maintained by distinct groups of engineers and used by
several projects/products.

I have recently taken on an existing project and have the dubious job of
supporting and extending the software. This is where SN comes in. I had
previously purchased the SN99r1 Developer Edition, but found that I could not
use it fully on this project due to its 250KLOC limit. Thankfully the full
enterprise edition has been made Open Source, so I no longer have to go begging
to my manager for some money!

I have found SN to be extremely useful and use it most with the Retriever -
Editor window to locate symbols in the code base. I would also like to use the
XREF and Class views to visualise and navigate the convoluted relationships in
the software's data structures (i.e. C struct's). This is where I find that SN
is, err, deficient.

1. The Hierarchy Browser does not draw graphs of C struct's (or typedef'd
struct's).
2. Class Browser only shows the contents of the specified struct and not of any
embedded or referred (i.e. via a pointer) struct's (i.e. augmented). Moreover,
it will not show typedef'd structures unless a structure tag name is used, e.g.
typedef struct mystruct_tag {int a; int b;} mystruct; only 'mystruct_tag' works
in Class Browser and most typedef struct declarations do not provide a tag name.
3. The Xref Browser only appears to show what symbols are used by a function and
not what functions use it - the 'refers by' option is disabled. It would be very
useful to know what functions use a given symbol.
4. If SN has a complete database of all symbol references, then why is the grep
tool the only way of finding all references to a symbol in the code base? Could
the Retriever tool have an option to display all instances, rather than just the
declaration of the symbol.

I have had a quick look through the SN SDK manual. It is not very obvious where
to even start such customisations, and since I am not a TCL/TK programmer it is
difficult to know where to start. Moreover, it sounds like setting up a MS VC++
5 build of SN is going to be a little tricky. Does any one have any suggestions?

Best Regards
Dave Banham




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-08-06 13:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-04  0:35 SN and C Struct's dave.banham
2000-08-04  5:54 ` Mo DeJong
  -- strict thread matches above, loose matches on Subject: below --
2000-08-03  3:52 dave.banham
2000-08-03 20:01 ` Mo DeJong
2000-08-06  9:49   ` Carl C. Petersen
2000-08-06 13:14     ` Mo DeJong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).