16 May 2015, 13:13 | #1 |
Registered User
Join Date: Jan 2015
Location: Belarus
Posts: 44
|
Debugger interface
Hi!
I'm writing IDA debugger plugin for WinUAE, and it requires some info about debugger functions of this emulator. Where I can find such functions?:
I mean functions somewhere in debug.h, or debug_win32.h. |
16 May 2015, 14:51 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
They don't exist. They are all in debug.cpp, there was never need to call them from outside of debugger.
\.\pipe\WinUAE named pipe may be also useful, it can be used to send and receive debugger, input event, etc commands. |
16 May 2015, 14:56 | #3 |
Registered User
Join Date: Jan 2015
Location: Belarus
Posts: 44
|
Toni Wilen, ok, I can make them outside (for my version).
But, anyway, could you point me to that functions? I don't understand that system with chars, that should be sent to console to execute commands. For example: Code:
static void step(BOOL over) { if (over) _tcscpy(internalcmd, _T("z")); else _tcscpy(internalcmd, _T("t")); useinternalcmd = TRUE; inputfinished = 1; } Last edited by Dr. MefistO; 16 May 2015 at 15:42. |
17 May 2015, 10:24 | #4 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Sources come with ipctester.cpp that was used to test pipe sending and receiving. Perhaps it helps.
It is nearly same as writing debugger commands directly to console window, only difference is that it supports also other than debugger commands which requires prefixes or targeting command. (Check uaeipc.cpp for prefixes) All debugger routines expect command as a string, then they parse it and do the command. There is no routines that take "normal" parameters. (like address and length). As I said, there as never need previously For example "instruction_breakpoint()" takes string, then parses it, then adds/removes breakpoint. There is also plans for "real" UAE debugger interface: https://github.com/FrodeSolheim/fs-uae/issues/63 |
17 May 2015, 12:47 | #5 |
Registered User
Join Date: Jan 2015
Location: Belarus
Posts: 44
|
Thank you! I think, now I will do that!)
|
17 May 2015, 18:13 | #6 |
Registered User
Join Date: Jan 2015
Location: Belarus
Posts: 44
|
Is there any posibility to start new process in WinUAE from that pipe? Or by any other way.
For example, I have already copied binary in some directory of WinUAE, and I just want start it. First, I don't know how to start, and then I need know start IP. Which functions are responsible for starting binaries in WinUAE? Last edited by Dr. MefistO; 17 May 2015 at 18:46. |
18 May 2015, 17:32 | #7 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
What do you mean by "process"? Amiga process?
|
18 May 2015, 17:43 | #8 |
Registered User
Join Date: Jan 2015
Location: Belarus
Posts: 44
|
I mean process or task which will be created when I'll execute my amiga-hunk binary in WinUAE.
|
18 May 2015, 17:55 | #9 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Quote:
But why not just create startup-sequence that runs program(s) you need? |
|
18 May 2015, 17:57 | #10 |
Registered User
Join Date: Jan 2015
Location: Belarus
Posts: 44
|
Because I want connect to my executable at its startup and debug it by pipe interface.
|
18 May 2015, 19:08 | #11 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
There is nothing like that and this is too high level for my tastes, sorry.
Existing debugger features don't know nothing about Amiga processes or tasks. It is mainly done for hardware level debugging programs that take over the system. (Most of these probably can be done by simple AmigaDOS loader program, if someone bothers..) |
18 May 2015, 19:19 | #12 | |
Registered User
Join Date: Jan 2015
Location: Belarus
Posts: 44
|
Quote:
How do you think, such variant will be good?: 1) Patch amiga-executable at start with infinite loop (store original bytes too); 2) Ask user for starting executable with needed params (program will hang at start and will become a current task); 3) Connect to WinUAE by Pipe; 4) Restore original bytes at entry point and do needed work with this process. |
|
18 May 2015, 19:46 | #13 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
It is only dumps data, it does not do anything with it.
I'd put write to absolute address (that does not point to anything important, like $100 or $ffffffff or whatever) at the beginning of program, when program starts it triggers break point you have set before loading the program. No need to care about processes or tasks or anything else. |
18 May 2015, 20:01 | #14 |
Registered User
Join Date: Jan 2015
Location: Belarus
Posts: 44
|
So, I should put opcode of writing value to some independent address and set breakpoint to it, right? Hmm, good idea..)
But what difference with infinite loop? Problem is that I have no source code for this program. So, it will be a patch. P.S. In your way it will popup debugger's window then? It is bad. Last edited by Dr. MefistO; 18 May 2015 at 20:26. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using the ASM-One debugger on K3.1 | zedr | Coders. Asm / Hardware | 14 | 28 August 2014 23:01 |
Star NL-10 + commodore interface + parallel interface | bpco | MarketPlace | 7 | 06 May 2010 12:19 |
WinUAE Debugger | BippyM | support.WinUAE | 7 | 02 April 2008 07:59 |
Using debugger to cheat | Unregistered | support.WinUAE | 1 | 12 August 2004 17:53 |
WinUAE Debugger ???? | RetroMan | support.WinUAE | 2 | 27 January 2004 12:17 |
|
|