[prev in list] [next in list] [prev in thread] [next in thread]
List: gdb-bugs
Subject: Problem to backtrace the stack on a ARM target
From: "Thierry GOLDWASER" <Thierry.GOLDWASER () ingenico ! com>
Date: 2009-01-30 15:03:08
Message-ID: 72CF8F2B2766084DBD7AEAFCAE4A3B7909F4DA8C () frsnprexc1 ! usr ! ingenico ! loc
[Download RAW message or body]
Hi,
I'm using GDB to debug an application on a remote ARM target, compiled
in Thumb mode (16-bit).
When the size of the locals is too big (apparently something close to
512 bytes), GDB is unable to display the call stack.
See sample code below:
void NoBugStack(void)
{
char buf[508];
buf[0] = 0;
}
void BugStack(void)
{
char buf[509];
buf[0] = 0;
}
When you set a breakpoint at line 5 (function "NoBugStack"),
everything's fine. On the other hand, when you set a breakpoint at line
12 (function "BugStack"), GDB is unable to display the call stack (the
command "bt" returns an error). The only difference between the 2
functions is
the size of the locals.
The file was compiled with GCC 3.4.3, with the following command line:
arm-elf-gcc.exe -g -c -Wall -Wcast-align -mthumb-interwork
-mlittle-endian -msoft-float -pipe -mcpu=arm920t -fomit-frame-pointer
-fshort-enums -mstructure-size-boundary=8 -mthumb
Additional notes:
- This does not happen when the application is compiled in ARM mode
(32-bit)
- I've reproduced the problem with 2 different types of ARM target, so
it does not seem caused by the target itself.
Thanks for your help,
Thierry
P.S.: I've filled a bug report
http://sourceware.org/bugzilla/show_bug.cgi?id=9742
About Ingenico: Ingenico is the world's leading provider of payment solutions, with \
over 15 million terminals deployed across the globe. Delivering the very latest \
secure electronic payment technologies, transaction management and the widest range \
of value added services, Ingenico is shaping the future direction of the payment \
solutions market. Leveraging on its global presence and local expertise, Ingenico is \
reinforcing its leadership by taking banks and businesses beyond payment through \
offering comprehensive solutions, a true source of differentiation and new revenues \
streams. This message may contain confidential and/or privileged information. If you \
are not the addressee or authorized to receive this for the addressee, you must not \
use, copy, disclose or take any action based on this message or any information \
herein. If you have received this message in error, please advise the sender \
immediately by reply e-mail and delete this message. Thank you for your cooperation. \
P Please consider the environment before printing this e-mail
[Attachment #3 (text/html)]
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o="xmlns:o" \
xmlns:w="urn:schemas-microsoft-com:office:word"><head><META content="text/html; \
charset=us-ascii" http-equiv="Content-Type">
<META content="text/html; charset=us-ascii" HTTP-EQUIV="Content-Type">
<meta content="Microsoft Word 11 (filtered medium)" name=Generator>
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
pre
{margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
{page:Section1;}
-->
</style>
<META content="text/html; charset=us-ascii" \
http-equiv="Content-Type"><TITLE>Notice</TITLE> </head><BODY>
<DIV>
<div class=Section1><pre><font face="Courier New" size=2><span lang=EN-GB \
style='font-size:10.0pt'>Hi,<o:p></o:p></span></font></pre><pre><font face="Courier \
New" size=2><span lang=EN-GB \
style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font \
face="Courier New" size=2><span lang=EN-GB style='font-size:10.0pt'>I'm using GDB to \
debug an application on a remote ARM target, compiled in Thumb mode \
(16-bit).<o:p></o:p></span></font></pre><pre><font face="Courier New" size=2><span \
lang=EN-GB style='font-size:10.0pt'>When the size of the locals is too big \
(apparently something close to 512 bytes), GDB is unable to display the call \
stack.<o:p></o:p></span></font></pre><pre><font face="Courier New" size=2><span \
lang=EN-GB style='font-size:10.0pt'>See sample code \
below:<o:p></o:p></span></font></pre><pre><font face="Courier New" size=2><span \
lang=EN-GB style='font-size:10.0pt'>void \
NoBugStack(void)<o:p></o:p></span></font></pre><pre><font face="Courier New" \
size=2><span lang=EN-GB \
style='font-size:10.0pt'>{<o:p></o:p></span></font></pre><pre><font face="Courier \
New" size=2><span lang=EN-GB \
style='font-size:10.0pt'> char \
buf[508];<o:p></o:p></span></font></pre><pre><font face="Courier New" size=2><span \
lang=EN-GB style='font-size:10.0pt'> \
<o:p></o:p></span></font></pre><pre><font face="Courier New" size=2><span lang=EN-GB \
style='font-size:10.0pt'> buf[0] = \
0;<o:p></o:p></span></font></pre><pre><font face="Courier New" size=2><span \
lang=EN-GB style='font-size:10.0pt'>}<o:p></o:p></span></font></pre><pre><font \
face="Courier New" size=2><span lang=EN-GB \
style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font \
face="Courier New" size=2><span lang=EN-GB style='font-size:10.0pt'>void \
BugStack(void)<o:p></o:p></span></font></pre><pre><font face="Courier New" \
size=2><span lang=EN-GB \
style='font-size:10.0pt'>{<o:p></o:p></span></font></pre><pre><font face="Courier \
New" size=2><span lang=EN-GB \
style='font-size:10.0pt'> char \
buf[509];<o:p></o:p></span></font></pre><pre><font face="Courier New" size=2><span \
lang=EN-GB style='font-size:10.0pt'> \
<o:p></o:p></span></font></pre><pre><font face="Courier New" size=2><span lang=EN-GB \
style='font-size:10.0pt'> buf[0] = \
0;<o:p></o:p></span></font></pre><pre><font face="Courier New" size=2><span \
lang=EN-GB style='font-size:10.0pt'>}<o:p></o:p></span></font></pre><pre><font \
face="Courier New" size=2><span lang=EN-GB \
style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font \
face="Courier New" size=2><span lang=EN-GB style='font-size:10.0pt'>When you set a \
breakpoint at line 5 (function "NoBugStack"), everything's fine. On the \
other hand, when you set a breakpoint at line 12 (function "BugStack"), GDB \
is unable to display the call stack (the command "bt" returns an error). \
The only difference between the 2 functions \
is<o:p></o:p></span></font></pre><pre><font face="Courier New" size=2><span \
lang=EN-GB style='font-size:10.0pt'>the size of the \
locals.<o:p></o:p></span></font></pre><pre><font face="Courier New" size=2><span \
lang=EN-GB style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font \
face="Courier New" size=2><span lang=EN-GB style='font-size:10.0pt'>The file was \
compiled with GCC 3.4.3, with the following command \
line:<o:p></o:p></span></font></pre><pre><font face="Courier New" size=2><span \
lang=EN-GB style='font-size:10.0pt'>arm-elf-gcc.exe -g -c -Wall -Wcast-align \
-mthumb-interwork -mlittle-endian -msoft-float -pipe -mcpu=arm920t \
-fomit-frame-pointer -fshort-enums -mstructure-size-boundary=8 \
-mthumb<o:p></o:p></span></font></pre><pre><font face="Courier New" size=2><span \
lang=EN-GB style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font \
face="Courier New" size=2><span lang=EN-GB style='font-size:10.0pt'>Additional \
notes:<o:p></o:p></span></font></pre><pre><font face="Courier New" size=2><span \
lang=EN-GB style='font-size:10.0pt'>- This does not happen when the application is \
compiled in ARM mode (32-bit)<o:p></o:p></span></font></pre><pre><font face="Courier \
New" size=2><span lang=EN-GB style='font-size:10.0pt'>- I've reproduced the problem \
with 2 different types of ARM target, so it does not seem caused by the target \
itself.<o:p></o:p></span></font></pre><pre><font face="Courier New" size=2><span \
lang=EN-GB style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font \
face="Courier New" size=2><span lang=EN-GB style='font-size:10.0pt'>Thanks for your \
help,<o:p></o:p></span></font></pre><pre><font face="Courier New" size=2><span \
lang=EN-GB style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font \
face="Courier New" size=2><span lang=EN-GB \
style='font-size:10.0pt'> \
Thierry<o:p></o:p></span></font></pre><pre><font face="Courier New" size=2><span \
lang=EN-GB style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font \
face="Courier New" size=2><span lang=EN-GB style='font-size:10.0pt'>P.S.: I’ve \
filled a bug report <a \
href="http://sourceware.org/bugzilla/show_bug.cgi?id=9742">http://sourceware.org/bugzilla/show_bug.cgi?id=9742</a><o:p></o:p></span></font></pre>
<p class=MsoNormal><font face="Times New Roman" size=3><span lang=EN-GB \
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
</div>
</DIV>
<DIV> </DIV>
<DIV><FONT FACE="Arial" SIZE="1">
<P STYLE="TEXT-ALIGN: justify"><STRONG><SPAN STYLE="FONT-SIZE: 11pt; COLOR: red; \
FONT-FAMILY: 'Arial','sans-serif'">About Ingenico</SPAN></STRONG><STRONG><SPAN \
STYLE="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">: Ingenico is the \
world’s leading provider of payment solutions, with over 15 million terminals \
deployed across the globe. </SPAN></STRONG><STRONG><SPAN LANG="EN-GB" \
STYLE="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Delivering the very latest \
secure electronic payment technologies, transaction management and the widest range \
of value added services, Ingenico is shaping the future direction of the payment \
solutions market. Leveraging on its global presence and local expertise, Ingenico is \
reinforcing its leadership by taking banks and businesses beyond payment through \
offering comprehensive solutions, a true source of differentiation and new revenues \
streams</SPAN></STRONG><STRONG><SPAN LANG="EN-GB" STYLE="FONT-SIZE: 8pt; FONT-FAMILY: \
'Arial','sans-serif'">.</SPAN></STRONG><SPAN STYLE="FONT-SIZE: 7.5pt; FONT-FAMILY: \
'Arial','sans-serif'"></SPAN></P> <P STYLE="TEXT-ALIGN: justify"><SPAN \
STYLE="FONT-SIZE: 7.5pt; FONT-FAMILY: 'Arial','sans-serif'"> This message may \
contain confidential and/or privileged information. If you are not the addressee or \
authorized to receive this for the addressee, you must not use, copy, disclose or \
take any action based on this message or any information herein. If you have received \
this message in error, please advise the sender immediately by reply e-mail and \
delete this message. Thank you for your cooperation.</SPAN></P> <P \
CLASS="MsoNormal"><SPAN STYLE="FONT-SIZE: 7.5pt; FONT-FAMILY: \
'Arial','sans-serif'"> </SPAN><SPAN LANG="EN-GB" STYLE="FONT-SIZE: 12pt; COLOR: \
green; FONT-FAMILY: Webdings">P</SPAN><SPAN LANG="EN-GB" STYLE="COLOR: black; \
FONT-FAMILY: 'Arial','sans-serif'"> </SPAN><SPAN LANG="EN-GB" STYLE="FONT-SIZE: \
7.5pt; COLOR: green; FONT-FAMILY: 'Arial','sans-serif'">Please consider the \
environment before printing this e-mail</SPAN></P></FONT></DIV> <DIV> </DIV>
<DIV><U><FONT COLOR="#0000ff" SIZE="1"></FONT></U><FONT COLOR="#0000ff" FACE="Times \
New Roman" SIZE="1"> <P><U></U> </P></FONT></DIV></BODY></HTML>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic