Date: Sun, 13 Jun 2004 20:30:25 GMT From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 54855 for review Message-ID: <200406132030.i5DKUPxG045732@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=54855 Change 54855 by marcel@marcel_nfs on 2004/06/13 20:29:36 The variable access functions are supposed to return 1 on success and 0 only on failure. Fix them. Affected files ... .. //depot/projects/gdb/sys/i386/i386/db_trace.c#9 edit Differences ... ==== //depot/projects/gdb/sys/i386/i386/db_trace.c#9 (text+ko) ==== @@ -101,7 +101,7 @@ *valuep = r ## reg (); \ else \ load_ ## reg (*valuep); \ - return (0); \ + return (1); \ } DB_DRX_FUNC(dr0) @@ -125,32 +125,43 @@ { int *reg; + if (kdb_frame == NULL) + return (0); + reg = (int *)((uintptr_t)kdb_frame + (db_expr_t)vp->valuep); if (op == DB_VAR_GET) *valuep = *reg; else *reg = *valuep; - return (0); + return (1); } static int db_esp(struct db_variable *vp, db_expr_t *valuep, int op) { + + if (kdb_frame == NULL) + return (0); + if (op == DB_VAR_GET) *valuep = get_esp(kdb_frame); else if (ISPL(kdb_frame->tf_cs)) kdb_frame->tf_esp = *valuep; - return (0); + return (1); } static int db_ss(struct db_variable *vp, db_expr_t *valuep, int op) { + + if (kdb_frame == NULL) + return (0); + if (op == DB_VAR_GET) *valuep = (ISPL(kdb_frame->tf_cs)) ? kdb_frame->tf_ss : rss(); else if (ISPL(kdb_frame->tf_cs)) kdb_frame->tf_ss = *valuep; - return (0); + return (1); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406132030.i5DKUPxG045732>