<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:"Yu Gothic";
panose-1:2 11 4 0 0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:ArialMT;
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"\@Yu Gothic";
panose-1:2 11 4 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif">Hello guys,<br>
I’m currently a student at the company Carl Zeiss in Oberkochen Germany. I’d like to trace the Kernel from our CMM-Controller with CTF and convert it to plain text, like Babeltrace 2 does. To understand how Babeltrace 2 works with CTF, I debug the code.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif">However when I try to step into a function which is included via the extern Babeltrace 2 library (e.g.
<b>bt_graph_run(ctx.graph)</b> in graph.c), the GNU Compiler steps over the function and I’m unable to look into this function.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif">I figured, it is because the Debugger cannot find the Debug Symbols even though I compile everything with Debug-Symbols and no compiler optimization.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif">I configure the Makefile as follows:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif">BABELTRACE_DEV_MODE=1 BABELTRACE_MINIMAL_LOG_LEVEL=TRACE BABELTRACE_DEBUG_MODE=1 CFLAGS='-g -O0' CPPFLAGS='-g -O0' LDFLAGS='-g -O0' ./configure<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif">For test purposes, I implemented the function
<b>bt_graph_run(NULL) </b>inside a new project to check, if I could step into the function with my debugger, or whether it is a general problem with my machine.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif">That actually worked and I was able to step into the function, but not with the normal Babeltrace 2 project.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif">None of my colleagues could explain this behavior, so my question now is, how do you guys debug the code? Is there a different way you debug these functions, or
do I configure my project the wrong way?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif">I appreciate it if someone can help me and tell me how to configure the project so that the code is debugable.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif">Sincerely,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif">Aron<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"ArialMT",serif;color:black">__________</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">Aron Seidl</span></b><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">DH-Student IT Education</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black"> </span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">Carl Zeiss AG</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">Carl-Zeiss-Strasse 22</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">73447 Oberkochen, Deutschland</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><o:p> </o:p></p>
<p class="MsoNormal" style="text-autospace:none"><a href="mailto:aron.seidl@zeiss.com"><span style="color:#0563C1">aron.seidl@zeiss.com</span></a><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><a href="http://www.zeiss.de/"><span style="color:#0563C1">www.zeiss.de</span></a></span><o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;text-autospace:none"><span style="font-size:10.0pt;font-family:"ArialMT",serif;color:black">__________</span><o:p></o:p></p>
<p class="MsoNormal" style="vertical-align:baseline"><span style="font-size:8.0pt;font-family:"Arial",sans-serif">Carl Zeiss AG </span><o:p></o:p></p>
<p class="MsoNormal" style="vertical-align:baseline"><span style="font-size:8.0pt;font-family:"Arial",sans-serif">Sitz der Gesellschaft: Oberkochen, Deutschland </span><o:p></o:p></p>
<p class="MsoNormal" style="vertical-align:baseline"><span style="font-size:8.0pt;font-family:"Arial",sans-serif">Vorsitzender des Aufsichtsrates: Dr. Michael Bolle </span><o:p></o:p></p>
<p class="MsoNormal" style="vertical-align:baseline"><span style="font-size:8.0pt;font-family:"Arial",sans-serif">Vorstand: Dr. Karl Lamprecht (Vorsitzender), </span><o:p></o:p></p>
<p class="MsoNormal" style="vertical-align:baseline"><span style="font-size:8.0pt;font-family:"Arial",sans-serif">Susan-Stefanie Breitkopf, Sven Hermann, Dr. Christian Müller,<br>
Andreas Pecher, Dr. Jochen Peter, Dr. Markus Weber </span><o:p></o:p></p>
<p class="MsoNormal" style="vertical-align:baseline"><span style="font-size:8.0pt;font-family:"Arial",sans-serif">Amtsgericht Ulm, HRB 501 555, USt-IdNr: DE 811 119 940 </span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:"Arial",sans-serif;color:#979797"> </span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>