Commit Graph

40 Commits

Author SHA1 Message Date
d2a6151f8d Beginning of a dwarf unwinder.
Sat Mar 29 11:14:38 2008  Søren Sandmann  <sandmann@redhat.com>

        * unwind.[ch], testunwind.c: Beginning of a dwarf unwinder.



svn path=/trunk/; revision=405
2008-03-29 16:00:33 +00:00
b98db05f9b Add commented out code to reject callback.
2008-02-17  Soren Sandmann  <sandmann@redhat.com>

	* collector.c (lookup_symbol): Add commented out code to reject
	callback.

	* elfparser.c (struct ElfParser): Store the filename if any
	(elf_parser_get_sym_address): Subtract the load address, so the
	result will be an offset into the text section.

	* process.[ch] (process_lookup_symbol): Add an offset out-argument
	
	* binfile.[ch] (bin_symbol_get_address): New function

	* TODO: updates



svn path=/trunk/; revision=397
2008-02-17 23:31:19 +00:00
1867b97a8d Use an array instead of a list. Look for vmlinux in the source directory.
2007-10-22  Soren Sandmann <sandmann@daimi.au.dk>

        * process.c (look_for_vmlinux): Use an array instead of a
        list. Look for vmlinux in the source directory.

        * elfparser.c (elf_parser_get_crc32): Only use MADV_DONTNEED if
        the data is file-backed.

        * TODO: updates.

        Various formatting fixes


svn path=/trunk/; revision=385
2007-10-25 02:45:54 +00:00
a7b39cf517 Don't discard weak symbols.
2007-10-22  Soren Sandmann <sandmann@daimi.au.dk>

	* elfparser.c (read_table): Don't discard weak symbols.

	* elfparser.c (elf_parser_lookup_symbol): If the symbol has
	unknown size, don't check that the address is in range.


svn path=/trunk/; revision=381
2007-10-22 04:41:27 +00:00
6d96c33032 + * elfparser.c (elf_parser_get_crc32): madvise()
2007-03-24  Soren Sandmann <sandmann@daimi.au.dk>
 
+       * elfparser.c (elf_parser_get_crc32): madvise()



svn path=/trunk/; revision=363
2007-03-24 17:56:20 +00:00
5ee13adc34 Fix two leaks, both pointed out by Kjartan Maraas
2007-03-02  Soren Sandmann <sandmann@daimi.au.dk>

        Fix two leaks, both pointed out by Kjartan Maraas

        * binparser.c (bin_parser_free): Free the record list 

        * elfparser.c (elf_parser_free): Free the symbol table. 



svn path=/trunk/; revision=356
2007-03-02 05:23:30 +00:00
6fa782dcd6 svn path=/trunk/; revision=355
svn path=/trunk/; revision=355
2007-02-25 04:15:51 +00:00
cf70d3a7ed Updates
2007-02-24  Soren Sandmann <sandmann@daimi.au.dk>

        * TODO: Updates

        * binparser.[ch]: Get rid of BIN_UINTn types; replace with single
        BIN_UINT, where the user must provide the width

        * elfparser.c: Update to new binparser API



svn path=/trunk/; revision=354
2007-02-24 08:49:51 +00:00
494e40a912 Switch to a simpler conceptual model. Update to binparser API changes.
2007-02-24  Soren Sandman <sandmann@daimi.au.dk>

        * binparser.[ch]: Switch to a simpler conceptual model.
        * elfparser.c: Update to binparser API changes.
        * TODO: updates



svn path=/trunk/; revision=352
2007-02-24 07:15:24 +00:00
ea18b8e991 svn path=/trunk/; revision=351
svn path=/trunk/; revision=351
2007-02-09 22:04:45 +00:00
c541052c19 Update copyright notices
Fri Feb  9 16:53:29 2007  Søren Sandmann  <sandmann@redhat.com>

	* Update copyright notices



svn path=/trunk/; revision=350
2007-02-09 21:59:15 +00:00
c1025c6b44 Don't store the size of the symbol. (elf_parser_lookup_symbol): Look it up
Fri Feb  9 16:16:34 2007  Søren Sandmann  <sandmann@redhat.com>

       * elfparser.c (struct ElfSym): Don't store the size of the symbol.
       (elf_parser_lookup_symbol): Look it up here instaed.

       * binfile.c (bin_file_free): Use pre-decrement instead of
       post-decrement.
       (bin_file_check_inode): Clarify the warning a little


svn path=/trunk/; revision=349
2007-02-09 21:30:01 +00:00
9af533a11f Declare bin_parser_free();
2006-11-19   Soren Sandmann <sandmann@redhat.com>

        * binparser.h: Declare bin_parser_free();

        * elfparser.c (elf_parser_get_crc32): Use madvise(DONT_NEED) on
        the file.

        * process.c (struct Process): Remove do_offset.
2006-11-19 22:48:28 +00:00
55fc6d7805 New function
2006-11-02  Soren Sandmann <sandmann@daimi.au.dk>

       * sysprof.c (disable_g_slice): New function

       * sysprof.c (main): Call it from here.
2006-11-11 03:34:40 +00:00
0513ed87e8 Valgrind:
2006-11-02  Soren Sandmann <sandmann@daimi.au.dk>

        Valgrind:

        * binparser.c (bin_parser_free): Add this function

        * elfparser.c (elf_parser_free): Call bin_parser_free()

        * sysprof.c (compute_text_width, add_text): Plug leaks

        * collector.c (add_trace_to_stash): Copy n_addresses to a stack
        variable instead of reading it out of the mmap'ed area all the
        time. (That way if there is an overrun, we won't write too much
        into the address array).
2006-11-02 08:33:35 +00:00
b54b0809b6 New function.
2006-10-09  Soren Sandmann  <ssp@localhost.localdomain>

	* process.c (process_get_vdso_bytes): New function.

	* elfparser.c (parser_new_from_data): export this function as
	elf_parser_new_from_data().

	* binfile.c (read_inode): Don't stat if filename is
	'[vdso]'. Instead just return -1;
	(bin_file_new): Use elf_parser_new_from_data() when the file is
	[vdso].

	* process.c (read_maps): Change the offset of the vdso map to 0
	and the inode to -1.

	* elfparser.c (elf_parser_lookup_symbol): Remove unused 'size'
	variable.

	* binfile.c (find_separate_debug_file): Deal with cycles in the
	debuglink graph.

	* configure.ac: Set version to 1.1.0. Print warning about HEAD.
2006-10-09 21:32:24 +00:00
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
6a7178f612 Remove old commented out code Add commented out code accessing entire
2006-08-27  Soren Sandmann <sandmann@redhat.com>

        * binparser.c: Remove old commented out code
        * module/sysprof-module.c: Add commented out code accessing entire
        stack.

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 03:09:24 +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
e44c9a0167 Update to new API
2006-08-26  Soren Sandmann <sandmann@daimi.au.dk>

	* elfparser.c: Update to new API

	* binparser.h: Delete commented out declarations. Add new
	functions.

	* binparser.c: Delete ParserFrame, replace with one current
	offset.
	(convert_uint): Make static
	(bin_parser_get_uint): Delete this function
	(bin_parser_get_string): Change this function to use current
	offset instead of frame offset.
	(bin_parser_goto): New function
	(bin_parser_align): New function
	(bin_parser_get_uint32): New function
	(bin_parser_begin): Delete this function
	(bin_parser_end): Delete this function
	(bin_parser_index): Delete this function
	(bin_record_get_string_indirect): Make this function use _goto()
	instead of _begin()/_end()
	(bin_parser_get_offset): Make this function return current offset
2006-08-26 23:01:07 +00:00
54862afc74 Add new struct BinRecord. Comment out functions related to formats. Add
2006-08-26  Soren Sandmann <sandmann@daimi.au.dk>

	* binparser.[ch]: Add new struct BinRecord. Comment out functions
	related to formats. Add new functions to get fields out of
	BinRecords.

	* elfparser.c: Update to new API.
2006-08-26 22:44:12 +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
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
ad09fd10cb Update
2006-08-21  Soren Sandmann <sandmann@redhat.com>

	* TODO: Update

	* elfparser.c (elf_parser_lookup_symbol): Change sense of size
	check.
2006-08-21 05:00:53 +00:00
858d1fab58 Initialize crc to 0xffffffff and invert it before returning.
2006-08-20  Soren Sandmann <sandmann@redhat.com>

	* elfparser.c (elf_parser_get_crc32): Initialize crc to 0xffffffff
	and invert it before returning.

	* elfparser.h: Declare elf_parser_get_debug_link()
2006-08-21 04:12:12 +00:00
66a28bd501 Comment out debug spew. (elf_parser_lookup_symbol): Add check that address
2006-08-20  Soren Sandmann  <sandmann@daimi.au.dk>

	* elfparser.c (elf_parser_get_load_address): Comment out debug spew.
	(elf_parser_lookup_symbol): Add check that address is actually
	within the bounds of the found function.
2006-08-21 03:34:44 +00:00
7d8f3c232d New function
2006-08-20  Soren Sandmann <sandmann@daimi.au.dk>

	* elfparser.c (elf_parser_new_from_file): New function
2006-08-21 01:30:54 +00:00
1b72901c4d New function
2006-08-20   Soren Sandmann <sandmann@daimi.au.dk>

	* elfparser.c (elf_parser_get_debug_link): New function

	* elfparser.c: Delete SymbolTable typedef

	* binparser.[ch] (bin_parser_get_data): New function
	(bin_parser_get_length): New function

	* elfparser.[ch] (elf_parser_get_crc32): New function

	* TODO: Updates

	* elfparser.c (elf_parser_lookup_symbol): Offset passed in
	addresses by the load address.

	* elfparser.c (elf_parser_get_load_address): New function to
	compute the load address of the beginning of the file.
2006-08-21 00:18:10 +00:00
49e1fabe46 Read the name out of the file instead of out of the struct.
2006-08-20  Soren Sandmann  <sandmann@redhat.com>

	* elfparser.c (elf_sym_get_name): Read the name out of the file
	instead of out of the struct.

	* elfparser.c (struct ElfSym): Store an offset instead of the
	name.

	* elfparser.c (all_elf_parsers): Keep track of all elf parsers
	created.
2006-08-20 06:26:54 +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
8967b3148c Many cleanups.
2006-08-19  Soren Sandmann  <sandmann@redhat.com>

	* elfparser.c: Many cleanups.
2006-08-19 23:56:18 +00:00
d3c6a66101 Pass the correct pointer.
2006-08-16  Søren Sandmann  <ssp@localhost.localdomain>

	* elfparser.c (check_symbol): Pass the correct pointer.
2006-08-16 17:25:03 +00:00
1f4dd13cd3 Really add this file.
2006-08-16  Soren Sandmann  <sandmann@redhat.com>

	* testelf.c: Really add this file.
2006-08-16 17:21:54 +00:00
2bc2e3658d Add beginning of an ELF parser.
2006-08-15  Soren Sandmann  <sandmann@redhat.com>

	Add beginning of an ELF parser.

	* binparser.[ch]: New files
	* elfparser.[ch]: New files
	* testelf.c: New file
	* Makefile.am (testelf_SOURCES): Add new testelf program.
2006-08-16 03:31:10 +00:00