Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6761f45

Browse files
committedApr 15, 2018
update npm packages and rebuild
1 parent de5cce7 commit 6761f45

9 files changed

+2286
-406
lines changed
 

‎CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# gdbgui release history
22

3+
## dev
4+
* ensure expressions with hex values are parsed and updated appropriately (#182)
5+
* improve command line arguments
6+
* use python logging module
7+
38
## 0.11.2.0
49
* add option to remove fflush command (#179)
510
* remove react-treebeard and render filesystem w/ new component

‎gdbgui/src/js/GdbVariable.jsx

+7-4
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ class GdbVariable extends React.Component {
266266
''
267267
),
268268
toggle_classes = has_children ? 'pointer' : '',
269-
val = GdbVariable._get_value_jsx(mi_obj),
270269
plot_content = '',
271270
plot_button = '',
272271
plusminus_click_callback = has_children ? () => GdbVariable.click_toggle_children_visibility(mi_obj.name) : () => {}
@@ -300,7 +299,7 @@ class GdbVariable extends React.Component {
300299
{plus_or_minus} {expression} 
301300
</span>
302301

303-
{val}
302+
{GdbVariable._get_value_jsx(mi_obj)}
304303

305304
<span className="var_type">{_.trim(mi_obj.type) || ''}</span>
306305

@@ -472,10 +471,14 @@ class GdbVariable extends React.Component {
472471
return new_obj
473472
}
474473
static _update_numeric_properties(obj) {
475-
obj._float_value = parseFloat(obj.value)
474+
let value = obj.value
475+
if(obj.value.startsWith('0x')){
476+
value = parseInt(obj.value, 16)
477+
}
478+
obj._float_value = parseFloat(value)
476479
obj.is_numeric = !window.isNaN(obj._float_value)
477480
obj.can_plot = obj.is_numeric && obj.expr_type === 'expr'
478-
obj.is_int = obj.is_numeric ? parseFloat(obj.value) % 1 === 0 : false
481+
obj.is_int = obj.is_numeric ? obj._float_value % 1 === 0 : false
479482
}
480483
static _update_radix_values(obj) {
481484
if (obj.is_int) {

‎gdbgui/src/js/Memory.jsx

+5-11
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import {store} from 'statorgfc'
99
import GdbApi from './GdbApi.jsx'
1010
import constants from './constants.js'
11-
import MemoryLink from './MemoryLink.jsx'
1211
import ReactTable from './ReactTable.jsx'
12+
import MemoryLink from './MemoryLink.jsx'
1313
import Actions from './Actions'
1414
import React from 'react'
1515

@@ -219,11 +219,6 @@ class Memory extends React.Component {
219219
Memory.fetch_memory_from_state()
220220
}
221221

222-
static _make_addr_into_link_react(addr) {
223-
void React
224-
return <MemoryLink addr={addr} />
225-
}
226-
227222
/**
228223
* @param text: string to convert address-like text into clickable components
229224
* return react component
@@ -233,22 +228,21 @@ class Memory extends React.Component {
233228
if (text && matches && matches.length) {
234229
let addr = matches[0]
235230
let leading_text = text.slice(0, text.indexOf(addr))
236-
let component = Memory._make_addr_into_link_react(addr)
237231
let trailing_text = text.slice(text.indexOf(addr) + addr.length, text.length)
238232
let suffix_component = trailing_text
239233
if (trailing_text) {
240234
// recursive call to turn additional addressed after the first
241235
suffix_component = Memory.make_addrs_into_links_react(trailing_text)
242236
}
243237
return (
244-
<span>
238+
<React.Fragment>
245239
{leading_text}
246-
{component}
240+
<MemoryLink addr={addr}/>
247241
{suffix_component}
248-
</span>
242+
</React.Fragment>
249243
)
250244
} else {
251-
return <span>{text}</span>
245+
return text
252246
}
253247
}
254248

‎gdbgui/src/js/MemoryLink.jsx

+9-12
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,18 @@ import React from 'react'
22
import Memory from './Memory.jsx'
33

44
class MemoryLink extends React.Component {
5-
constructor(props) {
6-
super()
7-
this.parsed_addr = `0x${parseInt(props.addr, 16).toString(16)}` // remove leading zeros
8-
}
95
render() {
6+
// turn 0x00000000000000 into 0x0
7+
const address_no_leading_zeros = '0x' + parseInt(this.props.addr, 16).toString(16)
108
return (
11-
<React.Fragment>
12-
<span
9+
<span
1310
className="pointer memadr_react"
14-
onClick={() => Memory.set_inputs_from_address(this.parsed_addr)}
15-
title={`click to explore memory at ${this.parsed_addr}`}
16-
style={this.props.style}>
17-
{this.parsed_addr}
18-
</span>
19-
</React.Fragment>
11+
onClick={() => Memory.set_inputs_from_address(address_no_leading_zeros)}
12+
title={`click to explore memory at ${address_no_leading_zeros}`}
13+
style={this.props.style}
14+
>
15+
{address_no_leading_zeros}
16+
</span>
2017
)
2118
}
2219
static defaultProps = {style: {fontFamily: 'monospace'}}

‎gdbgui/src/js/Settings.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class Settings extends React.Component {
7979
'show_all_sent_commands_in_console',
8080
'Print all sent commands in console, including those sent automatically by gdbgui'
8181
)}
82-
{Settings.get_checkbox_row('highlight_source_code', 'Add syntax highlighting to source files (turn off for better performance)')}
82+
{Settings.get_checkbox_row('highlight_source_code', 'Add syntax highlighting to source files')}
8383

8484
<tr>
8585
<td>

‎gdbgui/static/js/build.js

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+14-15
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "0.1.0",
44
"license": "GPL-3.0",
55
"scripts": {
6-
"build": "webpack -p",
7-
"watch": "webpack --watch",
6+
"build": "webpack --mode production --config webpack.config.js",
7+
"watch": "webpack --mode development --watch --config webpack.config.js",
88
"test": "jest",
99
"prettier": "prettier ./gdbgui/src/js/** --write"
1010
},
@@ -16,23 +16,22 @@
1616
]
1717
},
1818
"dependencies": {
19-
"babel-eslint": "^8.0.0",
20-
"babel-preset-stage-0": "^6.24.1",
21-
"eslint-loader": "^1.9.0",
22-
"react": "^16.2.0",
23-
"react-dom": "^16.2.0",
24-
"statorgfc": "^0.1.6",
25-
"webpack": "^3.5.5"
26-
},
27-
"devDependencies": {
2819
"babel-core": "^6.26.0",
29-
"babel-loader": "^7.1.2",
20+
"babel-eslint": "^8.2.3",
21+
"babel-loader": "^7.1.4",
3022
"babel-preset-es2015": "^6.24.1",
3123
"babel-preset-react": "^6.24.1",
32-
"eslint": "^4.7.0",
24+
"babel-preset-stage-0": "^6.24.1",
25+
"eslint": "^4.19.1",
26+
"eslint-loader": "^2.0.0",
3327
"eslint-plugin-prettier": "^2.6.0",
34-
"eslint-plugin-react": "^7.3.0",
28+
"eslint-plugin-react": "^7.7.0",
3529
"jest": "^21.2.1",
36-
"prettier": "^1.10.2"
30+
"prettier": "^1.12.0",
31+
"react": "^16.3.1",
32+
"react-dom": "^16.3.1",
33+
"statorgfc": "^0.1.6",
34+
"webpack": "^4.5.0",
35+
"webpack-cli": "^2.0.14"
3736
}
3837
}

‎webpack.config.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
const path = require('path');
2+
13
module.exports = {
24
entry: './gdbgui/src/js/gdbgui.jsx',
5+
devtool: 'source-map',
6+
performance: {
7+
hints: false
8+
},
39
output: {
4-
filename: './gdbgui/static/js/build.js'
10+
path: path.resolve(__dirname, 'gdbgui/static/js/'),
11+
filename: 'build.js'
512
},
613
module: {
714
rules: [
@@ -20,6 +27,5 @@ module.exports = {
2027
exclude: /node_modules/
2128
}
2229
]
23-
},
24-
devtool: 'source-map'
30+
}
2531
}

‎yarn.lock

+2,227-351
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.