This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch/testcase] fix gdb.base/relocate.c


The attached patch fixes gdb.base/relocate.c.

"relocate.exp: get address of function_bar" fails with m32r-elf-gdb
as the following:

print &function_bar
$6 = (int (*)(void)) 0xc <global_bar>
(gdb) FAIL: gdb.base/relocate.exp: get address of function_bar (unknown output)

Both function_bar and global_bar have the same address, 0xc.
Though they belong to different sections, gdb considers they
are the same and prints global_bar's data instead of
function_bar's.

The same error happens with i386 if line 4 and 5 of relocate.c
are modified as the following:

short global_foo = 3;
short global_bar = 4;

I guess this is not gdb's bug but a feature and the testcase
should be modified. So I made a patch file.

The attached patch inserts a definition of a dummy array so that
global_bar and function_bar should not have the same address.

Kei

2003-07-08    Kei Sakamoto  <sakamoto.kei@renesas.com>

 * gdb.base/relocate.c : Add a dummy array to make global_bar
        and function_bar have different addresses.

Attachment: relocate.c.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]