00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
#include "memviewdlg.h"
00019
00020
#include <kbuttonbox.h>
00021
#include <klineedit.h>
00022
#include <kglobalsettings.h>
00023
#include <klocale.h>
00024
00025
#include <qlabel.h>
00026
#include <qlayout.h>
00027
#include <qmultilineedit.h>
00028
#include <qpushbutton.h>
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
namespace JAVADebugger
00052 {
00053
00054 MemoryViewDialog::MemoryViewDialog(
QWidget *parent,
const char *name)
00055 :
KDialog(parent, name, true),
00056 start_(new
KLineEdit(this)),
00057 end_(new
KLineEdit(this)),
00058 output_(new
QMultiLineEdit(this))
00059 {
00060 setCaption(i18n(
"Memory/Misc Viewer"));
00061
00062
00063
QBoxLayout *topLayout =
new QVBoxLayout(
this, 5);
00064
00065
QGridLayout *grid =
new QGridLayout(2, 2, 5);
00066 topLayout->addLayout(grid);
00067
00068
QLabel *label =
new QLabel(
start_, i18n(
"the beginning",
"Start:"),
this);
00069 grid->addWidget(label, 0, 0);
00070 grid->setRowStretch(0, 0);
00071 grid->addWidget(
start_, 1, 0);
00072 grid->setRowStretch(1, 0);
00073
00074 label =
new QLabel(
end_, i18n(
"Amount/End address (memory/disassemble):"),
this);
00075 grid->addWidget(label, 0, 1);
00076 grid->addWidget(
end_, 1, 1);
00077
00078 label =
new QLabel(i18n(
"MemoryView:"),
this);
00079 topLayout->
addWidget(label, 0);
00080 topLayout->
addWidget(
output_, 5);
00081
output_->setFont(KGlobalSettings::fixedFont());
00082
00083
KButtonBox *buttonbox =
new KButtonBox(
this, Horizontal, 5);
00084
QPushButton *
memoryDump = buttonbox->
addButton(i18n(
"Memory"));
00085
QPushButton *
disassemble = buttonbox->
addButton(i18n(
"Disassemble"));
00086
QPushButton *
registers = buttonbox->
addButton(i18n(
"Registers"));
00087
QPushButton *
libraries = buttonbox->
addButton(i18n(
"Libraries"));
00088
QPushButton *cancel = buttonbox->
addButton(i18n(
"Cancel"));
00089 memoryDump->setDefault(
true);
00090 buttonbox->
layout();
00091 topLayout->
addWidget(buttonbox);
00092
00093 connect(memoryDump, SIGNAL(clicked()), SLOT(
slotMemoryDump()));
00094 connect(disassemble, SIGNAL(clicked()), SLOT(
slotDisassemble()));
00095 connect(registers, SIGNAL(clicked()), SIGNAL(
registers()));
00096 connect(libraries, SIGNAL(clicked()), SIGNAL(
libraries()));
00097 connect(cancel, SIGNAL(clicked()), SLOT(reject()));
00098 }
00099
00100
00101
00102 MemoryViewDialog::~MemoryViewDialog()
00103 {
00104 }
00105
00106
00107
00108 void MemoryViewDialog::slotRawJDBMemoryView(
char *buf)
00109 {
00110
00111
output_->clear();
00112
output_->insertLine(buf);
00113
output_->setCursorPosition(0,0);
00114 }
00115
00116
00117
00118
00119 void MemoryViewDialog::slotDisassemble()
00120 {
00121
QString start(
start_->text());
00122
QString end(
end_->text());
00123 emit
disassemble(start, end);
00124 }
00125
00126
00127
00128 void MemoryViewDialog::slotMemoryDump()
00129 {
00130
QString start(
start_->text());
00131
QString size(
end_->text());
00132 emit
memoryDump(start,
size);
00133 }
00134
00135
00136
00137
00138
00139 }
00140
00141
#include "memviewdlg.moc"