Configuring USB 3G Modem on Linux

I was in the process of configuring my USB 3G broadband modem with my Linux boxes and was interested to
find out all about Linux's USB serial interface and drivers etc. So I've kind of assimilated all the
information below along with the links for those of you who want to read them.

Its fairly simple to configure any (or most) of the USB modems in Linux.
But you'll need to know some details about it first. You would need to find out

- Username (this could be your SIM card's phone number)
- Password (this could be your SIM card's phone number)
- Phone Number (which number to dial to #777 or *99# something like that)

NOTE : For Airtel it is *99# and for Reliance it is #777.

Before you connect you will need to write /etc/wvdial.conf You can read the man
page of wvdial.conf and write everything by hand or run "sudo wvdialconf" on your
computer. Linux probes for details of the device and generates wvdial.conf with
some information. It could look like something below --

[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
; Phone = <Target Phone Number>
ISDN = 0
; Username = <Your Login Name>
Init1 = ATZ
; Password = <Your Password>
Modem = /dev/ttyUSB0
Baud = 9600

You will then need to fill up the rest of the details such as (a sample) -

[Dialer Defaults]
Modem = /dev/ttyUSB0
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
CBaud = 460800
Stupid Mode = 1
Modem Type = Analog Modem
Phone = *99#
New PPPD = yes
ISDN = 0
Username = <Your Username>
Password = <Your Password>
Baud = 9600

Save and quit the above file and then run "sudo wvdial" with the device plugged
and you should be online after that.

Some internal information -

USB modem (http://en.wikipedia.org/wiki/Modem)

"USB wireless modem use a USB port on the laptop instead of a PC card or
ExpressCard slot. Most of the wireless modems come with an integrated SIM
cardholder (Huawei E220, Sierra 881, etc.) and some models also provided a
microSD memory slot and/or jack for additional external antenna such as Huawei
E1762 and Sierra Wireless Compass 885.

USB modems work in Linux with kernel versions 2.6.20 and greater. Its development
started in 2.5. This article on Linux Journal explains about USB Serial implementation
in the linux kernel in detail.

It needs support for /dev/ttyUSB* devices. See this link in wikipedia for more
information http://en.wikipedia.org/wiki/Huawei_E220. You can use wvdial
to connect via this USB modem.

wvdial (See wikipedia link http://en.wikipedia.org/wiki/Wvdial) is a dial-up
utility available for Linux OSes. 

wvdial initializes the modem and executes the dial up instructions based on
what is specified in wvdial.conf (See man wvdial.conf) to find out what to
write in that file. Or you can plugin the USB modem and run wvdialconf
(as root or sudo) and that detects and generates the /etc/wvdial.conf file.

RESOURCES

http://en.wikipedia.org/wiki/Modem

https://forum.openwrt.org/viewtopic.php?id=19171

http://en.wikipedia.org/wiki/Wvdial#cite_note-0

https://wiki.archlinux.org/index.php/USB_3G_Modem

http://www.mjmwired.net/kernel/Documentation/usb/usb-serial.txt

http://www.linux-usb.org/

http://www.linuxjournal.com/article/6434?page=0,2

http://www.linux-usb.org/devices.html

http://cateee.net/lkddb/web-lkddb/USB_SERIAL.html

How to setup ReviewBoard for code reviews on your Ubuntu OS

This post provides a series of steps and commands that is required to setup and configure reviewboard server on your Ubuntu OS. Having reviewboard to post and track changes and reviews is really awesome. Well of-course reviewboard documentation has done a wonderful job of describing everything needed. I had to open a few other sites (like MySQL and some forums) to complete the steps successfully. I stumbled upon a few errors while I was setting up reviewboard and I’ve added steps on how I got around them and got it up and running.

I have a Ubuntu 10.10 running on a system on which I’ve setup reviewboard. You could put these in a script and it would work -

There are some pre-requisites -

    sudo apt-get install firefox
    sudo apt-get install mysql-server
    sudo apt-get install libmysqlclient-dev
    sudo apt-get install apache2
    sudo apt-get install libapache2-mod-python

    sudo apt-get install python-setuptools
    sudo apt-get install python-dev  # (re-starts the machine to complete setup)
    sudo apt-get install memcached
    sudo apt-get install patch

All of reviewboard components and python modules can be installed using setuptools (easy_install)

    sudo easy_install python-memcached
    sudo easy_install ReviewBoard
    sudo easy_install mysql-python
    sudo easy_install python-mysqldb

Am setting this up for subversion. Installing subversion and the python-svn (source control components)

    sudo apt-get install subversion
    sudo apt-get install python-svn

In order to setup / configure reviewboard you’ll need a MySQL database (I’ve chosen MySQL, you could choose others listed on reviewboard site). So run the following command -

mysql –user=root –password=”your passwd here” mysql

Create the reviewboard database of your choice. At the mysql prompt type

mysql> CREATE DATABASE {your-database-name-here};

At the mysql prompt create a reviewboard user and grant it all permissions.

mysql> CREATE USER ‘rbuser’@'localhost’ IDENTIFIED BY ‘your_password’;
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘rbuser’@'localhost’ WITH GRANT OPTION;

Now run the configuration command rb-site install to configure your review board server

sudo rb-site install /var/www/your.review-site.com

sudo chown -R www-data:www-data /var/www/your.review-site.com

rb-site install is going to ask you a lot of questions, which you should be able to answer since it would be your choices and specific to your environment. Remember your reviewboard admin credentials which will be required later.

NOTE: Apache runs as www-data user on my Ubuntu. If you don’t change the owner and group of /var/www/your.review-site.com to www-data:www-data, Apache won’t have the right permissions to add the source control repository. This is required because, you would have to upload your changed files and reviewboard should be able to detect the difference between what is in the source repository vs. the file you’ve submitted.

cd /etc/apache2/sites-available
cp /var/www/your.review-site.com/conf/apache-modpython.conf your.review-site.com.conf
cd ../sites-enabled
sudo ln -s ../sites-available/your.review-site.com.conf .

And you’re done !

With this, you have a review board setup. Based on the questions you’ve answered (hopefully with correct details) visit reviewboard link http://<your.rb.hostname>:<port>/dashboard

As an admin you’ll have to add your source control repository URL in to your reviewboard environment. Login to your reviewboard server as ‘admin’. Click on the “Add” link next to “Repositories” in the “Database” tab. In this window, fill-up the Source control details. And click ‘Save’.

NOTE-1: If you’ve forgotten to run the chown command command above to set the owner to www-data on /var/www/your.review-site.com/ reviewboard cannot create the configuration.

NOTE-2: If you get an error saying unable to create .subversion directory under /var/www/your.review-site.com/data, then create it manually.

Once you’ve added your source repository successfully, the setup is complete.

Users of reviewboard need to

  1. Create their accounts and login to reviewboard.
  2. To post new reviews, users would need post-review (part of RBTools). This is a tool that allows you to post review from your source control using command line. This tool is available for Linux, Windows and MacOS. This can be installed by running

easy_install -U RBTools

For users to start using the tool (in case of SVN). In your SVN checked-out directory set a property using -

svn propset reviewboard:url http://<your.rb.hostname>:<port>/

post-review –user=<your-username> –password=<your-passwd> -p

This should post this for review !

 

 

Building Pidgin as an alternative to Microsoft Office Communicator Client

A new post on my blog been long due. I’ve switched to Linux as the primary and the only OS on my work laptop for a while now and have setup equivalent alternatives to all the office applications and I feel at $HOME. And this one being the last piece of the puzzle.OSS & Linux Rocks and I cannot emphasize enough.

I’ve built all the required pre-requisites for Pidgin right from glib, gtk+ to pidgin and pidgin-sipe (MS Office Communicator Plugin) and got it working and am delighted. I am running RHEL 5.5 and I’ve compiled all the components for this environment. I had a few things I found out on the way and would like to share it here.

You can download the bash script (available from my box.net widget). This script does -

  • Download
  • Extract archive and build
  • Install

of all the required software, pidgin and pidgin-sipe. After the script completes, you will have a fully functional pidgin with SIPE plugin and you’ll be able to use it as an alternative to MS Office Communicator client.

These are the required packages and the script builds them in the following order -

  1. glib-2.26.1.tar.bz2
  2. atk-1.29.2.tar.gz
  3. tiff-3.9.4.tar.gz
  4. gdk-pixbuf-2.22.1.tar.bz2
  5. pixman-0.21.4.tar.gz
  6. cairo-1.8.0.tar.gz
  7. fontconfig-2.8.0.tar.gz
  8. pango-1.28.3.tar.bz2
  9. gtk+-2.22.1.tar.bz2
  10. enchant-1.6.0.tar.gz
  11. gtkspell-2.0.16.tar.gz
  12. pidgin-2.7.9.tar.bz2
  13. pidgin-sipe-1.10.0.tar.gz

The script uses 3 variables. You can alter them and make them point to directories of your choice. The default values are -

  • ZIPS=$HOME/sandbox/zips (Location where the packages would get downloaded)
  • SRC=$HOME/sandbox/src (Extract each of the packages here; configure and make runs here)
  • DST=$HOME/pidgin-deps (Install them into this location)

Many of these packages have dependencies / pre-requisites that need to be met before they get built and installed. You could take a look into the script to know exactly what they are. Some of those details are described here.

PKG_CONFIG_PATH is a variable that the configure script refers to. If the package you are building is dependent on another package and that package is installed in a non-standard location, then you could set this variable to point it to the location of lib/pkgconfig (.pc files). So that the configure script knows where to look for its dependencies.

  • ATK – depends on GLIB
  • GDK-PIXBUF does not compile if LIBTIFF environment variable is not set to point to LIBTIFF install location /lib directory.And CFLAGS need to be set to LIBTIFF/include.
  • CAIRO – depends on Pixman
  • PANGO – depends on Cairo and pangocairo builds only when you have the latest fontconfig.
  • GTK+ – depends on all of the above packages.
  • GTKSPELL – required for spell check in your IM depends on Enchant
  • PIDGIN – depends on all of the above. And the configure script needs quite a few options. I’ve disabled some features that I didn’t require (–disable-screensaver –disable-startup-notification –disable-gstreamer –disable-vv –disable-idn –disable-meanwhile –disable-avahi –disable-dbus –disable-tcl –disable-consoleui)
  • PIDGIN-SIPE – depends on pidgin and the install location should be set to pidgin so that the plugins are placed correctly.

NOTE: While compiling gtk+ if you get an error that says “/bin/sh: no : command not found”. This could mean, that one of the commands was not found during the configure step. Peek into the config.log to find out more and also take a look at the configure script. gtk+ requires gdk-pixbuf-csource make sure you put that on PATH before running configure.

After all this, you’ll have a working pidgin that can work as a MS communicator client.

Some of the references that could prove useful -

Reference URLs:

  • http://developer.pidgin.im/wiki/Protocol Specific Questions
  • http://developer.pidgin.im/wiki/DbusHowto
  • http://www.gtkforums.com/about3760.html
  • http://old.nabble.com/Compiling-pango-with-cairo-font-backend-td23186772.html
  • http://www.mail-archive.com/gtk-i18n-list@gnome.org/msg01400.html

Compiling SVN client on Linux

This article describes how to build SVN client from source on a Linux OS.

These are the following modules you’ll need. Well ofcourse you are free to download other versions of the sources and experiment with them. I’ve tested the SVN client with these versions and found them to be working.

Copy all these tar.gz files under your working directory.If you are bored of clicking and downloading each of these versions you could just paste these wget commands on your linux box. Just be sure you have internet access from that machine -

  • wget http://www.ecoficial.com/apachemirror/apr/apr-1.4.2.tar.gz
  • wget http://www.ecoficial.com/apachemirror/apr/apr-util-1.3.9.tar.gz
  • wget http://www.webdav.org/neon/neon-0.29.3.tar.gz
  • wget http://www.sqlite.org/sqlite-amalgamation-3.6.23.1.tar.gz
  • wget http://www.openssl.org/source/openssl-0.9.8n.tar.gz
  • wget http://subversion.tigris.org/downloads/subversion-1.6.12.tar.bz2

And you could run this simple wrapper script that I’ve written. This script extracts, builds and installs all the required components and SVN client to the location of your choice. You can get the script (makesvn.sh) from my box.net widget on the right hand side of this blog. If you are using different versions of the dependent software, just edit the makesvn.sh and alter the first few variables APR_GZ, APRUTIL_GZ etc. to point to the correct names.

Enabling user-dump in Windows

It is hard to believe how complex enabling user-dump can get in Windows !! And there are different procedures on every different version of Windows ! I don’t understand Windows internals that well. But I wonder what makes it that difficult to keep it consistent across their own OS kernels. Gives one more reason (as a developer) to not like Windows. And there are different tools, procedures, scattered knowledge base articles to illustrate the steps.

1. Using a tool named userdump and this can be used to generate user dump on the following Windows OSes -

  • Microsoft Windows Server 2003, Standard x64 Edition
  • Microsoft Windows Server 2003, Enterprise x64 Edition
  • Microsoft Windows Server 2003, Standard Edition (32-bit x86)
  • Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
  • Microsoft Windows XP Professional x64 Edition
  • Microsoft Windows XP Professional
  • Microsoft Windows XP Home Edition
  • Microsoft Windows 2000 Service Pack 1
  • Microsoft Windows 2000 Service Pack 2
  • Microsoft Windows 2000 Advanced Server

A sample of using userdump – (@See more here http://support.microsoft.com/kb/250509)

C:\> userdump 1188 c:\store.dmp

2. Now this is different for Windows Vista and Windows 7 and  for these OS flavors, you open task manager, right-click on the process and click on “Create dump file” option. And if you have process that hangs or crashes you can use Adplus tool. The same procedure is applicable to all sorts of Windows 2008 editions

Adplus is a vbscript a utility written around CDB. This can run in two modes -

a. Hang mode – to detect process hangs and create user dump

b. Crash mode – to detect process crashes and create user dump

For example to create a user dump using adplus run the following command -

For a process that crashes -

C:\> adplus -crash -p <PID>

For the process that hangs -

C:\> adplus -hang -p <PID>

Here is a decent link I found that records a lot of these options - http://support.microsoft.com/kb/286350/

3. And then there is “Debug diagnostic 1.1″ that is used to debug high performance applications that crashes, hangs etc. http://support.microsoft.com/kb/931370

4. And then there is generating a Kernel dump. Luckily there is just one way to generate kernel dump on most of the Windows OSes; Details on how to is here http://support.microsoft.com/kb/254649; There is a hotfix from Microsoft that allows user to generate memory dump via a keystroke - http://support.microsoft.com/kb/244139

Here are some reference links

5. Now what about production systems where you wouldn’t want to install any such tools but still want to get a user-dump file. This is still a question to me and am looking for an answer. So if any of you windows gurus are here do tell me how ?

Trouble Connecting to VPN on Vista after using Reliance NetConnect

I started using Reliance NetConnect wireless broadband internet over the last few weeks. Everything was fine. I used to conect to a VPN over the Reliance NetConnect connection. Things were fine.

Later at home I tried using my WiFi connection (via the Linksys router). I was able to connect to the router and browse the net. However the VPN connection was never successful. I kept getting errors. I saw the error numbers 691 and 829. I struggled with this error for two days before I figured out I had to run the following commands –

Netcfg –u MS_PPTP

Netcfg –u MS_L2TP

And then,

Netcfg -l %windir%\inf\netrast.inf –c p –i MS_PPTP

Netcfg –l %windir%\inf\netrast.inf –c p –i MS_L2TP

After running these commands I am now able to connect to the VPN via my WiFi !

How To Configure VNC for Linux

I had a Linux box (RHEL 5.4 X64) to which I only had Telnet & SSH access. And I wanted a full screen export to test some GUI. So here is what I learnt and did to enable VNC and get a full screen export to the GNOME environment.

Make sure you have installed a VNC server on the box. You could download TightVNC source and compile it on your Linux box.

  • First login to the machine as root (via telnet/SSH).
  • Edit the following file /etc/sysconfig/vncservers and add lines with the following syntax/format

VNCSERVERS=”n:username”

VNCSERVERARGS[n]=”arguments here”

For example to enable a VNC access for root user on display 2, you would enter the following lines

VNCSERVERS=”2:root”

VNCSERVERARGS[2]=”-geometry 800×600″

The above entries will enable root user to login to VNC display 2, with a screen resolution of 800 x 600.

  • As root run the command /usr/bin/vncpasswd; Enter and confirm the VNC login password to be used by the client.
  • Then Edit the /etc/X11/xorg.conf and add the following lines to the end of the file -

Section “Module”
Load “glx”
Load “dbe”
Load “extmod”
Load “freetype”
Load “type1″
Load “dri”
Load “vnc”
EndSection

  • NOTE: Press Enter after “EndSection” then save & quit the file.
  • If the firewall on Linux (iptables) is enabled and running then it is likely that the ports that VNC uses (5900 – 590x) are blocked.
  • Open those ports by running “system-config-securitylevel” at the root prompt (#). In the (curses type) CUI that appears on the screen, click on “Customize” button and in the “Allow incoming” section in the “Other ports” textfield, add “5900-5904:tcp”. Save and exit the application.
  • You will then have to enable VNCServer for a particular run-level. And here is how you can check and enable them

chkconfig –list vncserver # This list the displays enabled/disabled status (from run-level 0 to 6).

chkconfig –level 3 vncserver on

  • Now start the VNC service by typing “service vncserver start“. This should start the VNC server on your machine on display 2 for root user.
  • At this point you can VNC to the server, but you will by default get a TWM window manager (which just has a X-Windows bash prompt). Which is not good enough. So to enable GNOME or KDE,
  • Now edit the file $HOME/.vnc/xstartup, Un-comment the following lines -

unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

At the end of the file, replace “twm &” with “startx &” for GNOME and “startkde &” for KDE.

  • Re-start your VNC service with “service vncserver restart”.
  • With this you are all set.

You can install a Tight VNC client on your Windows or any other box and then connect to display 2, by typing your machines IP followed by :2. For example – 192.168.3.130:2

Thanks to these links from where I gathered the above info :)

MSI, MSP, MST, .CAB…

I recently had to understand and debug an application that processes MSI and MSP files. This was my first time I had to really work on debugging Windows Installer application. And a learnt a thing or two which I found useful. Then I thought it would be blog about the basics.

MSI – This is a Windows installer package (a .msi file) which is used for installation, repair of software on Windows OSes. A MSI file can be viewed and editied by using softwares like Wise for Windows Installer (now Symantec), ORCA a tool that Microsoft ships with its Windows Installer SDK (which can also be downloaded for free here). You can imagine a MSI to contain a set of Properties, Tables (like database tables), Components, Files, Custom Action logic etc. In Windows Installer files could be inside the MSI or could be part of an “Administrative Install”. In an Administrative installation, the files are kept in a separate location and the MSI contains the location information of the files which are used during installation.

MSP – In a nutshell (MSP = MST + .CAB). A patch file (.msp) contains MST (Transforms) and CAB (Cabinet) files. The files in the patch could be patching existing files which are part of the base installation and/or could contain a set of new files not present in the original MSI. The files in the .CAB in the MSP could contain only binary differences as compared to the files in the base installation. Windows installer follows a set of rules to decide whether a file in the patch is a diff or if it has to keep the entire file. If the size of the file part of the patch is greater than the size of the original file, then a diff is created. But if the size of the file is smaller, then the entire file is maintained. Look at this link for more information — http://msdn.microsoft.com/en-us/library/aa371146(VS.85).aspx.

MST – As we know a MSI contains properties, tables etc. If the patch is changing any of the properties or one of the values in a table such as updating a file’s timestamp etc.; then such things are recorded as a transform. If you have an MST file, then you could observe the effects it has on the MSI by applying the transform to the MSI. You could achieve this by using the ORCA tool. Open the MSI using ORCA, then click on menu Transform -> Apply Transform…

Installing a MSI

The command to install, un-install, verify, update a MSI/Package is -> “msiexec.exe”. To install an msi, you could use the command -

msiexec /i adobe.msi /L*v msi_install.log

Enable Logging

When debugging or looking into errors that may have been caused during installation/uninstallation etc, looking at a detailed log is most important. The above command will install the MSI with verbose logging. Inorder for verbose logging to work, you will have to add the following registry setting -

  • run ‘regedit’
  • Goto HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer
  • Create key Logging (Type will be REG_SZ).
  • For value voicewarmupx

For complete  on logging see – http://support.microsoft.com/kb/223300. Also look at the Wikipedia link http://en.wikipedia.org/wiki/Windows_Installer that has additional info on how to enable this logging from Windows Server 2008 onwards (the procedure has changed as compared to how it was done in XP/W2K3).

More on Patching

If you want to extract a .msp file and look in to what is inside the file then you could use a tool called msix to extract a MSP file into pieces. The msix tool extracts an MSI into a set of MSTs and CAB files.The tool along with the source has been provided along with good description on Heath Stewarts MSDN blog link – http://blogs.msdn.com/heaths/archive/2006/04/07/571138.aspx

Usually as a good practice exe and dlls have version information associated with them. So a exe/dll in a patch would have a version greater than the one present in the base installation. In such  cases it is easier for Windows installer to decide how to patch the file. But in some cases, where the exe/dll does not have any version information or if the file is not an exe/dll. For example if it is a text file or some other file like an image for example. Then Windows installer follows a flowchart to decide how to patch such files. I found a good link here – Aaron Stebner’s WebLog : How Windows Installer handles file replacement logic for versioned and unversioned files

Programming -

You could write a program and register a call back as an external UI, which gets called for every file being installed by the Windows installer. See this API as a starting point for that here documented here – http://msdn.microsoft.com/en-us/library/aa370384(VS.85).aspx

Windows Installer page has a flowchart that clearly describes the handling of such scenarios – http://msdn.microsoft.com/en-us/library/aa370532%28VS.85%29.aspx

Here are a bunch of reference links that helped me understand some basics of Windows Installer

Application process com.android.browser stopped unexpectedly after upgrade to Android 1.6

I own a HTC Dream running Google’s Android 1.5 and I was being prompted for an upgrade saying “System update available”. I accepted the install and it upgraded my firmware to version 1.6.

Firmware Version : 1.6

Build Number: DRD020

After this, the browser application refused to open. It would give an error that said “the application browser process com.android.browser has stopped unexpectedly”.

I tried removing all browser data and cache via Android system system settings but that did not help! I read in one of the Google forums that the only way out of this was to format the SD card. I don’t seem to find that link/site again. I formatted the SD card and things seem to work fine now !.

GDB Vs. WinDbg Commands

I have always enjoyed working on Unix/Linux environments makes me feel at home. Off late I had to debug a crash on windows and used WinDbg for it. I liked WinDbg for the fact that it is command driven and is similar to GDB. So am tempted to compare and record the options available in the two debuggers here. This post, discusses only debugging tools available for user mode debugging and not kernel mode debuggers.

First and foremost, for any source level meaningful debugging to work at you should have compiled your code in debug mode. Use -g flag on Unix/Linux or generate PDB file on windows using compiler flag /ZI.

Procedure to create a dump (core-dump) file in Windows using WinDbg or analyzing a crash -

Execute the command below -

> cscript.exe adplus.vbs -crash -sc C:\path\to\your\executable.exe

Note: adplus.vbs : resides under the WinDbg install location.

If your program crashes, the above command dumps core under your WinDbg install location under CrashDump folder. This can be a good way to examine the stack trace of a program if it crashes during startup.

Type the kb command in your windbg debugger command after executing the above command to view the stack trace of the crash or run the other windbg commands below to continue execution if the program didn’t crash during startup.

To dump core at a specific location in your program, type the command at your break point or line of your choice in windbg -

.dump /mfh C:\path\of\yourchoice\myfile.dmp

Here are a list of various useful commands that come in handy

Command / Option description GDB Command WinDbg Command / GUI operation descriptions

Enabling
post-mortem default debugger

Not
applicable on any Unix/Linux OS

To
register as the default debugger type “windbg -I”
and to use Dr.Watson use “drwtsn32 -i”

Invoking
Debugger with core file
or dump
file (as called in windows)

gdb
<executable-file> <core-file>

Windbg-y
SymbolPath -i ImagePath -z DumpFileName

<ExecutableName>

Attaching
to a Running Process

gdb
<executable> <pid>

windbg
-p <pid>

Repeat
Last Command

Hit the enter key the most
previous command is repeated.

Hit the enter key the most
previous command is repeated.

Display
debugger command(s) while performing GUI operations

in the debugger

Not applicable. You’ll have
to type in your commands here.

.bpcmds

Enabling
Source level debugging

Enabled for files compiled
with -g option.

list / list {linenum} / list
{filename:linenum} to display source file.

windbg <executable>
<arguments>

“File->Open Source
File…”. Then hit the F5 key to run the program. The
program stops at the specified breakpoint.

Setting
break point in a certain line in the code

break <line>

break <source>.<line>

break function_name

break
cpp_class::function(params)

bp
@@masm(`FileName:LineNumber+`)

Execute
/ Run program to a breakpoint or end of execution

Run

r

go

g

Step
over to next instruction

next

p

Step
into function / method

step

t

Display
variable contents

print variable_name

dv local_variable_name

Dump
memory contents

dump

d{a|b|c|d|D|f|p|q|u|w|W}

Back
track and display stack frames from current frame

bt <number-of-stack-frames>

kc

k[b|p|P|v] [c] [n] [f] [L]
[FrameCount]

More to follow on threads and other sub-commands.

Follow

Get every new post delivered to your Inbox.