From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26797 invoked by alias); 28 Oct 2010 11:57:08 -0000 Received: (qmail 26785 invoked by uid 22791); 28 Oct 2010 11:57:07 -0000 X-SWARE-Spam-Status: No, hits=-0.0 required=5.0 tests=AWL,BAYES_40,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nm20-vm0.bullet.mail.sp2.yahoo.com (HELO nm20-vm0.bullet.mail.sp2.yahoo.com) (98.139.91.218) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Thu, 28 Oct 2010 11:57:00 +0000 Received: from [98.139.91.68] by nm20.bullet.mail.sp2.yahoo.com with NNFMP; 28 Oct 2010 11:56:59 -0000 Received: from [98.139.91.16] by tm8.bullet.mail.sp2.yahoo.com with NNFMP; 28 Oct 2010 11:56:59 -0000 Received: from [127.0.0.1] by omp1016.mail.sp2.yahoo.com with NNFMP; 28 Oct 2010 11:56:59 -0000 Received: (qmail 8982 invoked by uid 60001); 28 Oct 2010 11:56:58 -0000 Message-ID: <592649.8818.qm@web112518.mail.gq1.yahoo.com> Received: from [123.237.140.102] by web112518.mail.gq1.yahoo.com via HTTP; Thu, 28 Oct 2010 04:56:57 PDT References: <877394.75835.qm@web112505.mail.gq1.yahoo.com> <201010281118.10136.pedro@codesourcery.com> <428402.79807.qm@web112503.mail.gq1.yahoo.com> <201010281227.13121.pedro@codesourcery.com> Date: Thu, 28 Oct 2010 11:57:00 -0000 From: paawan oza Subject: Re: gdb cross compilation, error from gdb/tui module To: Pedro Alves , Baurzhan Ismagulov , gdb@sourceware.org In-Reply-To: <201010281227.13121.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-10/txt/msg00120.txt.bz2 gdb hangs with target sim for following configuration.... following is the sample program void a(int t) { printf("%d\n",t); } int main() { a(6); } and I have cross compiled it with tool chain at following location http://www.codesourcery.com/sgpp/lite/arm/portal/package3696/public/arm-none-linux-gnueabi/arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 ./gdb GNU gdb (GDB) 7.2 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later 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=i686-pc-linux-gnu --target=arm-elf". For bug reporting instructions, please see: . Setting up the environment for debugging gdb. No symbol table is loaded. Use the "file" command. Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal] No symbol table is loaded. Use the "file" command. Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal] .gdbinit:8: Error in sourced command file: Argument required (one or more breakpoint numbers). (gdb) target sim Connected to the simulator. (gdb) file ./a.out warning: A handler for the OS ABI "GNU/Linux" is not built into this configuration of GDB. Attempting to continue with the default arm settings. Reading symbols from /home/oza/mk_patch/gdb/gdb-7.2/gdb/a.out...done. (gdb) load Loading section .interp, size 0x13 vma 0x8134 Loading section .note.ABI-tag, size 0x20 vma 0x8148 Loading section .hash, size 0x28 vma 0x8168 Loading section .dynsym, size 0x50 vma 0x8190 Loading section .dynstr, size 0x43 vma 0x81e0 Loading section .gnu.version, size 0xa vma 0x8224 Loading section .gnu.version_r, size 0x20 vma 0x8230 Loading section .rel.dyn, size 0x8 vma 0x8250 Loading section .rel.plt, size 0x20 vma 0x8258 Loading section .init, size 0xc vma 0x8278 Loading section .plt, size 0x44 vma 0x8284 Loading section .text, size 0x15c vma 0x82c8 Loading section .fini, size 0x8 vma 0x8424 Loading section .rodata, size 0x8 vma 0x842c Loading section .ARM.exidx, size 0x8 vma 0x8434 Loading section .eh_frame, size 0x4 vma 0x843c Loading section .init_array, size 0x4 vma 0x10440 Loading section .fini_array, size 0x4 vma 0x10444 Loading section .jcr, size 0x4 vma 0x10448 Loading section .dynamic, size 0xe8 vma 0x1044c Loading section .got, size 0x20 vma 0x10534 Loading section .data, size 0x8 vma 0x10554 Start address 0x82c8 Transfer rate: 8480 bits in <1 sec. (gdb) start Temporary breakpoint 1 at 0x83a4: file ./test.c, line 8. Starting program: /home/oza/mk_patch/gdb/gdb-7.2/gdb/a.out .... .... .... then I collected gdb's backtrace using another gdb...and I got following... (gdb) bt #0 0x081f82b9 in ARMul_Emulate32 (state=0x83e1920) at ./armemu.c:918 #1 0x081e42c1 in ARMul_DoProg (state=0x83e1920) at arminit.c:241 #2 0x081d8eb2 in sim_resume (sd=0x1, step=0, siggnal=0) at wrapper.c:228 #3 0x080959d7 in gdbsim_wait (ops=0x835ae40, ptid={pid = -1, lwp = 0, tid = 0}, status=0xbfffc8c8, options=0) at remote-sim.c:705 #4 0x08139c9b in target_wait (ptid={pid = -1, lwp = 0, tid = 0}, status=0xbfffc8c8, options=0) at target.c:2219 #5 0x0810ecf4 in wait_for_inferior (treat_exec_as_sigtrap=0) at infrun.c:2529 #6 0x0810f403 in proceed (addr=4294967295, siggnal=TARGET_SIGNAL_DEFAULT, step=0) at infrun.c:2064 #7 0x0810499b in continue_1 (all_threads=0) at infcmd.c:689 #8 0x08104aad in continue_command (args=0x0, from_tty=1) at infcmd.c:781 #9 0x080559e2 in execute_command (p=0x8361181 "", from_tty=1) at top.c:422 #10 0x0811efa7 in command_handler (command=0x8361180 "c") at event-top.c:498 #11 0x0811fb3c in command_line_handler (rl=0x83ec078 "\020\uffff>\b \uffff>\b") at event-top.c:702 #12 0x08212ac4 in rl_callback_read_char () at callback.c:205 #13 0x0811f01b in rl_callback_read_char_wrapper (client_data=0x0) at event-top.c:178 #14 0x0811ec1e in handle_file_event (data={ptr = 0x0, integer = 0}) at event-loop.c:817 #15 0x0811df75 in process_event () at event-loop.c:399 #16 0x0811eb5b in gdb_do_one_event (data=0x0) at event-loop.c:464 #17 0x08119443 in catch_errors (func=0x811e960 , func_args=0x0, errstring=0x829c415 "", mask=6) at exceptions.c:518 #18 0x0811e64a in start_event_loop () at event-loop.c:488 #19 0x0811ff2b in cli_command_loop () at event-top.c:211 #20 0x0804beeb in captured_command_loop (data=0x0) at ./main.c:227 #21 0x08119443 in catch_errors (func=0x804bee0 , func_args=0x0, errstring=0x829c415 "", mask=6) at exceptions.c:518 #22 0x0804c674 in captured_main (data=0xbfffcce4) at ./main.c:910 #23 0x08119443 in catch_errors (func=0x804bf20 , func_args=0xbfffcce4, errstring=0x829c415 "", mask=6) at exceptions.c:518 #24 0x0804bcb1 in gdb_main (args=0xbfffcce4) at ./main.c:919 #25 0x0804bc75 in main (argc=Cannot access memory at address 0x0 ) at gdb.c:34 any idea how to get the arm binaries correctly getting worked under arm simulator ? Regards, Oza. ----- Original Message ---- From: Pedro Alves To: paawan oza Cc: Baurzhan Ismagulov ; gdb@sourceware.org Sent: Thu, October 28, 2010 4:57:12 PM Subject: Re: gdb cross compilation, error from gdb/tui module On Thursday 28 October 2010 12:13:12, paawan oza wrote: > 2) If I correctly understand, the nomenclature 'arm-tdep', does it mean > arm-target-depedent, and when I try to compile gdb with --target=arm-eabi or > arm-elf, it also compile arm-tdep.c as a packge of simulator. Is My > understanding correct ? Yes. -- Pedro Alves