On 13.04.2014 01:16, Paul Smith wrote:
>> I can send the patch on monday.
>>
The attached patch writes the library load addresses to the xml output.
They can then be used to feed the contained addresses to addr2line.
Regards
Matthias
--- a/coregrind/m_debuginfo/debuginfo.c
+++ b/coregrind/m_debuginfo/debuginfo.c
@@ -663,6 +663,20 @@ static ULong di_notify_ACHIEVE_ACCEPT_STATE ( struct _DebugInfo* di )
vg_assert(di->have_dinfo == False);
}
+ if (VG_(clo_xml)) {
+ Word i;
+ VG_(printf_xml)("<load_obj>\n<obj>%s</obj>\n",
+ di->fsm.filename);
+ VG_(printf_xml)("<text_avma>%#lx</text_avma>\n",
+ VG_(DebugInfo_get_text_avma)(di));
+ for (i = 0; i < VG_(sizeXA)(di->fsm.maps); i++) {
+ struct _DebugInfoMapping* map = VG_(indexXA)(di->fsm.maps, i);
+ if (map->rx)
+ VG_(printf_xml)("<rx_avma>%#lx</rx_avma>\n",
+ map->avma);
+ }
+ VG_(printf_xml)("</load_obj>\n");
+ }
TRACE_SYMTAB("\n");
TRACE_SYMTAB("------ name = %s\n", di->fsm.filename);
TRACE_SYMTAB("------ end ELF OBJECT "
--- a/helgrind/tests/filter_xml
+++ b/helgrind/tests/filter_xml
@@ -45,7 +45,8 @@ my %patterns = (
# List of XML sections to be ignored.
my %ignore_sections = (
"<errorcounts>" => "</errorcounts>",
- "<suppcounts>" => "</suppcounts>"
+ "<suppcounts>" => "</suppcounts>",
+ "<load_obj>" => "</load_obj>"
);
--- a/memcheck/tests/filter_xml
+++ b/memcheck/tests/filter_xml
@@ -11,6 +11,7 @@ sed "s/<obj>.*<\/obj>/<obj>...<\/obj>/" |
sed "s/<line>.*<\/line>/<line>...<\/line>/" |
sed "s/<dir>.*<\/dir>/<dir>...<\/dir>/" |
sed "s/<count>.*<\/count>/<count>...<\/count>/" |
+sed "/<load_obj>/,/<\/load_obj>/d" |
sed "s/of size [48]</of size N</" |
perl -p -e "s/(m_replacemalloc\/)?vg_replace_malloc.c/vg_replace_malloc.c/" |
perl -0 -p -e "s/<suppcounts>.*<\/suppcounts>/<suppcounts>...<\/suppcounts>/s" |
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users