public inbox for
 help / color / mirror / Atom feed
From: Syd Polk <>
To: "Salman Khilji" <>,
	"''" <>
Subject: Re: Want Help with Source Navigator source code
Date: Mon, 30 Jul 2001 09:40:00 -0000	[thread overview]
Message-ID: <> (raw)

Salman Khilji wrote:

>I wanted some help with the source code of the Source Navigator.  Usually,
>the developers and maintainers do not like to be sent direct e-mails.  Their
>e-mail addresses are:
>Syd Polk

Hmm. I should change this. I no longer work at Red Hat.

>Ian Roxborough
>Mo DeJong
>If this is appropriate to ask, could you please forward this e-mail to them?
>If not, can you please tell me who I need to contact in order to get some
>help on this issue.  Here is my question:
>I am developing a debugger type application for C/C++/FORTRAN (not exactly a
>source line debugger).  I need access to the complete symbol table of the
>target application.  This requires me to parse the source code of the
>application and build a complete symbol table.  For example, I will parse
>the source code and determine the type of each symbol.  For example, if a
>given symbol is a structure, what are the structure members?  What is the
>type of each structure member?  Ok, if a given symbol is an array, what kind
>of an array is it?  What is its dimension?  Is it a multiple dimension
>array?  If a given symbol is a pointer, is it pointing to a structure, a
>float, etc?  Do I have an array of structures, pointers to structures etc

Usually, compilers generate this information and encode it into the 
executable. The debugger knows to look at the section in the executable 
and load the symbol table that way. There are all sorts of complications 
arising from shared libraries, etc.

gcc and the fsf Fortran compiler both generate this information in much 
more detail than Source-Navigator, and in a more compact form. I would 
investigate using gcc for this before using the Source-Navigator parsers. 
Source-Navigator's Fortran parser, for instance, is code that has not 
been actively maintained in several years. In C, you are going to have 
problems with local variables. I would also investigate gcc's debugging 
formats, STABS and DWARF2. In particular, DWARF2 has recently been 
updated to be much more robust with C++.

>For this purpose, I need to have a parser for C, C++, and FORTRAN.  I have
>downloaded the source code of Source Navigator.  I feel that I can somehow
>extract the parsing specific code out of it and use it for my application.
>The source code that I found was under the snavigator/parsers folder.
>However, given the size of all the code out there, it would be hard for me
>to dig into the code and find out how my main function should look like to
>build a symbol table.  I'd suppose that the maintainers would know somewhat
>about it and would have some sort of idea as to where and how the parsers
>are used.  If you could give me pointers to where I need to look at the code
>to extract parsing specific code, this would give me a great jump start.  Is
>there a design documentation available that I can go through and find out
>how each block of the software is put together?
>Could I ask a maintainer of Source Navigator for this favor?

If you really wish to use SN for this purpose, and I don't recommend it, 
I would read the SDK documentation. It details how to get symbols out of 
Source-Navigator's database using Tcl or C.

Another reason not to use SN: Right now, SN requires a GUI, even when 
building a project.

             reply	other threads:[~2001-07-30  9:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-30  9:40 Syd Polk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-07-30  6:30 Salman Khilji
2001-07-30 14:04 ` Mo DeJong

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* 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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).