Merge branch ucsim-034-pre3 to main trunk; new version 0.4
[fw/sdcc] / sim / ucsim / cmd.src / bp.cc
index 19c3e767525fce837a58af706f1440c49d0bd8de..7a1302408363d123b35b376c3bdffd714932c605 100644 (file)
@@ -83,7 +83,7 @@ COMMAND_DO_WORK_UC(cl_break_cmd)
   }
   else
     {
-      con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+      con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
       return(DD_FALSE);
     }
   return(DD_FALSE);
@@ -95,19 +95,20 @@ cl_break_cmd::do_fetch(class cl_uc *uc,
 {
   if (hit > 99999)
     {
-      con->printf("Hit value %d is too big.\n", hit);
+      con->dd_printf("Hit value %d is too big.\n", hit);
       return;
     }
   if (uc->fbrk->bp_at(addr))
-    con->printf("Breakpoint at 0x%06x is already set.\n", addr);
+    con->dd_printf("Breakpoint at 0x%06x is already set.\n", addr);
   else
     {
-      class cl_brk *b= new cl_fetch_brk(uc->make_new_brknr(),
+      class cl_brk *b= new cl_fetch_brk(uc->mem(MEM_ROM),
+                                       uc->make_new_brknr(),
                                        addr, perm, hit);
       b->init();
       uc->fbrk->add_bp(b);
       char *s= uc->disass(addr, NULL);
-      con->printf("Breakpoint %d at 0x%06x: %s\n", b->nr, addr, s);
+      con->dd_printf("Breakpoint %d at 0x%06x: %s\n", b->nr, addr, s);
       free(s);
     }
 }
@@ -123,7 +124,7 @@ cl_break_cmd::do_event(class cl_uc *uc,
   if (b)
     uc->ebrk->add_bp(b);
   else
-    con->printf("Couldn't make event breakpoint\n");
+    con->dd_printf("Couldn't make event breakpoint\n");
 }
 
 
@@ -143,7 +144,7 @@ COMMAND_DO_WORK_UC(cl_clear_cmd)
     {
       if (!brk)
        {
-         con->printf("No breakpoint at this address.\n");
+         con->dd_printf("No breakpoint at this address.\n");
          return(0);
        }
       uc->fbrk->del_bp(uc->PC);
@@ -159,7 +160,7 @@ COMMAND_DO_WORK_UC(cl_clear_cmd)
        return(DD_FALSE);
       addr= param->value.address;
       if (uc->fbrk->bp_at(addr) == 0)
-       con->printf("No breakpoint at 0x%06x\n", addr);
+       con->dd_printf("No breakpoint at 0x%06x\n", addr);
       else
        uc->fbrk->del_bp(addr);
     }
@@ -190,7 +191,10 @@ COMMAND_DO_WORK_UC(cl_delete_cmd)
        {
          long num;
          if (param->get_ivalue(&num))
-           uc->rm_brk(num);
+           {
+             if (!uc->rm_brk(num))
+               con->dd_printf("Error\n");
+           }
        }
     }
   return(DD_FALSE);