Debug question!

Everything else that doesn't fall into one of the other PB categories.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> Maybe you could use DbgPrint and DebugView

Why? Too much work when my macro solves the problem perfectly.
It still allows Debugs to work but doesn't include any of the code in
the final executable; not even imports as Freak said.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Fred
Administrator
Administrator
Posts: 18553
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Actually it was a bug, it's now fixed.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Fred wrote:Actually it was a bug, it's now fixed.
There you are look at that; an innocent question results in a bug fix! :)

That's debugging for you! :)
I may look like a mule, but I'm not a complete ass.
User avatar
idle
Always Here
Always Here
Posts: 6238
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

There's one for the books, how to debug the debugger.
freak
PureBasic Team
PureBasic Team
Posts: 5962
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

> how to debug the debugger.

There is a good reason why the debugger can debug itself. Helped us avoid a lot of trouble.
We can even use the 32bit debugger to debug the 64bit one and vice versa :)

That said, this was actually a compiler problem, not a debugger one :P
quidquid Latine dictum sit altum videtur
User avatar
idle
Always Here
Always Here
Posts: 6238
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

Having a debugger that can debug a debugger is a very handy but I've yet to find a debugger that can prevent me from saying bugger while in the debugger, debugging my buggered code. :lol:
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: Debug question!

Post by Vera »

Hello,

I'm glad I found this fitting topic to ask a small Debug question!

After creating an XML and applying a handful of nodes and I can save the whole creation as a file, but I would like to view the XML-code directly without the indirect way of producing an external file. How does one grab the contents behind an adress ?

xml = CreateXML(#PB_Any)
create several nodes + items
Debug "the contents behind the adressID of xml" ?

greetings ~ Vera
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: Debug question!

Post by Vera »

This makes me really sad, that there is not the slightest attempt to help me out of this dilemma, not knowing where PB adresses/memorizes various informations and which maybe classical ways to get hold of them.

Even if it is impossible to attain certain allocated string-datas for further processing it would be helpful to know this as a fact and how one could work around it.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6175
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: Debug question!

Post by blueznl »

Vera Vera... just a day has passed, are you not exaggerating a little?
Last edited by blueznl on Sat Nov 27, 2010 11:19 pm, edited 1 time in total.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
freak
PureBasic Team
PureBasic Team
Posts: 5962
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: Debug question!

Post by freak »

Try ExportXML().

Vera wrote:This makes me really sad, that there is not the slightest attempt to help me out of this dilemma, not knowing where PB adresses/memorizes various informations and which maybe classical ways to get hold of them.
No comment.
quidquid Latine dictum sit altum videtur
cas
Enthusiast
Enthusiast
Posts: 597
Joined: Mon Nov 03, 2008 9:56 pm

Re: Debug question!

Post by cas »

Or, if you only want to read it then you can use:

Code: Select all

xml = CreateXML(#PB_Any)

;create several nodes + items

ShowLibraryViewer("xml",xml)
CallDebugger
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: Debug question!

Post by Vera »

blueznl wrote:Vera Vera... just a day has passed, are you not exaggerating a little?
Two days and proceeded to page 3 and many have regarded this posting and none of them bothered to give a short hint. Nobody would come back days later to leave a note.
Even you prefer to keep it unanswered.
freak wrote:
Vera wrote:This makes me really sad, that there is not the slightest attempt to help me out of this dilemma, not knowing where PB adresses/memorizes various informations and which maybe classical ways to get hold of them.
No comment.
Exactely what I told you about twice already - making friendly requests will be neglected although maybe a single word could give an answer.

Try ExportXML().
tried -
but unfortunately this even leads me into more confusion as it needs to handle AllocateMemory() as well. It also seems an indirect route, as the string data already exists. It would be as indirect as re-reading is from a created file.
cas wrote:Or, if you only want to read it then you can use:

Code: Select all

ShowLibraryViewer("xml",xml)
CallDebugger
thanks - I haven't come across this tool yet, and give it a closer look later on. On first glance I see it does not show me the plain xml-code but gives me the opportunity to check the tree - nice to know.


Maybe it's simply impossible what I want but if this command
SaveXML(xml, "new.xml")
writes a single string into a file then why can't I resolve this 'already memorized' string of text as a string, so that I could e.g. debug it or show it in an explorer gadget or process it otherwise?

greetings ~ Vera
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6175
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: Debug question!

Post by blueznl »

Vera, this forum is by primarily by and for hobby users and volunteers. I cannot force, or even expect, other forum users to give an answer. I cannot even be angry about it, disappointed, or outright in tears ;-) if they do not answer me. It's their free choice...

Perhaps nobody is in the mood to answer a particular question, perhaps they're all teaming up to frustrate you (hey, not being paranoid doesn't mean they're not out there to get you! :-) ), perhaps X-mas is looming near and people had to choose between typing up that word shattering life improving answer to all questions reply, and carrying the wife's shopping.

I don't know.

Take it easy. Some of my questions were not answered for ages either... and look how brilliant I have become 8) Thanks to all those non-replies I had to figure it out myself, and now I'm definitely settled and on my way to world domination, and all those non-replying forum members will become my slaves, mowhahahahahahahaargh... excuse me, peanut (cough).
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Debug question!

Post by Trond »

Try ExportXML().
tried -
but unfortunately this even leads me into more confusion as it needs to handle AllocateMemory() as well. It also seems an indirect route, as the string data already exists.
I am quite confident when I say that the string data does not exist. The xml library very likely handles the xml file not as a string, but rather as a tree structure, where each node is allocated as a separate memory area.

Since you asked so politely, here's one simple way to use ExportXML() to get a string:

Code: Select all

Procedure.s XmlToString(xml)
  Protected Size = ExportXMLSize(xml)
  Protected Value.s = Space(Size)
  ExportXML(xml, @Value, Size)
  ProcedureReturn Value
EndProcedure
freak
PureBasic Team
PureBasic Team
Posts: 5962
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: Debug question!

Post by freak »

Vera wrote:
freak wrote:
Vera wrote:This makes me really sad, that there is not the slightest attempt to help me out of this dilemma, not knowing where PB adresses/memorizes various informations and which maybe classical ways to get hold of them.
No comment.
Exactely what I told you about twice already - making friendly requests will be neglected although maybe a single word could give an answer.
People have a life, you know. Not everybody is waiting just to answer your questions.
If you can't even show a little patience then even less people will make the effort to help you.
quidquid Latine dictum sit altum videtur
Post Reply