This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: remote XOpenDisplay in Solaris (SunOS 5.6)


>-----Original Message-----
>From: Jerry Miller [mailto:gmiller@cs.sunysb.edu]
>Sent: 23 February 2001 17:28

>I'm not sure what is dynamically linked in terms of object
>modules under UNIX in general or Solaris specifically.
>Any idea of some potential candidates?

  I believe you can probably use the 'ldd' utility to find out which shared
objects an executable needs.  If not, 'man ld.so' might point you in the
right direction.  As I said, though, I'm not expert with shared objects.

>One thing did occur to me.  Do you (or does anyone)
>know whether window managers use ipc and/or rpc
>(interprocess control and remote process control)
>routines in dealing with GUI's and other window
>managers???  And if so, is it possible to create some
>kind of "X-sniffer" on the display host to emulate the
>window manager and intercept X requests?????

  X windows certainly does, it uses straightforward RPC calls over UDP/IP
to communicate between the remote terminal and the X server, and I believe
if they are local to the same machine it will still use RPC sent over the
loopback rather than drop back to local pipes or other IPC.  tcpdump will
sniff packets for you but there is probably some other software you could
find that knows how to interpret X packets and show the commands etc. they
contain.  I'm afraid I don't know what or where though.

>Is this true of straight C code as well, e.g., ordinary static local
>functions?

  Nope, it only applies to static instances of class objects.

>I'm not using C++ at all, so I'd be really surprised if it did 
>anything more automatically than to initialize static and global variables.

  In theory the C runtime library is allowed to do whatever it wants and 
not tell you about it - that's implementation defined behaviour.  There's
no reason why the C runtime library can't be built in C++ internally, and
I rather suspect (because of the way the problem goes away when you remove
symbols from un-called functions in the same file as main) that one of 
your X or Motif libs must have some C++ in it.

>I've never heard Kernighan and Ritchie mention anything about functions 
>starting themselves with no provocation from main()!

  Well, K+R don't have anything to say about how a program gets to the
entry point of main, or what it does before it gets there.  Nor do they
impose any restrictions on it, either.  Things like opening stdin and
stdout and initialising the stdio buffers, zeroing the .bss space, and
more that don't spring to mind right now were all implicitly allowed even
by K+R.  The moral of the story is that there's a lot of dark magic going
on 'under the hood' in most compilers...

      DaveK
-- 
we are not seats or eyeballs or end users or consumers.
we are human beings - and our reach exceeds your grasp.
                    deal with it.                      - cluetrain.org 


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]