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 gdb/14916] New: Segmentation fault when running python script


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

             Bug #: 14916
           Summary: Segmentation fault when running python script
           Product: gdb
           Version: 7.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: daniel.zaoui@yahoo.com
    Classification: Unclassified


In .gdbinit, I source the following python file eo_step.py (prints are
temporary here for debug):
class Eo_step(gdb.Command):
   def __init__(self):
      print "11"
      gdb.Command.__init__(self, "eo_step", gdb.COMMAND_OBSCURE)
      print "12"

   def invoke (self, arg, from_tty):
      print "21"
      while True:
         print "22"
         gdb.execute("step")
         print "23"
         self.priv_filename = gdb.selected_frame().find_sal().symtab.filename
         print "24"
         self.priv_function = gdb.selected_frame().function()
         print "25"
         if (self.priv_filename != "lib/eo/eo.c") and (self.priv_function !=
None):
            print "26"
            break
         if (self.priv_filename == "lib/eo/eo.c"):
            print "27"
            gdb.execute("step")
         if (self.priv_function == None):
            print "28"
            gdb.execute("finish")
Eo_step()

I run gdb with my program and put a breakpoint on a specific function that is
supposed to call a function of the file eo.c. Then I run it and it stops on the
breakpoint.
I run my eo_step command that will step while the current function is in eo.c
or the function is None (it is used for the moment to jump over functions like
memcpy).
When I run my program from the beginning (without exiting gdb), it stops as
expected at the breakpoint. When I run eo_step, a segfault occurs.
The last number I see in the terminal is 24, i.e supposed to fail just after.

Thank you for your help
Daniel

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