diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2017-10-13 11:07:22 +0900 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2017-10-13 11:07:22 +0900 |
commit | 63aa0d72fd4d551668e75e86f362d6849b541589 (patch) | |
tree | 54f8914b6523d2998866e58e3ea332e6558c6065 | |
parent | 98df4b62c410b0bafb3e3ce20627140e5b84e78c (diff) |
Add README/TODO files
-rw-r--r-- | README | 39 | ||||
-rw-r--r-- | TODO | 23 |
2 files changed, 62 insertions, 0 deletions
@@ -0,0 +1,39 @@ +dwarf-extract-struct +==================== + +Simple utility to extract struct as header file from binary +debug informations + + +Usage +===== + +There's a trivial Makefile for now, just run `make` and run the program. + +Once built, `dwarf-extract-struct` takes for arguments: + - path to the binary you want to extract debug informations from +(must be built with -g and not stripped, alternatively it can be a +'.debug' file) + - the name of the struct you want to mimic + - the name of the fields you want to extract + +For example, on itself: +``` +$ ./dwarf-extract-struct dwarf-extract-struct _IO_FILE _markers _IO_buf_base +struct _IO_FILE { + union { + char whole_struct[216]; + struct { + char padding0[56]; + char *_IO_buf_base; + }; + struct { + char padding1[96]; + struct _IO_marker *_markers; + }; + }; +}; +``` + + +This is work in progress, interface will likely change. @@ -0,0 +1,23 @@ +Orderless todo: + + - add option to extract all members of given struct + + - add option to recursively dump any struct inside requested struct +(only fill in padding or resue option to extract all members? figure +another syntax to specify substruct.field?) + + - add option to list all the structs available in a file + + - add option to list all the fields available for a struct (I guess +that's close enough to extracting, but might be more human readable) + + - refactor some (in particular add wrappers/helpers around dwarf +functions so we abort properly checking both error and !ok, with +clear error messages) + + - log levels ? + + - pack elements into the same union member when sizes are appropriate +(need to be careful about embedded structs when we're not in recurse +mode? or have a mode that replaces 'em with char[x]?) + |