Commit Graph
285 Commits
Author SHA1 Message Date
Filippos Karapetis 7a68ee57b1 SCI: Always include the opcodeNames table, as it's used in VM hooks 2020-03-16 01:58:34 +02:00
Zvika Haramaty ac87c01895 SCI: debugger: disasm - added 'bcc' parameter, to use in C code
'bcc' is based on 'bc', but prints in format that's can be used in
C code for patches - just copy and paste (without the address column).
2020-02-13 23:42:06 +02:00
sluicebox e0a3a387b9 SCI: Log bp_function (bpe) parameters in debugger
Trac #9833
2020-01-09 18:04:03 -08:00
sluicebox a804afc571 SCI: Trigger bpr/bpw breakpoints within kernel calls
Trac #9835
2020-01-09 18:04:03 -08:00
D G Turner d11c61db14 SCI: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-12-01 05:06:31 +00:00
D G Turner 420cbaf8b0 SCI: Fix MSVC Warning 2019-09-30 03:15:47 +01:00
Filippos Karapetis 9da3d22703 SCI: Fix MSVC warnings
- Remove unused parameters
- Initialize potentially uninitialized variables
- Use Common::String instead of a fixed buffer
- Remove redundant parentheses
- Change float suffix to be uppercase
- Fix spacing
- Fix integer left shifts with boolean variables
- Fix potential division by zero
- Fix missing breaks
2019-05-27 14:53:41 +03:00
sluicebox f73584f0e5 SCI: Fix disassembler crash on invalid property
Fixes debugger crash when disassembling an instruction whose operand
is an invalid property. This occurs in LB2 floppy 1.0 script 720 in
sGetUp:changeState and sStepOnNail:changeState.
2019-03-18 07:44:23 +02:00
D G Turner 09abcc5c2c SCI: Fix Fall Through Compiler Warnings. 2018-11-13 12:10:30 +00:00
Filippos Karapetis 941869c466 SCI32: Remove reg32_t and use reg_t in all cases
reg32_t was a transitive solution, before reg_t's were
adapted to use 32-bit addresses internally, and before
support for SCI3 was added. It was introduced as another
way to handle large script offsets in SCI3, and was only
used for the program counter (PC). It's no longer
needed, as we now support SCI3 script offsets using
reg_t's, so we can use make_reg32 in all cases where
we need to access offsets over 64KB
2018-08-25 12:39:12 +03:00
Willem Jan Palenstijn 9030b09ecc SCI: Allow lofsa string printing in disasm for all SCI versions 2017-10-21 19:13:38 +02:00
Willem Jan Palenstijn fab43f0f71 SCI: Fix offsets in disasm for multi-param opcodes
This code was assuming that retval points to the start of the next
instruction, which is only true if the current parameter is the last
one. This fixes op_call printing.
2017-10-21 18:55:40 +02:00
Colin Snover be37a62591 SCI: Fix printing of super calls on clones in debugger 2017-09-30 01:08:12 -05:00
Colin Snover 4bd31dae9b SCI: Fix use-after-free when kernel call debugging is active during a save game restore 2017-09-27 20:27:33 -05:00
Colin Snover e4b3478d99 SCI: Show inherited methods when viewing an object in the debugger 2017-07-30 19:10:50 -05:00
Colin Snover 06686c09f0 SCI32: Fix breakpoints on reading/writing selectors in SCI3 2017-07-30 19:10:50 -05:00
Colin Snover 14907039fe SCI32: Fix lofsa/lofss of strings in SCI3 disassembly 2017-07-26 22:02:37 -05:00
Colin Snover 8bab5a3467 SCI: Resolve offset names when disassembling object methods 2017-07-23 10:35:13 -05:00
Willem Jan Palenstijn c7d631cb66 SCI: Expand kernel breakpoint pattern matching for negative matches
See matchKernelBreakpointPattern() for samples. The main envisioned use is

DoSound*,!DoSoundUpdateCues

to match all DoSound sub-functions except DoSoundUpdateCues.
2017-06-10 21:32:35 +02:00
Willem Jan Palenstijn 4102a77964 SCI: Clean up breakpoint code (indentation, consistency) 2017-06-10 21:32:35 +02:00
Willem Jan Palenstijn e2e3f7c4c5 SCI: Move bpk/logkernel to main breakpoint infrastructure
This changes the syntax for bpk and logkernel:

Enable breakpoint on kernel call:

bpk FrameOut

Enable logging for kernel call:

bpk FrameOut log
For backward compatibility this has an alias: logkernel FrameOut

Removing a kernel call breakpoint is done with bp_del/bc now.
2017-06-10 21:32:35 +02:00
Willem Jan Palenstijn b3866aa3d5 SCI: Allow multiple breakpoints with same trigger but different action 2017-06-10 21:32:35 +02:00
Willem Jan Palenstijn be84cfdb59 SCI: Add inspect, none breakpoint actions 2017-06-10 21:32:35 +02:00
Willem Jan Palenstijn 423ecde8e0 SCI: Move printObject from console to scriptdebug 2017-06-10 21:32:35 +02:00
Willem Jan Palenstijn 8e683db72b SCI: Add break/log/backtrace actions for triggered breakpoints
The action can be set using the new console command bp_action/bpact.
2017-06-10 21:32:35 +02:00
Willem Jan Palenstijn cb69d10e96 SCI: Add underscores to Breakpoint member variables 2017-06-10 21:32:35 +02:00
Willem Jan Palenstijn b56a49c53e SCI: Move backtrace output to scriptdebug.cpp 2017-06-10 21:32:35 +02:00
Willem Jan Palenstijn e9867356f5 SCI: Handle selector read/write breakpoints from opcodes 2017-06-10 21:32:35 +02:00
Willem Jan Palenstijn 3554875c7a SCI: Fix wildcard selector breakpoints
0f9c33e02f in 2011 broke selector
breakpoints of the type "ObjName::", which previously caught all
selector sends of the named object.

Thanks to TMM and snover for noticing.
2017-06-10 21:32:35 +02:00
Colin Snover a2d7851e4d SCI32: Improve disassembly output of SCI3 property opcodes
Since SCI3 scripts use selectors instead of offsets as operands
to property-related opcodes, the disassembler can look up and
display property names everywhere (unlike SCI2.1 and earlier,
which need to know the object being operated on to look up the
correct selector for a given offset).
2017-04-23 13:07:25 -05:00
Colin Snover eadf5d818f SCI: Fix support for 32-bit SCI3 script offsets 2017-04-23 13:07:25 -05:00
Colin Snover 0394fd44e8 SCI: Fix whitespace errors 2017-04-23 13:07:25 -05:00
Colin Snover 61fba94139 SCI: Remove dead code in Script_Offset disassembler
Script_Offset is only ever used for lofsa/lofss opcodes.
2017-04-23 13:07:25 -05:00
Colin Snover 0676e640db SCI: Fix bad offsets in disassembly for SCI3 lofsa/lofss 2017-04-23 13:07:25 -05:00
Colin Snover 9e7c75cc79 SCI: Avoid crashing when disassembling a call with a bad object
lookupSelector will raise an error if the passed object ID is
invalid.
2017-04-22 19:38:13 -05:00
Colin Snover 3ab1f5f4cc SCI: Display class names in disassembly 2017-04-22 19:28:35 -05:00
Colin Snover f4d3664d3f SCI: Replace magic numbers in reg_t handling with symbols 2017-03-30 19:46:27 -05:00
Colin Snover 31daa956d6 SCI: Implement bounds-checked reads of game resources 2017-03-27 19:42:31 -05:00
Colin Snover 10d97ce379 SCI: Fix more unsafe C-string usage 2017-02-05 12:38:21 -06:00
Colin Snover be14778b2b SCI: Ensure bytecode/BWT for "file" op is also printed
Learning the bytecode for file op is necessary when creating
workaround signatures, as the signature-finding mechanism does not
currently ignore line/file instructions.
2016-12-12 15:20:08 -06:00
Colin Snover 4814682d5f SCI: Improve disassembly output
1. pushi opcode now displays decimal value and selector value (if
   one exists) in-line
2. lofsa, lofss, and super opcodes now display resolved
   object/class names
3. Opcode arguments are visually aligned
2016-11-20 12:31:44 -06:00
Colin Snover 9380b54120 SCI: Add code-address breakpoints to debugger 2016-11-20 12:31:43 -06:00
Johannes Schickel 1c6112e121 SCI: Introduce accessors for SegmentObjTable entries.
This makes code not use _table directly whenever possible. An exception is the
save game code which is not easy to adapt due to design deficiencies.
2016-03-25 01:15:26 +01:00
Filippos Karapetis cdbd7c8add SCI: Use uint32 instead of unsigned int 2016-03-01 01:12:58 +02:00
Johannes Schickel daa8d57a86 ALL: Rename Debugger::DebugPrintf to Debugger::debugPrintf. 2014-05-27 02:04:07 +02:00
Johannes Schickel 8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
Martin Kiewitz 07568931ce SCI: fix null pointer access in logKernelCall
method was/is used for debugging only
CID 1003612
2014-01-27 23:31:40 +01:00
Willem Jan Palenstijn 2d1fd3b554 ALL: Fix typo (existant->existent) 2013-02-23 22:07:32 +01:00
Willem Jan Palenstijn e38d4f20e8 SCI: Fix dissect_script crash with invalid object types 2012-10-06 13:07:12 +02:00
Willem Jan Palenstijn 5f3f21e20e SCI: Fix some console output formatting 2012-10-06 13:07:12 +02:00