This is the mail archive of the gdb-patches@sources.redhat.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]
Other format: [Raw text]

Re: [PATCH] -data-list-changed-registers


 > I think the changes are right in this case, though.  Could you take a
 > look at those two functions (the change to make is obvious) and see if
 > that fixes your problem?

If you mean the changes below, then these seem fine and give:

(gdb) 
-data-list-changed-registers
&"No registers.\n"
^error,msg="No registers."
(gdb) 

I have presumed that similarly this is wrong:

(gdb) 
-data-list-register-values x
^error,msg="mi_cmd_data_list_register_values: No registers."
(gdb) 

and removed the same error check (if (!target_has_registers)...) so that
this also gives:

(gdb) 
-data-list-register-values x
&"No registers.\n"
^error,msg="No registers."
(gdb) 

mi_cmd_data_write_register_values has the same error check.  Should I remove
this too?


Nick


*** /home/nick/src/gdb/mi/mi-main.c.~1.78.~	2005-05-27 12:27:29.000000000 +1200
--- /home/nick/src/gdb/mi/mi-main.c	2005-06-04 23:34:21.000000000 +1200
***************
*** 388,394 ****
  {
    gdb_byte raw_buffer[MAX_REGISTER_SIZE];
  
!   if (! frame_register_read (deprecated_selected_frame, regnum, raw_buffer))
      return -1;
  
    if (memcmp (&old_regs[DEPRECATED_REGISTER_BYTE (regnum)], raw_buffer,
--- 388,394 ----
  {
    gdb_byte raw_buffer[MAX_REGISTER_SIZE];
  
!   if (! frame_register_read (get_selected_frame (NULL), regnum, raw_buffer))
      return -1;
  
    if (memcmp (&old_regs[DEPRECATED_REGISTER_BYTE (regnum)], raw_buffer,
***************
*** 433,444 ****
  
    format = (int) argv[0][0];
  
-   if (!target_has_registers)
-     {
-       mi_error_message = xstrprintf ("mi_cmd_data_list_register_values: No registers.");
-       return MI_CMD_ERROR;
-     }
- 
    list_cleanup = make_cleanup_ui_out_list_begin_end (uiout, "register-values");
  
    if (argc == 1)		/* No args, beside the format: do all the regs */
--- 433,438 ----
***************
*** 509,515 ****
    if (format == 'N')
      format = 0;
  
!   frame_register (deprecated_selected_frame, regnum, &optim, &lval, &addr,
  		  &realnum, buffer);
  
    if (optim)
--- 503,509 ----
    if (format == 'N')
      format = 0;
  
!   frame_register (get_selected_frame (NULL), regnum, &optim, &lval, &addr,
  		  &realnum, buffer);
  
    if (optim)


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