GDB is crashing on GNU Tools ARM Embedded 4.7

Asked by Kevin Tang

Hi,

I've been using GNU Tools ARM Embedded 4.6 to compile and debug my projects for Cortex-M0 without any issues. On the GNU Tools ARM Embedded 4.7, the GDB (7.4.1) is crashing while launching simple instruction such as "b main". Do you have any solution ?

Thank you
Kevin

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Terry Guo (terry.guo) said :
#1

Hello Kevin,

Can you please be more specific on your issue like what board and gdb server you are using? If possible, can you provide a small example for others to reproduce your issue? Those will be great helpful for us to look into the issue.

Revision history for this message
Denys Yurchenko (denys-l) said :
#2

I have the same problem with last release (4.7 2013q2):

arm-none-eabi-gdb.exe has stopped working.

I use SEGGER J-Link GDB Server V4.72a and STM3240G Evaluation board.

Revision history for this message
Denys Yurchenko (denys-l) said :
#3

P.S. I have the same problem with ALL 4.7 releases.

Revision history for this message
Denys Yurchenko (denys-l) said :
#4

P.S. If I use arm-none-eabi-gdb.exe of Yagarto or Sourcery its works fine.

Revision history for this message
Terry Guo (terry.guo) said :
#5

Hi Denys,

what do you mean for "arm-none-eabi-gdb.exe has stopped working"? Is arm-none-eabi-gdb simply crashed or something else? I tried with same GDB server and TWR-K60N512 board on win 7 64bit machine. The gdb can connect to board and show the register info.

Revision history for this message
Terry Guo (terry.guo) said :
#6

Hi Denys,

what do you mean for "arm-none-eabi-gdb.exe has stopped working"? Is arm-none-eabi-gdb simply crashed or something else? I tried with same GDB server and TWR-K60N512 board on win 7 64bit machine. The gdb can connect to board and show the register info.

Revision history for this message
Denys Yurchenko (denys-l) said :
#7

Additional info for arm-none-eabi-gdb crashing:

arm-none-eabi-gdb crash ONLY when I choose a Maximum(-g3) debug level in Project properties.
In ALL other conditions it works fine.

Revision history for this message
Terry Guo (terry.guo) said :
#8

Still no luck to reproduce the issue. The gdb works well for binaries with -g3 debug level. I am using gdb standalone on win7 64, not using gdb through IDE.

It sounds like you are calling gdb through IDE. If so, what IDE are you using?

Revision history for this message
Artem Pisarenko (jblackarty) said :
#9

Same problem.
Initially I discovered issue with Yagrato toolchain (build 20121222). After I made some source code modifications to our project (complex and working) I faced with surprising gdb failure: right after gdb connected to target it hangs and starts consume memory until it chocks at windows process memory limit and produces error as described in old gdb bug: http://sourceware.org/bugzilla/show_bug.cgi?id=9232 (in my case it was 4072 bytes only, although it eaten around 2GB actually).
Same project built and run with GNU Tools ARM Embedded 4.7 2013q1 results in gdb crash at same place.
I haven't found a way to produce simple test case. For example it doesn't crash just after I remove some function call somewhere. Funny, but large and long developed project works ok as opposed to it's heavily reduced and shrinked version.
I confirm that changing maximum debug level (-g3) to default (-g) resolves issue (in both toolchains).
OS: Windows 7 Pro x64.

Revision history for this message
Terry Guo (terry.guo) said :
#10

Sorry that I forgot to update this thread. I think the issue here is same as the one at https://answers.launchpad.net/gcc-arm-embedded/+question/234131. And the reason for such issue is incomplete support to GNU DWARF extension in gdb, especially the DWARF extensions for C Macro. The recent gdb like 7.6 should provide better support and fix this issue.

Revision history for this message
Terry Guo (terry.guo) said :
#11

If build app with gcc -g3 option, a DWARF entry named DW_MACRO_GNU_transparent_include will be generated to record Macro information. When parsing this entry in gdb, gdb will fall into an endless recursive call. That's why we can see the constantly memory consume.

Can you help with this problem?

Provide an answer of your own, or ask Kevin Tang for more information if necessary.

To post a message you must log in.