public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13427] New: Incorrect address of std::string argument in constructor when passing by value
@ 2011-11-22  3:52 davewong at syberdave dot net
  2011-11-24  7:28 ` [Bug c++/13427] " davewong at syberdave dot net
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: davewong at syberdave dot net @ 2011-11-22  3:52 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13427

             Bug #: 13427
           Summary: Incorrect address of std::string argument in
                    constructor when passing by value
           Product: gdb
           Version: 7.3
            Status: NEW
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned@sourceware.org
        ReportedBy: davewong@syberdave.net
    Classification: Unclassified


Created attachment 6070
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6070
Test case

When setting a breakpoint at a constructor, I cannot "print" an argument
because gdb doesn't get its address correct. See attached.

It may be useful to note that it works properly at a class method (as opposed
to the constructor).

gcc (Debian 4.5.3-1) 4.5.3
GNU gdb (GDB) 7.3-debian

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug c++/13427] Incorrect address of std::string argument in constructor when passing by value
  2011-11-22  3:52 [Bug c++/13427] New: Incorrect address of std::string argument in constructor when passing by value davewong at syberdave dot net
@ 2011-11-24  7:28 ` davewong at syberdave dot net
  2015-03-24 17:42 ` phil at kantaka dot co.uk
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: davewong at syberdave dot net @ 2011-11-24  7:28 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13427

Dave <davewong at syberdave dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |davewong at syberdave dot
                   |                            |net

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug c++/13427] Incorrect address of std::string argument in constructor when passing by value
  2011-11-22  3:52 [Bug c++/13427] New: Incorrect address of std::string argument in constructor when passing by value davewong at syberdave dot net
  2011-11-24  7:28 ` [Bug c++/13427] " davewong at syberdave dot net
@ 2015-03-24 17:42 ` phil at kantaka dot co.uk
  2015-03-25 15:03 ` phil at kantaka dot co.uk
  2020-04-05 12:28 ` ssbssa at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: phil at kantaka dot co.uk @ 2015-03-24 17:42 UTC (permalink / raw)
  To: gdb-prs

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

Phil Armstrong <phil at kantaka dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |phil at kantaka dot co.uk

--- Comment #1 from Phil Armstrong <phil at kantaka dot co.uk> ---
This bug still affects gdb 7.9 - See this stack overflow thread:
http://stackoverflow.com/questions/8980566/gdb-reports-wrong-address-for-parameter-in-c-objects-constructor#comment46681158_8980566

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


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

* [Bug c++/13427] Incorrect address of std::string argument in constructor when passing by value
  2011-11-22  3:52 [Bug c++/13427] New: Incorrect address of std::string argument in constructor when passing by value davewong at syberdave dot net
  2011-11-24  7:28 ` [Bug c++/13427] " davewong at syberdave dot net
  2015-03-24 17:42 ` phil at kantaka dot co.uk
@ 2015-03-25 15:03 ` phil at kantaka dot co.uk
  2020-04-05 12:28 ` ssbssa at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: phil at kantaka dot co.uk @ 2015-03-25 15:03 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Phil Armstrong <phil at kantaka dot co.uk> ---
Addendum: clang++ -gdwarf-4 creates a binary that gdb debugs correctly, so
maybe this is a gcc bug?

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


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

* [Bug c++/13427] Incorrect address of std::string argument in constructor when passing by value
  2011-11-22  3:52 [Bug c++/13427] New: Incorrect address of std::string argument in constructor when passing by value davewong at syberdave dot net
                   ` (2 preceding siblings ...)
  2015-03-25 15:03 ` phil at kantaka dot co.uk
@ 2020-04-05 12:28 ` ssbssa at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: ssbssa at sourceware dot org @ 2020-04-05 12:28 UTC (permalink / raw)
  To: gdb-prs

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

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ssbssa at sourceware dot org

--- Comment #3 from Hannes Domani <ssbssa at sourceware dot org> ---
(In reply to Phil Armstrong from comment #2)
> Addendum: clang++ -gdwarf-4 creates a binary that gdb debugs correctly, so
> maybe this is a gcc bug?

I can reproduce this problem when compiling with gcc up to version 8, but it
works fine for me with gcc 9, so I guess you were right that this was a gcc bug
(but I don't know which one).

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

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

end of thread, other threads:[~2020-04-05 12:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-22  3:52 [Bug c++/13427] New: Incorrect address of std::string argument in constructor when passing by value davewong at syberdave dot net
2011-11-24  7:28 ` [Bug c++/13427] " davewong at syberdave dot net
2015-03-24 17:42 ` phil at kantaka dot co.uk
2015-03-25 15:03 ` phil at kantaka dot co.uk
2020-04-05 12:28 ` ssbssa at sourceware dot org

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).