Subject: gdb: single stepping fails with unrelated "Cannot access memory at 
address 0x7c8"
Package: gdb
Version: 6.8-3
Severity: important

*** Please type your report below this line ***
After a single stepping a few times (using a command macro "g" that expands to
"stepi\n x/i $pc\n") then single stepping and many other commands fail to work
at all.  The complaint is "Cannot access memory at address 0x7c8" where address
0x7c8 is not relevant to any part of the requested action.  This makes gdb
mostly unusable.

The architecture is armel-eabi on a Linksys NSLU2 (armv5te).

Here is a copy+paste from text console:
-----
$ gdb date.upx
GNU gdb 6.8-debian
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 "arm-linux-gnueabi"...
(no debugging symbols found)
(gdb) b *0xd9f0
Breakpoint 1 at 0xd9f0
(gdb) run
Starting program: /home/jreiser/date.upx

Breakpoint 1, 0x0000d9f0 in ?? ()
(gdb) x/i $pc
Cannot access memory at address 0x0
0xd9f0: ldm     r12, {r1, r2, r10, r11}
(gdb) g
Cannot access memory at address 0x264
0x0000d9f4 in ?? ()
0xd9f4: add     r10, r10, r12
(gdb)
Cannot access memory at address 0x264
0x0000d9f8 in ?? ()
0xd9f8: add     r11, r11, r12
(gdb)
Cannot access memory at address 0x7c8
(gdb) info reg
r0             0x0      0x0
r1             0x59dc   0x59dc
r2             0x20000  0x20000
r3             0x0      0x0
r4             0x0      0x0
r5             0x0      0x0
r6             0x0      0x0
r7             0x0      0x0
r8             0x0      0x0
r9             0x0      0x0
r10            0xdb6c   0xdb6c
r11            0xdc40   0xdc40
r12            0xd9dc   0xd9dc
sp             0xbeda3970       0xbeda3970
lr             0x0      0x0
pc             0xd9fc   0xd9fc
fps            0x1001000        0x1001000
cpsr           0x10     0x10
(gdb) x/i $pc
Cannot access memory at address 0x7c8
(gdb) p $pc
Cannot access memory at address 0x7c8
(gdb) x/i 0xd9fc
0xd9fc: mov     r0, r2
(gdb) g
Cannot access memory at address 0x7c8
(gdb) x/i 0xd9fc
0xd9fc: mov     r0, r2
(gdb)
0xda00: sub     r9, r12, r1
(gdb)
0xda04: add     r1, r1, #4096   ; 0x1000
(gdb) tbreak *$_
Breakpoint 2 at 0xda04
(gdb) c
Continuing.
0x0000da04 in ?? ()
(gdb) x/i $pc
Cannot access memory at address 0x7c8
(gdb) g
Cannot access memory at address 0x7c8
(gdb) q
The program is running.  Exit anyway? (y or n) y
$
-----

I will try to attach the complete program date.upx:
-rwxr-xr-x  1 jreiser jreiser    25148 Jul 20 13:45 date.upx

The relevant contents of $HOME/.gdbinit are:
-----
set output-radix 0x10

define g
stepi
x/i $pc
end
-----

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: armel (armv5tel)

Kernel: Linux 2.6.24-1-ixp4xx
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages gdb depends on:
ii  libc6                     2.7-10         GNU C Library: Shared libraries
ii  libexpat1                 1.95.8-4       XML parsing C library - runtime li
ii  libgcc1                   1:4.3.1-2      GCC support library
ii  libncurses5               5.6+20080308-1 Shared libraries for terminal hand
ii  libreadline5              5.2-3          GNU readline and history libraries

gdb recommends no packages.

-- no debconf information

-- 

Attachment: date.upx
Description: Binary data

Reply via email to