This is the mail archive of the gdb-prs@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]

gdb/6: static variable address incorrect in dynamically linked binary



>Number:         6
>Category:       gdb
>Synopsis:       static variable address incorrect in dynamically linked binary
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 07 08:38:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     ngupta@zumanetworks.com
>Release:        5.0 and up
>Organization:
>Environment:
gdb for powerpc on i586 linnux host
>Description:
we have an embedded system in which an application is dynamically added to the system, the symbols are added to gdb using the add_symbol_file command with the text, data, bss section information, if the object has global static variables, their address is incorrectly computed by gdb
in the proper context

c file looks like

static int test;

test_fn()
{
test = 5;
}

the object is dynamically relocated and the symbols added to gdb using add_symbol_file test.o -Ttext......

at break of the test_fn
p/x &test incorrect address of test ie the address is actual address +/- 4, this happens for only global static variables, in this object, everything else is fine
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

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