/* Print i386 instructions for GDB, the GNU debugger.
- Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc.
+ Copyright (C) 1988, 1989, 1991, 1993, 1994 Free Software Foundation, Inc.
This file is part of GDB.
*/
#include "dis-asm.h"
+#include <string.h>
#define MAXLEN 20
if (status != 0)
{
(*info->memory_error_func) (status, start, info);
- longjmp (priv->bailout);
+ longjmp (priv->bailout, 1);
}
else
priv->max_fetched = addr;
{ "stosS", Yv, eAX },
{ "lodsb", AL, Xb },
{ "lodsS", eAX, Xv },
- { "scasb", AL, Xb },
- { "scasS", eAX, Xv },
+ { "scasb", AL, Yb },
+ { "scasS", eAX, Yv },
/* b0 */
{ "movb", AL, Ib },
{ "movb", CL, Ib },
else
dp = &dis386[*codep];
codep++;
+
+ /* Fetch the mod/reg/rm byte. FIXME: We should be only fetching
+ this if we need it. As it is, this code loses if there is a
+ one-byte instruction (without a mod/reg/rm byte) at the end of
+ the address space. */
+
FETCH_DATA (info, codep + 1);
mod = (*codep >> 6) & 3;
reg = (*codep >> 3) & 7;
rm = *codep & 7;
-
+
if (dp->name == NULL && dp->bytemode1 == FLOATCODE)
{
dofloat ();
if (*first)
{
if (op_index[0] != -1)
- print_address (op_address[op_index[0]], info->stream);
+ (*info->print_address_func) (op_address[op_index[0]], info);
else
(*info->fprintf_func) (info->stream, "%s", first);
needcomma = 1;
if (needcomma)
(*info->fprintf_func) (info->stream, ",");
if (op_index[1] != -1)
- print_address (op_address[op_index[1]], info->stream);
+ (*info->print_address_func) (op_address[op_index[1]], info);
else
(*info->fprintf_func) (info->stream, "%s", second);
needcomma = 1;
if (needcomma)
(*info->fprintf_func) (info->stream, ",");
if (op_index[2] != -1)
- print_address (op_address[op_index[2]], info->stream);
+ (*info->print_address_func) (op_address[op_index[2]], info);
else
(*info->fprintf_func) (info->stream, "%s", third);
}