23 January 2022, 00:14 | #1 | |
Registered User
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
|
Using Memwatch with VBCC?
Does anyone know if its possible to get memwatch compiling under VBCC?
(building against 3.2.1 and NDK 3.2) If I only include memwatch when compiling with SAS/c, that compiler compiles fine and works. (I have other troubles with my SAS/C install that make it super unstable, so I would really like to get it working under VBCC). When I try to include it in a VBCC build, I get compiler errors like this: Quote:
I've tried a few things, but have never got this to work with VBCC. MemWatch ref: MWDEBUG (MemLib) from Amiga World Tech Journal vol1no2 1991. http://aminet.net/package/dev/debug/memlib. |
|
23 January 2022, 06:32 | #2 |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,993
|
Sounds like an include issue. There is no dos.h in the memwatch distribution so I am not sure why the output is giving a dos.h in /opt/vbcc/memwatch/Include/
Should be something like ndk32/Include/include_h/dos/dos.h within the VBCC path calloc is I think part of stdlib and the includes are at targets/m68k-amigaos/include within the VBCC path. The MWInit probably fails on a faulty define of either NULL or MWF_CHECK or is a result from the typedef redecleration warning earlier. NULL is defined in types.h. This without looking at the actual source. |
23 January 2022, 12:46 | #3 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
There are multiple problems. MemWatch seems very SAS/C-specific. You have to port the whole project to vbcc first. The included memwatch.lib also only works with SAS/C.
What I spotted immediately: 1. SAS/C constructors/destructors _STI_240_MWInit(), _STD_240_MWTerm(), etc. have to be changed. vlink recognizes these functions by _INIT_<pri>_<name> and _EXIT_<pri>_<name>. Without a working constructor the library is useless. 2. memwatch.h redefines memory functions (AllocMem, FreeMem, malloc, etc.) by macros. This cannot work when including vbcc's <proto/xyz.h>, because it also uses macros to define all OS calls with inline assembly. There will be redefinition errors. 3. dos.h (without path) is SAS/C specific and does neither exist in the NDK nor in vbcc. Did you copy it over? I assume it declares some POSIX support functions for SAS/C? sys/commsize.h is also from SAS/C, which certainly defines size_t differently than vbcc does. There is PosixLib for vbcc on Aminet, but you shouldn't need any POSIX stuff for MemWatch, when properly ported. 4. In vbcc NULL is defined as ((void *)0), and not simply as 0L, to make sure it is used for pointers only. This might cause conflicts as well. |
23 January 2022, 17:44 | #4 |
Registered User
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
|
Thanks for looking phx.
ah. I was afraid it might be something like that. Makes sense that it would have a lot of SAS/C-specific things in it: I believe the author was working for SAS/C at the time. I think I will probably invest time in getting my program running more stably in the SAS/C build rather than try to make memwatch work under VBCC. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
vbcc memwatch, debugging, symbols | carrion | Coders. C/C++ | 8 | 17 April 2021 11:43 |
vbcc 0.9d | phx | News | 43 | 13 July 2015 19:41 |
Memwatch functions in Action Replay III don't work in WinUAE | Galahad/FLT | support.WinUAE | 12 | 11 May 2014 13:42 |
Memwatch+Arcadia | thor | support.WinUAE | 4 | 28 December 2013 17:28 |
Winuae - (debugger) Memwatch Problem | barny | support.WinUAE | 2 | 03 October 2005 12:30 |
|
|