[Search for users]
[Overall Top Noters]
[List of all Conferences]
[Download this site]
| Title: | Digital Ladebug debugger | 
|  | 
| Moderator: | TLE::LUCIA | 
|  | 
| Created: | Fri Feb 28 1992 | 
| Last Modified: | Fri Jun 06 1997 | 
| Last Successful Update: | Fri Jun 06 1997 | 
| Number of topics: | 969 | 
| Total number of notes: | 3959 | 
868.0. "shared libraries aren't seamless enough" by ADA9X::BRETT () Wed Mar 05 1997 16:04
The following demonstrates that shared libraries aren't as seamless
as one would like.  Since we want to teach customers to use shared libraries
to reduce link-time overhead, we should make the shared/non-shared case
as similar as possible.
In the following, that means that once you decide you can't resolve a 
symbol in the current executable, you should start lookig in the rest
before giving up.
/Bevin
0.csh
-----
rm a.out* *.o* so_locations *.so
$CEXE/deccxx_driver -g -shared -rpath . -o eg_a.so eg_a.cxx
$CEXE/deccxx_driver -o a.out1 -g eg_a.so  eg_b.cxx
$CEXE/deccxx_driver -o a.out2 -g eg_a.cxx eg_b.cxx
ln -s eg.dbxinit .dbxinit
ladebug a.out1
ladebug a.out2
rm .dbxinit
 
eg.dbxinit
----------
stop in BASE_trigger
stop in DERIVED_trigger
run
p bb,dd,b
cont
p bb,dd,b,d
quit
eg.h
----
void BASE_trigger   (int &b);
void DERIVED_trigger(int &d);
eg_a.cxx
--------
#include "eg.h"
int dd;
void BASE_trigger(int &b){
    b++;
    DERIVED_trigger(dd);
}
eg_b.cxx
--------
#include "eg.h"
int bb;
void DERIVED_trigger(int &d){
    d;
}
int main()
{
    BASE_trigger(bb);
    return 0;
}
% source 0.csh
--------------
rm: a.out: No such file or directory
ld:
Warning: Unresolved:
DERIVED_trigger(int&)
eg_a.cxx:
eg_b.cxx:
Welcome to the Ladebug Debugger Version 4.0-31
------------------
object file name: a.out1    	    	    	    	    SHARED LIBRARY FORM
Reading symbolic information ...done
[#1: stop in void BASE_trigger(int&) ]
[#2: stop in void DERIVED_trigger(int&) ]
[1] stopped at [void BASE_trigger(int&):6 0x3ffbfff1ca4]
      6     b++;
Symbol bb not visible in current scope.     	    	    bb should be
visible
Error: no value for bb
0 0
[2] stopped at [void DERIVED_trigger(int&) 0x1200021b4]
1 Symbol dd not visible in current scope.
Error: no value for dd	    	    	    	    	    dd should be
visible
Symbol b not visible in current scope.
Error: no value for b
0
Welcome to the Ladebug Debugger Version 4.0-31
------------------  	    	    	    	    	    NONSHARED FORM
object file name: a.out2
Reading symbolic information ...done
[#1: stop in void BASE_trigger(int&) ]
[#2: stop in void DERIVED_trigger(int&) ]
[1] stopped at [void BASE_trigger(int&):6 0x1200021c4]
      6     b++;
0 0 0	    	    	    	    	    	    	    bb is visible
[2] stopped at [void DERIVED_trigger(int&) 0x120002204]
1 0 Symbol b not visible in current scope.  	    	    dd is visible
Error: no value for b
0
| T.R | Title | User | Personal Name
 | Date | Lines | 
|---|