OSDN Git Service

* generic/gdbtk-cmds.c (gdb_load_disassembly): Save the original
authorKeith Seitz <keiths@redhat.com>
Mon, 20 Aug 2001 17:55:32 +0000 (17:55 +0000)
committerKeith Seitz <keiths@redhat.com>
Mon, 20 Aug 2001 17:55:32 +0000 (17:55 +0000)
address from parse_and_eval_address: if find_pc_partial_function
errors, we will lose our original address.
If find_pc_partial_function does error, print out both
the address we thought we were disassembling at AND the address
we actually did disassemble at. This should help elide address-
to-pointer and pointer-to-address problems in the tdep files.
* library/srctextwin.itb (FillAssembly): When gdb_load_disassembly
fails, use its error message instead of the cooked "Unable to
Read insturctions..." message.
(UnLoadFromCache): If oldpane is empty, don't try show it,
don't try to set our view to it, don't do anything but
erase the given pane.

gdb/gdbtk/ChangeLog
gdb/gdbtk/generic/gdbtk-cmds.c
gdb/gdbtk/library/srctextwin.itb

index a9312a2..4d1dd59 100644 (file)
@@ -1,3 +1,19 @@
+2001-08-20  Keith Seitz  <keiths@redhat.com>
+
+       * generic/gdbtk-cmds.c (gdb_load_disassembly): Save the original
+       address from parse_and_eval_address: if find_pc_partial_function
+       errors, we will lose our original address.
+       If find_pc_partial_function does error, print out both
+       the address we thought we were disassembling at AND the address
+       we actually did disassemble at. This should help elide address-
+       to-pointer and pointer-to-address problems.
+       * library/srctextwin.itb (FillAssembly): When gdb_load_disassembly
+       fails, use its error message instead of the cooked "Unable to
+       Read insturctions..." message.
+       (UnLoadFromCache): If oldpane is empty, don't try show it,
+       don't try to set our view to it, don't do anything but
+       erase the given pane.
+
 2001-08-17  Keith Seitz  <keiths@redhat.com>
 
        * generic/gdbtk-varobj.c (variable_obj_command): Pass pointer
index 7720294..79577a6 100644 (file)
@@ -1636,7 +1636,7 @@ static int
 gdb_load_disassembly (ClientData clientData, Tcl_Interp *interp,
                      int objc, Tcl_Obj *CONST objv[])
 {
-  CORE_ADDR low, high;
+  CORE_ADDR low, high, orig;
   struct disassembly_client_data client_data;
   int mixed_source_and_assembly, ret_val, i;
   char *arg_ptr;
@@ -1729,11 +1729,13 @@ gdb_load_disassembly (ClientData clientData, Tcl_Interp *interp,
   /* Now parse the addresses */
   
   low = parse_and_eval_address (Tcl_GetStringFromObj (objv[5], NULL));
+  orig = low;
 
   if (objc == 6)
     {
       if (find_pc_partial_function (low, NULL, &low, &high) == 0)
-        error ("No function contains specified address");
+       error ("No function contains address 0x%s (%s)",
+              paddr_nz (orig), Tcl_GetStringFromObj (objv[5], NULL));
     }
   else
     high = parse_and_eval_address (Tcl_GetStringFromObj (objv[6], NULL));
index 7850032..a17c902 100644 (file)
@@ -1034,7 +1034,7 @@ body SrcTextWin::FillAssembly {w tagname filename funcname line addr pc_addr lib
        set pane $Stwc(gdbtk_scratch_widget:pane)
        set win [[$itk_interior.p childsite $pane].st component text]
        $win delete 0.0 end
-       $win insert 0.0 "Unable to Read Instructions at $addr"
+       $win insert 0.0 "$mess"
        if {$oldpane != "" && $oldpane != $pane} {
          $itk_interior.p replace $oldpane $pane
        } else {
@@ -2773,9 +2773,11 @@ body SrcTextWin::UnLoadFromCache {w oldpane name asm lib} {
     unset Stwc($elem)
   }
 
-  $itk_interior.p show $oldpane
-  set pane $oldpane
-  set win [[$itk_interior.p childsite $pane].st component text]
+  if {$oldpane != ""} {
+    $itk_interior.p show $oldpane
+    set pane $oldpane
+    set win [[$itk_interior.p childsite $pane].st component text]
+  }
 }
 
 # ------------------------------------------------------------------