* Copyright (c) 1991,1990 Carnegie Mellon University
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
* Carnegie Mellon requests users of this software to return to
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
* $Log: db_write_cmd.c,v $
* Revision 1.1 1992/03/25 21:45:42 pace
* Revision 2.4 91/02/05 17:07:35 mrt
* Changed to new Mach copyright
* [91/01/31 16:20:19 mrt]
* Revision 2.3 90/10/25 14:44:26 rwd
* Changed db_write_cmd to print unsigned.
* Revision 2.2 90/08/27 21:53:54 dbg
* Set db_prev and db_next instead of explicitly advancing dot.
* Reflected changes in db_printsym()'s calling seq.
* Warn user if nothing was written.
* Author: David B. Golub, Carnegie Mellon University
#include <machine/db_machdep.h>
#include <ddb/db_access.h>
#include <ddb/db_command.h>
db_write_cmd(address
, have_addr
, count
, modif
)
boolean_t wrote_one
= FALSE
;
addr
= (db_addr_t
) address
;
db_error("Unknown size\n");
while (db_expression(&new_value
)) {
old_value
= db_get_value(addr
, size
, FALSE
);
db_printsym(addr
, DB_STGY_ANY
);
db_printf("\t\t%#8n\t=\t%#8n\n", old_value
, new_value
);
db_put_value(addr
, size
, new_value
);
db_error("Nothing written.\n");