Author Topic: err messages in console  (Read 2869 times)

0 Members and 1 Guest are viewing this topic.

pber

  • Guest
err messages in console
« on: March 21, 2015, 10:00:56 PM »
Hi all,
hello Charles how are you?

Does exist a way to be notified about erros not with MsgBox'es?

thanks

Charles Pegge

  • Guest
Re: err messages in console
« Reply #1 on: March 22, 2015, 02:08:48 AM »
Hi Paolo,

I am emerging from hibernation in the spring sunshine. How are you? :)


The -m switch diverts error messages to the console

You can compile from the command prompt:

gxo2 -m t.o2bas

to capture error messages in t.txt:

gxo2 -m t.o2bas>t.txt





pber

  • Guest
Re: err messages in console
« Reply #2 on: March 22, 2015, 03:20:08 AM »
thanks, and I'm quite fine.

Something I never asked
(but I know the answer: you are too comfort between hex numbers):

does exist some tool for debugging o2 code (apart printing and olly2)?


Charles Pegge

  • Guest
Re: err messages in console
« Reply #3 on: March 22, 2015, 03:48:42 AM »
No, do you have any ideas on what debugging tools would be useful?

The main problem with low-level debugging, is generating too much data, but tracing with the console (print printl)  might give you more flexibility than relying on single-shot message boxes.




pber

  • Guest
Re: err messages in console
« Reply #4 on: March 22, 2015, 05:48:02 PM »
I understand machine code, but i'm totally ignorant about
windows low-levels, assembly conventions, tecniques and what else.
So the low-lev debugger is totally useless to me, unless... there is a way
to deduce the source position of a sequence of mc instructions?

maybe processing the oil source before the runtime?

or just interleaving some marks in the basic source code,
that magically get transfered as mc intructions?

Charles Pegge

  • Guest
Re: err messages in console
« Reply #5 on: March 22, 2015, 08:19:37 PM »
I have no experience of debugging tools myself. I use print statements and commenting-out, as the main means of trapping a bug. It works in any language, even in assembly code, as long as the registers are preserved on the stack.

Code: OxygenBasic
  1.   mov eax,4
  2.   mov ecx,100
  3.   imul eax,ecx
  4.   pushad : print eax : popad
  5.   add eax,40
  6.   pushad : print eax : popad
  7.  

such print statements can be condensed into a macro

def x   pushad : print eax : popad

then:

Code: OxygenBasic
  1. def x   pushad : print eax : popad
  2.  
  3.   mov eax,4
  4.   mov ecx,100
  5.   imul eax,ecx
  6.   x
  7.   add eax,40
  8.   x
  9.