public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
* Re: Want Help with Source Navigator source code
@ 2001-07-30  9:40 Syd Polk
  0 siblings, 0 replies; 3+ messages in thread
From: Syd Polk @ 2001-07-30  9:40 UTC (permalink / raw)
  To: Salman Khilji, 'sourcenav@sources.redhat.com'

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		spolk@redhat.com

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

>Ian Roxborough		irox@redhat.com
>Mo DeJong		mdejong@redhat.com
>
>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:
>
>NEED HELP WITH SOURCE CODE PARSING
>==================================
>
>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
>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.

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

* Re: Want Help with Source Navigator source code
  2001-07-30  6:30 Salman Khilji
@ 2001-07-30 14:04 ` Mo DeJong
  0 siblings, 0 replies; 3+ messages in thread
From: Mo DeJong @ 2001-07-30 14:04 UTC (permalink / raw)
  To: sourcenav

On Mon, 30 Jul 2001, 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:

...

> If this is appropriate to ask, could you please forward this e-mail to them?

SN questions should be sent to the mailing list. Emails sent directly
to me often end up in the trash.

> NEED HELP WITH SOURCE CODE PARSING
> ==================================
> 
> 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.

It sounds like you want to hack GDB to do this sort of thing. SN is
more suited to static code analysis. SN is not a debugger so it does
not have access to some of the runtime info you might be interested in.

cheers
Mo

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

* Want Help with Source Navigator source code
@ 2001-07-30  6:30 Salman Khilji
  2001-07-30 14:04 ` Mo DeJong
  0 siblings, 1 reply; 3+ messages in thread
From: Salman Khilji @ 2001-07-30  6:30 UTC (permalink / raw)
  To: 'sourcenav@sources.redhat.com'

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		spolk@redhat.com
Ian Roxborough		irox@redhat.com
Mo DeJong		mdejong@redhat.com

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:

NEED HELP WITH SOURCE CODE PARSING
==================================

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
etc.

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?


Salman

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

end of thread, other threads:[~2001-07-30 14:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-30  9:40 Want Help with Source Navigator source code Syd Polk
  -- strict thread matches above, loose matches on Subject: below --
2001-07-30  6:30 Salman Khilji
2001-07-30 14:04 ` 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).