From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3133 invoked by alias); 1 Oct 2013 08:32:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 3114 invoked by uid 89); 1 Oct 2013 08:32:56 -0000 Received: from mail-qc0-f173.google.com (HELO mail-qc0-f173.google.com) (209.85.216.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 01 Oct 2013 08:32:56 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.3.2 X-HELO: mail-qc0-f173.google.com Received: by mail-qc0-f173.google.com with SMTP id c3so4528611qcv.32 for ; Tue, 01 Oct 2013 01:32:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=yNmRBlBcFhGppW53bQmqHId0vXd9xvKE/O13olypgQ8=; b=aH3JV9pDLSwv7KM/NlHgWDg7dwQXLLWl1kT3WpPf4grQ+ca+S9gPY2snz80aCV6DlJ 53oWPE9pjJK20cHsvImqV4gc0FmUKzWhOn4LO8PJjhNAtA4P9RFg4Q3EZjlX1u5udrmT iHBQl6RQ8Oh6gVE46R0e2vJhdQ0NXo7Hm6Ed6QDsWPLuyDn7NUse6Boc6Z6d/L1UYTyY V7GlDLR5hMuO8us0wrDgoGiC3dhwuyTLFeZq21oC2xf8AJ3wTJTIMjVP1ryG/1ulTb/q s9/+Nohm940pOP7/Ue1/eDtWEVFDTXSshNx4xG/RjU/XY1fVE26QdhrQHJ5JvvQjbO+x ROew== X-Gm-Message-State: ALoCoQl86uaj/G6iahBHW6CR1wfyFRlU8wlsaOyhcyQPqP8dPRoMJ7/TkLo3nbkdzaQwwwKcGWWq X-Received: by 10.224.54.129 with SMTP id q1mr38036722qag.19.1380616372797; Tue, 01 Oct 2013 01:32:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.49.87.39 with HTTP; Tue, 1 Oct 2013 01:32:31 -0700 (PDT) In-Reply-To: <523B1DDE.2060002@redhat.com> References: <51F7DDF0.8090605@redhat.com> <523B1DDE.2060002@redhat.com> From: Omair Javaid Date: Tue, 01 Oct 2013 08:32:00 -0000 Message-ID: Subject: Re: [PATCH] testsuite/gdb.dwarf2: Fix for dw2-dos-drive failure on ARM To: Pedro Alves Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00013.txt.bz2 On 19 September 2013 20:53, Pedro Alves wrote: > Please don't top post. > > On 09/19/2013 04:23 PM, Omair Javaid wrote: >> Thanks everyone for the feedback. >> >> I am getting following problem with 1byte text section in the dw2-dos-drive.exp >> >> (gdb) PASS: gdb.dwarf2/dw2-dos-drive.exp: set breakpoint pending off >> break 'z:file.c':func >> Cannot access memory at address 0x0 >> >> When I change this to 4bytes the problem gets fixed. That is why I >> thought this could be an unaligned illegal memory access but I accept >> that the above comments verify that its not a alignment issue. >> >> Can anyone help me figure out what could be the cause of this problem? > > Breakpoint instructions on ARM are 4-byte wide. It sounds like > GDB is trying to read the memory at the breakpoint's address, and > that fails (that error message comes from GDB, not the program). > AFAICS, the test doesn't execute the compiled object's code, so > GDB will try to read memory from the binary's sections. As the > section is only 1 byte long, and probably no other section is allocated > contiguously, that'll fail... To confirm, debug GDB under GDB, > and put a break on throw_it or some such. Then work up the stack > to see where that is thrown, and why. > > -- > Pedro Alves > I have verified the error is being thrown by gdb while its unable to read the 4byte breakpoint address. Heres the call stack: Thread [1] (Suspended: Breakpoint hit.) 38 throw_error() exceptions.c:444 0x0016728c 37 memory_error() corefile.c:204 0x001d1fcc 36 read_memory() corefile.c:223 0x001d201a 35 read_memory_unsigned_integer() corefile.c:312 0x001d2166 34 arm_skip_prologue() arm-tdep.c:1452 0x00054270 33 gdbarch_skip_prologue() gdbarch.c:2603 0x00176e5c 32 skip_prologue_sal() symtab.c:2869 0x0013dad2 31 find_function_start_sal() symtab.c:2782 0x0013d9aa 30 symbol_to_sal() linespec.c:3622 0x0014f722 29 convert_linespec_to_sals() linespec.c:2028 0x0014d6fa 28 parse_linespec() linespec.c:2319 0x0014dc04 27 decode_line_full() linespec.c:2430 0x0014df44 26 parse_breakpoint_sals() breakpoint.c:9323 0x00108560 25 create_sals_from_address_default() breakpoint.c:14306 0x0010ec6e 24 bkpt_create_sals_from_address() breakpoint.c:13123 0x0010d736 23 create_breakpoint() breakpoint.c:9554 0x00108a6e 22 break_command_1() breakpoint.c:9772 0x00108ef0 21 break_command() breakpoint.c:9845 0x00109000 20 do_cfunc() cli-decode.c:113 0x000a4782 19 cmd_func() cli-decode.c:1859 0x000a669c 18 execute_command() top.c:484 0x0022299c 17 command_handler() event-top.c:431 0x0016fcac 16 command_line_handler() event-top.c:629 0x0017028e 15 rl_callback_read_char() callback.c:220 0x0026a9d2 14 rl_callback_read_char_wrapper() event-top.c:163 0x0016f880 13 stdin_event_handler() event-top.c:371 0x0016fba6 12 handle_file_event() event-loop.c:768 0x0016ec66 11 process_event() event-loop.c:342 0x0016e288 10 gdb_do_one_event() event-loop.c:406 0x0016e348 9 start_event_loop() event-loop.c:431 0x0016e38a 8 cli_command_loop() event-top.c:176 0x0016f8b2 7 current_interp_command_loop() interps.c:331 0x001685d8 6 captured_command_loop() main.c:258 0x00168e1c 5 catch_errors() exceptions.c:546 0x00167458 4 captured_main() main.c:1041 0x0016a19a 3 catch_errors() exceptions.c:546 0x00167458 2 gdb_main() main.c:1050 0x0016a1ca 1 main() gdb.c:34 0x0004f26c I guess only way to address it is to either use the patch I have posted or may be disable the test for arm? Any suggestions? Thanks!