--- ddd-3.3.12/ddd/ddd.C	2009-02-11 18:25:07.000000000 +0100
+++ ddd-3.3.12/ddd/ddd.C	2010-02-26 14:13:23.000000000 +0100
@@ -300,7 +300,6 @@ extern "C" {
 }
 #endif
 
-
 //-----------------------------------------------------------------------------
 // Forward function decls
 //-----------------------------------------------------------------------------
@@ -339,6 +338,7 @@ static void gdbUpdateAllMenus();
 
 // Preferences
 static void make_preferences (Widget parent);
+static void make_regspref(Widget parent);
 static void dddPopupPreferencesCB (Widget, XtPointer, XtPointer);
 
 // Synchronize `():' fields
@@ -1231,6 +1231,68 @@ static MMDesc button_menu [] = 
     { "docs",  MMToggle, { dddToggleButtonDocsCB, 0 }, 0, &button_docs_w, 0,0},
     MMEnd
 };
+//buttons for the register window
+static Widget xmmDsply_w[8];
+static MMDesc register1_menu [] = 
+{
+	{"None",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(0)},0,&xmmDsply_w[0],0,0},
+	{"Float",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(1)},0,&xmmDsply_w[1],0,0},
+	{"Double",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(2)},0,&xmmDsply_w[2],0,0},
+	{"8 Bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(3)},0,&xmmDsply_w[3],0,0},
+	{"16 bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(4)},0,&xmmDsply_w[4],0,0},
+	{"32 bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(5)},0,&xmmDsply_w[5],0,0},
+	{"64 bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(6)},0,&xmmDsply_w[6],0,0},
+	{"128 bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(7)},0,&xmmDsply_w[7],0,0},
+ 	MMEnd
+};
+
+static Widget RegDisable_w[16];
+static MMDesc disableReg1_menu [] = 
+{
+	{"ax",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(14)},0,&RegDisable_w[0],0,0},
+	{"bx",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(15)},0,&RegDisable_w[1],0,0},
+	{"cx",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(16)},0,&RegDisable_w[2],0,0},
+	{"dx",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(17)},0,&RegDisable_w[3],0,0},
+	{"si",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(18)},0,&RegDisable_w[4],0,0},
+	{"di",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(19)},0,&RegDisable_w[5],0,0},
+	{"bp",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(20)},0,&RegDisable_w[6],0,0},
+	{"sp",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(21)},0,&RegDisable_w[7],0,0},
+	{"r8",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(22)},0,&RegDisable_w[8],0,0},
+	{"r9",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(23)},0,&RegDisable_w[9],0,0},
+	{"r10",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(24)},0,&RegDisable_w[10],0,0},
+	{"r11",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(25)},0,&RegDisable_w[11],0,0},
+	{"r12",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(26)},0,&RegDisable_w[12],0,0},
+	{"r13",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(27)},0,&RegDisable_w[13],0,0},
+	{"r14",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(28)},0,&RegDisable_w[14],0,0},
+	{"r15",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(29)},0,&RegDisable_w[15],0,0},
+ 	MMEnd
+};
+
+static Widget xRegDisable_w[8];
+static MMDesc xdisableReg1_menu [] = 
+{
+	{"ip",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(30)},0,&xRegDisable_w[0],0,0},
+	{"flags",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(31)},0,&xRegDisable_w[1],0,0},
+	{"cs",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(32)},0,&xRegDisable_w[2],0,0},
+	{"ss",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(33)},0,&xRegDisable_w[3],0,0},
+	{"ds",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(34)},0,&xRegDisable_w[4],0,0},
+	{"es",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(35)},0,&xRegDisable_w[5],0,0},
+	{"fs",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(36)},0,&xRegDisable_w[6],0,0},
+	{"gs",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(37)},0,&xRegDisable_w[7],0,0},
+ 	MMEnd
+};
+
+static Widget mmDsply_w[6];
+static MMDesc register3_menu[] = 
+{
+	{"None",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(8)},0,&mmDsply_w[0],0,0},
+	{"FP Reg",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(9)}, 0,&mmDsply_w[1],0,0},
+	{"8 Bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(10)}, 0,&mmDsply_w[2],0,0},
+	{"16 bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(11)},0,&mmDsply_w[3],0,0},
+	{"32 bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(12)},0,&mmDsply_w[4],0,0},
+	{"64 bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(13)},0,&mmDsply_w[5],0,0},
+   MMEnd
+};
 
 static Widget value_tips_w;
 static Widget value_docs_w;
@@ -1287,7 +1349,20 @@ static MMDesc general_preferences_menu[]
     { "undoSize",            MMPanel,  MMNoCB, undo_menu, 0, 0, 0 },
     MMEnd
 };
-
+//pushbuttons for the register window
+static Widget PMMX_w;
+static Widget PXMM_w;
+static MMDesc register_preferenes_menu[] = 
+{
+   { "ALL MMX",MMPush,{dddToggleFPMMXButton,0},0,&PMMX_w,0,0},
+	{"MMX",MMRadioPanel,MMNoCB,register3_menu,0,0,0},
+   { "ALL XMM",MMPush,{dddToggleXMMButton,0},0,&PXMM_w,0,0},
+	{"XMM",MMRadioPanel,MMNoCB,register1_menu,0,0,0},
+	MMSep,
+	{"MASK",MMButtonPanel,MMNoCB,disableReg1_menu,0,0,0},
+	{"XMASK",MMButtonPanel,MMNoCB,xdisableReg1_menu,0,0,0},
+	MMEnd
+};
 
 // Source preferences
 static Widget set_display_glyphs_w;
@@ -2800,6 +2875,73 @@ ddd_exit_t pre_main_loop(int argc, char 
     source_view->set_max_glyphs(app_data.max_glyphs);
     source_view->cache_glyph_images = app_data.cache_glyph_images;
 
+//-----------------------------------------------------------------------------
+// For new register display
+//-----------------------------------------------------------------------------
+
+	source_view->ProgramArch = -1;
+	source_view->RegsSaved = false;
+	source_view->xmregp = 0;
+	source_view->LastClicked = -1;
+	source_view->XmmSet = 0;
+	source_view->mmSet = 0;
+	strcpy(source_view->vfdblStr,"def vfdbl\ninf reg\n");
+	strcpy(source_view->fltStr,"ec \\nst0*\nou $st0\nec \\nst1*\nou $st1\nec \\nst2*\nou $st2\nec \\nst3*\nou $st3\nec \\nst4*\nou $st4\nec \\nst5*\nou $st5\nec \\nst6*\nou $st6\nec \\nst7*\nou $st7\n");
+	strcpy(source_view->fltstat,"ec \\nfctrl*\nou/x $fctrl\nec \\nfstat*\nou/x $fstat\nec \\nftag*\nou/x $ftag\nec \\nfiseg*\nou/x $fiseg\nec \\nfioff*\nou/x $fioff\nec \\nfoseg*\nou/x $foseg\nec \\nfooff*\nou/x $fooff\nec \\nfop*\nou/x $fop\n");
+	strcpy(source_view->mmx8x,"ec \\nmm0*\nou $mm0.v8_int8\n");
+	strcpy(source_view->mmx16x,"ec \\nmm0*\nou $mm0.v4_int16\n");
+	strcpy(source_view->mmx32x,"ec \\nmm0*\nou $mm0.v2_int32\n");
+	strcpy(source_view->mmx64x,"ec \\nmm0*\nou $mm0.uint64\n");
+	strcpy(source_view->xmmfloat,"ec \\nxmm0*\nou $xmm0.v4_float\n");
+	strcpy(source_view->xmmfloat10,"ec \\nxmm10*\nou $xmm10.v4_float\n");
+	strcpy(source_view->xmmdouble,"ec \\nxmm0*\nou $xmm0.v2_double\n");
+	strcpy(source_view->xmmdouble10,"ec \\nxmm10*\nou $xmm10.v2_double\n");
+	strcpy(source_view->xmmint8,"ec \\nxmm0*\nou $xmm0.v16_int8\n");
+	strcpy(source_view->xmmint810,"ec \\nxmm10*\nou $xmm10.v16_int8\n");
+	strcpy(source_view->xmmint16,"ec \\nxmm0*\nou $xmm0.v8_int16\n");
+	strcpy(source_view->xmmint1610,"ec \\nxmm10*\nou $xmm10.v8_int16\n");
+	strcpy(source_view->xmmint32,"ec \\nxmm0*\nou $xmm0.v4_int32\n");
+	strcpy(source_view->xmmint3210,"ec \\nxmm10*\nou $xmm10.v4_int32\n");
+	strcpy(source_view->xmmint64,"ec \\nxmm0*\nou $xmm0.v2_int64\n");
+	strcpy(source_view->xmmint6410,"ec \\nxmm10*\nou $xmm10.v2_int64\n");
+	strcpy(source_view->xmmint128,"ec \\nxmm0*\nou $xmm0.uint128\n");
+	strcpy(source_view->xmmint12810,"ec \\nxmm10*\nou $xmm10.uint128\n");
+	strcpy(source_view->endit,"end\n");
+	strcpy(source_view->mxcsr,"ec \\nmxcsr*\nou $mxcsr\n");
+	source_view->regStrPt[0] = source_view->xmmfloat;
+	source_view->regStrPt[1] = source_view->xmmdouble;
+	source_view->regStrPt[2] = source_view->xmmint8;
+	source_view->regStrPt[3] = source_view->xmmint16;
+	source_view->regStrPt[4] = source_view->xmmint32;
+	source_view->regStrPt[5] = source_view->xmmint64;
+	source_view->regStrPt[6] = source_view->xmmint128;
+	source_view->regStrPt[7] = source_view->xmmfloat10;
+	source_view->regStrPt[8] = source_view->xmmdouble10;
+	source_view->regStrPt[9] = source_view->xmmint810;
+	source_view->regStrPt[10] = source_view->xmmint1610;
+	source_view->regStrPt[11] = source_view->xmmint3210;
+	source_view->regStrPt[12] = source_view->xmmint6410;
+	source_view->regStrPt[13] = source_view->xmmint12810;
+	source_view->regStrPt[14] = source_view->mmx8x;
+	source_view->regStrPt[15] = source_view->mmx16x;
+	source_view->regStrPt[16] = source_view->mmx32x;
+	source_view->regStrPt[17] = source_view->mmx64x;
+
+	for(i = 0;i < 8;i++)
+	{
+		source_view->mmregs[i] = -1;
+		source_view->saved_mmregs[i] = -1;
+	}
+	for(i = 0;i < 16;i++)
+	{
+		source_view->saved_xmregs[i] = -1;
+		source_view->xmregs[i] = -1;
+	}
+	for(i = 0;i < 24;i++)
+	{
+		source_view->saved_Masked[i] = 0;
+		source_view->Masked[i] = 0;
+	}
     if (app_data.separate_source_window)
     {
 	// More values for main window
@@ -3059,6 +3201,9 @@ ddd_exit_t pre_main_loop(int argc, char 
 
     // Create preference panels
     make_preferences(paned_work_w);
+	//setup the register dialog
+	if(gdb->type() == GDB)
+		make_regspref(source_view->box);
 
     // Save option states
     save_option_state();
@@ -3074,7 +3219,7 @@ ddd_exit_t pre_main_loop(int argc, char 
     const string tmp_1_ = gdb->info_locals_command();
     strcpy(XtName(locals_w), tmp_1_.chars());
     const string tmp_2_ = gdb->info_args_command();
-    strcpy(XtName(args_w),   tmp_2_.chars());
+    strcpy(XtName(args_w),tmp_2_.chars());
     
     if (gdb->info_locals_command() != gdb->info_args_command())
     {
@@ -3152,6 +3297,11 @@ ddd_exit_t pre_main_loop(int argc, char 
 	    msg = msg.after('\n');
 	}
     }
+	if(gdb->type() == GDB)
+	{
+	string strn = "def vfdbl\ninf reg\nec \\nst0*\nou $st0\nec \\nst1*\nou $st1\nec \\nst2*\nou $st2\nec \\nst3*\nou $st3\nec \\nst4*\nou $st4\nec \\nst5*\nou $st5\nec \\nst6*\nou $st6\nec \\nst7*\nou $st7\nend\n";
+	gdb->write(strn);
+	}
     return DDD_CONTINUE;
 }
 
@@ -4088,6 +4238,8 @@ static bool have_cmd(const string& cmd)
 // Reflect state in option menus
 void update_options()
 {
+	if(gdb->type() == GDB)
+		source_view->refresh_registers_command();
     set_toggle(find_words_only_w, app_data.find_words_only);
     set_toggle(words_only_w, app_data.find_words_only);
 
@@ -4476,7 +4628,10 @@ static LayoutMode    initial_layout_mode
 static unsigned char initial_focus_policy;
 
 static Widget preferences_dialog;
+static Widget regspref_dialog;
 static Widget reset_preferences_w;
+static Widget reset_regprefs_w = NULL;
+static Widget set_regprefs_w = NULL;
 static Widget current_panel;
 
 void save_option_state()
@@ -5209,6 +5364,148 @@ static void OfferRestartCB(Widget dialog
 	manage_and_raise(restart_dialog);
     }
 }
+//setup the dialog button
+void StartupRegisterSettings(int *Mask)
+{
+	manage_and_raise(regspref_dialog);
+	set_sensitive(reset_regprefs_w,true);	//turn on the OK and Cancle buttons
+	set_sensitive(set_regprefs_w,true);
+	int i;
+	if(source_view->ProgramArch == 1)
+	{	//if this is 64 bit mode then set the extra 8 buttons
+		for(i = 8;i < 16;i++)
+		{
+			XtManageChild(RegDisable_w[i]);	//turn on integer register
+			XmToggleButtonSetState(RegDisable_w[i],Mask[i],True);
+		}
+	}
+	else
+	{	//turn off the top 8 integer regs.
+		for(i = 8;i < 16;i++)
+			XtUnmanageChild(RegDisable_w[i]);
+	}
+	for(i = 0;i < 8;i++)
+	{
+		XtManageChild(xRegDisable_w[i]);	//turn on integer register
+		XmToggleButtonSetState(xRegDisable_w[i],Mask[i+16],True);
+	}
+}
+
+void EndRegsDialog(void)
+{	//kill the register dialog
+	XtUnmanageChild(regspref_dialog);
+}
+
+void ToggelRegister(int regNo,int Msk)
+{	//turn on and set register button state
+	if(regNo < 16)
+		XmToggleButtonSetState(RegDisable_w[regNo],Msk,True);
+	else
+		XmToggleButtonSetState(xRegDisable_w[regNo-16],Msk,True);
+}
+
+void RegSetChoise()
+{	//set the register data from the button clicks
+	int j;
+	if(source_view->LastClicked < 8)
+	{
+		if(!source_view->XmmSet)
+		{
+			for(j = 0;j < 16;j++)
+				source_view->xmregs[j] = source_view->LastClicked-1;
+		}
+		else
+			source_view->xmregs[source_view->XmmSet - 1] = source_view->LastClicked-1;
+	}
+	else if(source_view->LastClicked < 14)
+	{
+		if(!source_view->mmSet)
+		{
+			for(j = 0;j < 8;j++)
+				source_view->mmregs[j] = source_view->LastClicked-9;
+		}
+		else
+			source_view->mmregs[source_view->mmSet - 1] = source_view->LastClicked-9;
+	}
+}
+
+void ToggleRegisterButton(int buttonNo,int XmMm)
+{	//toggle the XMM X and MMX X buttons
+	if(XmMm)
+		XmToggleButtonSetState(xmmDsply_w[buttonNo],True,True);
+	else
+		XmToggleButtonSetState(mmDsply_w[buttonNo],True,True);
+}
+
+void SetCancelRegMod(bool isit)
+{	//hide or show Cancle button
+	set_sensitive(reset_regprefs_w,isit);
+}
+
+void SizeRegsButton(int w,Dimension width,Dimension height,Dimension border_width)
+{	//size the MMX X XMM X buttons
+	if(w & 1)
+		XtResizeWidget(PMMX_w,width,height,border_width);
+	if(w & 2)
+		XtResizeWidget(PXMM_w,width,height,border_width);
+}
+
+static void make_regspref(Widget parent)
+{	//the setup for the register dialog box
+	Arg args[4];
+	int arg;
+
+	regspref_dialog = verify(XmCreatePromptDialog(parent, 
+		XMST("registerpreferences"),args,0));
+	Delay::register_shell(regspref_dialog);
+	XtVaSetValues(regspref_dialog,XmNdefaultButton,Widget(0),XtPointer(0));
+	if (lesstif_version <= 79)
+		XtUnmanageChild(XmSelectionBoxGetChild(regspref_dialog,
+			XmDIALOG_APPLY_BUTTON));
+	// Remove old prompt
+	XtUnmanageChild(XmSelectionBoxGetChild(regspref_dialog,XmDIALOG_TEXT));
+	XtUnmanageChild(XmSelectionBoxGetChild(regspref_dialog,
+		XmDIALOG_SELECTION_LABEL));
+	// Use cancel button to reset settings
+	reset_regprefs_w = XmSelectionBoxGetChild(regspref_dialog,
+		XmDIALOG_CANCEL_BUTTON);
+	XtRemoveAllCallbacks(reset_regprefs_w,XmNactivateCallback);
+	set_sensitive(reset_regprefs_w,false);
+	XtAddCallback(reset_regprefs_w,XmNactivateCallback,
+		ResetRegsPreferencesCB, XtPointer(2));
+	//setup the OK button Callback
+	set_regprefs_w = XmSelectionBoxGetChild(regspref_dialog,
+		 XmDIALOG_OK_BUTTON);
+	XtRemoveAllCallbacks(set_regprefs_w,XmNactivateCallback);
+	set_sensitive(set_regprefs_w,false);
+	XtAddCallback(set_regprefs_w,XmNactivateCallback,
+		SetRegsPreferencesCB, XtPointer(0));
+	XtAddCallback(regspref_dialog,XmNhelpCallback,
+		ImmediateHelpCB,XtPointer(regspref_dialog));
+ 	arg = 0;
+	//setup the register dialog
+	XtSetArg(args[arg],XmNmarginWidth,0); arg++;
+	XtSetArg(args[arg],XmNmarginHeight,0); arg++;
+	XtSetArg(args[arg],XmNborderWidth,0); arg++;
+	Widget box = verify(XmCreateRowColumn(regspref_dialog,XMST("box"),
+		args,arg));
+ 	XtManageChild(box);
+	Widget frame = verify(XmCreateFrame(box,XMST("frame"),args,0));
+	XtManageChild(frame);
+	arg = 0;
+	XtSetArg(args[arg],XmNmarginWidth,0); arg++;
+	XtSetArg(args[arg],XmNmarginHeight,0); arg++;
+	XtSetArg(args[arg],XmNborderWidth,0); arg++;
+	Widget change = verify(XmCreateRowColumn(frame,XMST("change"),args,arg));
+	XtManageChild(change);
+	Dimension max_width  = 0;
+	Dimension max_height = 0;
+	Widget general_button = add_panel(change,box,"",
+		register_preferenes_menu,max_width,max_height,false);
+	XmToggleButtonSetState(xmmDsply_w[0],True,True);
+	XmToggleButtonSetState(mmDsply_w[0],True,True);
+	XtUnmanageChild(general_button);
+}
 
 // Create preferences dialog
 static void make_preferences(Widget parent)
--- ddd-3.3.12/ddd/ddd.h	2009-02-11 18:25:06.000000000 +0100
+++ ddd-3.3.12/ddd/ddd.h	2010-02-25 17:23:22.000000000 +0100
@@ -111,5 +111,13 @@ extern void register_menu_shell(const MM
 // Process ^C key
 extern bool process_emergencies();
 
+extern void StartupRegisterSettings(int *);
+extern void ToggelRegister(int regno,int toggleMask);
+extern void SetCancelRegMod(bool b);
+extern void EndRegsDialog();
+extern void ToggleRegisterButton(int buttonNo,int XmMm);
+extern void RegSetChoise(void);
+extern void	SizeRegsButton(int w,Dimension width,Dimension height,Dimension border_width);
+
 #endif // _DDD_ddd_h
 // DON'T ADD ANYTHING BEHIND THIS #endif
--- ddd-3.3.12/ddd/options.C	2009-02-11 18:25:06.000000000 +0100
+++ ddd-3.3.12/ddd/options.C	2010-02-26 14:02:00.000000000 +0100
@@ -116,7 +116,7 @@ extern "C" FILE *popen(const char *comma
 extern "C" int pclose(FILE *stream);
 #endif
 
-
+extern SourceView *source_view;
 //-----------------------------------------------------------------------------
 // Helper Decls
 //-----------------------------------------------------------------------------
@@ -128,7 +128,6 @@ extern "C" int pclose(FILE *stream);
 enum ChangeMode { ACKNOWLEDGE, ACCESS };
 static bool options_file_has_changed(ChangeMode mode, bool reset = false);
 
-
 //-----------------------------------------------------------------------------
 // Source Options
 //-----------------------------------------------------------------------------
@@ -257,20 +256,266 @@ void sourceSetAllRegistersCB (Widget, Xt
     update_options();
 }
 
+void sourceSetRegisterCB(Widget,XtPointer,XtPointer)
+{	//the setup for the register dialog
+	source_view->ProgramArch = 0;
+	string archtype = gdb_question("show architecture");
+	if(archtype.length() > 2)
+	{
+		if(archtype.contains("64"))
+			source_view->ProgramArch = 1;
+	}	//setup the buttons
+	StartupRegisterSettings(source_view->Masked);
+	source_view->refresh_registers_command();
+	SizeRegsButton(3,68,24,0);
+	memcpy(source_view->saved_xmregs,source_view->xmregs,16*4);
+	memcpy(source_view->saved_mmregs,source_view->mmregs,8*4);
+	memcpy(source_view->saved_Masked,source_view->Masked,24*4);
+	for(int i = 0; i < 24;i++)		//reset the integer button,etc. state
+		ToggelRegister(i,source_view->Masked[i]);
+}
+
+void dddToggleRegisterButtonsCB(Widget,XtPointer butn, XtPointer call_data)
+{
+	if(source_view->ProgramArch != -1)	//if a session is already been loaded
+	{	//this comes up in startup	// get the button pressed
+		XmToggleButtonCallbackStruct *info = (XmToggleButtonCallbackStruct *)call_data;
+		int button = (long int)butn; 
+		if(!source_view->RegsSaved)			//only if the OK button was pressed
+			source_view->RegsSaved = true;
+		if(info->set && button != -1)	//something else happened
+		{
+			if(button < 14)					//the mmx xmm reg buttons
+			{
+				source_view->LastClicked = button;
+				RegSetChoise();		//set the appropriate bits
+			}
+			else							//integer buttons etc.
+				source_view->Masked[button-14] = 1;
+		}
+		else if(button > 13)
+			source_view->Masked[button-14] = 0;
+	}
+}
+
 void sourceSetIntRegistersCB (Widget, XtPointer, XtPointer call_data)
 {
     XmToggleButtonCallbackStruct *info = 
-	(XmToggleButtonCallbackStruct *)call_data;
-
+		(XmToggleButtonCallbackStruct *)call_data;
     if (info->set)
     {
 	set_status("Showing integer registers only.");
 	app_data.all_registers = false;
     }
-
     update_options();
 }
 
+void RegisterSettingsCB(void)
+{
+	if(source_view->RegsSaved)	//do only if OK was pressed
+	{
+		char*	bldStr = new char[1024];
+		int i,k;
+		int j = 0;
+		int m = 16;
+		source_view->xmregp = 0;
+		if(source_view->ProgramArch == 0)	//32 bit mode
+			m = 8;		//only 8 xmm registers
+		for(i = 0;i < m;i++)
+		{
+			if(source_view->xmregs[i] != -1)
+			{
+				source_view->xmregp = 1;
+				break;
+			}
+		}
+		for(i = 0;i < 8;i++)	//the mmx registers
+		{
+			if(source_view->mmregs[i] != -1)
+			{
+				source_view->xmregp |= 2;
+				for(;i < 8;i++)
+				{
+					if(source_view->mmregs[i] == 0)
+					{
+						source_view->xmregp |= 4;
+						break;
+					}
+				}
+				break;
+			}
+		}
+		if(!source_view->xmregp)	//no float
+		{
+			source_view->RegisterDisplay = 0;
+			gdb->regs_command(false);
+		}
+		else if(source_view->xmregp & 4)	//if a floating poin st reg was set as float
+		{
+			strcpy(bldStr,source_view->vfdblStr);	//first string with integers
+			strcat(bldStr,source_view->fltStr);		//floating point regs st
+			if(source_view->ProgramArch == 0)
+				strcat(bldStr,source_view->fltstat);		//floating point state
+			if(source_view->xmregp & 1)
+			{	// at least one xmm activated
+				source_view->RegisterDisplay = 2;
+				for(i = 0;i < m;i++)
+				{
+					k = source_view->xmregs[i];
+					if(k != -1)
+					{
+						j = strlen(bldStr);
+						if(i<10)
+						{
+							strcat(bldStr,source_view->regStrPt[k]);
+							bldStr[j+8] = i + '0';			
+							bldStr[j+18] = i + '0';			
+						}
+						else
+						{
+							strcat(bldStr,source_view->regStrPt[k+7]);
+							bldStr[j+9] = i + '0' - 10;			
+							bldStr[j+20] = i + '0' - 10;			
+						}
+					}
+				}
+			}
+			else	//only the mmx or st
+				source_view->RegisterDisplay = 1;
+			strcat(bldStr,source_view->endit);	//end of the string
+			gdb->write(bldStr,strlen(bldStr));	//tell gdb
+		}
+		else
+		{	//no floating point activated
+			strcpy(bldStr,source_view->vfdblStr);
+			if(source_view->ProgramArch == 0)	//if 32 bit
+				strcat(bldStr,source_view->mxcsr);
+			for(i = 0;i < m;i++)
+			{
+				k = source_view->xmregs[i];
+				if(k != -1)
+				{	//set up the xmm string
+					j = strlen(bldStr);
+					if(i<10)
+					{
+						strcat(bldStr,source_view->regStrPt[k]);
+						bldStr[j+8] = i + '0';
+						bldStr[j+18] = i + '0';
+					}
+					else
+					{
+						strcat(bldStr,source_view->regStrPt[k+7]);
+						bldStr[j+9] = i + '0' - 10;
+						bldStr[j+20] = i + '0' - 10;
+					}
+				}
+			}
+			if(source_view->ProgramArch == 0)
+			{	//if there is at least one mmx st on
+				if((source_view->xmregp & 2) != 0)
+				{	//do the 8 register strings
+					for(i = 0;i < 8;i++)
+					{
+						k = source_view->mmregs[i];
+						if(k != -1)
+						{
+							j = strlen(bldStr);
+							strcat(bldStr,source_view->regStrPt[k+13]);
+							bldStr[j+7] = i + '0';
+							bldStr[j+16] = i + '0';
+						}
+					}
+				}
+				else
+				{	//set in only the float regs and float status
+					strcat(bldStr,source_view->fltStr);
+					if(source_view->ProgramArch == 0)
+						strcat(bldStr,source_view->fltstat);
+				}
+			}	//only set in the floating point -- later changed to mmx
+			else if(source_view->xmregp & 2)
+				strcat(bldStr,source_view->fltStr);
+			strcat(bldStr,source_view->endit);
+			gdb->write(bldStr,strlen(bldStr));	//give the define string to gdb 
+ 		}
+		source_view->refresh_registers();
+		delete bldStr;
+	}
+}
+
+void ResetRegsPreferencesCB(Widget,XtPointer,XtPointer)
+{	// if Cancle is pressed just reset everything that was changed
+	memcpy(source_view->xmregs,source_view->saved_xmregs,16*4);
+	memcpy(source_view->mmregs,source_view->saved_mmregs,8*4);
+	memcpy(source_view->Masked,source_view->saved_Masked,24*4);
+	source_view->RegsSaved = false;
+	EndRegsDialog();
+}
+
+void SetRegsPreferencesCB(Widget,XtPointer,XtPointer)
+{	// if OK was pressed
+	RegisterSettingsCB();	//do the define string for gdb setup
+	EndRegsDialog();
+}
+
+void dddToggleFPMMXButton(Widget fpbutton,XtPointer,XtPointer)
+{	//advances the MMX button text and pointer
+	source_view->mmSet++;
+	if(source_view->mmSet == 9)
+		source_view->mmSet = 0;
+	char regst[8];
+	if(!source_view->mmSet)
+		strcpy(regst,"ALL MMX");
+	else
+	{
+		strcpy(regst,"MMX 0");
+		regst[4] = source_view->mmSet-1 + '0';	//set the number for the MMX X reg.
+		ToggleRegisterButton(source_view->mmregs[source_view->mmSet-1]+1,0);
+	}
+	Arg args[1];
+   XmString label_str = XmStringCreateLocalized(regst);
+   XtSetArg(args[0],XmNlabelString,label_str);      
+   XtSetValues(fpbutton,args,1);
+	SizeRegsButton(3,68,24,0); //otherwise the button size changes
+}
+
+void dddToggleXMMButton(Widget fxbutton,XtPointer,XtPointer)
+{	//do the same for the XMM XX button
+	source_view->XmmSet++;
+	if(source_view->ProgramArch)
+	{
+		if(source_view->XmmSet > 16)
+			source_view->XmmSet = 0;
+	}
+	else
+	{
+		if(source_view->XmmSet > 8)
+			source_view->XmmSet = 0;
+	}
+	char regst[8];
+	if(!source_view->XmmSet)
+		strcpy(regst,"ALL XMM");
+	else
+	{
+		if(source_view->XmmSet < 11)
+		{
+			strcpy(regst,"XMM 0 ");
+			regst[4] = source_view->XmmSet-1 + '0';
+		}
+		else
+		{
+			strcpy(regst,"XMM 10");
+			regst[5] = source_view->XmmSet-11 + '0';			
+		}
+		ToggleRegisterButton(source_view->xmregs[source_view->XmmSet-1]+1,1);		
+	}
+	Arg args[1];
+   XmString label_str = XmStringCreateLocalized(regst);
+   XtSetArg(args[0],XmNlabelString,label_str);      
+   XtSetValues(fxbutton,args,1);
+	SizeRegsButton(3,68,24,0);
+}
+
 void sourceSetTabWidthCB (Widget, XtPointer, XtPointer call_data)
 {
     XmScaleCallbackStruct *info = (XmScaleCallbackStruct *)call_data;
--- ddd-3.3.12/ddd/options.h	2009-02-11 18:25:06.000000000 +0100
+++ ddd-3.3.12/ddd/options.h	2010-02-25 16:15:32.000000000 +0100
@@ -79,6 +79,10 @@ extern void sourceSetTabWidthCB         
 extern void sourceSetSourceIndentCB 	    (Widget, XtPointer, XtPointer);
 extern void sourceSetCodeIndentCB 	    (Widget, XtPointer, XtPointer);
 
+extern void	SetRegisterSettingsCB			  (Widget, XtPointer, XtPointer);
+extern void ResetRegsPreferencesCB			  (Widget, XtPointer, XtPointer);
+extern void SetRegsPreferencesCB				  (Widget, XtPointer, XtPointer);
+extern void sourceSetRegisterCB				  (Widget,XtPointer,XtPointer);
 extern void graphToggleDetectAliasesCB      (Widget, XtPointer, XtPointer);
 extern void graphToggleAlign2dArraysCB      (Widget, XtPointer, XtPointer);
 extern void graphToggleShowGridCB           (Widget, XtPointer, XtPointer);
@@ -94,6 +98,9 @@ extern void graphSetGridSizeCB          
 extern void graphSetDisplayPlacementCB      (Widget, XtPointer, XtPointer);
 
 extern void dddToggleGroupIconifyCB         (Widget, XtPointer, XtPointer);
+extern void dddToggleRegisterButtonsCB			(Widget, XtPointer, XtPointer);
+extern void dddToggleFPMMXButton					(Widget, XtPointer, XtPointer);
+extern void dddToggleXMMButton					(Widget, XtPointer, XtPointer);
 extern void dddToggleUniconifyWhenReadyCB   (Widget, XtPointer, XtPointer);
 extern void dddToggleSeparateExecWindowCB   (Widget, XtPointer, XtPointer);
 extern void dddToggleCheckGrabsCB           (Widget, XtPointer, XtPointer);
--- ddd-3.3.12/ddd/SourceView.C	2009-02-11 18:25:06.000000000 +0100
+++ ddd-3.3.12/ddd/SourceView.C	2010-02-25 11:53:41.000000000 +0100
@@ -154,6 +154,8 @@ char SourceView_rcsid[] =
 #include <X11/IntrinsicP.h>
 #include "LessTifH.h"
 
+extern int Masked[];
+extern int xmregp;
 // System stuff
 extern "C" {
 #include <sys/types.h>
@@ -173,6 +175,7 @@ extern "C" {
 #endif
 
 
+
 //-----------------------------------------------------------------------
 // Xt stuff
 //-----------------------------------------------------------------------
@@ -300,6 +303,19 @@ MMDesc SourceView::text_popup[] =
     MMEnd
 };
 
+string regsTxt[] = 
+{
+	"eax","ebx","ecx","edx","esi","edi","ebp","esp","xx","xx","xx","xx","xx","xx",
+	"xx","xx","eip","eflags","cs","ss","ds","es ","fs","gs"
+};
+
+string regsTxt64[] = 
+{
+	"rax","rbx","rcx","rdx","rsi","rdi","rbp","rsp","r8","r9","r10","r11","r12","r13",
+	"r14","r15","rip","eflags","cs","ss","ds","es","fs","gs"
+};
+
+bool FirstTime = false;
 
 //-----------------------------------------------------------------------
 // Glyphs and images
@@ -3447,6 +3463,7 @@ SourceView::SourceView(Widget parent)
     create_text(parent, "code", false, code_form_w, code_text_w);
     if (disassemble)
 	XtManageChild(code_form_w);
+	RegisterDisplay = 1;
 }
 
 void SourceView::create_shells()
@@ -3607,50 +3624,52 @@ void SourceView::create_shells()
     XtUnmanageChild(XmSelectionBoxGetChild(register_dialog_w, 
 					   XmDIALOG_CANCEL_BUTTON));
 
-    arg = 0;
-    Widget box = XmCreateRadioBox(register_dialog_w, XMST("box"), args, arg);
-    XtManageChild(box);
-
-    arg = 0;
-    XtSetArg(args[arg], XmNset, !all_registers); arg++;
-    int_registers_w = 
-	XmCreateToggleButton(box, XMST("int_registers"), args, arg);
-    XtManageChild(int_registers_w);
-
-    arg = 0;
-    XtSetArg(args[arg], XmNset, all_registers); arg++;
-    all_registers_w = 
-	XmCreateToggleButton(box, XMST("all_registers"), args, arg);
-    XtManageChild(all_registers_w);
-
-    XtAddCallback(int_registers_w, XmNvalueChangedCallback, 
-		  sourceSetIntRegistersCB, XtPointer(0));
-    XtAddCallback(all_registers_w, XmNvalueChangedCallback, 
-		  sourceSetAllRegistersCB, XtPointer(0));
-
-    arg = 0;
-    register_list_w = XmSelectionBoxGetChild(register_dialog_w, XmDIALOG_LIST);
-    XtVaSetValues(register_list_w,
-		  XmNselectionPolicy, XmSINGLE_SELECT,
-		  XtPointer(0));
-
-    XtAddCallback(register_list_w,
-		  XmNsingleSelectionCallback, SelectRegisterCB, 0);
-    XtAddCallback(register_list_w,
-		  XmNmultipleSelectionCallback, SelectRegisterCB, 0);
-    XtAddCallback(register_list_w,
-		  XmNextendedSelectionCallback, SelectRegisterCB, 0);
-    XtAddCallback(register_list_w,
-		  XmNbrowseSelectionCallback, SelectRegisterCB, 0);
-
-    XtAddCallback(register_dialog_w,
-		  XmNokCallback, UnmanageThisCB, register_dialog_w);
-    XtAddCallback(register_dialog_w,
-		  XmNokCallback, RegisterDialogPoppedDownCB, 0);
-    XtAddCallback(register_dialog_w,
-		  XmNhelpCallback, ImmediateHelpCB, 0);
-
-
+	arg = 0;
+  	box = XmCreateRadioBox(register_dialog_w,XMST("box"),args,arg);
+   XtManageChild(box);
+	if(gdb->type() == GDB)	//setup the button menu and buttons
+	{
+		Widget Rgst = XmCreatePushButton(box,XMST("Settings"),NULL,0);
+		XtManageChild(Rgst);
+		XtAddCallback(Rgst, XmNactivateCallback, 
+			sourceSetRegisterCB,XtPointer(0));
+		register_list_w = XmSelectionBoxGetChild(register_dialog_w, XmDIALOG_LIST);
+		XtVaSetValues(register_list_w,XmNselectionPolicy,XmSINGLE_SELECT,
+			XtPointer(0));
+		XtAddCallback(register_list_w,
+			XmNsingleSelectionCallback, SelectRegisterCB, 0);
+		XtAddCallback(register_dialog_w,
+			XmNokCallback, UnmanageThisCB, register_dialog_w);
+		XtAddCallback(register_dialog_w,
+			XmNhelpCallback, ImmediateHelpCB, 0);
+	}
+	else
+	{
+		arg = 0;
+		XtSetArg(args[arg], XmNset, !all_registers); arg++;
+		int_registers_w = 
+			XmCreateToggleButton(box, XMST("int_registers"), args, arg);
+		XtManageChild(int_registers_w);
+		arg = 0;
+		XtSetArg(args[arg], XmNset, all_registers); arg++;
+		all_registers_w = 
+		XmCreateToggleButton(box, XMST("all_registers"), args, arg);
+		XtManageChild(all_registers_w);
+		XtAddCallback(int_registers_w, XmNvalueChangedCallback, 
+			sourceSetIntRegistersCB, XtPointer(0));
+		XtAddCallback(all_registers_w, XmNvalueChangedCallback, 
+			sourceSetAllRegistersCB, XtPointer(0));
+		arg = 0;
+		register_list_w = XmSelectionBoxGetChild(register_dialog_w, XmDIALOG_LIST);
+		XtVaSetValues(register_list_w,XmNselectionPolicy,XmSINGLE_SELECT,XtPointer(0));
+		XtAddCallback(register_list_w,XmNsingleSelectionCallback,SelectRegisterCB,0);
+		XtAddCallback(register_list_w,XmNmultipleSelectionCallback, SelectRegisterCB, 0);
+		XtAddCallback(register_list_w,XmNextendedSelectionCallback, SelectRegisterCB, 0);
+		XtAddCallback(register_list_w,XmNbrowseSelectionCallback,SelectRegisterCB,0);
+		XtAddCallback(register_dialog_w,XmNokCallback,UnmanageThisCB,register_dialog_w);
+		XtAddCallback(register_dialog_w,XmNokCallback,RegisterDialogPoppedDownCB,0);
+		XtAddCallback(register_dialog_w,XmNhelpCallback,ImmediateHelpCB,0);
+	}
     // Create thread view
     arg = 0;
     XtSetArg(args[arg], XmNautoUnmanage, False); arg++;
@@ -7438,48 +7457,284 @@ bool SourceView::can_go_down()
 
 void SourceView::process_registers(string& register_output)
 {
-    register_output.gsub(";\n", "\n");
-    register_output.gsub("; ", "\n");
-    register_output.gsub(";", "\n");
-    register_output.gsub("\n\n", "\n");
-
-    if (!register_output.contains("No ", 0))
-	undo_buffer.add_registers(register_output);
-
-    int count             = register_output.freq('\n') + 1;
-    string *register_list = new string[count];
-    bool *selected        = new bool[count];
-
-    split(register_output, register_list, count, '\n');
-
-    while (count > 0 && register_list[count - 1].empty())
-	count--;
-
-    for (int i = 0; i < count; i++)
-    {
-	tabto(register_list[i], 26);
-	untabify(register_list[i]);
-	selected[i] = false;
-    }
-
-    setLabelList(register_list_w, register_list, selected, count,
-		 false, false);
-
-    delete[] register_list;
-    delete[] selected;
+	register_output.gsub(";\n", "\n");
+	register_output.gsub("; ", "\n");
+	register_output.gsub(";", "\n");
+	register_output.gsub("\n\n", "\n");
+	if (!register_output.contains("No ", 0))
+		undo_buffer.add_registers(register_output);
+	int count             = register_output.freq('\n') + 1;
+	string *register_list = new string[count];
+	bool *selected        = new bool[count];
+	split(register_output, register_list, count, '\n');
+	if(FirstTime || gdb->type() != GDB)	//FirstTime starts as false
+	{
+		while (count > 0 && register_list[count - 1].empty())
+			count--;
+	}
+	else
+	{
+		if((count > 2) && (gdb->type() == GDB))	//if you do not get a one line error message
+		{
+			source_view->ProgramArch = 0;	//x86_32 program
+			string archtype = gdb_question("show architecture");
+			if(archtype.length() > 2)
+			{
+				if(archtype.contains("64"))
+					source_view->ProgramArch = 1;	// if it is a x86_64 program
+			}
+			count = 16;			//count of  32 bit registers displayed
+			if(source_view->ProgramArch)
+				count = 24;		//64 bit registers displayed
+		}
+		else
+		{
+			while (count > 0 && register_list[count - 1].empty())
+				count--;
+		}
+		FirstTime = true;	//only one time in this routine
+	}
+	int j,i;
+	string tstr;
+	if(gdb->type() == GDB)
+	{
+		for (i = 0; i < count; i++)
+		{
+			tabto(register_list[i], 26);
+			untabify(register_list[i]);
+			if(register_list[i].contains("0x") || register_list[i].contains(",")
+				||register_list[i].contains("*"))
+			{
+				if(register_list[i].contains("*"))	//parse the line
+				{
+					int fR0 = register_list[i].index("*",0);
+					switch(fR0)		// make the printing come out even
+					{
+					case 3:
+						tstr = "      ";
+						break;
+					case 4:
+						tstr = "     ";
+						break;
+					case 5:
+						tstr = "    ";
+						break;
+					}
+					register_list[i] = register_list[i].at(0,fR0) + tstr +
+						register_list[i].at(fR0+1,register_list[i].length()-fR0-1);
+					if(fR0 == 3)		// this was a floating point register or mmx
+					{
+						j = register_list[i][2] & 7;
+						if(source_view->mmregs[j] == -1)
+						{
+							for(j = i;j < count-1;j++)
+								register_list[j] = register_list[j+1];
+							count--;
+							i--;
+						}
+					}	//if no st-mmx registers were chosen as floating point
+					if(register_list[i][0] == 'f' && (!source_view->xmregp & 4))
+					{	// then remove the floating point status registers
+						for(j = i;j < count-1;j++)
+							register_list[j] = register_list[j+1];
+						count--;
+						i--;
+					}	//check for mmx register
+					if(register_list[i][0] == 'm' && register_list[i][1] == 'm')
+					{
+						j = (int)register_list[i][2] & 7;	//get the number -- mm3
+						if(source_view->mmregs[j] == -1)	//if the register is masked for printing
+						{
+							for(j = i;j < count-1;j++)
+								register_list[j] = register_list[j+1];
+							count--;
+							i--;
+						}
+					}
+				}
+				else
+				{	// floating point status registers and mxcsr
+				 	if((register_list[i][0] == 'f' && register_list[i][2] != ' ' &&
+						((source_view->xmregp & 4) == 0)) ||	//no floating point or mmx displayed
+						(register_list[i][0] == 'm' && register_list[i][1] == 'x' &&
+						(!source_view->xmregp & 1)))	// no xmm register is displayed
+					{	//remove the string
+						for(j = i;j < count-1;j++)
+							register_list[j] = register_list[j+1];
+						count--;	//decrease the line count
+						i--;
+					}
+					else
+					{
+						register_list[i] = register_list[i].at(0,9)+
+							register_list[i].at(15,register_list[i].length()-15);
+						int m = register_list[i].index("0x",-1);
+						if(m > 9)	//to get rid of the double printing of the hex value
+						{				//but the decimal value will not be removed
+							int n = 9;
+							int p = register_list[i].length();
+							for(;m < p;m++,n++)
+								register_list[i][n] = register_list[i][m];
+							register_list[i][n] = 0;
+						}
+					}
+				}	//parse the floating point - mmx registers
+				if(source_view->ProgramArch == 1 && register_list[i].contains("st",0))
+				{ // get the register number
+					j = (int)register_list[i][register_list[i].index("st") + 2] & 7;
+					if(source_view->mmregs[j] != -1)
+						//gdb hack for not displaying mmx in 64 bit mode - see below
+						register_list[i] = Gdb64MMXWorkaround(register_list[i]);
+					else
+					{	// if masked - remove
+						if(source_view->RegisterDisplay > 1)
+						{
+							for(j = i;j < count-1;j++)
+								register_list[j] = register_list[j+1];
+							count--;
+							i--;
+						}
+					}
+				}
+				for(int k = 0;k < 24;k++)
+				{	// check for indeger,eflags,ip,segment registers
+					if(source_view->Masked[k])
+					{	//get the correct mask
+						if(source_view->ProgramArch == 0)
+							j = register_list[i].index(regsTxt[k]);
+						else
+							j = register_list[i].index(regsTxt64[k]);
+						if(j == 0)
+						{	//remove the line
+							for(j = i;j < count-1;j++)
+								register_list[j] = register_list[j+1];
+							count--;
+							i--;
+						}
+					}
+				}
+			}
+			selected[i] = false;
+		}
+	}
+	else
+	{	// if not GDB
+	    for (i = 0; i < count; i++)
+   	 {
+			tabto(register_list[i], 26);
+			untabify(register_list[i]);
+			selected[i] = false;
+	    }
+	}
+	setLabelList(register_list_w, register_list, selected, count,
+		false, true);
+	delete[] register_list;
+	delete[] selected;
+}
+//Hack for gdb missing mmx registers in 64bit mode - hope gdb fixes this later
+string SourceView::Gdb64MMXWorkaround(string& transin)
+{	//translate the nan output to the normal nnx output
+	string transx = "mm0      (0x";
+	transx[2] = transin[2];
+	int k = transin.length();
+	int i = (int)transin[2] - '0';
+	if(transin.contains("nan"))
+	{
+		int j;
+		int m = 17;
+		string transtr;
+		for(j = k;transin[j-1] != 'x';j--)
+			m--;
+		for(;m > 0;m--)
+			transtr += "0";
+		for(;j < k-1;j++)
+			transtr += transin[j];
+		switch(source_view->mmregs[i])
+		{
+		case 1:
+			for(i = 14;i >= 0;i -= 2)
+			{
+				transx += transtr[i];
+				transx += transtr[i+1];
+				if(i != 0)
+					transx += ",0x";
+			}
+			transx += ")";
+			break;
+		case 2:
+			for(i = 12;i >= 0;i -= 4)
+			{
+				for(j = i;j < i+4;j++)
+					transx += transtr[j];
+				if(i != 0)
+					transx += ",0x";
+			}
+			transx += ")";
+			break;
+		case 3:
+			for(j = 8;j < 16;j++)
+				transx += transtr[j];
+			transx += ",0x";
+			for(j = 0;j < 8;j++)
+				transx += transtr[j];
+			transx += ")";
+			break;
+		case 4:
+			transx += transtr;
+			transx += ")";
+			break;
+		default:
+			transx = transin;
+			break;
+		}
+	}	// 32 bit gives '0' but 64 bit gives '-inf'
+	else if(((k == 10 && transin[9] == '0') || transin.contains("-inf")) &&
+		source_view->mmregs[i] > 0 )
+	{
+		switch(source_view->mmregs[i])
+		{
+		case 1:				
+			transx += "00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)";
+			break;
+		case 2:			
+			transx += "0000,0x0000,0x0000,0x0000)";
+			break;
+		case 3:
+			transx += "00000000,0x00000000)";
+			break;
+		case 4:
+			transx += "0000000000000000)";
+			break;
+		}
+	}
+	else
+		transx = transin;
+return transx;
 }
 
 void SourceView::refresh_registers()
 {
-    string registers = gdb_question(refresh_registers_command());
-    if (registers == NO_GDB_ANSWER)
-	registers = "No registers.";
-    process_registers(registers);
+	string registers = gdb_question(refresh_registers_command());
+	if (registers == NO_GDB_ANSWER)
+		registers = "No registers.";
+	if(gdb->type() == GDB)
+	{
+		if(registers[0] == '>' && registers[1] == '>')
+			registers = gdb_question(refresh_registers_command());
+	 	if(registers.contains("(gdb) "))	//this get rid of the extra trash
+			registers = registers.after("(gdb) ");	//that sometimes appears
+	}
+   process_registers(registers);
 }
 
 string SourceView::refresh_registers_command()
 {
-    return gdb->regs_command(all_registers);
+	if(gdb->type() != GDB)
+    	return gdb->regs_command(all_registers);
+	if(source_view->RegisterDisplay == 0)
+		return "info registers";	//integer registers
+	else	// modified registers
+		return "vfdbl";
 }
 
 void SourceView::ViewRegistersCB(Widget, XtPointer, XtPointer)
--- ddd-3.3.12/ddd/SourceView.h	2009-02-11 18:25:06.000000000 +0100
+++ ddd-3.3.12/ddd/SourceView.h	2010-02-25 21:16:14.000000000 +0100
@@ -293,6 +293,7 @@ class SourceView {
     static Widget register_list_w;            // Register list inside
     static Widget int_registers_w;            // Display integer registers
     static Widget all_registers_w;            // Display all registers
+
     static bool register_dialog_popped_up;    // True if registers are visible
 
     static Widget thread_dialog_w;            // Dialog for threads
@@ -304,6 +305,7 @@ class SourceView {
     
     static bool disassemble;	              // Disassemble code?
     static bool all_registers;	              // Show all registers?
+
     static bool at_lowest_frame;              // Are we at lowest frame?
     static bool signal_received;	      // Did we receive a signal?
 
@@ -514,7 +516,45 @@ public:
 
     // Additional offset for multiple breakpoints (pixels)
     static Position multiple_stop_x_offset;
-
+	//New register data and strings
+	bool RegsSaved;
+	int	xmregp;
+	int	LastClicked;
+	int	XmmSet;
+	int	mmSet;
+	int	RegisterDisplay;
+	int	ProgramArch;
+	int	xmregs[16];
+	int	mmregs[8];
+	int	Masked[24];
+	int	saved_xmregs[16];
+	int	saved_mmregs[8];
+	int	saved_Masked[24];
+	char	vfdblStr[20];
+	char	fltStr[148];
+	char	fltstat[188];
+	char	mmx8x[28];
+	char	mmx16x[28];
+	char	mmx32x[28];
+	char	mmx64x[28];
+	char	xmmfloat[32];
+	char	xmmfloat10[32];
+	char	xmmdouble[32];
+	char	xmmdouble10[36];
+	char	xmmint8[32];
+	char	xmmint810[32];
+	char	xmmint16[32];
+	char	xmmint1610[32];
+	char	xmmint32[32];
+	char	xmmint3210[32];
+	char	xmmint64[32];
+	char	xmmint6410[32];
+	char	xmmint128[32];
+	char	xmmint12810[32];
+	char	endit[6];
+	char	mxcsr[24];
+	char	*regStrPt[18];
+	Widget box;
 private:
     // Glyph locations: X[0] is source, X[1] is code
     static Widget plain_arrows[2];
@@ -532,7 +572,8 @@ private:
     static Widget drag_conds[2];
     static Widget drag_temps[2];
 
-    // Return position POS of glyph GLYPH in X/Y.  Return true iff displayed.
+	 static string Gdb64MMXWorkaround(string& transtr);
+   // Return position POS of glyph GLYPH in X/Y.  Return true iff displayed.
     static bool glyph_pos_to_xy(Widget glyph, XmTextPosition pos,
 				Position& x, Position& y);
 
@@ -737,7 +778,6 @@ public:
 
     // Whether to cache glyph images
     static bool cache_glyph_images;
-
     // Maximum length of expr in source popup
     static int max_popup_expr_length;
 
