From 9a9053e91df6e08761e2ce72be350c5c2233153b Mon Sep 17 00:00:00 2001 From: "John Hodge (sonata)" Date: Fri, 7 Nov 2014 10:47:49 +0800 Subject: [PATCH] Usermode/AxWin4 - Debugging quirks in ARCH=native --- Usermode/Applications/Makefile.cfg | 6 +++--- Usermode/Applications/Makefile.tpl | 2 +- .../axwin4_src/Server/CIPCChannel_AcessIPCPipe.cpp | 2 +- Usermode/Applications/axwin4_src/Server/Makefile | 1 + Usermode/Applications/axwin4_src/Server/draw_control.cpp | 7 ++++++- Usermode/Applications/axwin4_src/Server/ipc.cpp | 3 ++- .../ld-acess.so_src/include_exp/acess/_native_syscallmod.h | 1 + Usermode/Libraries/libaxwin4.so_src/window_drawing.cpp | 1 + Usermode/common_settings.mk | 1 + 9 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Usermode/Applications/Makefile.cfg b/Usermode/Applications/Makefile.cfg index f87736c9..af5a5e45 100644 --- a/Usermode/Applications/Makefile.cfg +++ b/Usermode/Applications/Makefile.cfg @@ -7,17 +7,17 @@ include $(_appsdir)../Makefile.cfg ifeq ($(ARCHDIR),native) ASFLAGS = -felf - LDFLAGS = -L $(OUTPUTDIR)Libs + LDFLAGS := LIBS := -lacess-native -lc_acess #LIBGCC_PATH = $(ACESSDIR)/AcessNative/symbol_renames.ld else ASFLAGS = -felf # LDFLAGS = -T $(OUTPUTDIR)Libs/acess.ld - LDFLAGS = -L $(OUTPUTDIR)Libs + LDFLAGS := LIBS = -lld-acess endif -LDFLAGS += -rpath-link $(OUTPUTDIR)Libs +#LDFLAGS += -rpath-link $(OUTPUTDIR)Libs CXXFLAGS += -std=gnu++11 CPPFLAGS += CFLAGS += -Wall diff --git a/Usermode/Applications/Makefile.tpl b/Usermode/Applications/Makefile.tpl index d1dcfcff..d72ac6a2 100644 --- a/Usermode/Applications/Makefile.tpl +++ b/Usermode/Applications/Makefile.tpl @@ -20,7 +20,7 @@ _LIBS := $(filter -l%,$(LIBS)) _LIBS := $(patsubst -l%,$(OUTPUTDIR)Libs/lib%.so,$(_LIBS)) ifeq ($(ARCHDIR),native) - LDFLAGS := -L$(OUTPUTDIR)Libs/ $(patsubst -lc++,-lc++_acess,$(LDFLAGS)) + LDFLAGS := $(patsubst -lc++,-lc++_acess,$(LDFLAGS)) LIBS := $(patsubst -lc++,-lc++_acess,$(LIBS)) endif ifeq ($(VERBOSE),) diff --git a/Usermode/Applications/axwin4_src/Server/CIPCChannel_AcessIPCPipe.cpp b/Usermode/Applications/axwin4_src/Server/CIPCChannel_AcessIPCPipe.cpp index 867c4917..51d88b17 100644 --- a/Usermode/Applications/axwin4_src/Server/CIPCChannel_AcessIPCPipe.cpp +++ b/Usermode/Applications/axwin4_src/Server/CIPCChannel_AcessIPCPipe.cpp @@ -109,7 +109,7 @@ void CClient_AcessIPCPipe::HandleReceive() if( len == (size_t)-1 ) throw ::std::system_error(errno, ::std::system_category()); //_SysDebug("CClient_AcessIPCPipe::HandleReceive - Rx %i/%i bytes", len, rxbuf.capacity()); - //_SysDebugHex("CClient_AcessIPCPipe::HandleReceive", rxbuf.data(), len); + _SysDebugHex("CClient_AcessIPCPipe::HandleReceive", rxbuf.data(), len); rxbuf.resize(len); CDeserialiser msg( ::std::move(rxbuf) ); diff --git a/Usermode/Applications/axwin4_src/Server/Makefile b/Usermode/Applications/axwin4_src/Server/Makefile index dfd4d0fc..c7d79833 100644 --- a/Usermode/Applications/axwin4_src/Server/Makefile +++ b/Usermode/Applications/axwin4_src/Server/Makefile @@ -15,6 +15,7 @@ BIN := AxWinServer LIBS += -lc++ CXXFLAGS += -O3 +USE_CXX_LINK = 1 include ../../Makefile.tpl diff --git a/Usermode/Applications/axwin4_src/Server/draw_control.cpp b/Usermode/Applications/axwin4_src/Server/draw_control.cpp index 59ea0bc9..c3e54e1e 100644 --- a/Usermode/Applications/axwin4_src/Server/draw_control.cpp +++ b/Usermode/Applications/axwin4_src/Server/draw_control.cpp @@ -9,6 +9,8 @@ */ #include #include +#include +#include // === CODE === namespace AxWin { @@ -22,7 +24,8 @@ CControl::CControl(int EdgeX, int FillX, int InnerX, int EdgeY, int FillY, int I m_inner_y(InnerY), m_data(data) { - + _SysDebug("CControl(X={E:%i,F:%i,I:%i}, Y={E:%i,F:%i,I:%i}, data={Size:%i})", + m_edge_x, m_fill_x, m_inner_x, m_edge_y, m_fill_y, m_inner_y, m_data.size()); } void CControl::Render(CSurface& dest, const CRect& rect) const @@ -46,6 +49,7 @@ void CControl::Render(CSurface& dest, const CRect& rect) const renderLine(dest, y++, scanline, rect, &m_data[(base_ofs+i)*ctrl_width]); base_ofs += m_edge_y; // FillY + assert(m_fill_y > 0 || y == top_fill_end); while( y < top_fill_end ) { for( int i = 0; i < m_fill_y && y < top_fill_end; i ++ ) @@ -78,6 +82,7 @@ void CControl::Render(CSurface& dest, const CRect& rect) const void CControl::renderLine(CSurface& dest, int y, ::std::vector& scanline, const CRect& rect, const uint32_t* ctrl_line) const { + _SysDebug("renderLine: (y=%i,rect={(%i,%i) %ix%i}", y, rect.m_x, rect.m_y, rect.m_w, rect.m_h); const int left_fill_end = rect.m_w / 2 - m_inner_x; const int right_fill_end = rect.m_w - m_edge_x; diff --git a/Usermode/Applications/axwin4_src/Server/ipc.cpp b/Usermode/Applications/axwin4_src/Server/ipc.cpp index 4ed0352f..d042da9f 100644 --- a/Usermode/Applications/axwin4_src/Server/ipc.cpp +++ b/Usermode/Applications/axwin4_src/Server/ipc.cpp @@ -276,7 +276,7 @@ void HandleMessage_PushData(CClient& client, CDeserialiser& message) uint16_t y = message.ReadU16(); uint16_t w = message.ReadU16(); uint16_t h = message.ReadU16(); - //_SysDebug("_PushData: (%i, (%i,%i) %ix%i)", win_id, x, y, w, h); + _SysDebug("_PushData: (%i, (%i,%i) %ix%i)", win_id, x, y, w, h); CWindow* win = client.GetWindow(win_id); if(!win) { @@ -307,6 +307,7 @@ void HandleMessage_DrawCtl(CClient& client, CDeserialiser& message) uint16_t h = message.ReadU16(); uint16_t ctrl_id = message.ReadU16(); uint16_t frame = message.ReadU16(); + _SysDebug("_DrawCtl: (%i, (%i,%i) %ix%i %i %06x)", win_id, x, y, w, h, ctrl_id, frame); CWindow* win = client.GetWindow(win_id); if(!win) { diff --git a/Usermode/Libraries/ld-acess.so_src/include_exp/acess/_native_syscallmod.h b/Usermode/Libraries/ld-acess.so_src/include_exp/acess/_native_syscallmod.h index 0b386904..b3d78bf1 100644 --- a/Usermode/Libraries/ld-acess.so_src/include_exp/acess/_native_syscallmod.h +++ b/Usermode/Libraries/ld-acess.so_src/include_exp/acess/_native_syscallmod.h @@ -24,6 +24,7 @@ #define _SysUnloadBin acess__SysUnloadBin #define _SysSetFaultHandler acess__SysSetFaultHandler #define _SysDebug acess__SysDebug +#define _SysDebugHex acess__SysDebugHex #define _SysGetPhys acess__SysGetPhys #define _SysAllocate acess__SysAllocate #define _SysSetMemFlags acess__SysSetMemFlags diff --git a/Usermode/Libraries/libaxwin4.so_src/window_drawing.cpp b/Usermode/Libraries/libaxwin4.so_src/window_drawing.cpp index 40f55a00..8f355a6e 100644 --- a/Usermode/Libraries/libaxwin4.so_src/window_drawing.cpp +++ b/Usermode/Libraries/libaxwin4.so_src/window_drawing.cpp @@ -48,6 +48,7 @@ extern "C" void AxWin4_DrawBitmap(tAxWin4_Window *Window, int X, int Y, unsigned extern "C" void AxWin4_DrawControl(tAxWin4_Window *Window, int X, int Y, unsigned int W, unsigned int H, uint16_t ID, unsigned int Frame) { CSerialiser message; + //_SysDebug("AxWin4_DrawControl: (Window->ID=%i, (%i,%i) %ix%i %i 0x%06x", Window->m_id, X, Y, W, H, ID, Frame); message.WriteU8(IPCMSG_DRAWCTL); message.WriteU16(Window->m_id); message.WriteU16(X); diff --git a/Usermode/common_settings.mk b/Usermode/common_settings.mk index e6f9231e..2f6fa8f4 100644 --- a/Usermode/common_settings.mk +++ b/Usermode/common_settings.mk @@ -5,6 +5,7 @@ CPPFLAGS += -I$(ACESSUSERDIR)/include/ -DARCHDIR_is_$(ARCHDIR) CPPFLAGS += -I $(ACESSDIR)/Externals/Output/$(ARCHDIR)/include CFLAGS += -std=gnu99 -g LDFLAGS += -L $(ACESSDIR)/Externals/Output/$(ARCHDIR)/lib +LDFLAGS += -L $(OUTPUTDIR)Libs CRTI := $(OUTPUTDIR)Libs/crti.o CRTBEGIN := $(shell $(CC) $(CFLAGS) -print-file-name=crtbegin.o 2>/dev/null) -- 2.20.1