public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "simon.marchi at polymtl dot ca" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug breakpoints/13463] bad multi-inferior behavior with breakpoint resetting
Date: Mon, 05 Aug 2013 19:11:00 -0000	[thread overview]
Message-ID: <bug-13463-4717-5tKXJCz5NE@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-13463-4717@http.sourceware.org/bugzilla/>

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

Simon Marchi <simon.marchi at polymtl dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simon.marchi at polymtl dot ca

--- Comment #3 from Simon Marchi <simon.marchi at polymtl dot ca> ---
I think I have an even simpler test case that triggers this bug.

---8<---
#include <stdio.h>
#include <unistd.h>
#include <string.h>

void function_in_a() {
    printf("Hi, I'm a\n");
}

int main(int argc, char **argv) {
    for (;;) {
        function_in_a();
        sleep(1);
    }
    return 0;
}
--->8---

What I do:

$ gdb
(gdb) set non-stop on
(gdb) set target-async on
(gdb) file a <!-- the code above, compiled with no special flags) -->
(gdb) r &
(gdb) b function_in_a

I get the same kind of error: Cannot access memory at address 0x400504
>From what I understand, adding this breakpoint requires to read the running
inferior's memory to analyze the function prologue. GDB tries to read the
memory while the ptrace state of the inferior is "running", which isn't
allowed.

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


  parent reply	other threads:[~2013-08-05 19:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-01 18:50 [Bug breakpoints/13463] New: " tromey at redhat dot com
2011-12-01 18:53 ` [Bug breakpoints/13463] " tromey at redhat dot com
2012-10-24 16:51 ` palves at redhat dot com
2013-08-05 19:11 ` simon.marchi at polymtl dot ca [this message]
2013-08-05 19:59 ` simon.marchi at polymtl dot ca
2013-08-05 21:39 ` simon.marchi at polymtl dot ca
2021-07-01 13:07 ` cvs-commit at gcc dot gnu.org
2021-07-01 13:10 ` pedro at palves dot net

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=bug-13463-4717-5tKXJCz5NE@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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).