On Wed, 29 Oct 2008, Jonny Taylor wrote: > This is probably a basic question, but I can't find any information in > the docs or through web searches. How can I get cachegrind to annotate > my code at the instruction level when the source is C code? I can get > C code annotated at source level, and the docs describe how to get > assembly code annotated at instruction level, but can't work out how > to get an instruction-level annotation for what was originally C code.
What would the annotated code look like? I think you'll just have to annotate the assembly code, and then mentally map that back to the C code. > The instructions in the docs suggest: > as --gstabs foo.s > This seems to be intended for assembly source; if I generate an > assembly file from my C source and then use this command, with debug > symbols disabled when doing the disassembly, cg_annotate reports ??? > for the filename and I can't persuade it to do any annotation. If I > enable debug symbols when doing the disassembly, I can get cg_annotate > to give me source-level annotation, but still no instruction-level > annotation. I'm confused by some of your terminology, particularly "disassembly", as in "with debugs symbols disabled when doing the disassembly". BTW, you might find "gcc -g foo.s" works better than "as --stabs foo.s". Nick ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Valgrind-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/valgrind-users
