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 python/12930] New: GDB state during gdb.Breakpoint::stopcallback is unclear


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

           Summary: GDB state during gdb.Breakpoint::stop callback is
                    unclear
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
        AssignedTo: unassigned@sourceware.org
        ReportedBy: kevin.pouget@gmail.com


GDB seems to be in a temporary state when gdb.Breakpoint::stop is called:
issuing gdb.execute("info threads") command highlights that the process is
viewed as running:

* 1    process 18244 "functionPtr" (running)

but some sequences of command (namely an "attach" in another inferior) will
revert to a "normal" state:

(gdb) r
Starting program: /home/kevin/travail/arm/perso/root/sample/debug/functionPtr 
  Id   Target Id         Frame 
* 1    process 18244 "functionPtr" (running)
Added inferior 2
[Switching to inferior 2 [process 0] (<noexec>)]

(SIGTTOU received)

0x0000003402e165c7 in open64 () from /lib64/ld-linux-x86-64.so.2
  Id   Target Id         Frame 
* 2    process 18251 "sleep" 0x0000003402e165c7 in open64 () from
/lib64/ld-linux-x86-64.so.2
  1    process 18244 "functionPtr" main () at ./functionPtr.c:8


it should be state somewhere a) what is allowed to do in `Breakpoint::stop'
function, or stabilize the state so that everything can be done

--

class MyBreakpoint(gdb.Breakpoint):
    def stop(self):
        gdb.execute("info threads")
        gdb.execute("add-inferior")
        gdb.execute("inferior 2")
        import subprocess
        sleep = subprocess.Popen(["sleep", "1000"])
        gdb.execute("attach %d" % sleep.pid)
        gdb.execute("info threads")

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


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