public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* break on C++ global objects ctors
@ 2014-03-26 18:22 Daniel Gutson
  2014-03-31 12:24 ` Daniel Gutson
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Gutson @ 2014-03-26 18:22 UTC (permalink / raw)
  To: gdb-patches

Hi,

    AFAIK, there is no command to break and debug the construction of
global objects in C++.

I'm looking for an equivalent command to "start" but instead of temp
breaking at the
beginning of main(), breaks at the beginning of every global ctor.

The way I'm currently doing this in GNU Linux/x86_64 is:
  br __static_initialization_and_destruction_0
which is a workaround, with the nice side effect that when asking info br, gdb
shows all the source locations of the global object instances.

I'm not sure whether this could supported by a native gdb feature or by a python
extension.
If there is consensus about the former, I might create some patch.
However, I suspect that this might require some support from collect2 too,
or some libc internals knowledge by gdb.

    Daniel.

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

end of thread, other threads:[~2014-09-26 18:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-26 18:22 break on C++ global objects ctors Daniel Gutson
2014-03-31 12:24 ` Daniel Gutson
2014-03-31 13:56   ` Paul_Koning
2014-03-31 14:10     ` Daniel Gutson
2014-03-31 14:16       ` Paul_Koning
2014-03-31 14:41         ` Daniel Gutson
2014-09-26 18:00           ` Daniel Gutson

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