List Info

Thread: Can't step assembler code that in user-defined section




Can't step assembler code that in user-defined section
user name
2008-03-24 06:04:13
Hi all:

Recently I using the arm-gdb to debug my arm code, and find
some
"bugs" in arm-gdb.One of my assembler source has
3
sections-----".init",".text",".fini
", these 3 sections are not
adjacent after link, the ".init" section comes
first, then the ".text"
section ,and finally the ".fini". I set a
breakpoint in the line of
the ".init" section, and used "r"
command in arm-gdb then it stop in
correct position, then I typed "step" command
attempting that it will
stops in the next line, but gdb warned the following
messages:
"Cannot find bounds of current function,Single stepping
until exit
from function __rest,which has no line number
information."

I tracked the execution of the gdb for a while, and finally
find the
problem. In dbxread.c, there is a function
"read_dbx_symtab", this
function initialize the the "psymtabs" member of
global var
"object_files"(and also other
functions, but I don't care), the psymtabs chain is created
from the
debug information in the final exectuable file, mainly the
stabs debug
inforamtion whose type is "N_SO". The psymtabs's
textlow member is
determided by this "N_SO" stabs's value, which is
this file's inital
".text" section address in the final executable
file. For example, the
final address of this 3 sections shows in follow:

.init:  0x0  - 0x200
.text:  0x500 - 0x600
.fini:  0x900   - 0xC00

then the textlow and texthigh member of the psymtabs node in
psymtabs
chain of this assemble file is 0x500 and 0x600! I made a
change in
"read_dbx_symtab", and the textlow and texthigh is
0x0 and 0xC00, but
when I set a breakpoint in the ".fini" section
soure line and use
"step" after break, there comes an another
problem, the gdb executes
this assemble's code, but it displays other's assembler
file's
contents.This assembler's code range is 0x700-0x800.

   For the situation of single assembler file containing
several
sections which are not adjacent, I suggest that during
psymtabs
creating, there should be
multiple psymtabs node for individual sections, with which
sharing a file(their
"filename" member is same).

 The gdb version is :

GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public
License, and you are
welcome to change it and/or distribute copies of it under
certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show
warranty" for details.
This GDB was configured as "--host=i686-pc-cygwin
--target=arm"



redriver

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )