LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-03-2012, 05:19 AM   #1
chanducnu
LQ Newbie
 
Registered: Dec 2011
Posts: 6

Rep: Reputation: Disabled
Program received signal SIGTRAP, Trace/breakpoint trap while testing the arm elf


Hi,

iam a newbie to linux and crosscompilers. following are my C and assembly functions

#include <stdio.h>

void hello_asm(void);

void main()
{

printf("hello world");
hello_asm();
}


.global hello_asm
hello_asm:

PUSH {r4-r12,LR}

VLDMIA r2, {Q0}

POP {r4-r12,pc}

following are the commands used to compile and link.

mckala@mckala:~/crosstool-ng/crosstool-ng-1.6.1$ arm-unknown-eabi-gcc -g -c main.c -o main.o
mckala@mckala:~/crosstool-ng/crosstool-ng-1.6.1$ arm-unknown-eabi-as -mfpu=neon hello.s -o hello.o
mckala@mckala:~/crosstool-ng/crosstool-ng-1.6.1$ arm-unknown-eabi-gcc -o mainelf main.o hello.o

Iam able to generate executable. when i try to execute this using gdb it is giving SIGTRAP.

following is the gdb log

mckala@mckala:~/crosstool-ng/crosstool-ng-1.6.1$ arm-unknown-eabi-gdb mainelf
GNU gdb (Linaro GDB) 7.2-2011.04-0
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-build_unknown-linux-gnu --target=arm-unknown-eabi".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/mckala/crosstool-ng/crosstool-ng-1.6.1/mainelf...done.
(gdb) target sim
Connected to the simulator.
(gdb) load
Loading section .init, size 0xc vma 0x8000
Loading section .text, size 0x4288 vma 0x800c
Loading section .fini, size 0xc vma 0xc294
Loading section .rodata, size 0xe8 vma 0xc2a0
Loading section .ARM.exidx, size 0x8 vma 0xc388
Loading section .eh_frame, size 0x4 vma 0xc390
Loading section .init_array, size 0x4 vma 0x14394
Loading section .fini_array, size 0x4 vma 0x14398
Loading section .jcr, size 0x4 vma 0x1439c
Loading section .data, size 0x9a0 vma 0x143a0
Start address 0x8061
Transfer rate: 158208 bits in <1 sec.
(gdb) b main
Breakpoint 1 at 0x8144: file main.c, line 8.
(gdb) run
Starting program: /home/mckala/crosstool-ng/crosstool-ng-1.6.1/mainelf

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00008066 in start ()
(gdb)


Can anyone please tell me where iam going wrong.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Program received signal SIGABRT, Aborted. In __kernel_vsyscall () barbuceanu Linux - Software 0 07-03-2008 10:06 AM
Program received signal SIGABRT, Aborted. barbuceanu Linux - Software 3 07-03-2008 08:13 AM
Program received signal SIGPIPE, Broken pipe. grupoapunte Programming 1 06-03-2005 05:49 AM
Program received signal SIGSEGV, Segmentation fault ims_mca Linux - Distributions 0 03-09-2005 04:16 AM
Trace/breakpoint trap received when running glxgears QtCoder Linux - Software 0 01-27-2004 01:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration