updated stuff to allow debugging
added a debug server/shared library project
This commit is contained in:
35
begui/begui/fdb/fdb.cpp
Normal file
35
begui/begui/fdb/fdb.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#include <stdio.h>
|
||||
#include "fdb.h"
|
||||
|
||||
DBApp::DBApp():
|
||||
BApplication("application/x-vnd.befpc-debugconsole")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
DBApp::~DBApp(){
|
||||
|
||||
}
|
||||
|
||||
void DBApp::MessageReceived(BMessage *message){
|
||||
status_t err = B_OK;
|
||||
const char *text;
|
||||
|
||||
if (message->what == 'dbug'){
|
||||
if ( (err = message->FindString("dbstring", &text)) == B_OK){
|
||||
printf("dbug : %s\n", text);
|
||||
}
|
||||
else{
|
||||
printf("error %d\n", err);
|
||||
}
|
||||
}
|
||||
else{
|
||||
BApplication::MessageReceived(message);
|
||||
}
|
||||
}
|
||||
|
||||
int main(){
|
||||
printf("befpc debug console v0.1\nMatt Emson, April 2002\n");
|
||||
DBApp *dba = new DBApp();
|
||||
dba->Run();
|
||||
}
|
||||
9
begui/begui/fdb/fdb.h
Normal file
9
begui/begui/fdb/fdb.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <Application.h>
|
||||
|
||||
|
||||
class DBApp : public BApplication{
|
||||
public:
|
||||
DBApp();
|
||||
virtual ~DBApp();
|
||||
virtual void MessageReceived(BMessage *message);
|
||||
};
|
||||
BIN
begui/begui/fdb/fdb.proj
Normal file
BIN
begui/begui/fdb/fdb.proj
Normal file
Binary file not shown.
19
begui/begui/fdb/libfdb.cpp
Normal file
19
begui/begui/fdb/libfdb.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <Application.h>
|
||||
#include <Message.h>
|
||||
#include <stdio.h>
|
||||
#include "libfdb.h"
|
||||
|
||||
void SendMessage(BMessage *message){
|
||||
if (be_app != NULL){
|
||||
printf("in sendmessage\n");
|
||||
BMessenger messenger("application/x-vnd.befpc-debugconsole");
|
||||
if (messenger.IsValid()) messenger.SendMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
void SendText(const char *text){
|
||||
BMessage *msg = new BMessage('dbug');
|
||||
printf("in sendtext\n");
|
||||
msg->AddString("dbstring", text);
|
||||
SendMessage(msg);
|
||||
}
|
||||
14
begui/begui/fdb/libfdb.h
Normal file
14
begui/begui/fdb/libfdb.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef LIBFDB_H
|
||||
#define LIBFDB_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void SendText(const char *text);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
BIN
begui/begui/fdb/libfdb.proj
Normal file
BIN
begui/begui/fdb/libfdb.proj
Normal file
Binary file not shown.
Reference in New Issue
Block a user