From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11514 invoked by alias); 27 Sep 2010 10:08:13 -0000 Received: (qmail 11503 invoked by uid 22791); 27 Sep 2010 10:08:12 -0000 X-SWARE-Spam-Status: No, hits=2.5 required=5.0 tests=AWL,BAYES_50,TW_MD,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cdactvm.in (HELO cdactvm.in) (210.212.236.18) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 27 Sep 2010 10:08:05 +0000 Received: (from root@localhost) by cdactvm.in (8.12.10/8.12.10) id o8R9vkq8009742 for gdb@sourceware.org; Mon, 27 Sep 2010 15:27:46 +0530 Received: from HDG120 ([172.16.17.120]) by cdactvm.in (8.12.10/8.12.10) with ESMTP id o8R9vkUY009607 for ; Mon, 27 Sep 2010 15:27:46 +0530 From: "Thomas Joseph" To: Subject: Alignment error Date: Mon, 27 Sep 2010 10:08:00 -0000 Message-ID: <002001cb5e2b$5600aa80$781110ac@HDG120> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-scanner: Scanned by Xamime-LT 0.1.5 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-09/txt/msg00148.txt.bz2 Hi, This is regarding to the alignment error generated by GDB when compiled in same GCC with u-boot makefile. I wrote a small code consisting of following statements for the ARM platform int* pInt = (int*)0x10002004; //word-aligned char* pChar = (char* )0x10003005; //non-word-aligned *pInt = 0x34; *pChar = 'A'; The assembly mnemonics for the above two statements are STR and STRB respectively. This I made part of the u-boot and build successfully for the smdk2400 platform. But when I debugged with GDB, *pChar = 'A' throwed an exception. Later, I put the above code snippet into my own main() and compiled at the command prompt without any makefile. This time also STR and STRB respectively were generated. But it worked without any exception in the same gdb. So, the same source code and also the same ASM mnemonic works differently with the code generation commands(i.e., gcc). In this regard, I am searching for the gcc command line argument present in the u-boot makefile which throws exception in GDB for accessing non-word-aligned address that corresponds to char*. Kindly give me useful tips. Regards, Thomas Joseph ______________________________________ Scanned and protected by Email scanner