public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/18733] New: GDB sees alternative instance of static template member variable in shared objects
@ 2015-07-29 11:59 christopher.hite at sc dot com
  2015-07-29 12:00 ` [Bug gdb/18733] " christopher.hite at sc dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: christopher.hite at sc dot com @ 2015-07-29 11:59 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18733

            Bug ID: 18733
           Summary: GDB sees alternative instance of static template
                    member variable in shared objects
           Product: gdb
           Version: 7.9
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: christopher.hite at sc dot com
  Target Milestone: ---

Created attachment 8456
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8456&action=edit
main (would like to submit all files in one post)

gdb-7.9.1 and 7.7.1

When a templated class's static member variable is defined in referenced in
multiple compilation scopes it must be reference the same object.

The code works fine.  GDB sees some other instance of the object which isn't
updating.

13              X<0>::m=2;
(gdb) n
14              printState();
(gdb) print X<0>::m
$4 = 1                       <============ Should be 2
(gdb) n
2 2


This works as expected when the program is built like this:
g++ -g *.cpp 

but not when built like this:
g++ -c -g -fpic lib.cpp
g++ -shared -o liblib.so lib.o
g++ main.cpp -g  -L. -llib

I will attach the tiny sources.  This is a very reproducible bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug gdb/18733] GDB sees alternative instance of static template member variable in shared objects
  2015-07-29 11:59 [Bug gdb/18733] New: GDB sees alternative instance of static template member variable in shared objects christopher.hite at sc dot com
@ 2015-07-29 12:00 ` christopher.hite at sc dot com
  2015-07-29 12:01 ` christopher.hite at sc dot com
  2015-07-30 14:54 ` christopher.hite at sc dot com
  2 siblings, 0 replies; 4+ messages in thread
From: christopher.hite at sc dot com @ 2015-07-29 12:00 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18733

--- Comment #1 from Christopher Hite <christopher.hite at sc dot com> ---
Created attachment 8457
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8457&action=edit
header

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug gdb/18733] GDB sees alternative instance of static template member variable in shared objects
  2015-07-29 11:59 [Bug gdb/18733] New: GDB sees alternative instance of static template member variable in shared objects christopher.hite at sc dot com
  2015-07-29 12:00 ` [Bug gdb/18733] " christopher.hite at sc dot com
@ 2015-07-29 12:01 ` christopher.hite at sc dot com
  2015-07-30 14:54 ` christopher.hite at sc dot com
  2 siblings, 0 replies; 4+ messages in thread
From: christopher.hite at sc dot com @ 2015-07-29 12:01 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18733

--- Comment #2 from Christopher Hite <christopher.hite at sc dot com> ---
Created attachment 8458
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8458&action=edit
lib which defines X<0>::m

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug gdb/18733] GDB sees alternative instance of static template member variable in shared objects
  2015-07-29 11:59 [Bug gdb/18733] New: GDB sees alternative instance of static template member variable in shared objects christopher.hite at sc dot com
  2015-07-29 12:00 ` [Bug gdb/18733] " christopher.hite at sc dot com
  2015-07-29 12:01 ` christopher.hite at sc dot com
@ 2015-07-30 14:54 ` christopher.hite at sc dot com
  2 siblings, 0 replies; 4+ messages in thread
From: christopher.hite at sc dot com @ 2015-07-30 14:54 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18733

Christopher Hite <christopher.hite at sc dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |christopher.hite at sc dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-30 14:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-29 11:59 [Bug gdb/18733] New: GDB sees alternative instance of static template member variable in shared objects christopher.hite at sc dot com
2015-07-29 12:00 ` [Bug gdb/18733] " christopher.hite at sc dot com
2015-07-29 12:01 ` christopher.hite at sc dot com
2015-07-30 14:54 ` christopher.hite at sc dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).