jdwp
jdwp copied to clipboard
Fix getValue for boolean types
I ran into an issue when trying to request the value of a stackframe variable when it was the boolean type.
(node:11980) UnhandledPromiseRejectionWarning: TypeError: this._bytes.getByte is not a function
at ByteBuffer.getValue (D:\Studium\Masterarbeit\projects\jdwp-react\backend\node_modules\jdwp\lib\byte_buffer.js:332:29)
at GetValues.decode (D:\Studium\Masterarbeit\projects\jdwp-react\backend\node_modules\jdwp\lib\command\stack_frame\get_values.js:38:24)
at JDWPConnection._handlePacket (D:\Studium\Masterarbeit\projects\jdwp-react\backend\node_modules\jdwp\lib\connection.js:100:40)
Taking a look at the code it seemed it was trying to call the .getByte() function of Buffer which does not exist. It seems it was supposed to call the this.getByte() function instead.
case 90: // BOOLEAN
len = 1;
value = this._bytes.getByte(index + 1) === 1;
break;
PS: Good job on this library overall!
Codecov Report
Merging #2 (523cb27) into master (3ba67e8) will increase coverage by
3.04%. The diff coverage is28.57%.
:exclamation: Current head 523cb27 differs from pull request most recent head ae689e0. Consider uploading reports for the commit ae689e0 to get more accurate results
@@ Coverage Diff @@
## master #2 +/- ##
==========================================
+ Coverage 60.18% 63.22% +3.04%
==========================================
Files 178 178
Lines 3870 3872 +2
==========================================
+ Hits 2329 2448 +119
+ Misses 1541 1424 -117
| Impacted Files | Coverage Δ | |
|---|---|---|
| lib/byte_buffer.js | 58.14% <0.00%> (+0.22%) |
:arrow_up: |
| lib/command/virtual_machine/all_threads.js | 25.00% <0.00%> (ø) |
|
| lib/value/array_reference.js | 21.42% <ø> (-48.58%) |
:arrow_down: |
| lib/virtual_machine.js | 59.92% <0.00%> (+2.24%) |
:arrow_up: |
| lib/event_request_manager.js | 80.00% <50.00%> (-12.86%) |
:arrow_down: |
| lib/command/const/tag.js | 100.00% <100.00%> (ø) |
|
| lib/event/modifier/count.js | 16.66% <0.00%> (-83.34%) |
:arrow_down: |
| lib/event/modifier/step.js | 18.18% <0.00%> (-81.82%) |
:arrow_down: |
| lib/command/array_reference/set_values.js | 23.07% <0.00%> (-76.93%) |
:arrow_down: |
| lib/command/thread_group_reference/children.js | 22.22% <0.00%> (-72.23%) |
:arrow_down: |
| ... and 46 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 3ba67e8...ae689e0. Read the comment docs.
Is this repo still maintained?