This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug breakpoints/13463] bad multi-inferior behavior with breakpoint resetting


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]