English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 16 May 2015, 13:13   #1
Dr. MefistO
Registered User
 
Join Date: Jan 2015
Location: Belarus
Posts: 44
Cool 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?:
  1. Read memory from some address;
  2. Write memory to some address;
  3. Get register value;
  4. Set register value;
  5. Set breakpoint at some address (read/write, execution);
  6. Clear breakpoint at some address;
  7. Attach to some program;
  8. Pause execution of program;
  9. Stop execution of program;
  10. Continue execution;
  11. Execute one instruction;

I mean functions somewhere in debug.h, or debug_win32.h.
Dr. MefistO is offline  
Old 16 May 2015, 14:51   #2
Toni Wilen
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.
Toni Wilen is offline  
Old 16 May 2015, 14:56   #3
Dr. MefistO
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;
}
Or tell me about pipe commands. Are there some commands for my list?

Last edited by Dr. MefistO; 16 May 2015 at 15:42.
Dr. MefistO is offline  
Old 17 May 2015, 10:24   #4
Toni Wilen
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
Toni Wilen is offline  
Old 17 May 2015, 12:47   #5
Dr. MefistO
Registered User
 
Join Date: Jan 2015
Location: Belarus
Posts: 44
Thank you! I think, now I will do that!)
Dr. MefistO is offline  
Old 17 May 2015, 18:13   #6
Dr. MefistO
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.
Dr. MefistO is offline  
Old 18 May 2015, 17:32   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
What do you mean by "process"? Amiga process?
Toni Wilen is offline  
Old 18 May 2015, 17:43   #8
Dr. MefistO
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.
Dr. MefistO is offline  
Old 18 May 2015, 17:55   #9
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Quote:
Originally Posted by Dr. MefistO View Post
I mean process or task which will be created when I'll execute my amiga-hunk binary in WinUAE.
There is no support in UAE for running Amiga executables. It does not need to run any programs. Some sort of remote CLI may be something you want.

But why not just create startup-sequence that runs program(s) you need?
Toni Wilen is offline  
Old 18 May 2015, 17:57   #10
Dr. MefistO
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.
Dr. MefistO is offline  
Old 18 May 2015, 19:08   #11
Toni Wilen
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..)
Toni Wilen is offline  
Old 18 May 2015, 19:19   #12
Dr. MefistO
Registered User
 
Join Date: Jan 2015
Location: Belarus
Posts: 44
Quote:
Originally Posted by Toni Wilen View Post
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.
But there is T command for debugger which dumps current process/task list.

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.
Dr. MefistO is offline  
Old 18 May 2015, 19:46   #13
Toni Wilen
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.
Toni Wilen is offline  
Old 18 May 2015, 20:01   #14
Dr. MefistO
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.
Dr. MefistO is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 23:33.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09233 seconds with 15 queries