This is the mail archive of the gdb-patches@sourceware.cygnus.com 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]

Re: RFA: permanent breakpoints


Jim,

 > 
 > Request for approval.  This contains changes mostly to breakpoint.c,
 > but also has a small change to the GDBTk files, and pa64solib.c.
 > 
 > Here are the internal changes necessary to support "permanent"
 > breakpoints: breakpoints that are hardwired into the inferior's code
 > by the programmer.  GDB just knows they're there, but doesn't try to
 > insert or remove them.
 > 
 > GDB needs this to communicate properly with the dynamic linker on
 > HP/UX on PA 2.0 in wide (64-bit) mode.
 > 
 > There is no user interface for this, which is lame, but the HP
 > contract doesn't need it, and I'm low on time.  If folks think it's
 > interesting, I could add one later, write docs and a NEWS entry, etc.
 > 

I am just commenting on the gdbtk end of your changes.  It doesn't
look, at the Tcl level, like there is any way I can tell these
breakpoints are special.  I probably don't want to show them to the
user at all in the GUI, right?  If I do show them, then I certainly
don't want to allow the user to think that he/she can modify them.

Is the only way you know they are special the value of b->enable?  If
so, then maybe we need to change the Enabled value returned from
gdb_get_breakpoint_info from a simple boolean to a three valued
quantity, 0 being disabled, 1 being enabled, and -1 for permanent.
Actually, we should also have something for the call_disabled &
shlib_disabled types as well.  I made them -2.  Then in the GUI, I
will probably just ignore anything with a negative enabled value.  

I appended a patch to this message.  Look okay?

Jim.

Index: gdbtk-cmds.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/gdbtk-cmds.c,v
retrieving revision 2.57
diff -p -r2.57 gdbtk-cmds.c
*** gdbtk-cmds.c        1999/09/03 10:15:31     2.57
--- gdbtk-cmds.c        1999/09/13 17:14:47
*************** gdb_get_breakpoint_info (clientData, int
*** 3915,3921 ****
  {
    struct symtab_and_line sal;
    struct command_line *cmd;
!   int bpnum;
    struct breakpoint *b;
    extern struct breakpoint *breakpoint_chain;
    char *funcname, *filename;
--- 3915,3921 ----
  {
    struct symtab_and_line sal;
    struct command_line *cmd;
!   int bpnum, enable_result;
    struct breakpoint *b;
    extern struct breakpoint *breakpoint_chain;
    char *funcname, *filename;
*************** gdb_get_breakpoint_info (clientData, int
*** 3967,3974 ****
                                 paddr_nz (b->address));
    Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
                            Tcl_NewStringObj (bptypes[b->type], -1));
    Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
!                           Tcl_NewBooleanObj (b->enable == enabled));
    Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
                            Tcl_NewStringObj (bpdisp[b->disposition], -1));
    Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
--- 3967,3988 ----
                                 paddr_nz (b->address));
    Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
                            Tcl_NewStringObj (bptypes[b->type], -1));
+   switch (b->enable) {
+   case enabled:
+     enable_result = 1;
+     break;
+   case disabled:
+     enable_result = 0;
+     break;
+   case permanent:
+     enable_result = -1;
+     break;
+   default:
+     enable_result = -2;
+   }
+   
    Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
!                           Tcl_NewIntObj (enable_result));
    Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
                            Tcl_NewStringObj (bpdisp[b->disposition], -1));
    Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,

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