| 14 | type State = any; |
| 15 | |
| 16 | class SourceCode extends React.Component<{}, State> { |
| 17 | static el_code_container = null; // todo: no jquery |
| 18 | static el_code_container_node = null; |
| 19 | static code_container_node = null; |
| 20 | static view_more_top_node = null; |
| 21 | static view_more_bottom_node = null; |
| 22 | |
| 23 | constructor() { |
| 24 | // @ts-expect-error ts-migrate(2554) FIXME: Expected 1-2 arguments, but got 0. |
| 25 | super(); |
| 26 | // @ts-expect-error ts-migrate(2339) FIXME: Property 'connectComponentState' does not exist on... Remove this comment to see the full error message |
| 27 | store.connectComponentState(this, [ |
| 28 | "fullname_to_render", |
| 29 | "cached_source_files", |
| 30 | "missing_files", |
| 31 | "disassembly_for_missing_file", |
| 32 | "line_of_source_to_flash", |
| 33 | "paused_on_frame", |
| 34 | "breakpoints", |
| 35 | "source_code_state", |
| 36 | "make_current_line_visible", |
| 37 | "source_code_selection_state", |
| 38 | "current_theme", |
| 39 | "inferior_binary_path", |
| 40 | "source_linenum_to_display_start", |
| 41 | "source_linenum_to_display_end", |
| 42 | "max_lines_of_code_to_fetch", |
| 43 | "source_code_infinite_scrolling" |
| 44 | ]); |
| 45 | |
| 46 | // bind methods |
| 47 | this.get_body_assembly_only = this.get_body_assembly_only.bind(this); |
| 48 | this._get_source_line = this._get_source_line.bind(this); |
| 49 | this._get_assm_row = this._get_assm_row.bind(this); |
| 50 | this.click_gutter = this.click_gutter.bind(this); |
| 51 | this.is_gdb_paused_on_this_line = this.is_gdb_paused_on_this_line.bind(this); |
| 52 | } |
| 53 | |
| 54 | render() { |
| 55 | return ( |
| 56 | <div className={this.state.current_theme} style={{ height: "100%" }}> |
| 57 | <table |
| 58 | id="code_table" |
| 59 | className={this.state.current_theme} |
| 60 | style={{ width: "100%" }} |
| 61 | > |
| 62 | <tbody id="code_body">{this.get_body()}</tbody> |
| 63 | </table> |
| 64 | </div> |
| 65 | ); |
| 66 | } |
| 67 | |
| 68 | componentDidUpdate() { |
| 69 | let source_is_displayed = |
| 70 | this.state.source_code_state === constants.source_code_states.SOURCE_CACHED || |
| 71 | this.state.source_code_state === |
| 72 | constants.source_code_states.ASSM_AND_SOURCE_CACHED; |
| 73 | if (source_is_displayed) { |
nothing calls this directly
no outgoing calls
no test coverage detected