You can try a couple of things 1. Compile a newer gdb. gdb has undergone a large number of fixes in handling of section addresses as well as debug info.
2. Uninitialized data is placed in .bss. If you initialize those global variables in definitions, you'll find that they go into .data. This will get around the problem of gdb not being able to locate variables in .bss (Only a work around, this doesn't fix any problems). -Amit On Monday 04 September 2006 18:57, Surya Santosh Kumar Allena wrote: > Hi, > I have a problem with resolving addresses of global variables while using > KGDB for debugging modules. > I am using RedHat 9 and KGDB version 1.6. GDB Version used is 6.0 > > The required module to be debugged is insmoded. getsyms.sh is executed on > the executable file . It is noted that the output does not contain the > address of BSS. i.e, the output of this is something like > > add-symbol-file mymodule.o 0xc8930060 -s .rodata 0xc8c17960 -s .bss 0x -s > .data 0xc8d2b560 > Note that the address of BSS section is null, i.e not filled. > > add-symbol-file command is pasted in GDB. I am able to keep break-points on > the functions and everything is fine except the Global variables which > are stored in BSS are not accessible. Whenever i try to print the address > of any global variable(stored in BSS), gdb always prints the starting > address of the text Segment.(In this case 0xc8930060 is printed) > > I obtained the starting address of BSS by giving -m option while doing > insmod. I supplied this address to add-symbol-file , but the effect is > same. add-symbol-file mymodule.o 0xc8930060 -s .rodata 0xc8c17960 -s > .bss 0xc8d33ee0 -s .data 0xc8d2b560 > Addresses of all the global variables is being shown as the start of text > segment. > > Please help me in sorting out this issue. > > Thanks in Advance > Regards > Surya Santosh ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Kgdb-bugreport mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport
