Advertisement

User blog:Phlox

User blog

Phlox Phlox 14 September 2012
0

Tracing a call

In the server code, in response to a load, you can watch it in stdinhand.c load_command() in the save file which is a compressed version of what looks like a .ini structure file. Just a guess but from the dates this project was started, the developers who put this in probably had no xml option at the time. They apparently wanted a lightweight database that was high enough performance, and text based so that naive users could manipulate it.


Set a breakpoint at do_move_unit in control.c, then do a move. Resulting stack most recent order looks like this:

  • do_move_unit
    • handle_unit_packet_common
      • handle_unit_info
        • client_handle_packet
          • client_packet_input
            • input_from_server
              • get_net_input

Crikies. They are doing a net IO for every tiny bit of a move trans…

Read Full Post
Phlox Phlox 13 September 2012
0

First debug sessions

Using WinDBG has been going along ok. Step in step out, moving around the stack, setting the breakpoints works well enough.

Some things seem way way wrong.

  • error messages on watching some variables, suggesting they are either out of scope, or have illegal/ unitialized values. In many of these cases, the program worked just fine.
  • non watchable variables that display "optimized out" when I try to click and inspect them.

I haven't built with robust debug and gdb compile time helper flags- if any such exist. That's next up.

  • Setting environment variable CLIENT_CFLAGS=-DDEBUG at the msys command line may enable a bunch of the debug diagnostic messages.
Read Full Post
Phlox Phlox 11 September 2012
0

AutoHell IV- MSYS revisted

Huh. I reloaded a clean directory of Freeciv2_3. Tried autogen.h, blows up at aclocal step with

aclocal: macro `_LT_DECL_SED' required but not defined aclocal: macro `_LT_FUNC_STRIPNAME_CNF' required but not defined aclocal failed - check that all needed development files are present on system

Swell. My old directory with 2.3 tree builds just fine.

Just Swell.

Can I get a ticket home now? Why does this have to be so fricking arcane and non repeatable?

Cripes.

Oh, looking at the M4 directory, I see I have some entries there that aren't there in the clean tree:

  • libtool.m4
  • ltoptions.m4
  • ltsugar.m4

Ok copied those over... negative result. But the prefixes of the error suggest it is some sort of libtool initialization that was not performed. But why…

Read Full Post
Phlox Phlox 11 September 2012
0

Visual Studio- WinGDB setup

It is possible to use Visual Studio with the Freeciv codebase to build and test revisions to the GTK client.


  • Install a build setup conforming to the instructions for installing MinGw and MySys on the Install-Windows page. This does not require Cygwin.
  • Install Visual studio 2010 trial. I used professional from this location. According to some notes I have seen on developer sites, MS never expires the trial. Don't know if that is true.
  • Install WinGDB. Some notes to orient you to a MinGw setup may be found here. Ignore the details regarding Cygwin. If you are not familiar with the Cygwin environment, this information concerns a separate setup that we aren't using.
  • Config using automake- and build using Mysys command line.

./autogen.sh --ena…

Read Full Post
Phlox Phlox 10 September 2012
0

Locked In code

Producing code that works cross platform is a significant feat. Producing code that builds using different compilers and build environments is the next level of horror.

Of course, the easy out is to say your platform is the best, and your favorite compiler/ build tool environment is the best and everyone should just convert to your right way of thinking. At any one time, one of the persons is probably close to the truth regarding either point. The trouble is, that there are many others in the room and it is more inclusive if our collaboration did not have a "my way of the highway" level of chauvinism concerning the neglect for accommodating other popular tools and platforms.

I don't think any of this is particularly intentional. If your …

Read Full Post

Community content is available under CC-BY-SA unless otherwise noted.