public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: GDB and thread
Date: Sun, 29 Dec 2019 07:25:00 -0000	[thread overview]
Message-ID: <5bb42265-9adf-9499-0b94-ab1f2b139e58@SystematicSw.ab.ca> (raw)
In-Reply-To: <d24dfbbd-5883-4675-1889-9428142aca04@gmail.com>

On 2019-12-28 15:28, Marco Atzeri wrote:
> Am 28.12.2019 um 23:03 schrieb Ken Brown:
>> On 12/28/2019 4:27 PM, Marco Atzeri wrote:
>>> I am trying to debug the libuv test failures,
>>> but it seems I am not able to convince GDB on stopping
>>> just before the failure.
>>>
>>> Is "thread apply all" working on Cygwin ?
>>> The fact that produces no output in comparison to
>>> a normal break command is a bit strange
>>>
>>> (gdb) break test-dlerror.c:34
>>> Breakpoint 1 at 0x10040b0b0: file /pub/devel/libuv/libuv-1.34.0/test/test-dlerro
>>> r.c, line 34.
>>> (gdb) thread apply all break test-dlerror.c:34
>>
>> Others know this better than I do, but I seem to recall that a break command
>> automatically applies to all threads.  In other words, "thread apply all" is
>> redundant.
> 
> It seems to ignore any break for what I see.
> thread apply all was a tentative after simple break was ineffective

>>> Any hint will be appreciated
>>
>> Might this be related to optimization?  That could change the order in which
>> lines of code are executed.  Have you tried building without optimization?
> 
> Already thought, but it is built with -ggdb -O0
Recommended to use at least -Og nowadays for better debugging:

	$ info gcc inv debug

"With no '-O' option at all, some compiler passes that collect information
useful for debugging do not run at all, so that '-Og' may result in a better
debugging experience."

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

WARNING: multiple messages have this Message-ID
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: GDB and thread
Date: Sun, 29 Dec 2019 12:58:00 -0000	[thread overview]
Message-ID: <5bb42265-9adf-9499-0b94-ab1f2b139e58@SystematicSw.ab.ca> (raw)
Message-ID: <20191229125800.F61BwTEu5otwFTmgy66o1n0VrNwUvz-RyAep0KKYjKU@z> (raw)
In-Reply-To: <d24dfbbd-5883-4675-1889-9428142aca04@gmail.com>

On 2019-12-28 15:28, Marco Atzeri wrote:
> Am 28.12.2019 um 23:03 schrieb Ken Brown:
>> On 12/28/2019 4:27 PM, Marco Atzeri wrote:
>>> I am trying to debug the libuv test failures,
>>> but it seems I am not able to convince GDB on stopping
>>> just before the failure.
>>>
>>> Is "thread apply all" working on Cygwin ?
>>> The fact that produces no output in comparison to
>>> a normal break command is a bit strange
>>>
>>> (gdb) break test-dlerror.c:34
>>> Breakpoint 1 at 0x10040b0b0: file /pub/devel/libuv/libuv-1.34.0/test/test-dlerro
>>> r.c, line 34.
>>> (gdb) thread apply all break test-dlerror.c:34
>>
>> Others know this better than I do, but I seem to recall that a break command
>> automatically applies to all threads.  In other words, "thread apply all" is
>> redundant.
> 
> It seems to ignore any break for what I see.
> thread apply all was a tentative after simple break was ineffective

>>> Any hint will be appreciated
>>
>> Might this be related to optimization?  That could change the order in which
>> lines of code are executed.  Have you tried building without optimization?
> 
> Already thought, but it is built with -ggdb -O0
Recommended to use at least -Og nowadays for better debugging:

	$ info gcc inv debug

"With no '-O' option at all, some compiler passes that collect information
useful for debugging do not run at all, so that '-Og' may result in a better
debugging experience."

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  reply	other threads:[~2019-12-29  4:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-28 22:05 Marco Atzeri
2019-12-28 22:28 ` Ken Brown
2019-12-29  4:39   ` Marco Atzeri
2019-12-29  7:25     ` Brian Inglis [this message]
2019-12-29 12:58       ` Brian Inglis
2019-12-29 16:50       ` Marco Atzeri
2019-12-29 17:25 ` Jon Turney
2019-12-29 17:57   ` Marco Atzeri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5bb42265-9adf-9499-0b94-ab1f2b139e58@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).