updated stuff to allow debugging

added a debug server/shared library project
This commit is contained in:
memson
2002-04-27 08:28:58 +00:00
parent a54309bb71
commit ea1f7b3b83
6 changed files with 77 additions and 0 deletions

35
begui/begui/fdb/fdb.cpp Normal file
View 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
View 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

Binary file not shown.

View 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
View 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

Binary file not shown.