SharePoint Console Output - sharepoint-2007

I made a class library, and put it in GAC.
It has one C# code file, and I put a Console.WriteLine() statement in.
When I run the Feature, where would I see the output from this statement?

Use
System.Diagnostics.Trace.WriteLine()
or
System.Diagnostics.Debug.WriteLine()
(Will only output text if assembly
compiled in debug mode)
to output some text. You would then see it in a program like DebugView.
But the best way to debug the program (if you ask this question regarding to debugging) i recommend attachking to SharePoint with Visual Studio debugger. Some debugging tips here.

Related

How to debug Lua code using Visual Studio

I have a win32 application and this is linked with Lua files. Both Lua and C++ files have bi-directional communication and can invoke function within each other.
I wanted to debug Lua code from Visual Studio IDE likewise what we do for C++ code. I have installed "BabeLua For 2012 V3.2.2.0" extension, but not able to debug...
I simply created a break point in Lua file and attached the code to my Win32 application, but it says that "No symbols have been loaded".
Please help me to understand where does the symbol files resides for Lua, or is there any other intuitive way to debug Lua scripts..
Any help will be greatly appreciated...
is there any other intuitive way to debug LUA scripts.
You may try ZeroBrane Studio IDE, which supports debugging of Lua scripts included in other applications. See the remote debugging section in the documentation for details and examples.

Debugging Grails Applications

In ruy on rails in order to debug the application you could just call, "debugger", and
it will start a debugger in the console. How is this approach possible in Grails? Especially in a .gsp file? I am using a simple text editor for my development, Sublime.
Thanks
Debugging java is simply not possible in Sublime.You can use another debugger like JDebugTools or a full-featured IDE like Eclipse or Netbeans (but that breaks the whole point to have a lightweight IDE like Sublime, which is great for Java, if not for debugging purpose)
There exists a command-line debugging tool, jdb which can be used for very simple debugging purposes, and may be integrated as a build tool for Sublime (I don't think the result will be good though)
Debugging for Grails is done with the --debug switch as for recent versions, you can then attach a debugger to the session. GSP debugging, like JSP, needs a specific tooling as to be aware of compilation means, and you'd better switch to IntelliJ Idea or [GGTS (Groovy/Grails Tool Suite)](http://spring.io/tools/ggts) which provide both strong debugging capabilities

REPL for the Dart language

Is there a REPL for Dart to experiment with?
I tried inputing dart code in DevTools in Dartium and that also didn't work.
So I couldn't find an easy way to play with various APIs in dart.
I tried inputing dart code in devtools in Dartium and that also didn't
work.
I'm very new to Dart, but something I came across was that you CAN evaluate code in Dartium. In order to do so, you must first load a page with Dart code in it and then toggle this selector in the console from "javascript page context" to one that references a Dart package or Dart code.
Once you do that you should be able to execute Dart in the console:
As a VIM user, I hardly have to open the Dart Editor now :). I should also mention that breakpoints, hovering over stepped into code to get variable details, navigating the call stack, and some level of intellisense in the console also work. I couldn't get conditional breakpoints to work, though.
Though it is not really a REPL, you may find the Try Dart online tool useful for playing around. It's a bit slow, since it is actually compiling the Dart code to JavaScript in order to have it work within the browser.
There is also a console that someone built, which is probably better if you're looking for a real REPL, but it requires a bit of setup.
There is an announcement about REPL for Dartium - see Nathanial's comment below. There are plans for Smalltalk like super-REPL. Here is what Gilad Bracha (member of the Dart team at Google) wrote on this subject in Is there a REPL or console for Dart:
"I don't see this as a language question at all. It is a matter of tooling and reflective library support. With proper mirror builder APIs, building a REPL would be trivial. As it sands right now, it can be quite challenging. And of course, REPL is not the ultimate goal - there are more advanced interactive tools, like workspaces in Smalltalk/Self/Newspeak, where you not only evaluate things interactively at some top level, but can inspect the resulting objects, evaluate within the scope of an individual declaration or object etc. I am sure we will get there in time - and i much prefer sooner than later."
The correct answer is https://dartpad.dev/
That site didn't exist when the other answers were posted in 2013, but you've stumbled on this post after 2020. And now you know. https://dartpad.dev allows you to create and share new Dart snippets and even put them in a Flutter app running online. Very, very cool!
Since 2022.10.22, there is a REPL for Dart: https://github.com/fzyzcjy/dart_interactive :)
Features:
Use any third-party package freely
Auto hot-reload code anywhere, with state preserved
Supports full grammar in REPL
Play with existing code side-by-side
Disclaimer: I wrote that package.

Lua Debugger that can Attach to Process

My company has a program that uses Lua embedded in its runtime, loading up .lua files from disk and executing functions defined in them repeatedly.
Is there a way to attach to the running process and set breakpoints in my .lua files? (I'd accept either gdb-style command-line debugging as part of the Lua distribution, or perhaps a third-party IDE that provides Visual-Studio-like GUI breakpoints.)
Or is what I'm asking for entirely nonsensical and impossible given the nature of the runtime loading up random files from disk?
Edit: Looks like it's not nonsensical, given that Lua's own debug.getinfo() function can determine the source file for a given function, and debug.sethook() allows a callback for each new line of code entered. So, it's reasonable to load source code from disk and be able to tell when the interpreter is executing a particular line of code from that file. The question remains: how do I latch onto an existing process that has a Lua interpreter and inject my own trace function (which can then watch for file/line number pairs and pause execution)?
If you can modify the .lua files, you can insert the following call just before anything you need to debug:
require 'remdebug.engine'.start()
It starts the RemDebug Lua debugger engine and tries to connect to a controller. If it cannot connect, it will just continue running as normal. I did some fixes to the debugger engine, such as dealing with temporary variables, and my student is working on a debugger GUI (due next year).
In the meantime, you can try if Lua Development Tools works for you. It features a debugger similar to RemDebug, which should be possible to set up as follows:
require("debugger")(host, port, idekey)
Alternatively, you can use SciTE-debug, which is an extension to the SciTE editor, and can serve as a controller to RemDebug. Just make sure you insert the call to remdebug.engine.start somewhere in your Lua code and insert this into the SciTE output window:
:debug.target=remote.lua
When you start your program, SciTE should show the source and current line.
I've been using Decoda editor for that. It allows you to attach to a running C++ application, after that it detects that you're running a Lua Interpreter within your C++ code and show your Lua source code, where you can add beakpoints and inspect variables as usual.
This is an alternative I use after much searching. If you have an external executable that loads lua, I got this working in a few minutes. The op is very responsive, it has an interactive debugger which loads your code you can place debug points interactively. It doesn't have an editor, but I use scite or crimson editor and start the executable, one line in your main lua module enables the debugger.
http://www.cushy-code.com/grld/ - this link seems dead now
I've moved to eclipse.org/ldt it has an ide and integrated debugger, recommended
hth
The Lua plugin for IntelliJ has a working debugger with no special setup required other than pointing to your Lua interpreter.
Here's a screencast of it:
http://www.screencast.com/t/CBWIkoZPg
Similar to what Michal Kottman described, I have implemented a debugger based on RemDebug, but with additional fixes and features (on github: https://github.com/pkulchenko/MobDebug).
You can update your .lua file with require("mobdebug").start("localhost", 8171) at the point where you want the debugging to start. You can then use the command line debugger to execute commands, set breakpoints, evaluate/execute expressions and so on.
As an alternative, you can use ZeroBrane Studio IDE, which integrates with the debugger and gives you a front-end to load your code and execute same debugger commands in a nice GUI. If you want to see the IDE in action, I have a simple demo here: http://notebook.kulchenko.com/zerobrane/live-coding-in-lua-bret-victor-style.
You should probably use Decoda.
Go to Debug -> Processes -> Attach to attach your process. This should work fine.
Well the easiest way is this, thanks to the genius author
https://github.com/slembcke/debugger.lua
you don't need to setup a remote debug server ,just require one file,and simplely call dbg() and it will pause,just like gdb
an tutorial is also shipped with it, check it out.

Can I generate a .RSM file myself for the Delphi Debugger to use?

I wish to debug executables for which I have no code, using the Delphi Debugger.
WinDBG and other debuggers are no option in this case, as the given executables all call into my DLL, for which I do have code, obviously. My ultimate goal is, to see a stack-trace right down into the functions of the running executable.
I do have symbol-information for these executables, so I was hoping I could write my own .RSM files for this purpose. Will this work? Will the Delphi debugger pick up any .RSM file that it can find? And would that mean that other debug-information should be left out?
Do note that there are lots of executables that I need to debug, and for all of them I detect the symbols inside them myself, using a moderately advanced function-detection algorithm. So my main problem mainly is how to write .RSM files. For this I have to know the structure of the .RSM file-format. Is there documentation or example code available somewhere that shows me how to create such a file?
Any help is appreciated!
PS: Might you be wondering why I'm doing all this : It's all related to Dxbx - an open-source Xbox1 emulator. See sourceforce for details. New members are welcome!
I found a page that says the format is similar to CodeView (www.openwatcom.org/index.php/Debugging_Format_Interoperability)
There is a link to this reference at Microsoft's CodeView format specs
I doubt this fully answers your question, but maybe it will get you a little further?

Resources