Commit Graph

32 Commits

Author SHA1 Message Date
0cf636d8fe Add a cache of the text section.
2006-10-08  Soren Sandmann  <sandmann@redhat.com>

	* elfparser.c (struct ElfParser): Add a cache of the text section.

	* binparser.c (struct BinParser): Add a cache of a bin record to
	get rid of malloc()/free() overhead.

	* elfparser.c (struct ElfSym): Cache the size of the symbol
2006-10-08 20:14:25 +00:00
86810e63a5 Remove now unused load-address heuristic
2006-10-08  Soren Sandmann <sandmann@redhat.com>

	* elfparser.c: Remove now unused load-address heuristic

	* comment out debug spew
2006-10-08 18:50:10 +00:00
a91a19887a Use "SHT_DYNSYM" for ".dynsym".
2006-10-08  Soren Sandmann <sandmann@redhat.com>

	* elfparser.c (read_symbols): Use "SHT_DYNSYM" for ".dynsym".
2006-10-08 18:09:17 +00:00
c27e5debc5 Support _debuglink recursions.
2006-10-08  Soren Sandmann <sandmann@daimi.au.dk>

	* binfile.c (find_separate_debug_file): Support _debuglink
	recursions.

	* elfparser.c: Check that the sections have valid types before
	using them.
2006-10-08 17:45:09 +00:00
29a4acaa94 Delete debug spew 2006-10-08 04:07:18 +00:00
52274fadd6 Deal with address offsets. Address lookup is now:
2006-10-07  Soren Sandmann  <sandmann@daimi.au.dk>

	Deal with address offsets. Address lookup is now:

	- First convert the address to an offset into the file
	- Then convert to an offset into the text segment
	- Then add the load address of the text segment (found in the
	debug binary)
	- Then finally lookup the result in the symbol table.

	* elfparser.c (elf_parser_get_text_offset): New function

	* elfparser.c (elf_parser_lookup_symbol): Treat addresses as
	offsets into the text segment.

	* binfile.c (bin_file_new): Store the offset of the text section
	of the actual binary (not the debug one)

	(bin_file_lookup_symbol): Subtract text_offset before passing
	address to elf parser.

	* module/sysprof-module.c: Remove include of linux/config.h
2006-10-08 04:03:02 +00:00
8f4d731788 Revert accidental commit 2006-09-23 00:57:20 +00:00
b7cf5d34b8 Remove old commented out code
2006-08-27  Soren Sandmann <sandmann@redhat.com>

	* binparser.c: Remove old commented out code

2006-08-27  Soren Sandmann  <sandmann@redhat.com>

	* module/Makefile ($(MODULE).o): Add dependency on sysprof-module.h

	* elfparser.c (elf_parser_get_eh_frame): Add this function.
	Remove some commented out code.
2006-09-23 00:54:01 +00:00
4a145a21bc Rename elf_sym_get_* to elf_parser_get_sym_* and make these functions take
2006-08-21  Soren Sandmann <sandmann@redhat.com>

	* elfparser.[ch]
	(elf_parser_get_sym_name): Rename elf_sym_get_* to
	elf_parser_get_sym_* and make these functions take a parser.
	(parser_from_sym): Delete this function.
	(elf_parser_new): Don't add to all_elf_parsers
	(elf_parser_free): Don't remove from all_elf_parsers
	(elf_parser_new): Rename to parser_new_from_file()
	(elf_parser_new_from_file): Rename to elf_parser_new

	* binfile.c: Update for new elfparser API

	* TODO: updates
2006-08-22 04:19:08 +00:00
bb616fd754 Add ref_count and filename (bin_files): Add map from filenames to BinFiles
2006-08-21  Soren Sandmann <sandmann@redhat.com>

	* binfile.c (struct BinFile): Add ref_count and filename
	(bin_files): Add map from filenames to BinFiles
	(bin_file_new): First look for BinFile in the cache.
	(bin_file_free): If refcount reaches 0, remove BinFile from cache.

	* TODO: Updates
2006-08-22 03:26:57 +00:00
a1bddd8d9f Pass map->bin_file to bin_symbol_get_name.
2006-08-21  Soren Sandmann <sandmann@redhat.com>

	* process.c (process_lookup_symbol): Pass map->bin_file to
	bin_symbol_get_name.

	* binfile.h (bin_symbol_get_name): Add BinFile parameter

	* elfparser.c (elf_demangle): Use options DMGL_PARAMS | DMGL_ANSI

	* TODO: Updates

	* binfile.c: Rewrite this file to use ElfParser instead of libbfd.

	* configure.ac: Drop dependencies on libbfd and libiberty.
2006-08-21 06:00:57 +00:00
a880ee7f60 Make process_lookup_symbol() return a string. Delete
2006-08-20  Soren Sandmann  <sandmann@daimi.au.dk>

	* process.h: Make process_lookup_symbol() return a string. Delete
	process_lookup_symbol_with_filename().

	* process.c (struct Process): Make "undefined" a string
	(lookup_kernel_symbol): Return a string
	(process_lookup_symbol): Return a string, not a symbol

	* collector.c (unique_dup): Take a string instead of a
	Symbol.
	(lookup_symbol): Make sym a string instead of a Symbol.

	* binfile.c (bin_symbol_get_name): New function.

	* binfile.[ch] (struct BinSymbol): Rename Symbol to BinSymbol and
	make it an opaque structure.

	* binfile.[ch]: Remove unused symbol operations
2006-08-21 02:33:38 +00:00
6c7afad3ff New file, made out of files from libiberty in binutils.
2006-08-20  Soren Sandmann  <sandmann@redhat.com>

	* Makefile.am, demangle.c: New file, made out of files from
	libiberty in binutils.

	* binfile.c: Use the new sysprof_cplus_demangle() function

	* elfparser.[ch]: Add code to lookup symbols. Add demangling
	function

	* testelf.c: Various tests
2006-08-20 04:32:12 +00:00
ebb7728768 Check that the inodes match.
Fri Mar  3 22:28:03 2006  Soeren Sandmann  <sandmann@redhat.com>

        * process.c (process_lookup_symbol): Check that the inodes match.

        * binfile.c (read_symbols): Read the inode of the file

        * binfile.c (read_symbols): Close the bfd if the symbol table
        could not be read.
2006-03-04 03:28:26 +00:00
22d05ac014 Updates
Sun Sep  4 19:38:51 2005  Soeren Sandmann  <sandmann@redhat.com>

	* TODO: Updates
2005-09-04 23:38:40 +00:00
509d5f07ed Fix some warnings.
Mon Aug 15 20:39:11 2005  Soeren Sandmann  <sandmann@redhat.com>

        * binfile.c, process.c, profile.c: Fix some warnings.
2005-08-16 00:40:26 +00:00
775a1e3c5d Various minor clean-ups
Sun Jul 10 10:51:52 2005  Soeren Sandmann  <sandmann@redhat.com>

        * binfile.c: Various minor clean-ups
2005-07-10 14:52:41 +00:00
f3b78b7944 Cache BinFiles by filename.
Sat Jul  9 23:20:39 2005  Soeren Sandmann  <sandmann@redhat.com>

	* binfile.c (bin_file_new): Cache BinFiles by filename.

	* stackstash.c (stack_stash_free): Plug leak

	* process.c (process_free_maps): Plug leak

	* module/Makefile (install): Check that depmod exists before
	running it.
2005-07-10 03:28:35 +00:00
a2499b571f +Thu Jun 9 13:28:33 2005 Søren Sandmann <sandmann@redhat.com>
+
+       * TODO: Updates
+
2005-06-10 01:11:53 +00:00
c427b88352 Implement this function
Sat May  7 13:57:17 2005  Søren Sandmann  <sandmann@redhat.com>

	* sfile.c (sfile_output_free): Implement this function

	* sfile.c (sfile_input_free): Implement this function
2005-05-07 17:57:59 +00:00
b3c466debf Remove debug spew
Sat Apr  9 17:04:50 2005  Søren Sandmann  <sandmann@redhat.com>

	* Makefile: Remove debug spew

	* *: Add copyright notices
2005-04-09 21:17:24 +00:00
bda89efc68 Put back the weird loop, and stop pretending I understand this. This time
Tue Apr  5 23:01:02 2005  Søren Sandmann  <sandmann@redhat.com>

	* binfile.c (read_symbols): Put back the weird loop, and stop
	pretending I understand this. This time use SEC_ALLOC instead of
	SEC_LOAD.
2005-04-06 03:04:34 +00:00
88c3bbb880 Add commented out debug spew.
Tue Apr  5 20:13:44 2005  Søren Sandmann  <sandmann@redhat.com>

	* process.c (process_ensure_map): Add commented out debug spew.

	* process.c (process_lookup_symbol): Remove all should_offset()
	function and all references to it.

	* binfile.c (bin_file_lookup_symbol): Document that address must
	be in file coordinates.

	* binfile.c (read_symbols): Remove misguided code that tried to
	guess the load address of the file. Instead, do all computations
	in "file coordinates". Also fix a memory leak. Add commented out
	debug spew.

	* binfile.c (separate_debug_file_exists): Fix signedness
2005-04-06 00:16:12 +00:00
c5b66034c5 *** empty log message *** 2004-11-23 00:10:55 +00:00
1fa465fb26 *** empty log message *** 2004-11-04 15:25:39 +00:00
e16af9c730 *** empty log message *** 2004-11-04 15:23:41 +00:00
3798264846 make it compile 2004-05-23 14:46:17 +00:00
a618eb5c4e remove accidentally committed debug spew 2004-05-23 14:45:04 +00:00
be110fd2da Comment out disk profiler setup 2004-05-23 14:43:16 +00:00
649512d961 better disk profiling 2004-04-29 17:29:09 +00:00
7e5c6cbca4 support prelinked binaries 2004-04-28 15:08:22 +00:00
43dddf31ac Initial revision 2004-04-27 11:08:55 +00:00