Brian Utterback
2005-Aug-12 14:10 UTC
[dtrace-discuss] Got the offset for instructions, now need offsets for structures.
I found a useful tool to do the disassembly and printing the line numbers. The tool is er_src, ships with Sun Studio 10. The great thing about it is that it prints the linenumbers and embeds the source, but it also prints the disassembled code, not the assembler input, so it corresponds exactly to the code. The only trouble is that I cannot get it to print just a single function and the offsets within that function, although the man page indicates that it should be able to do this. If anybody is familiar with it and knows how to do this, let me know. Now, my current problem is printing structs. I have a pointer to a rather complex struct and I want to print certain fields within it. I tried including the .h files needed, but ran into some difficulties. I think I might be able to work those out but I was wondering if there isn''t a better way. Now, I know that dtrace does not yet understand CTF data, but I thought that I might be able to use ctfdata myself to figure out the proper offsets. Could I run the ctftools while I build my program and then dump the info and find the symbols I am looking for and use them to get the offsets I need? I cannot find any documentation what ever on ctf, so if this is possible, how do I do it? Thanks for your help. -- blu Remember when SOX compliant meant they were both the same color? ---------------------------------------------------------------------- Brian Utterback - OP/N1 RPE, Sun Microsystems, Inc. Ph:877-259-7345, Em:brian.utterback-at-ess-you-enn-dot-kom
Marty Itzkowitz
2005-Aug-17 16:11 UTC
[dtrace-discuss] Got the offset for instructions, now need offsets for structures.
It''s a bug in er_src -- I filed 6312279 for it. P3, and I don''t know whether or not it''s too late to fix for Studio 11 -- the new name for Venus, the current release to be FCS''d shortly. Marty Brian Utterback wrote:> I found a useful tool to do the disassembly and printing the > line numbers. The tool is er_src, ships with Sun Studio 10. > The great thing about it is that it prints the linenumbers and > embeds the source, but it also prints the disassembled code, > not the assembler input, so it corresponds exactly to the code. > The only trouble is that I cannot get it to print just a single > function and the offsets within that function, although the man > page indicates that it should be able to do this. If anybody > is familiar with it and knows how to do this, let me know. > > Now, my current problem is printing structs. I have a pointer > to a rather complex struct and I want to print certain fields > within it. I tried including the .h files needed, but ran into > some difficulties. I think I might be able to work those out > but I was wondering if there isn''t a better way. > > Now, I know that dtrace does not yet understand CTF data, but I > thought that I might be able to use ctfdata myself to figure > out the proper offsets. > > Could I run the ctftools while I build my program and then > dump the info and find the symbols I am looking for and > use them to get the offsets I need? I cannot find any documentation > what ever on ctf, so if this is possible, how do I do it? > > Thanks for your help. >