Tuesday, February 9th 2010, 12:53pm UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Date of registration: Aug 10th 2009

Posts: 1

1

Monday, August 10th 2009, 11:38am

Problem with GDB fetching CPSR value.

Hello,

Recently I'm working on a AT91SAM9263 based project. I encountered a problem that the GDB debugger cannot step conditional jump instrution such as "beq 0x********". I notice that GDB is always thinking the register CPSR's value is 0xd3 when debugging program. Therefore, GDB misplaces the breakpoint needed for stepping and continues to run. See the following:

GNU gdb (Sourcery G++ Lite 2009q1-203) 6.8.50.20081022-cvs
Copyright (C) 2008 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=i686-pc-linux-gnu --target=arm-none-linux-gnueabi".
For bug reporting instructions, please see:
<
https://support.codesourcery.com/GNUToolchain/>.
(gdb) tar remote 192.168.5.9:2331
Remote debugging using 192.168.5.9:2331
0x00000000 in ?? ()
(gdb) info reg
r0 0x0 0
r1 0x0 0
r2 0x0 0
r3 0x0 0
r4 0x0 0
r5 0x0 0
r6 0x0 0
r7 0x0 0
r8 0x0 0
r9 0x0 0
r10 0x0 0
r11 0x0 0
r12 0x0 0
sp 0x0 0x0
lr 0x0 0
pc 0x0 0
fps 0x0 0
cpsr 0xd3 211
(gdb) mon regs
PC = 23F15568, CPSR = 600000D3 (SVC mode, ARM FIQ dis. IRQ dis.)
R0 = 00000000, R1 = 23F5F014, R2 = 00000000, R3 = 40001A1A
R4 = 23E7EFC0, R5 = 00000000, R6 = 00000000, R7 = 00000000
USR: R8 =23E7EFDC, R9 =00000000, R10=00000000, R11 =23E7ED90, R12 =23F51D74


Actually, r0 to r15 can be changed when executing program. Whatever you do, even change CPSR's value directly, command "info reg" shows CPSR never changed.

I have tried gdb 6.5 and gdb 6.8, J-Link 3.80a, 3.94 and 4.08i, the problem was all the same.
  • Go to the top of the page

SEGGER - Alex

Super Moderator

Date of registration: Dec 18th 2007

Posts: 189

2

Thursday, August 27th 2009, 12:41pm

Hello cosine,

>>I notice that GDB is always thinking the register CPSR's value is 0xd3 when debugging program.
This is fixed in the latest beta version of the J-Link GDB Server (V4.09b).

Note: When changing a register's value, the "Flush regs" command has to be
executed prior to the "info reg" command to invoke an update of the GDB's register cache.

The latest beta version is available for download on our website:
http://www.segger.com/download_jlink_beta.html

Best regards
Alex
  • Go to the top of the page