Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 80 81 [82] 83 84 ... 127

Author Topic: DFHack 0.44.12-r2  (Read 203218 times)

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: DFHack 0.44.10-r1
« Reply #1215 on: June 20, 2018, 06:44:10 am »

Thanks. I fear then generated codegen.h may have some issues with gcc builds. Generated structure for derived classes use
Code: [Select]
struct derived {
    struct base super;
    /* ... */
};
Although, this is usually how you do inheritance in C, it may not use the exact same layout as C++ classes. When deriving non-POD types, GCC optimize for space and and does not count the padding at the end of the base class. Among offsets used by DT, this affects history_event_hist_figure_diedst and item_crafted.

It should work fine with MSVC, where, IIRC, the tail padding is kept.

Yes. When I was recently using codegen_c_hdr to analyse osx binary, I modified it to just output all the fields from base class directly, and then all the layouts were correct.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.44.10-r1
« Reply #1216 on: June 20, 2018, 06:36:35 pm »

Interestingly, IDA 7.0 actually understands the "struct [class] : [base]" syntax in imported header files (despite its documentation stating that it doesn't understand C++), though it just translates it into a "baseclass_0" field at the beginning, which sadly doesn't help with this problem.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Clément

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.10-r1
« Reply #1217 on: June 22, 2018, 04:06:47 am »

Yes. When I was recently using codegen_c_hdr to analyse osx binary, I modified it to just output all the fields from base class directly, and then all the layouts were correct.

Can you share your modifications?

Edit: I tried to do it myself:
Code: [Select]
diff --git a/codegen_c_hdr.pl b/codegen_c_hdr.pl
index de6a3d2..1f73ec7 100644
--- a/codegen_c_hdr.pl
+++ b/codegen_c_hdr.pl
@@ -225,7 +225,7 @@ sub render_global_class {
     }
     indent {
         if ($parent) {
-            push @lines, "struct $parent super;";
+            push @lines, "struct $parent super;" if (!$linux);
         } elsif ($has_rtti) {
             push @lines, "struct vtable_$rtti_name *vtable;";
         }
@@ -245,12 +245,21 @@ sub render_global_class {
     push @lines_full, @lines;
 }
 sub render_struct_fields {
-    my ($type) = @_;
+    my ($type, $super_prefix) = @_;
+    $super_prefix = '' if (!$super_prefix);
+
+    my $parent = $type->getAttribute('inherits-from');
+    if ($linux && $parent) {
+        my $ptype = $global_types{$parent};
+        render_struct_fields($ptype, $super_prefix.'super_');
+        push @lines, "/* end of parent: $parent */";
+    }
 
     for my $field ($type->findnodes('child::ld:field')) {
         my $name = $field->getAttribute('name') ||
                    $field->getAttribute('ld:anon-name');
         $name = '_' . $name if !$stdc and $name and $name =~ /^(sub|locret|loc|off|seg|asc|byte|word|dword|qword|flt|dbl|tbyte|stru|algn|unk)_|^effects$/;
+        $name = $super_prefix . $name if $name;
         render_item($field, $name);
         $lines[$#lines] .= ';';
     }
Does it look right?
« Last Edit: June 22, 2018, 04:57:34 am by Clément »
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.10-r2
« Reply #1218 on: June 22, 2018, 05:51:14 am »

New release! https://github.com/DFHack/dfhack/releases/tag/0.44.10-r2
Thanks to everyone who submitted fixes - several long-standing issues were found and fixed.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: DFHack 0.44.10-r1
« Reply #1219 on: June 22, 2018, 07:04:11 am »

Yes. When I was recently using codegen_c_hdr to analyse osx binary, I modified it to just output all the fields from base class directly, and then all the layouts were correct.

It's on another computer, so the next time I get there.

Grey977

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.44.10-r2
« Reply #1220 on: June 25, 2018, 04:47:13 pm »

Good day.

 I cant find gui\autogem UI in game menus and in DFHack’s documentation no keybinding to this function like other gui scripts... Can someone help me?
Logged

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: DFHack 0.44.10-r1
« Reply #1221 on: June 25, 2018, 04:58:20 pm »

Yes. When I was recently using codegen_c_hdr to analyse osx binary, I modified it to just output all the fields from base class directly, and then all the layouts were correct.

Can you share your modifications?


https://gist.github.com/pronvit/19e4cd34427ccddd7b7d6cf0f61cc5ef

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.10-r2
« Reply #1222 on: June 25, 2018, 05:38:48 pm »

Good day.

 I cant find gui\autogem UI in game menus and in DFHack’s documentation no keybinding to this function like other gui scripts... Can someone help me?
First, it's gui/autogems, not gui\autogem. You can literally run "gui/autogems" in the console at any time (like most other commands) and the screen will open, as long as you have a world loaded. There's also a "G: Opts" option in the o-W menu, right next to "g: Auto cut gems", which will also open the screen.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Grey977

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.44.10-r2
« Reply #1223 on: June 25, 2018, 11:47:13 pm »

Quote
First, it's gui/autogems, not gui\autogem. You can literally run "gui/autogems" in the console at any time (like most other commands) and the screen will open, as long as you have a world loaded. There's also a "G: Opts" option in the o-W menu, right next to "g: Auto cut gems", which will also open the screen.

Ths for response. Yes, it is "gui/autogems", it was a typo.

There was another one... No gui script in giu folder. :-) Ths.
Logged

FantasticDorf

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.10-r2
« Reply #1224 on: June 26, 2018, 03:32:59 am »

As ever, its very amusing that Toady publishes the next release the day after a preceeding DF_hack update for the now previous release, may i ask how the follow up for the current (as of this post 44.11) DF version's DF_hack is coming along?
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.10-r2
« Reply #1225 on: June 26, 2018, 04:44:01 am »

As ever, its very amusing that Toady publishes the next release the day after a preceeding DF_hack update for the now previous release, may i ask how the follow up for the current (as of this post 44.11) DF version's DF_hack is coming along?
This time it wasn't that unexpected, as Toady said he'd make a release about a week from the previous post. However, I think it was still a good idea to wrap the changes up in a release, since there are people who won't upgrade to the latest DF until there's a DFHack for it, so I expect the release will still see some use.

Asking about when a new DFHack (or DT, or LNP) will become available is rather pointless. It will be done when sufficient prerequisites have been fulfilled, which depends on the amount of trouble encountered when (re)mapping structures and adapting to the changes. The first one may well be an alpha, though, intended more for fault finding and further mapping than play usage.
Logged

Darkond2100

  • Bay Watcher
  • Intrepid Groundhog
    • View Profile
Re: DFHack 0.44.10-r2
« Reply #1226 on: June 28, 2018, 03:57:11 pm »

Maybe if you update faster, Toady will too.
Logged
your hoard, your dwarves, and your fortress.
I prefer Hoard, Horde, and Hovel...

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.10-r2
« Reply #1227 on: June 28, 2018, 06:28:57 pm »

There's an alpha up as of around 4 hours ago: https://github.com/DFHack/dfhack/releases/tag/0.44.11-alpha1 (forgot to announce it here)

It's worth mentioning that we don't choose how much changes in DF updates. This one had a few things to fix. If you've gotten used to the last few DFHack pre-releases being fast, that's rarely the case - we jut got lucky with those DF updates. Nearly every DFHack release back in 0.40.x took at least a week, and that was considered fast.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Darkond2100

  • Bay Watcher
  • Intrepid Groundhog
    • View Profile
Re: DFHack 0.44.11-alpha1 (dev)
« Reply #1228 on: June 28, 2018, 06:35:26 pm »

Cool, now Toady will release a bugfix tomorrow.
Logged
your hoard, your dwarves, and your fortress.
I prefer Hoard, Horde, and Hovel...

Cathar

  • Bay Watcher
  • Adequate Engraver
    • View Profile
    • My shit
Re: DFHack 0.44.10-r2 | 0.44.11-alpha1 (dev)
« Reply #1229 on: June 28, 2018, 07:35:36 pm »

You guys are awesome. Thanks so much
Logged
I suppose you missed the whole thing of me thinking that fapping was the noise a keyboard made when being typed with.
Current project : Mong Kima
Commission me
Pages: 1 ... 80 81 [82] 83 84 ... 127